/* ===== EduDMS School ERP — Premium Design System ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary:       #4f46e5;
    --primary-dark:  #3730a3;
    --primary-light: rgba(79,70,229,.12);
    --success:       #10b981;
    --warning:       #f59e0b;
    --danger:        #ef4444;
    --info:          #06b6d4;
    --sidebar-bg:    #1e1b4b;
    --sidebar-hover: rgba(255,255,255,.08);
    --sidebar-active:#4f46e5;
    --sidebar-text:  rgba(255,255,255,.75);
    --sidebar-label: rgba(255,255,255,.35);
    --bg:            #f1f5f9;
    --card-bg:       #ffffff;
    --text:          #1e293b;
    --text-muted:    #64748b;
    --border:        #e2e8f0;
    --shadow:        0 4px 24px rgba(0,0,0,.06);
    --shadow-lg:     0 10px 40px rgba(0,0,0,.10);
    --radius:        14px;
    --radius-sm:     8px;
    --sidebar-w:     270px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    font-size: .925rem;
}

/* ===== LAYOUT ===== */
.erp-layout { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    left: 0; top: 0; 
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all .3s ease;
}

.sidebar-brand {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.sidebar-brand h4 {
    color: #fff;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -.5px;
}

.sidebar-brand span { color: var(--primary); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: .75rem 0 1rem;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 10px; }

/* Section labels */
.nav-label {
    padding: 1.25rem 1.25rem .4rem;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--sidebar-label);
}

/* Top-level nav items */
.nav-item { list-style: none; }

.nav-link-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem 1.25rem;
    color: var(--sidebar-text) !important;
    text-decoration: none !important;
    font-size: .85rem;
    font-weight: 500;
    border-radius: 0;
    cursor: pointer;
    transition: all .2s;
    border-left: 3px solid transparent;
    user-select: none;
}

.nav-link-parent i.nav-icon {
    color: inherit;
    font-size: 1rem;
    width: 20px;
    margin-right: 12px;
    text-align: center;
    opacity: .8;
}

.nav-link-parent:hover {
    color: #ffffff !important;
    background: var(--sidebar-hover);
    border-left-color: rgba(255,255,255,.2);
}

.nav-link-parent.active {
    color: #ffffff !important;
    background: var(--sidebar-active);
    border-left-color: #ffffff;
}



.nav-link-parent .nav-arrow {
    font-size: .7rem;
    opacity: .6;
    transition: transform .25s;
}

.nav-link-parent[aria-expanded="true"] .nav-arrow { transform: rotate(90deg); }

/* Sub-menu */
.nav-sub {
    background: rgba(0,0,0,.2);
    padding: .25rem 0;
    list-style: none;
}

.nav-sub-link {
    display: flex;
    align-items: center;
    padding: .5rem 1.25rem .5rem 3.25rem;
    color: rgba(255,255,255,.65) !important;
    text-decoration: none !important;
    font-size: .8rem;
    transition: all .2s;
    border-left: 3px solid transparent;
}

.nav-sub-link::before {
    content: '';
    width: 5px; height: 5px;
    background: rgba(255,255,255,.3);
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
    transition: background .15s;
}

.nav-sub-link:hover {
    color: #ffffff !important;
    background: rgba(255,255,255,.05);
}

.nav-sub-link.active {
    color: #ffffff !important;
    font-weight: 600;
}

.nav-sub-link:hover::before { background: var(--primary); }

.nav-sub-link.active::before { background: #818cf8; }

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.sidebar-footer .user-info { display: flex; align-items: center; gap: 10px; }
.sidebar-footer .avatar {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

.sidebar-footer .user-name { color: #fff; font-weight: 600; font-size: .82rem; line-height: 1.2; }
.sidebar-footer .user-role { color: var(--sidebar-label); font-size: .72rem; }

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: .5rem .75rem;
    background: rgba(239,68,68,.15);
    border: 1px solid rgba(239,68,68,.25);
    color: #fca5a5;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}

.btn-logout:hover { background: rgba(239,68,68,.3); color: #fff; }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: .9rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0,0,0,.05);
}

.topbar .page-title { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.topbar .breadcrumb { font-size: .8rem; margin: 0; }
.topbar .breadcrumb-item.active { color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.btn-notif {
    width: 36px; height: 36px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    position: relative;
}
.btn-notif:hover { background: var(--primary-light); color: var(--primary); }
.notif-badge {
    position: absolute; top: -4px; right: -4px;
    width: 16px; height: 16px;
    background: var(--danger);
    border-radius: 50%;
    font-size: .6rem;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}

.page-body { padding: 2rem; flex: 1; }

/* ===== CARDS ===== */
.card-erp {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.card-erp .card-header-erp {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-erp .card-header-erp h5 {
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
}

.card-erp .card-body-erp { padding: 1.5rem; }

/* stat cards */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.stat-card .stat-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.stat-card .stat-value { font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: .3rem; }
.stat-card .stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-card .stat-trend { font-size: .8rem; margin-top: .5rem; font-weight: 600; }

.icon-primary { background: var(--primary-light); color: var(--primary); }
.icon-success { background: rgba(16,185,129,.1); color: var(--success); }
.icon-warning { background: rgba(245,158,11,.1); color: var(--warning); }
.icon-info    { background: rgba(6,182,212,.1); color: var(--info); }
.icon-danger  { background: rgba(239,68,68,.1); color: var(--danger); }

/* ===== TABLE ===== */
.table-erp { width: 100%; border-collapse: collapse; }
.table-erp th {
    padding: .75rem 1rem;
    background: var(--bg);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.table-erp td {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: .875rem;
}
.table-erp tr:last-child td { border-bottom: none; }
.table-erp tr:hover td { background: rgba(79,70,229,.03); }

/* ===== BADGES ===== */
.badge-erp {
    padding: .3rem .65rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-success { background: rgba(16,185,129,.12); color: var(--success); }
.badge-danger  { background: rgba(239,68,68,.12); color: var(--danger); }
.badge-warning { background: rgba(245,158,11,.12); color: var(--warning); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-info    { background: rgba(6,182,212,.12); color: var(--info); }
.badge-neutral { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ===== BUTTONS ===== */
.btn-primary-erp {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border: none;
    padding: .55rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
}
.btn-primary-erp:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(79,70,229,.4); color: #fff; }

.btn-outline-erp {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: .5rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
}
.btn-outline-erp:hover { background: var(--primary); color: #fff; }

.btn-sm-icon {
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s;
    font-size: .8rem;
    color: var(--text-muted);
    text-decoration: none;
}
.btn-sm-icon:hover.edit { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-sm-icon:hover.delete { border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,.1); }
.btn-sm-icon:hover.view { border-color: var(--info); color: var(--info); background: rgba(6,182,212,.1); }

/* ===== FORMS ===== */
.form-label-erp { font-size: .8rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; display: block; }
.form-control-erp {
    width: 100%;
    padding: .6rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .875rem;
    color: var(--text);
    background: var(--card-bg);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    font-family: 'Inter', sans-serif;
}
.form-control-erp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.form-control-erp::placeholder { color: #94a3b8; }

/* ===== MODAL ===== */
.modal-erp .modal-content {
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 25px 60px rgba(0,0,0,.2);
}
.modal-erp .modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
}
.modal-erp .modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-erp .modal-body { padding: 1.5rem; }
.modal-erp .modal-footer { border-top: 1px solid var(--border); padding: 1rem 1.5rem; }

/* ===== SEARCH BAR ===== */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}
.search-bar i { position: absolute; left: 10px; color: var(--text-muted); font-size: .85rem; }
.search-bar input {
    padding: .5rem .9rem .5rem 2rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .85rem;
    color: var(--text);
    background: var(--card-bg);
    transition: border-color .2s;
    outline: none;
    width: 240px;
}
.search-bar input:focus { border-color: var(--primary); }

/* ===== AVATAR ===== */
.avatar-sm {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.empty-state p { font-size: .9rem; }

/* ===== DASHBOARD WIDGETS ===== */
.activity-list { list-style: none; }
.activity-list li {
    display: flex;
    gap: 12px;
    padding: .85rem 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.activity-list li:last-child { border-bottom: none; }
.activity-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

/* ===== TIMETABLE GRID ===== */
.timetable-grid { overflow-x: auto; }
.timetable-grid table th { background: var(--primary); color: #fff; text-align: center; }
.timetable-grid table td { text-align: center; font-size: .78rem; }
.period-cell {
    background: var(--primary-light);
    border-radius: 6px;
    padding: 4px 8px;
    font-weight: 600;
    color: var(--primary);
    font-size: .75rem;
}

/* ===== PROGRESS ===== */
.progress-erp {
    height: 6px;
    background: var(--bg);
    border-radius: 10px;
    overflow: hidden;
}
.progress-bar-erp {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary), #818cf8);
    transition: width 1s;
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar, .topbar, .btn-primary-erp, .btn-outline-erp { display: none !important; }
    .main-content { margin-left: 0 !important; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp .4s ease forwards; }
.fade-in-delay-1 { animation: fadeInUp .4s .1s ease both; }
.fade-in-delay-2 { animation: fadeInUp .4s .2s ease both; }
.fade-in-delay-3 { animation: fadeInUp .4s .3s ease both; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}
