/* ================================================
   APLIKASI DATA SISWA - Custom Stylesheet
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #dbeafe;
  --accent:        #f59e0b;
  --success:       #16a34a;
  --danger:        #dc2626;
  --sidebar-w:     240px;
  --sidebar-bg:    #1e293b;
  --sidebar-text:  #cbd5e1;
  --sidebar-hover: #334155;
  --bg:            #f1f5f9;
  --card-bg:       #ffffff;
  --border:        #e2e8f0;
  --text:          #1e293b;
  --text-muted:    #64748b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  min-height: 100vh;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .3s;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.sidebar-brand .brand-icon {
  width: 38px; height: 38px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-brand h6 {
  color: #fff;
  font-weight: 700;
  font-size: .875rem;
  line-height: 1.3;
}

.sidebar-brand small {
  color: var(--sidebar-text);
  font-size: .7rem;
}

.sidebar-nav {
  padding: 1rem 0;
  flex: 1;
}

.nav-label {
  padding: .5rem 1.25rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #475569;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.25rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  border-radius: 0;
  transition: background .2s, color .2s;
  margin: .1rem .75rem;
  border-radius: 8px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-nav a.active {
  background: var(--primary);
  color: #fff;
}

.sidebar-nav a i { width: 18px; text-align: center; font-size: .9rem; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #334155;
  font-size: .75rem;
  color: #475569;
  text-align: center;
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: .875rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.topbar-title small {
  display: block;
  font-size: .72rem;
  font-weight: 400;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.topbar-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 600;
  padding: .25rem .6rem;
  border-radius: 20px;
}

/* ── PAGE BODY ── */
.page-body {
  padding: 1.75rem;
  flex: 1;
}

/* ── STAT CARDS ── */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow .2s;
}

.stat-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.07); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-icon.blue  { background: #dbeafe; color: var(--primary); }
.stat-icon.green { background: #dcfce7; color: var(--success); }
.stat-icon.amber { background: #fef3c7; color: var(--accent); }
.stat-icon.red   { background: #fee2e2; color: var(--danger); }

.stat-info h3 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.stat-info p {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* ── DATA CARD ── */
.data-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.data-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}

.data-card-header h5 {
  font-size: .95rem;
  font-weight: 700;
}

/* ── TABLE ── */
.table-custom { width: 100%; border-collapse: collapse; }

.table-custom thead th {
  background: #f8fafc;
  padding: .75rem 1rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table-custom tbody td {
  padding: .875rem 1rem;
  font-size: .85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table-custom tbody tr:last-child td { border-bottom: none; }

.table-custom tbody tr:hover { background: #f8fafc; }

.badge-kelas {
  background: var(--primary-light);
  color: var(--primary);
  padding: .25rem .6rem;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 600;
}

.badge-jurusan {
  background: #f0fdf4;
  color: var(--success);
  padding: .25rem .6rem;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 600;
}

/* ── BUTTONS ── */
.btn-primary-custom {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: .5rem 1rem;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  transition: background .2s, transform .1s;
}

.btn-primary-custom:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }

.btn-edit {
  background: #fef3c7;
  color: #92400e;
  border: none;
  padding: .35rem .75rem;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  text-decoration: none;
  transition: background .2s;
}

.btn-edit:hover { background: #fde68a; color: #92400e; }

.btn-delete {
  background: #fee2e2;
  color: #991b1b;
  border: none;
  padding: .35rem .75rem;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  text-decoration: none;
  transition: background .2s;
}

.btn-delete:hover { background: #fecaca; color: #991b1b; }

.btn-secondary-custom {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: .5rem 1rem;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  transition: background .2s;
}

.btn-secondary-custom:hover { background: var(--border); color: var(--text); }

/* ── FORM CARD ── */
.form-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  max-width: 680px;
}

.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: .4rem;
  color: var(--text);
}

.form-label span { color: #dc2626; }

.form-control-custom {
  width: 100%;
  padding: .625rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-control-custom:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

textarea.form-control-custom { resize: vertical; min-height: 90px; }

/* ── SEARCH ── */
.search-box {
  position: relative;
  max-width: 260px;
}

.search-box i {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .85rem;
}

.search-box input {
  width: 100%;
  padding: .5rem .875rem .5rem 2.2rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .82rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}

.search-box input:focus { border-color: var(--primary); }

/* ── ALERT ── */
.alert-custom {
  padding: .875rem 1.25rem;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state i { font-size: 2.5rem; margin-bottom: .75rem; display: block; }
.empty-state p { font-size: .875rem; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { padding: .75rem 1rem; }
  .page-body { padding: 1rem; }
  .form-card { padding: 1.25rem; }
  .stat-card { padding: 1rem; }
}
