/* ============================================================
   SMA Excellence — Admin Panel CSS
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:      #B91C1C;
  --red-dark: #991B1B;
  --red-light:#FEE2E2;
  --bg:       #F8FAFC;
  --sidebar:  #1E1E2E;
  --sidebar-hover: #2A2A3E;
  --sidebar-active: #B91C1C;
  --text:     #1E293B;
  --muted:    #64748B;
  --border:   #E2E8F0;
  --white:    #FFFFFF;
  --shadow:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --radius:   10px;
  --sidebar-w: 240px;
}

body { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }

/* ── Sidebar ── */
.sidebar {
  position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh;
  background: var(--sidebar); display: flex; flex-direction: column;
  overflow-y: auto; z-index: 100;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px; padding: 20px 18px;
  color: #fff; font-weight: 700; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand svg { width: 28px; height: 28px; color: var(--red); flex-shrink: 0; }
.sidebar-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: rgba(255,255,255,.65); text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar-link svg { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-link.active { background: var(--red); color: #fff; }
.sidebar-link--danger { color: #FCA5A5 !important; }
.sidebar-link--danger:hover { background: rgba(185,28,28,.3) !important; color: #fff !important; }
.sidebar-footer { padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 2px; }

/* ── Main layout ── */
.admin-body { display: flex; min-height: 100vh; }
.main-wrap { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ── Topbar ── */
.topbar-admin {
  position: sticky; top: 0; z-index: 50;
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 60px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow);
}
.page-title { font-size: 17px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-name { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ── Content ── */
.content-area { padding: 28px; flex: 1; }

/* ── Alert ── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 13.5px; font-weight: 500; }
.alert-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.alert-danger  { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

/* ── Card ── */
.card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-head h3 { font-size: 15px; font-weight: 700; }

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 20px; display: flex; align-items: center; gap: 14px;
}
.stat-card--highlight { background: var(--red); border-color: var(--red); }
.stat-card--highlight .stat-num, .stat-card--highlight .stat-lbl { color: #fff; }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon--red    { background: var(--red-light); color: var(--red); }
.stat-icon--blue   { background: #DBEAFE; color: #1D4ED8; }
.stat-icon--green  { background: #DCFCE7; color: #15803D; }
.stat-icon--orange { background: #FEF3C7; color: #D97706; }
.stat-icon--purple { background: #EDE9FE; color: #7C3AED; }
.stat-icon--white  { background: rgba(255,255,255,.2); color: #fff; }
.stat-num { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-lbl { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── Dashboard grid ── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ── Table ── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--border); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #F8FAFC; }
.empty { text-align: center; color: var(--muted); padding: 24px !important; }

/* ── Badge ── */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: #F1F5F9; color: var(--muted); }
.badge--publish, .badge--aktif, .badge--diterima { background: #DCFCE7; color: #166534; }
.badge--draft, .badge--ditolak { background: #FEE2E2; color: #991B1B; }
.badge--diproses { background: #FEF3C7; color: #92400E; }
.badge--baru { background: #DBEAFE; color: #1E40AF; }

/* ── Buttons ── */
.btn-primary { background: var(--red); color: #fff; border: none; padding: 9px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; transition: background .15s; }
.btn-primary:hover { background: var(--red-dark); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); padding: 9px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; transition: background .15s; }
.btn-outline:hover { background: var(--bg); }
.btn-sm { background: #F1F5F9; color: var(--text); border: 1px solid var(--border); padding: 5px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; transition: background .15s; }
.btn-sm:hover { background: var(--border); }
.btn-danger { background: #FEE2E2 !important; color: #991B1B !important; border-color: #FECACA !important; }
.btn-danger:hover { background: #FECACA !important; }
.actions { display: flex; gap: 6px; align-items: center; }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.field input, .field select, .field textarea {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; color: var(--text); background: var(--white);
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); }
.field textarea { resize: vertical; }
.req { color: var(--red); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.img-preview { margin-top: 8px; max-width: 160px; max-height: 100px; border-radius: 6px; border: 1px solid var(--border); object-fit: cover; }

/* ── Galeri grid admin ── */
.galeri-grid-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.galeri-item-admin { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.galeri-thumb { position: relative; aspect-ratio: 4/3; background: #F1F5F9; }
.galeri-thumb img { width: 100%; height: 100%; object-fit: cover; }
.galeri-thumb .badge { position: absolute; top: 8px; left: 8px; }
.no-img { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 32px; }
.galeri-info { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 500; }
.galeri-item-admin .actions { padding: 0 12px 12px; }
.text-soft { color: var(--muted); font-size: 12px; }

/* ── Sidebar dropdown group ── */
.sidebar-group { display: flex; flex-direction: column; }
.sidebar-group-toggle {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 13.5px; font-weight: 500; width: 100%; color: rgba(255,255,255,.65);
}
.sidebar-group-toggle:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-chev { width: 14px; height: 14px; margin-left: auto; flex-shrink: 0; transition: transform .2s; }
.sidebar-group.open .sidebar-chev { transform: rotate(180deg); }
.sidebar-children { display: none; flex-direction: column; gap: 2px; padding-left: 14px; margin-top: 2px; }
.sidebar-group.open .sidebar-children { display: flex; }
.sidebar-child { font-size: 13px; }
.sidebar-child svg { width: 15px; height: 15px; }

/* ── Login page ── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1E1E2E 0%, #2D1B1B 100%); }
.login-card { background: var(--white); border-radius: 16px; padding: 40px 36px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { width: 56px; height: 56px; background: var(--red-light); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.login-logo svg { width: 30px; height: 30px; color: var(--red); }
.login-card h1 { text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 28px; }
.login-card .field { margin-bottom: 16px; }
.btn-login { width: 100%; background: var(--red); color: #fff; border: none; padding: 12px; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 8px; transition: background .15s; }
.btn-login:hover { background: var(--red-dark); }

/* ── Guru grid ── */
.guru-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.guru-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.guru-photo { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: #F1F5F9; display: block; }
.guru-photo-placeholder { width: 100%; aspect-ratio: 3/4; background: #F1F5F9; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.guru-info { padding: 12px; }
.guru-info strong { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.guru-info span { font-size: 12px; color: var(--muted); }
.guru-card .actions { padding: 0 12px 12px; }

/* ── Settings ── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ── Data Table (versi baru) ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: left; padding: 10px 12px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--border); background: #FAFAFA; }
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #F8FAFC; }

/* ── Badge extra ── */
.badge-success { background: #DCFCE7 !important; color: #166534 !important; }
.badge-secondary { background: #F1F5F9 !important; color: var(--muted) !important; }

/* ── Btn icon ── */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border); background: #F8FAFC; color: var(--text); cursor: pointer; text-decoration: none; transition: all .15s; }
.btn-icon:hover { background: var(--border); }
.btn-icon--danger { color: #991B1B; border-color: #FECACA; background: #FEF2F2; }
.btn-icon--danger:hover { background: #FECACA; }

/* ── Image preview real-time ── */
.img-upload-wrap { display: flex; flex-direction: column; gap: 8px; }
.img-upload-preview { width: 120px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: none; }
.img-upload-preview.show { display: block; }

/* ── Rich text editor area ── */
.tox-tinymce { border-radius: 8px !important; border-color: var(--border) !important; }

/* ── Profil sekolah tab ── */
.tab-nav { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; border-bottom: 2px solid var(--border); padding-bottom: 12px; }
.tab-btn { padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--muted); border: 1px solid transparent; transition: all .15s; }
.tab-btn:hover { background: var(--bg); color: var(--text); }
.tab-btn.active { background: var(--red); color: #fff; border-color: var(--red); }

/* ── Misi row ── */
.misi-row input { flex: 1; }

/* ── PPDB status badge ── */
.badge--arsip { background: #F1F5F9; color: var(--muted); }
.badge--selesai { background: #DCFCE7; color: #166534; }
