/* CSS Variables & Reset */
:root {
    /* Color Palette - Professional & Modern */
    --primary-color: #2563eb;
    /* Royal Blue */
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    /* Slate */
    --accent-color: #0ea5e9;
    /* Sky Blue */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    /* Backgrounds */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;

    /* Text */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-white: #ffffff;

    /* Spacing & Borders */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);

    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
}

/* Layout Utilities */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #2d3436;
    color: #b2bec3;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.brand {
    padding: 3rem 1.5rem;
    /* Increased padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    text-align: center;
    background: #252b2d;
    /* Slightly darker header background */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand img {
    width: 120px !important;
    /* Visual match to reference */
    height: 120px !important;
    border: 4px solid rgba(255, 255, 255, 0.15);
    /* Thicker border */
    padding: 3px;
    border-radius: 50%;
}

.brand span {
    font-size: 1.25rem;
    font-weight: 800;
    /* Extra bold */
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links {
    list-style: none;
    padding: 1rem 0;
    flex: 1;
}

.nav-item {
    position: relative;
}

/* Parent Menu Item */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #b2bec3;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 0.95rem;
    justify-content: space-between;
    /* Space for arrow */
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left: 4px solid var(--primary-color);
}

.nav-link i.icon-left {
    min-width: 24px;
    margin-right: 0.75rem;
}

.nav-link i.icon-right {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

/* Submenu */
.submenu {
    list-style: none;
    background: #22282a;
    display: none;
    /* Hidden by default */
    padding-left: 0;
}

.submenu.open {
    display: block;
}

.submenu .nav-link {
    padding-left: 3.5rem;
    /* Indent sub-items */
    font-size: 0.9rem;
    border-left: none !important;
}

.submenu .nav-link:hover {
    color: var(--primary-color);
    background: transparent;
}

/* Rotate arrow when open */
.nav-item.open>.nav-link .icon-right {
    transform: rotate(90deg);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* Utility Classes */
.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
        /* For now, simple hide on mobile */
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-md);
    transform: translateY(-20px);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

th {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    background-color: #f8fafc;
}

td {
    font-size: 0.875rem;
    color: var(--text-main);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Avatars in Table */
.student-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 32px;
    height: 32px;
    background-color: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Status Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.badge-active {
    background-color: #dcfce7;
    color: #166534;
}

.badge-pending {
    background-color: #fef9c3;
    color: #854d0e;
}

.badge-inactive {
    background-color: #f1f5f9;
    color: #64748b;
}

/* Search Bar */
.search-bar {
    position: relative;
    width: 300px;
}

.search-bar input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}