:root {
    --bg: #f1f5f9;
    --bg2: #ffffff;
    --bg3: #f8fafc;
    --border: #e2e8f0;
    --text: #1e293b;
    --text2: #64748b;
    --primary: #4f46e5;
    --primary-light: #eef2ff;
    --primary-dark: #4338ca;
    --green: #16a34a;
    --green-light: #dcfce7;
    --red: #dc2626;
    --red-light: #fee2e2;
    --orange: #ea580c;
    --orange-light: #ffedd5;
    --blue: #2563eb;
    --blue-light: #dbeafe;
    --purple: #7c3aed;
    --purple-light: #ede9fe;
    --sidebar-w: 240px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, .07), 0 2px 4px rgba(0, 0, 0, .05);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, .1), 0 4px 6px rgba(0, 0, 0, .06)
}

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

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

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width .3s;
    overflow: hidden;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: var(--shadow)
}

.sidebar.collapsed {
    width: 64px
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    min-height: 64px
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(79, 70, 229, .3)
}

.logo-text span {
    font-size: 15px;
    font-weight: 700;
    color: var(--text)
}

.logo-text em {
    display: block;
    font-size: 10px;
    font-style: normal;
    color: var(--primary);
    letter-spacing: 2px;
    font-weight: 600
}

.sidebar-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text2);
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s
}

.sidebar-toggle:hover {
    background: var(--bg);
    color: var(--primary)
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text2);
    letter-spacing: 1.5px;
    padding: 14px 10px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-transform: uppercase
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: 9px;
    cursor: pointer;
    color: var(--text2);
    transition: all .2s;
    text-decoration: none;
    white-space: nowrap;
    margin-bottom: 1px;
    font-size: 13.5px;
    font-weight: 500
}

.nav-item i {
    font-size: 15px;
    width: 18px;
    text-align: center;
    flex-shrink: 0
}

.nav-item:hover {
    background: var(--bg3);
    color: var(--text)
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600
}

.nav-item.active i {
    color: var(--primary)
}

.nav-item.nav-sub {
    padding-left: 32px;
    font-size: 12.5px;
    color: var(--text2);
    border-left: 2px solid transparent;
    margin-left: 4px;
    border-radius: 0 9px 9px 0
}

.nav-item.nav-sub:hover {
    border-left-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary)
}

.nav-item.nav-sub.active {
    border-left-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary)
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--border)
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0
}

.user-avatar.sm {
    width: 32px;
    height: 32px;
    font-size: 12px
}

.user-info strong {
    font-size: 13px;
    display: block;
    color: var(--text)
}

.user-info small {
    font-size: 11px;
    color: var(--text2)
}

/* ── MAIN ── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    transition: margin-left .3s
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: 64px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    box-shadow: var(--shadow)
}

.page-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text)
}

.breadcrumb {
    font-size: 12px;
    color: var(--text2);
    margin-top: 2px
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px
}

.topbar-mobile-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    border-radius: 10px;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
    white-space: nowrap
}

.topbar-mobile-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, .35);
    color: #fff
}

.topbar-mobile-btn i {
    font-size: 15px
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 7px 14px;
    transition: border .2s
}

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

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 13px;
    width: 180px
}

.search-box i {
    color: var(--text2);
    font-size: 14px
}

.topbar-icon {
    color: var(--text2);
    font-size: 16px;
    cursor: pointer;
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    transition: all .2s
}

.badge-wrap {
    position: relative
}

.topbar-icon:hover {
    background: var(--bg3);
    color: var(--primary)
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg2)
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79, 70, 229, .3)
}

/* ── PAGES ── */
.pages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg)
}

.pages-container::-webkit-scrollbar {
    width: 6px
}

.pages-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px
}

.page {
    display: none;
    animation: fadeIn .25s ease
}

.page.active {
    display: block
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* ── CARDS ── */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow)
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text)
}

.badge-pill {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 11px;
    color: var(--text2);
    font-weight: 500
}

.badge-pill.green {
    background: var(--green-light);
    border-color: rgba(22, 163, 74, .2);
    color: var(--green)
}

/* ── KPI CARDS ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px
}

.kpi-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    transition: all .2s
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md)
}

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

.kpi-card.blue .kpi-icon {
    background: var(--blue-light);
    color: var(--blue)
}

.kpi-card.green .kpi-icon {
    background: var(--green-light);
    color: var(--green)
}

.kpi-card.orange .kpi-icon {
    background: var(--orange-light);
    color: var(--orange)
}

.kpi-card.red .kpi-icon {
    background: var(--red-light);
    color: var(--red)
}

.kpi-card.purple .kpi-icon {
    background: var(--purple-light);
    color: var(--purple)
}

.kpi-info h3 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: var(--text)
}

.kpi-info p {
    font-size: 13px;
    color: var(--text2);
    margin-top: 3px;
    font-weight: 500
}

.kpi-trend {
    font-size: 11px;
    margin-top: 4px;
    display: block;
    font-weight: 500
}

.kpi-trend.up {
    color: var(--green)
}

.kpi-trend.down {
    color: var(--red)
}

/* ── DASHBOARD GRIDS ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px
}

.chart-card {
    grid-column: span 2
}

.dashboard-bottom {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px
}

/* ── ACTIVITY / EVENTS ── */
.activity-list,
.events-list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border)
}

.activity-item:last-child {
    border: none
}

.act-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0
}

.act-dot.green {
    background: var(--green)
}

.act-dot.blue {
    background: var(--blue)
}

.act-dot.orange {
    background: var(--orange)
}

.act-dot.red {
    background: var(--red)
}

.act-dot.purple {
    background: var(--purple)
}

.activity-item strong {
    font-size: 13px;
    display: block;
    color: var(--text);
    font-weight: 600
}

.activity-item small {
    font-size: 11px;
    color: var(--text2)
}

.event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border)
}

.event-item:last-child {
    border: none
}

.event-date {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.event-date span {
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    color: var(--primary)
}

.event-date em {
    font-size: 9px;
    font-style: normal;
    color: var(--primary);
    font-weight: 600
}

.event-item>div:nth-child(2) {
    flex: 1
}

.event-item strong {
    font-size: 13px;
    display: block;
    font-weight: 600
}

.event-item small {
    font-size: 11px;
    color: var(--text2)
}

.tag {
    font-size: 10px;
    padding: 3px 9px;
    border-radius: 20px;
    font-weight: 600
}

.tag.orange {
    background: var(--orange-light);
    color: var(--orange)
}

.tag.blue {
    background: var(--blue-light);
    color: var(--blue)
}

.tag.green {
    background: var(--green-light);
    color: var(--green)
}

.tag.purple {
    background: var(--purple-light);
    color: var(--purple)
}

/* ── QUICK ACTIONS ── */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px
}

.qa-btn {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text2);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all .2s
}

.qa-btn:hover {
    background: var(--primary-light);
    border-color: rgba(79, 70, 229, .3);
    color: var(--primary)
}

.qa-btn i {
    color: var(--primary);
    font-size: 14px
}

/* ── PENDING LIST ── */
.pending-list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.pending-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border)
}

.pending-item:last-child {
    border: none
}

.pending-item span {
    flex: 1;
    color: var(--text)
}

.red-icon {
    color: var(--red)
}

.orange-icon {
    color: var(--orange)
}

.blue-icon {
    color: var(--blue)
}

/* ── BUTTONS ── */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .2s;
    box-shadow: 0 1px 3px rgba(79, 70, 229, .25)
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(79, 70, 229, .35)
}

.btn-secondary {
    background: var(--bg2);
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .2s
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light)
}

.btn-sm {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 5px 11px;
    font-size: 11px;
    color: var(--text2);
    cursor: pointer;
    font-weight: 500;
    transition: all .2s
}

.btn-sm:hover {
    border-color: var(--primary);
    color: var(--primary)
}

.btn-sm-top {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600
}

.green-btn {
    background: var(--green-light);
    border: 1px solid rgba(22, 163, 74, .2);
    color: var(--green);
    border-radius: 7px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600
}

.red-btn {
    background: var(--red-light);
    border: 1px solid rgba(220, 38, 38, .2);
    color: var(--red);
    border-radius: 7px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600
}

.full-btn {
    width: 100%;
    justify-content: center;
    padding: 12px
}

/* ── PAGE ACTIONS / FILTER BAR ── */
.page-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px
}

.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap
}

.filter-bar select,
.filter-bar input {
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: border .2s
}

.filter-bar select:focus,
.filter-bar input:focus {
    border-color: var(--primary)
}

/* ── TABLE ── */
.table-card {
    padding: 0;
    overflow: hidden
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px
}

.data-table th {
    background: var(--bg3);
    padding: 11px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .6px;
    border-bottom: 1px solid var(--border)
}

.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text)
}

.data-table tr:last-child td {
    border: none
}

.data-table tr:hover td {
    background: #f8faff
}

.student-name {
    display: flex;
    align-items: center;
    gap: 10px
}

.s-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600
}

.status-badge.paid {
    background: var(--green-light);
    color: var(--green)
}

.status-badge.pending {
    background: var(--red-light);
    color: var(--red)
}

.status-badge.partial {
    background: var(--orange-light);
    color: var(--orange)
}

.action-icons {
    display: flex;
    gap: 8px
}

.action-icons i {
    color: var(--text2);
    cursor: pointer;
    font-size: 14px;
    transition: color .2s;
    padding: 4px;
    border-radius: 5px
}

.action-icons i:hover {
    color: var(--primary);
    background: var(--primary-light)
}

/* ── TEACHER GRID ── */
.teacher-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px
}

.teacher-card {
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 22px 18px;
    text-align: center;
    transition: all .2s;
    box-shadow: var(--shadow)
}

.teacher-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(79, 70, 229, .3)
}

.t-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    margin: 0 auto 12px;
    color: #fff
}

.teacher-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text)
}

.teacher-card .subj {
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 600
}

.teacher-card .t-meta {
    font-size: 11px;
    color: var(--text2);
    margin-bottom: 12px;
    line-height: 1.7
}

.teacher-card .t-actions {
    display: flex;
    gap: 8px;
    justify-content: center
}

.t-btn {
    padding: 5px 13px;
    border-radius: 7px;
    font-size: 11px;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--bg3);
    color: var(--text2);
    font-weight: 500;
    transition: all .2s
}

.t-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light)
}

/* ── ATTENDANCE ── */
.att-controls {
    margin-bottom: 20px
}

.att-selector h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px
}

.att-select-row {
    display: flex;
    gap: 10px;
    align-items: center
}

.att-select-row select,
.att-select-row input {
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    flex: 1;
    font-family: inherit
}

.att-summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 12px
}

.att-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    box-shadow: var(--shadow)
}

.att-box h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text)
}

.att-box p {
    font-size: 12px;
    color: var(--text2);
    margin-top: 4px;
    font-weight: 500
}

.att-actions-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px
}

.att-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px
}

.att-item {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: all .2s
}

.att-item:hover {
    border-color: rgba(79, 70, 229, .3);
    background: #f8f9ff
}

.att-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--text)
}

.att-roll {
    font-size: 10px;
    color: var(--text2);
    margin-bottom: 8px
}

.att-toggle {
    display: flex;
    gap: 4px;
    justify-content: center
}

.att-btn {
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    background: var(--bg);
    color: var(--text2);
    white-space: nowrap
}

.att-btn.p.active {
    background: var(--green);
    color: #fff
}

.att-btn.a.active {
    background: var(--red);
    color: #fff
}

.att-btn.l.active {
    background: var(--orange);
    color: #fff
}

.att-btn:not(.active):hover {
    background: var(--border)
}

/* ── HOMEWORK ── */
.hw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px
}

.hw-card {
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    transition: all .2s;
    box-shadow: var(--shadow)
}

.hw-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(79, 70, 229, .2)
}

.hw-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px
}

.hw-subject {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700
}

.hw-class {
    font-size: 11px;
    color: var(--text2);
    font-weight: 500
}

.hw-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
    line-height: 1.4
}

.hw-card p {
    font-size: 12px;
    color: var(--text2);
    margin-bottom: 12px;
    line-height: 1.5
}

.hw-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text2)
}

.hw-submissions {
    font-size: 12px;
    color: var(--green);
    font-weight: 600
}

/* ── EXAMS / TABS ── */
.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    background: var(--bg2);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
    width: fit-content;
    box-shadow: var(--shadow)
}

.tab {
    background: none;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    color: var(--text2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s
}

.tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, .3)
}

.tab-content {
    display: none
}

.tab-content.active {
    display: block;
    animation: fadeIn .25s
}

.exam-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border)
}

.exam-item:last-child {
    border: none
}

.exam-date-box {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.exam-date-box span {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary)
}

.exam-date-box em {
    font-size: 9px;
    font-style: normal;
    color: var(--primary);
    font-weight: 600
}

/* ── TIMETABLE ── */
.timetable-wrapper {
    overflow-x: auto
}

.timetable {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px
}

.timetable th,
.timetable td {
    border: 1px solid var(--border);
    padding: 10px 8px;
    text-align: center
}

.timetable th {
    background: var(--bg3);
    font-size: 11px;
    color: var(--text2);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px
}

.tt-period {
    border-radius: 7px;
    padding: 6px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text)
}

/* ── COMMUNICATION ── */
.comm-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 16px
}

.compose-card h3,
.notices-list-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text)
}

.form-group {
    margin-bottom: 14px
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .4px
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: border .2s
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: var(--bg2)
}

.notice-item {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--bg3);
    margin-bottom: 10px;
    border-left: 3px solid var(--primary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary)
}

.notice-item h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text)
}

.notice-item p {
    font-size: 12px;
    color: var(--text2)
}

.notice-item small {
    font-size: 10px;
    color: var(--text2);
    margin-top: 4px;
    display: block
}

/* ── CHAT ── */
.chat-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    height: 500px
}

.chat-sidebar h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text)
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s;
    margin-bottom: 4px;
    border: 1px solid transparent
}

.chat-item:hover,
.chat-item.active {
    background: var(--primary-light);
    border-color: rgba(79, 70, 229, .15)
}

.chat-item strong {
    font-size: 13px;
    display: block;
    color: var(--text)
}

.chat-item small {
    font-size: 11px;
    color: var(--text2)
}

.chat-main {
    display: flex;
    flex-direction: column
}

.chat-header-bar {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 10px
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0
}

.msg {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5
}

.msg.received {
    background: var(--bg3);
    border: 1px solid var(--border);
    align-self: flex-start;
    color: var(--text)
}

.msg.sent {
    background: var(--primary);
    color: #fff;
    align-self: flex-end
}

.chat-input-bar {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border)
}

.chat-input-bar input {
    flex: 1;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    font-family: inherit
}

.chat-input-bar button {
    background: var(--primary);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    color: #fff;
    cursor: pointer;
    transition: all .2s
}

.chat-input-bar button:hover {
    background: var(--primary-dark)
}

/* WhatsApp Business indicators */
:root { --whatsapp: #25D366; --whatsapp-dark: #128C7E; }
.tab-whatsapp-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--whatsapp-dark);
    background: rgba(37, 211, 102, .15);
    padding: 2px 8px;
    border-radius: 6px;
    vertical-align: middle;
}
.tab-whatsapp-badge i { color: var(--whatsapp); }
.chat-whatsapp-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: rgba(37, 211, 102, .08);
    border: 1px solid rgba(37, 211, 102, .25);
    border-radius: 10px;
    font-size: 12px;
    color: var(--text);
}
.chat-whatsapp-banner i { font-size: 20px; color: var(--whatsapp); flex-shrink: 0; }
.chat-sidebar-via {
    font-size: 11px;
    color: var(--whatsapp-dark);
    margin: -6px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}
.chat-sidebar-via i { color: var(--whatsapp); }
.chat-header-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--whatsapp-dark);
    background: rgba(37, 211, 102, .12);
    padding: 5px 10px;
    border-radius: 8px;
}
.chat-header-whatsapp i { color: var(--whatsapp); }
.chat-input-bar { flex-direction: column; align-items: stretch; }
.chat-input-via {
    font-size: 10px;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
}
.chat-input-via i { color: var(--whatsapp); font-size: 12px; }
.chat-input-row { display: flex; gap: 10px; }

/* ── SMS ── */
.sms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px
}

.sms-templates h4 {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .5px
}

.sms-tpl {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all .2s;
    color: var(--text2)
}

.sms-tpl:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light)
}

/* ── TRANSPORT ── */
.transport-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 16px
}

.bus-route-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border)
}

.bus-icon {
    width: 40px;
    height: 40px;
    background: var(--orange-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--orange);
    flex-shrink: 0
}

.bus-route-item strong {
    font-size: 13px;
    display: block;
    color: var(--text);
    font-weight: 600
}

.bus-route-item small {
    font-size: 11px;
    color: var(--text2)
}

/* ── LEAVE MANAGEMENT ── */
.leave-row {
    display: grid;
    grid-template-columns: 1.2fr 140px 2fr 90px auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px
}

.leave-row:last-child {
    border-bottom: none
}

.leave-app {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.leave-type-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: .5px
}

.leave-type-badge.student {
    background: var(--purple-light);
    color: var(--purple)
}

.leave-type-badge.teacher {
    background: var(--blue-light);
    color: var(--blue)
}

.leave-dates {
    color: var(--text2);
    font-size: 12px
}

.leave-reason {
    color: var(--text2);
    font-size: 12px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text2)
}

.empty-state i {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: .5
}

.empty-state p {
    font-size: 13px
}

.green-btn { background: var(--green-light) !important; color: var(--green) !important; border-color: var(--green) !important; }
.red-btn { background: var(--red-light) !important; color: var(--red) !important; border-color: var(--red) !important; }

.map-card {
    display: flex;
    flex-direction: column
}

.map-mockup {
    flex: 1;
    min-height: 300px;
    background: var(--bg3);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-top: 10px;
    border: 1px solid var(--border)
}

.map-bg {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(79, 70, 229, .06) 40px), repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(79, 70, 229, .06) 40px);
    position: absolute
}

.bus-marker {
    position: absolute;
    top: 40%;
    left: 30%;
    background: var(--orange);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 0 0 8px rgba(234, 88, 12, .15);
    animation: busMove 4s infinite alternate
}

@keyframes busMove {
    to {
        left: 60%;
        top: 55%
    }
}

.bus-popup {
    display: none;
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    white-space: nowrap;
    width: 160px;
    box-shadow: var(--shadow-md);
    color: var(--text)
}

.bus-marker:hover .bus-popup {
    display: block
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    display: inline-block;
    animation: blink 1s infinite;
    margin-right: 5px
}

@keyframes blink {
    50% {
        opacity: .3
    }
}

/* ── REPORTS ── */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px
}

.report-downloads {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px
}

.report-dl-item {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all .2s
}

.report-dl-item:hover {
    border-color: rgba(79, 70, 229, .3);
    background: var(--primary-light);
    box-shadow: var(--shadow-md)
}

.report-dl-item i {
    font-size: 26px;
    margin-bottom: 8px;
    color: var(--primary)
}

.report-dl-item h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text)
}

.report-dl-item p {
    font-size: 11px;
    color: var(--text2)
}

/* ── MOBILE APPS ── */
.mobile-section-title {
    text-align: center;
    margin-bottom: 32px
}

.mobile-section-title h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text)
}

.mobile-section-title p {
    color: var(--text2);
    font-size: 14px
}

.phones-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap
}

.phone-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px
}

.phone-label {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px
}

.teacher-label {
    background: var(--blue-light);
    color: var(--blue)
}

.parent-label {
    background: var(--green-light);
    color: var(--green)
}

.student-label {
    background: var(--purple-light);
    color: var(--purple)
}

.phone-frame {
    width: 230px;
    height: 460px;
    background: #f0f0f5;
    border-radius: 36px;
    border: 6px solid #c8cbd8;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .15), inset 0 0 0 1px rgba(255, 255, 255, .8);
    overflow: hidden;
    position: relative
}

.phone-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column
}

.app-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 600
}

.teacher-header {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6)
}

.parent-header {
    background: linear-gradient(135deg, #15803d, #22c55e)
}

.student-header {
    background: linear-gradient(135deg, #6d28d9, #8b5cf6)
}

.app-logo-sm {
    font-size: 18px;
    flex-shrink: 0
}

.app-header span {
    flex: 1
}

.app-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8f9fa
}

.app-card-sm {
    background: #ffffff;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06)
}

.app-card-sm i {
    font-size: 18px;
    flex-shrink: 0
}

.app-card-sm span {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    display: block
}

.app-card-sm em {
    font-size: 10px;
    color: #64748b;
    font-style: normal
}

.child-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e9ecef
}

.child-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0
}

.child-card strong {
    font-size: 12px;
    color: #1e293b;
    display: block
}

.child-card small {
    font-size: 10px;
    color: #64748b
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px
}

.stat-box {
    background: #ffffff;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    border: 1px solid #e9ecef
}

.stat-box span {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    display: block
}

.stat-box small {
    font-size: 9px;
    color: #64748b
}

.app-bottombar {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    color: #94a3b8;
    font-size: 18px
}

/* ── SETTINGS ── */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px
}

.role-list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.role-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg3);
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border)
}

.role-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0
}

.role-item h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text)
}

.role-item p {
    font-size: 11px;
    color: var(--text2);
    margin-top: 2px
}

.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    background: var(--bg3);
    border-radius: 10px;
    border: 1px solid var(--border)
}

.toggle-item span {
    font-size: 13px;
    color: var(--text);
    font-weight: 500
}

.toggle {
    width: 40px;
    height: 22px;
    background: var(--border);
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background .2s
}

.toggle.on {
    background: var(--green)
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: left .2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15)
}

.toggle.on::after {
    left: 21px
}

.upload-box {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: var(--text2);
    cursor: pointer;
    transition: all .2s
}

.upload-box:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light)
}

.upload-box i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block
}

.upload-box p {
    font-size: 12px;
    font-weight: 500
}

/* ── MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .4);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center
}

.modal-overlay.open {
    display: flex
}

.modal {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    width: 480px;
    max-width: 90vw;
    animation: slideUp .25s ease;
    box-shadow: var(--shadow-lg)
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0
    }

    to {
        transform: translateY(0);
        opacity: 1
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text)
}

.modal-header button {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text2);
    font-size: 14px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s
}

.modal-header button:hover {
    background: var(--red-light);
    color: var(--red)
}

/* ── PROGRESS BAR ── */
.progress-bar {
    height: 6px;
    background: var(--bg3);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
    border: 1px solid var(--border)
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .6s ease
}

/* ── TOOLTIP ── */
[data-tip] {
    position: relative;
    cursor: pointer
}

[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
    font-weight: 500
}