/* ==========================================================================
   VARKARI STUDENT MANAGEMENT PORTAL — SYSTEM DESIGN STYLESHEET
   ========================================================================== */

:root {
    /* Color Palette */
    --primary-color: #1877F2;         /* Facebook Blue Accent */
    --primary-hover: #0C63D4;
    --primary-light: #E8F4FF;
    
    --secondary-color: #0f172a;       /* Slate Dark Blue */
    --secondary-hover: #1e293b;
    
    --text-color: #050505;            /* Deep black text */
    --text-muted: #64748b;            /* Cool grey secondary */
    
    --bg-main: #f8fafc;               /* Slate Light main area bg */
    --bg-sidebar: #0f172a;            /* Dark Slate sidebar bg */
    
    --white: #ffffff;
    --border-color: #e2e8f0;
    
    /* Semantic Colors */
    --color-success: #10b981;         /* Emerald Green */
    --color-success-light: #ecfdf5;
    --color-warning: #f59e0b;         /* Amber Yellow */
    --color-warning-light: #fffbeb;
    --color-danger: #ef4444;          /* Soft Crimson Red */
    --color-danger-light: #fef2f2;
    --color-info: #3b82f6;            /* Sky Blue */
    --color-info-light: #eff6ff;

    /* Spacing & Borders */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    /* Transitions */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-color);
    line-height: 1.5;
    font-size: 0.95rem;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--secondary-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

/* Utilities */
.d-none { display: none !important; }
.w-full { width: 100% !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-6 { margin-top: 1.5rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.pt-4 { padding-top: 1rem !important; }
.border-t { border-top: 1px solid var(--border-color) !important; }
.overflow-hidden { overflow: hidden !important; }
.text-center { text-align: center !important; }
.text-sm { font-size: 0.825rem !important; }
.text-muted { color: var(--text-muted) !important; }
.text-green { color: var(--color-success) !important; }
.text-orange { color: var(--primary-color) !important; }
.text-red { color: var(--color-danger) !important; }
.flex { display: flex !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.align-center { align-items: center !important; }
.flex-column { flex-direction: column !important; }

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-primary, .btn-secondary, .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 6px -1px rgba(226, 88, 34, 0.2);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
    background-color: var(--bg-main);
    color: var(--secondary-color);
}

.btn-danger {
    background-color: var(--color-danger);
    color: var(--white);
}
.btn-danger:hover {
    background-color: #dc2626;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   INPUTS & FORM GROUPS
   ========================================================================== */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text-color);
    background-color: var(--white);
    transition: var(--transition);
}
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(226, 88, 34, 0.1);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
}
.input-wrapper input {
    padding-left: 40px;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}
.input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(226, 88, 34, 0.1);
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, #faf6f0 0%, #fefcfb 100%);
    padding: 20px;
}

.auth-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    border: 1px solid rgba(226, 88, 34, 0.1);
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}
.logo-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 15px;
    box-shadow: 0 6px 12px rgba(226, 88, 34, 0.1);
}
.auth-logo h2 {
    font-size: 1.6rem;
    margin-bottom: 4px;
}
.auth-logo p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.85rem;
}
.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
}
.remember-me label {
    cursor: pointer;
    color: var(--text-muted);
}

.auth-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.785rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ==========================================================================
   APP SHELL LAYOUT
   ========================================================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.app-sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
    z-index: 100;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #1e293b;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-logo i {
    font-size: 1.4rem;
    color: var(--primary-color);
}
.sidebar-logo h3 {
    color: var(--white);
    font-size: 1.05rem;
    font-weight: 700;
}
.sidebar-logo p {
    font-size: 0.725rem;
    color: #64748b;
}

.btn-sidebar-toggle {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1rem;
    display: none; /* Desktop hidden */
}

.sidebar-menu {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: #94a3b8;
    font-weight: 500;
    transition: var(--transition);
}
.menu-item i {
    font-size: 1.1rem;
    width: 20px;
}
.menu-item:hover {
    background-color: #1e293b;
    color: var(--white);
}
.menu-item.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid #1e293b;
}
.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 6px rgba(226, 88, 34, 0.2);
}
.user-info h4 {
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 600;
}
.user-info p {
    font-size: 0.725rem;
    color: #64748b;
}

.btn-logout-sidebar {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius-sm);
    width: 100%;
    transition: var(--transition);
}
.btn-logout-sidebar:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

/* CONTENT WRAPPER */
.app-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents flex children blowout */
}

/* HEADER */
.app-header {
    height: 70px;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}
.btn-menu-mobile {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    display: none;
    color: var(--text-color);
}
.header-title {
    font-size: 1.35rem;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Language Toggle Button */
.language-switch {
    display: flex;
    background-color: #f1f5f9;
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
.lang-btn {
    background: none;
    border: none;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-muted);
    transition: var(--transition);
}
.lang-btn.active {
    background-color: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Notification dropdown */
.notification-bell {
    position: relative;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #f8fafc;
    transition: var(--transition);
}
.notification-bell:hover {
    background-color: #f1f5f9;
    color: var(--secondary-color);
}
.notification-bell .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--color-danger);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

.notification-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    width: 320px;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    z-index: 110;
    overflow: hidden;
}
.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background-color: #f8fafc;
}
.dropdown-header span {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--secondary-color);
}
.dropdown-header a {
    font-size: 0.75rem;
    font-weight: 600;
}
.dropdown-body {
    max-height: 260px;
    overflow-y: auto;
}
.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: var(--transition);
}
.notif-item:hover {
    background-color: #f8fafc;
}
.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.notif-icon.red { background-color: var(--color-danger-light); color: var(--color-danger); }
.notif-icon.orange { background-color: var(--primary-light); color: var(--primary-color); }
.notif-content {
    font-size: 0.825rem;
}
.notif-content p {
    color: var(--text-color);
    margin-bottom: 2px;
}
.notif-content span {
    font-size: 0.725rem;
    color: var(--text-muted);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    border: 2px solid var(--border-color);
}

/* MAIN CONTENT PANE */
.app-main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

/* ==========================================================================
   CARDS & PANELS
   ========================================================================= */
.content-panel {
    animation: fadeIn 0.25s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.card-body {
    padding: 24px;
}

/* ==========================================================================
   DASHBOARD DETAILS
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.stat-icon.orange { background-color: var(--primary-light); color: var(--primary-color); }
.stat-icon.green { background-color: var(--color-success-light); color: var(--color-success); }
.stat-icon.blue { background-color: var(--color-info-light); color: var(--color-info); }
.stat-icon.red { background-color: var(--color-danger-light); color: var(--color-danger); }

.stat-details h3 {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
}
.stat-details p {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-rows {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 20px;
    align-items: start;
}

.legend {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot.green { background-color: #2ec4b6; }
.dot.orange { background-color: #ff9f1c; }
.dot.red { background-color: #ff3366; }

.chart-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 24px;
}

.donut-chart-container {
    position: relative;
    width: 220px;
    height: 220px;
}
.donut-svg {
    transform: rotate(-90deg);
}
.donut-segment {
    transition: stroke-dasharray 0.3s ease;
}
.donut-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.donut-text h4 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--secondary-color);
}
.donut-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chart-legend-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
    min-width: 200px;
}
.metric-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background-color: #f8fafc;
    font-size: 0.875rem;
}
.metric-row b {
    color: var(--secondary-color);
}

/* Warnings and alerts section */
.warning-badge {
    background-color: var(--color-danger-light);
    color: var(--color-danger);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
}

.issues-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.issue-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-md);
    background-color: #f8fafc;
    border-left: 4px solid var(--color-danger);
    align-items: flex-start;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.issue-card:hover {
    background-color: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.issue-card.warning {
    border-left-color: var(--color-warning);
}
.issue-icon {
    font-size: 1.15rem;
    margin-top: 2px;
}
.issue-card i.text-red { color: var(--color-danger); }
.issue-card i.text-orange { color: var(--color-warning); }

.issue-body h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
}
.issue-body p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.issue-btn-view {
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 6px;
    display: inline-block;
}
.issue-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.issue-btn-clear {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}
.issue-btn-clear:hover {
    color: var(--color-success);
}

/* ==========================================================================
   STUDENT DIRECTORY LIST
   ========================================================================== */
.controls-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
}

.search-filter-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex-grow: 1;
    max-width: 380px;
    min-width: 220px;
}
.search-box i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
}
.search-box input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background-color: #f8fafc;
    transition: var(--transition);
}
.search-box input:focus {
    background-color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(226, 88, 34, 0.1);
}

.filters-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.select-wrapper {
    position: relative;
}
.select-wrapper select {
    padding: 10px 32px 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background-color: var(--white);
    color: var(--text-color);
    appearance: none;
    cursor: pointer;
    font-weight: 500;
}
.select-wrapper::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.7rem;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Dynamic Data Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.925rem;
}
.data-table th, .data-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}
.data-table th {
    background-color: #f8fafc;
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.data-table tbody tr {
    transition: var(--transition);
}
.data-table tbody tr:hover {
    background-color: #faf9f6; /* cream hover touch */
}

/* Avatar badge in list */
.table-avatar-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-student-name {
    font-weight: 600;
    color: var(--secondary-color);
}

.table-actions {
    display: flex;
    gap: 8px;
}
.btn-table-action {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.btn-table-action:hover {
    background-color: #f1f5f9;
    color: var(--secondary-color);
}
.btn-table-action.view:hover {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

.empty-state {
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: #cbd5e1;
}
.empty-state h4 {
    font-size: 1.15rem;
    margin-bottom: 4px;
}

/* ==========================================================================
   STUDENT PROFILE VIEW
   ========================================================================== */
.profile-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.profile-action-buttons {
    display: flex;
    gap: 12px;
}

.profile-bio-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}
.bio-main {
    display: flex;
    align-items: center;
    gap: 20px;
}
.bio-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    box-shadow: 0 6px 12px rgba(226, 88, 34, 0.2);
}
.bio-details h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.bio-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.meta-item b {
    color: var(--secondary-color);
}

.bio-parent-info {
    display: flex;
    gap: 30px;
    padding-left: 20px;
    border-left: 2px solid var(--border-color);
}
.info-block {
    display: flex;
    flex-direction: column;
}
.info-block .label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.info-block .value {
    font-weight: 600;
    color: var(--secondary-color);
}

/* Profile Tab Navigation */
.profile-tabs-wrapper {
    border-bottom: 1px solid var(--border-color);
}
.tabs-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}
.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    white-space: nowrap;
}
.tab-btn:hover {
    color: var(--secondary-color);
}
.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-panel {
    display: none;
    animation: fadeIn 0.25s ease-out forwards;
}
.tab-panel.active {
    display: block;
}

.grid-two-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    align-items: start;
}

/* Tab 1: Progress specific components */
.attendance-percentage {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-success);
    background-color: var(--color-success-light);
    padding: 4px 12px;
    border-radius: 50px;
}

.attendance-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.calendar-day-header {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding-bottom: 6px;
}
.calendar-day-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 50%;
    color: var(--text-muted);
    background-color: #f8fafc;
}
.calendar-day-cell.present {
    background-color: var(--color-success);
    color: var(--white);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}
.calendar-day-cell.absent {
    background-color: var(--color-danger);
    color: var(--white);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}
.calendar-day-cell.empty {
    background-color: transparent;
}

.attendance-legend {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
}
.box-present, .box-absent {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}
.box-present { background-color: var(--color-success); }
.box-absent { background-color: var(--color-danger); }

/* SVG progress chart */
.svg-chart-container {
    width: 100%;
    max-width: 380px;
    margin: 15px auto;
}
.line-chart-svg {
    overflow: visible;
}
.chart-text {
    font-size: 9px;
    fill: var(--text-muted);
    font-weight: 600;
}
.text-anchor-middle {
    text-anchor: middle;
}

/* Subject-wise Rating List */
.subject-status-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.subject-status-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}
.subject-name {
    font-weight: 600;
}
.subject-badge {
    font-size: 0.725rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}
.subject-badge.good { background-color: var(--color-success-light); color: var(--color-success); }
.subject-badge.average { background-color: var(--color-warning-light); color: var(--color-warning); }
.subject-badge.weak { background-color: var(--color-danger-light); color: var(--color-danger); }

/* Timeline for Remarks */
.remarks-timeline {
    position: relative;
    padding-left: 20px;
    max-height: 220px;
    overflow-y: auto;
}
.remarks-timeline::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background-color: var(--border-color);
}
.remark-item {
    position: relative;
    padding-bottom: 16px;
}
.remark-item::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--white);
    border: 2px solid var(--primary-color);
}
.remark-date {
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--text-muted);
}
.remark-text {
    font-size: 0.85rem;
    margin-top: 2px;
}
.remark-author {
    font-size: 0.725rem;
    font-weight: 600;
    color: var(--primary-color);
}

.homework-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.homework-check input {
    cursor: pointer;
}

/* Tab 2: Health / Medical & Complaints */
.medical-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.medical-item {
    display: flex;
    flex-direction: column;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}
.medical-item .label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}
.medical-item .value {
    font-weight: 500;
}
.badge-blue {
    background-color: var(--color-info-light);
    color: var(--color-info);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    font-weight: 700 !important;
}

.timeline {
    position: relative;
    padding-left: 20px;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background-color: var(--border-color);
}
.timeline-item {
    position: relative;
    padding-bottom: 20px;
}
.timeline-item::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-danger);
    border: 2px solid var(--white);
}
.timeline-item.warning::before {
    background-color: var(--color-warning);
}
.timeline-item.health::before {
    background-color: var(--color-info);
}

.timeline-date {
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--text-muted);
}
.timeline-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-top: 2px;
}
.timeline-desc {
    font-size: 0.825rem;
    color: var(--text-muted);
}

/* Tab 3: Fees components */
.fee-ribbon {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.fee-ribbon-item {
    background-color: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
}
.fee-ribbon-item .label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.fee-ribbon-item .value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--secondary-color);
}
.fee-ribbon-item.green { border-left: 4px solid var(--color-success); }
.fee-ribbon-item.red { border-left: 4px solid var(--color-danger); }

/* Tab 4: Documents grid */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.document-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: #f8fafc;
    transition: var(--transition);
}
.document-card:hover {
    background-color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}
.doc-icon {
    font-size: 2.2rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.document-card.active .doc-icon {
    color: var(--primary-color);
}
.doc-title {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 2px;
    color: var(--secondary-color);
}
.doc-meta {
    font-size: 0.725rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Upload input simulation wrapper */
.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}
.upload-btn-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    padding: 20px;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    transform: scale(0.95);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}
.modal-box.small {
    max-width: 440px;
}
.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--secondary-color);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================================================
   TOAST SYSTEM
   ========================================================================== */
.toast-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}
.toast {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast.success {
    background-color: var(--color-success);
}
.toast.danger {
    background-color: var(--color-danger);
}
.toast.warning {
    background-color: var(--color-warning);
}
.toast.info {
    background-color: var(--color-info);
}

@keyframes toastIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE LAYOUT (MOBILE / TABLET)
   ========================================================================== */
@media (max-width: 1024px) {
    .dashboard-rows {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Collapsible Sidebar Overlay Mode */
    .app-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        box-shadow: var(--shadow-lg);
    }
    .app-sidebar.active {
        left: 0;
    }
    .btn-sidebar-toggle {
        display: block;
    }
    .btn-menu-mobile {
        display: block;
    }
    
    .app-header {
        padding: 0 20px;
    }
    
    .app-main-content {
        padding: 20px;
    }
    
    .profile-bio-card {
        padding: 16px;
    }
    .bio-parent-info {
        border-left: none;
        padding-left: 0;
        width: 100%;
        margin-top: 10px;
        gap: 16px;
    }
    .profile-action-buttons {
        width: 100%;
        margin-top: 10px;
    }
    .profile-action-buttons button {
        flex-grow: 1;
    }
    .search-filter-row {
        align-items: stretch;
    }
    .search-box, .filters-box {
        width: 100%;
    }
    .filters-box > button, .filters-box .select-wrapper {
        flex: 1 1 calc(50% - 8px);
    }
    .filters-box > button {
        min-height: 42px;
    }
    .issue-card {
        padding: 12px;
    }
}

@media (max-width: 420px) {
    .app-main-content { padding: 14px; }
    .filters-box > button, .filters-box .select-wrapper { flex-basis: 100%; }
    .stats-grid { grid-template-columns: 1fr; }
    .profile-header-nav, .profile-action-buttons { flex-direction: column; align-items: stretch; }
    .profile-action-buttons button { width: 100%; }
}

/* ==========================================================================
   PRINT LAYOUT
   ========================================================================== */
@media print {
    html, body {
        height: auto !important;
        overflow: visible !important;
        background-color: #fff !important;
        color: #000 !important;
    }
    #app-container, .app-content-wrapper, .app-main-content {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        box-shadow: none !important;
    }
    .app-sidebar, .app-header, .profile-header-nav, #form-add-remark, #card-add-payment, .upload-btn-wrapper, .modal-overlay, #session-select-wrapper {
        display: none !important;
    }
    .content-panel {
        display: none !important;
    }
    #panel-student-profile {
        display: block !important;
    }
    .tab-panel {
        display: none !important;
    }
    #tab-progress {
        display: block !important;
    }
    .content-card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        margin-bottom: 20px !important;
    }
    .attendance-percentage {
        border: 1px solid #000 !important;
    }
    .profile-layout-grid {
        display: block !important;
    }
    .profile-tabs-card, .profile-action-buttons {
        display: none !important;
    }
    /* Hide scrollbars during print */
    ::-webkit-scrollbar {
        display: none;
    }
}

/* Styled Clickable Student Name */
.table-student-name {
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    transition: color var(--transition-fast);
}
.table-student-name:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Split Sidebar Profile Layout Redesign */
.profile-layout-grid {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 24px;
    align-items: start;
    margin-top: 20px;
}

.profile-left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-summary-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 24px;
    text-align: center;
}

.profile-summary-card .bio-avatar {
    width: 90px;
    height: 90px;
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 auto 16px auto;
}

.profile-summary-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1.3;
}

.profile-quick-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
}

.detail-row span {
    color: var(--text-muted);
    font-weight: 500;
}

.detail-row strong {
    color: var(--secondary-color);
    font-weight: 600;
}

.profile-tabs-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-tab-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.profile-tab-btn i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.profile-tab-btn:hover {
    background-color: #f8fafc;
    color: var(--secondary-color);
}

.profile-tab-btn.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

/* Responsive adjustment for split layout */
@media (max-width: 992px) {
    .profile-layout-grid {
        grid-template-columns: 1fr;
    }
}

/* Circular avatar image adjustments */
.bio-avatar img,
.user-avatar img,
.table-avatar-badge img,
.header-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}
.bio-avatar,
.user-avatar,
.table-avatar-badge,
.header-avatar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

/* ========================================== */
/* ADMIN SPLIT SETTINGS PANEL LAYOUT */
/* ========================================== */
.profile-left-column {
    min-width: 240px;
}

#admin-settings-tabs .profile-tab-btn {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

#admin-settings-tabs .profile-tab-btn:hover {
    background-color: var(--background-color);
    color: var(--secondary-color);
}

#admin-settings-tabs .profile-tab-btn.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

/* ========================================== */
/* BIOMETRICS SCANNER AND SENSOR KEYFRAMES */
/* ========================================== */
#fingerprint-sensor-button.scanning {
    animation: sensor-pulse 1.2s infinite ease-in-out;
    box-shadow: 0 0 20px var(--primary-color);
}

@keyframes sensor-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
        box-shadow: 0 0 30px var(--primary-color);
    }
    100% {
        transform: scale(1);
    }
}

#face-laser-line {
    animation: laser-sweep 2s infinite ease-in-out;
}

@keyframes laser-sweep {
    0% {
        top: 0%;
    }
    50% {
        top: 98%;
    }
    100% {
        top: 0%;
    }
}

#login-biometrics-triggers i:hover {
    transform: scale(1.2);
    color: var(--secondary-color) !important;
}

/* ========================================== */
/* ANIMATIONS AND ACCESSIBILITY DECORATIONS */
/* ========================================== */
@keyframes customFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes customScaleIn {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes customBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes customPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

@keyframes customShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Accessible Animations (Respects prefers-reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
    .animate-fade-in {
        animation: customFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    
    .animate-scale-in {
        animation: customScaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }
    
    .animate-bounce {
        animation: customBounce 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .animate-pulse {
        animation: customPulse 1.6s infinite ease-in-out;
    }
    
    .animate-shimmer {
        background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
        background-size: 200% 100%;
        animation: customShimmer 1.6s infinite linear;
    }
    
    .hover-lift {
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    }
    
    .hover-lift:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
    }
}
