/* Golden Stars Academy — Unified Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --primary:    #0f2340;
  --gold:       #c9a84c;
  --surface:    #ffffff;
  --bg:         #f4f6f9;
  --border:     #e2e8f0;
  --text:       #1e293b;
  --text-muted: #64748b;
  --shadow:     0 1px 6px rgba(0,0,0,.08);
  --radius:     10px;
  --green:      #16a34a;
  --red:        #dc2626;
  --amber:      #f59e0b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }

/* Layout */
.admin-layout  { display: flex; min-height: 100vh; }
.sidebar       { width: 240px; background: var(--primary); color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; overflow-y: auto; z-index: 50; transition: transform .25s; }
.sidebar-logo  { padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.sidebar-logo img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.sidebar-logo span { font-weight: 800; font-size: .95rem; line-height: 1.25; }
.nav-section   { padding: .75rem 0 .25rem; }
.nav-label     { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.35); padding: 0 1.25rem .4rem; }
.nav-item      { display: flex; align-items: center; gap: .6rem; padding: .55rem 1.25rem; color: rgba(255,255,255,.72); text-decoration: none; font-size: .875rem; font-weight: 500; transition: all .15s; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.12); color: #fff; }
.nav-item i    { font-size: 1.05rem; width: 1.2rem; text-align: center; flex-shrink: 0; }
.main-content  { margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar        { background: var(--surface); border-bottom: 1px solid var(--border); padding: .75rem 1.5rem; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 40; box-shadow: var(--shadow); }
.page-body     { padding: 1.75rem 1.5rem; flex: 1; }
.page-header   { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem; }
.page-title    { font-size: 1.35rem; font-weight: 800; color: var(--primary); }
.page-subtitle { font-size: .84rem; color: var(--text-muted); margin-top: .2rem; }

/* Cards */
.card      { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); display: flex; align-items: center; gap: 1rem; }
.stat-icon { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon.green  { background: #dcfce7; color: var(--green); }
.stat-icon.gold   { background: #fef9c3; color: #b45309; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.red    { background: #fee2e2; color: var(--red); }
.stat-num   { font-size: 1.75rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }

/* Table */
.table-card  { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.data-table  { width: 100%; border-collapse: collapse; }
.data-table th { background: var(--primary); color: #fff; padding: .65rem 1rem; text-align: left; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.data-table td { padding: .65rem 1rem; border-bottom: 1px solid var(--border); font-size: .875rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }

/* Buttons */
.btn         { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border-radius: 8px; font-size: .875rem; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: all .15s; white-space: nowrap; font-family: inherit; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #1a3a6b; }
.btn-gold    { background: var(--gold); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-warning { background: var(--amber); color: #fff; }
.btn-danger  { background: var(--red); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); background: #f8fafc; }
.btn-sm      { padding: .28rem .6rem; font-size: .8rem; }
.btn-lg      { padding: .75rem 1.5rem; font-size: 1rem; }

/* Forms */
.form-group   { margin-bottom: 1rem; }
.form-label   { display: block; font-size: .82rem; font-weight: 600; color: var(--text-muted); margin-bottom: .3rem; }
.form-control { width: 100%; padding: .55rem .85rem; border: 1.5px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: .9rem; font-family: inherit; transition: border-color .15s; }
.form-control:focus { outline: none; border-color: var(--primary); }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* Badges */
.badge         { display: inline-flex; align-items: center; padding: .2rem .6rem; border-radius: 99px; font-size: .74rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-purple  { background: #ede9fe; color: #6d28d9; }
.badge-gray    { background: #f1f5f9; color: #475569; }

/* Modals */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; align-items: center; justify-content: center; padding: 1rem; }
.modal-box     { background: var(--surface); border-radius: 14px; padding: 1.75rem; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-title   { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }
.modal-close   { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted); line-height: 1; }

/* Flash */
.flash-msg     { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .875rem; font-weight: 500; transition: opacity .5s; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* Misc */
.empty-state   { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.empty-state i { font-size: 3rem; display: block; margin-bottom: 1rem; }
.progress      { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-bar  { height: 100%; border-radius: 4px; background: var(--primary); }
.avatar        { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--border); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; color: var(--primary); flex-shrink: 0; }
#scroll-top    { display: none; position: fixed; bottom: 1.5rem; right: 1.5rem; width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; border: none; cursor: pointer; font-size: 1.1rem; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.2); z-index: 90; }

/* Theme overrides */
.theme-staff { --primary: #052e16; }
.theme-student { --primary: #1e0a4e; }
.theme-parent  { --primary: #0f2340; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .page-body { padding: 1rem; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  #menu-btn { display: flex !important; }
}
@media (max-width: 480px) {
  .card-grid { grid-template-columns: 1fr; }
  .data-table { font-size: .8rem; }
  .data-table td, .data-table th { padding: .5rem .6rem; }
}
@media print {
  .sidebar, .topbar, .no-print, #scroll-top { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: #fff; }
}
