/* ========================================
   DASHBOARD STYLE - PTQ Abdullah
   ======================================== */

:root {
    --primary: #0d2b1f;
    --primary-dark: #0a4a2f;
    --primary-light: #2c6e4f;
    --green: #10b981;
    --green-dark: #059669;
    --blue: #3b82f6;
    --blue-dark: #2563eb;
    --orange: #f59e0b;
    --orange-dark: #d97706;
    --purple: #8b5cf6;
    --purple-dark: #7c3aed;
    --red: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: #f0f2f8;
    color: var(--gray-900);
    overflow-x: hidden;
}

/* ========== LAYOUT ========== */
.wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0d2b1f, #0a4a2f);
    color: white;
    padding: 25px 20px;
    position: fixed;
    height: 100%;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.logo-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.logo h2 {
    font-size: 18px;
    font-weight: 700;
}

.logo p {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 2px;
}

/* Menu */
.menu-title {
    margin: 25px 0 12px;
    font-size: 11px;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    margin-bottom: 5px;
    transition: all 0.25s;
    font-size: 14px;
    font-weight: 500;
}

.menu a:hover,
.menu a.active {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.menu a i {
    width: 22px;
    font-size: 16px;
}

/* ========== MAIN CONTENT ========== */
.main {
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* ========== TOPBAR ========== */
.topbar {
    height: 75px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 99;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.toggle {
    font-size: 22px;
    cursor: pointer;
    display: none;
    color: var(--primary-light);
    background: var(--gray-100);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.toggle:hover {
    background: var(--primary-light);
    color: white;
}

.top-title h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
}

.top-title p {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.notification {
    position: relative;
    font-size: 20px;
    color: var(--gray-500);
    cursor: pointer;
    transition: 0.3s;
}

.notification:hover {
    color: var(--primary-light);
}

.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--red);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 20px;
}

.profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 40px;
    transition: 0.3s;
}

.profile:hover {
    background: var(--gray-100);
}

.profile-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.profile-info b {
    font-size: 14px;
    color: var(--gray-800);
}

.profile-info small {
    font-size: 11px;
    color: var(--gray-500);
}

/* ========== CONTENT ========== */
.content {
    padding: 25px 30px;
}

/* ========== STATS CARDS ========== */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.stat-card {
    display: flex;
    gap: 18px;
    align-items: center;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.stat-info p {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin-top: 5px;
}

.stat-info small {
    font-size: 12px;
    font-weight: 500;
}

.stat-info small.up { color: #10b981; }
.stat-info small.down { color: #ef4444; }
.stat-info small.stable { color: #f59e0b; }

/* ========== GRID ========== */
.grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.chart-card {
    padding: 22px;
}

.chart-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 20px;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

/* School Info */
.school-info {
    text-align: center;
}

.school-logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8f5ee, #d1fae5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 40px;
    color: var(--primary-dark);
}

.school-info h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--gray-800);
}

.school-info p {
    color: var(--gray-500);
    line-height: 1.6;
    font-size: 14px;
}

.school-info hr {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--gray-200);
}

.school-contact {
    text-align: left;
    margin-top: 15px;
}

.school-contact p {
    margin-bottom: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.school-contact i {
    width: 24px;
    color: var(--primary-light);
}

/* ========== LOWER GRID ========== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
}

.section-header a {
    font-size: 12px;
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
}

.section-header a:hover {
    color: var(--primary-dark);
}

/* List Items */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
}

.list-item:last-child {
    border: none;
}

.list-item .title {
    font-weight: 500;
    font-size: 14px;
    color: var(--gray-700);
}

.list-item .date {
    color: #10b981;
    font-size: 12px;
    font-weight: 500;
    background: #ecfdf5;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Schedule Items */
.schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.schedule-item:last-child {
    border: none;
}

.schedule-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
    background: #ecfdf5;
    padding: 4px 12px;
    border-radius: 20px;
}

.schedule-class {
    font-size: 14px;
    color: var(--gray-600);
}

/* ========== TABLE STYLES ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 13px;
}

.data-table tr:hover td {
    background: var(--gray-50);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
    border: none;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-light);
    color: var(--primary-light);
}

.btn-outline:hover {
    background: var(--primary-light);
    color: white;
}

/* ========== RESPONSIVE ========== */
@media(max-width: 1200px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width: 992px) {
    .sidebar {
        left: -280px;
        position: fixed;
        z-index: 1000;
    }
    .sidebar.show {
        left: 0;
    }
    .main {
        margin-left: 0;
        width: 100%;
    }
    .toggle {
        display: flex;
    }
    .grid {
        grid-template-columns: 1fr;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .topbar {
        padding: 0 20px;
    }
    .content {
        padding: 20px;
    }
    .profile-info {
        display: none;
    }
    .profile {
        padding: 0;
    }
}

@media(max-width: 768px) {
    .stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .top-title h2 {
        font-size: 18px;
    }
    .top-title p {
        font-size: 11px;
    }
    .notification {
        font-size: 18px;
    }
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
        border-radius: 14px;
    }
    .stat-info h3 {
        font-size: 24px;
    }
    .chart-container {
        height: 220px;
    }
    .data-table {
        display: block;
        overflow-x: auto;
    }
}

@media(max-width: 480px) {
    .top-title h2 {
        font-size: 16px;
    }
    .top-title p {
        display: none;
    }
    .topbar {
        padding: 0 15px;
    }
    .content {
        padding: 15px;
    }
    .card {
        padding: 16px;
    }
    .list-item .title {
        font-size: 13px;
    }
    .schedule-time {
        font-size: 11px;
        padding: 3px 10px;
    }
    .schedule-class {
        font-size: 12px;
    }
}

/* ========== UTILITIES ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

.tooltip {
    position: relative;
}

.tooltip:hover:after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: white;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    white-space: nowrap;
    margin-bottom: 8px;
}