/* =============================================
   EduClass Pro – Unified Stylesheet
   ============================================= */
:root {
    --purple:       #7c6ff7;
    --purple-dark:  #6255e0;
    --purple-light: #f0effe;
    --teal:         #2bbfa0;
    --teal-light:   #e6f9f5;
    --blue:         #4a9eff;
    --blue-light:   #e8f3ff;
    --amber:        #f59e0b;
    --amber-light:  #fef3c7;
    --red:          #ef4444;
    --red-light:    #fee2e2;
    --green:        #10b981;
    --green-light:  #d1fae5;

    --primary:      var(--purple);
    --primary-dark: var(--purple-dark);
    --accent:       var(--amber);
    --success:      var(--green);
    --danger:       var(--red);
    --warning:      var(--amber);

    --bg:           #f1f5f9;
    --sidebar-bg:   #0f172a;
    --sidebar-text: #94a3b8;
    --card-bg:      #ffffff;
    --text:         #1e293b;
    --text-muted:   #64748b;
    --border:       #e2e8f0;
    --radius:       12px;
    --shadow:       0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --sidebar-w:    240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); }

/* ── APP WRAPPER (admin / new layout) ── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w); min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; z-index: 100;
}
.logo-section, .sidebar-logo {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    display: flex; align-items: center; gap: 10px;
}
.logo-title { display: flex; align-items: center; gap: 8px; }
.logo-title span:first-of-type { font-size: 18px; font-weight: 700; color: #fff; }
.logo-badge { font-size: 10px; background: var(--purple); color: #fff; padding: 2px 7px; border-radius: 20px; }
.sidebar-logo span { font-size: 18px; font-weight: 700; color: #fff; }
.sidebar-logo i { color: var(--purple); font-size: 20px; }
.sidebar-role, .nav-label {
    padding: 14px 18px 6px;
    font-size: 10px; font-weight: 700;
    color: #475569; text-transform: uppercase; letter-spacing: 1.2px;
}
.nav-section, .sidebar nav { flex: 1; padding: 6px 10px; overflow-y: auto; }
.nav-item, .sidebar nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 8px;
    color: var(--sidebar-text); text-decoration: none;
    font-size: 13.5px; font-weight: 500; margin-bottom: 2px;
    transition: all .18s;
}
.nav-item:hover, .sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active, .sidebar nav a.active { background: var(--purple); color: #fff; }
.nav-icon, .sidebar nav a i { width: 18px; text-align: center; font-size: 16px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 10px; }

.sidebar-footer, .user-card {
    padding: 14px; border-top: 1px solid rgba(255,255,255,.07);
}
.user-card { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--purple); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.user-info .uname, .user-info .name { font-size: 13px; color: #fff; font-weight: 600; }
.user-info .urole, .user-info .role { font-size: 11px; color: #64748b; }
.sidebar-footer a:not(.btn) { color: #64748b; font-size: 16px; text-decoration: none; margin-left: auto; }
.sidebar-footer a:not(.btn):hover { color: var(--red); }

/* ── MAIN CONTENT ── */
.main-content, .main {
    margin-left: var(--sidebar-w);
    flex: 1; padding: 24px; min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}
.page-title, .topbar h1 { font-size: 20px; font-weight: 700; }
.page-sub, .topbar .breadcrumb { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.content-area { }

/* ── CARDS ── */
.card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 22px; margin-bottom: 22px;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px;
}
.card-title { font-size: 15px; font-weight: 700; }

/* ── STATS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card {
    background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 20px; display: flex; align-items: center; gap: 14px;
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.stat-icon.blue,   .stat-icon.purple { background: var(--blue-light);   color: var(--blue);   }
.stat-icon.green  { background: var(--green-light); color: var(--green);  }
.stat-icon.amber  { background: var(--amber-light); color: var(--amber);  }
.stat-icon.red    { background: var(--red-light);   color: var(--red);    }
.stat-icon.teal   { background: var(--teal-light);  color: var(--teal);   }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── TABLES ── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
    text-align: left; padding: 12px 14px;
    font-size: 11px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .5px;
    border-bottom: 2px solid var(--border);
}
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px; border-radius: 8px; border: none;
    cursor: pointer; font-size: 13.5px; font-weight: 600;
    font-family: inherit; text-decoration: none; transition: all .18s;
    line-height: 1.4;
}
.btn-primary   { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dark); }
.btn-success   { background: var(--green); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger    { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning   { background: var(--amber); color: #fff; }
.btn-outline   { background: transparent; color: var(--purple); border: 1.5px solid var(--purple); }
.btn-outline:hover { background: var(--purple); color: #fff; }
.btn-ghost     { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm  { padding: 5px 11px; font-size: 12px; }
.btn-lg  { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; }
.w-100   { width: 100%; justify-content: center; }
.mt-2    { margin-top: 8px; }

/* ── FORMS ── */
.form-group  { margin-bottom: 16px; }
.form-label  { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.form-control {
    width: 100%; padding: 9px 13px;
    border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit; color: var(--text);
    background: #fff; transition: border-color .18s;
}
.form-control:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(124,111,247,.12); }
select.form-control { cursor: pointer; }
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── BADGES ── */
.badge {
    display: inline-flex; align-items: center; padding: 3px 9px;
    border-radius: 20px; font-size: 11.5px; font-weight: 600;
}
.badge-success   { background: var(--green-light); color: #065f46; }
.badge-danger    { background: var(--red-light);   color: #991b1b; }
.badge-warning   { background: var(--amber-light); color: #92400e; }
.badge-info      { background: var(--blue-light);  color: #1e40af; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-purple    { background: var(--purple-light); color: var(--purple-dark); }

/* ── ALERTS ── */
.alert {
    padding: 12px 16px; border-radius: 10px; font-size: 14px;
    margin-bottom: 18px; display: flex; align-items: center; gap: 10px;
}
.alert-success { background: var(--green-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: var(--red-light);   color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: var(--blue-light);  color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: var(--amber-light); color: #92400e; border: 1px solid #fde68a; }

/* ── MODAL ── */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:1000; align-items:center; justify-content:center; }
.modal-overlay.active { display:flex; }
.modal { background:#fff; border-radius:16px; padding:26px; width:100%; max-width:520px; box-shadow:0 20px 60px rgba(0,0,0,.2); max-height:90vh; overflow-y:auto; }
.modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.modal-title  { font-size:17px; font-weight:700; }
.modal-close  { background:none; border:none; font-size:20px; cursor:pointer; color:var(--text-muted); padding:4px; }

/* ── GRID ── */
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:22px; }
.grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:22px; }
.grid-4 { display:grid; grid-template-columns:repeat(4,1fr); gap:22px; }

/* ── LOGIN PAGE ── */
.login-page { min-height:100vh; display:flex; align-items:center; justify-content:center; background: linear-gradient(135deg,#0f172a 0%,#1e1b4b 100%); }
.login-box  { background:#fff; border-radius:20px; padding:42px; width:100%; max-width:420px; box-shadow:0 24px 80px rgba(0,0,0,.35); }
.login-logo { text-align:center; margin-bottom:28px; }
.login-logo h1 { font-size:24px; font-weight:800; margin:10px 0 4px; }
.login-logo p  { color:var(--text-muted); font-size:14px; }

/* ── ADMIN TABLE ACTIONS ── */
.actions { display:flex; gap:6px; }

/* ── FLASH TOAST ── */
.flash-toast { position:fixed; top:20px; right:20px; z-index:9999; min-width:280px; animation: slideIn .3s ease; }
@keyframes slideIn { from { opacity:0; transform:translateX(30px); } to { opacity:1; transform:translateX(0); } }

/* ── MISC ── */
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.empty-state { text-align:center; padding:60px 20px; color:var(--text-muted); }
.empty-state i { font-size:48px; display:block; margin-bottom:16px; opacity:.4; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    :root { --sidebar-w: 60px; }
    .logo-title span:first-of-type, .logo-badge,
    .sidebar-role, .nav-label,
    .nav-item span, .sidebar nav a span,
    .user-info { display: none; }
    .main-content, .main { margin-left: 60px; padding: 14px; }
    .form-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
