/* 
 * BS Tuition - Bilingual Learning Management System
 * Main Stylesheet
 * Modern, Responsive, Education-friendly Design
 */

/* ============================================
   CSS Variables & Theme
   ============================================ */
:root {
    /* Primary Colors - Education-friendly Blue */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-bg: #eff6ff;

    /* Secondary Colors - Teal/Green Accent */
    --secondary: #0d9488;
    --secondary-dark: #0f766e;
    --secondary-light: #ccfbf1;
    --secondary-bg: #f0fdfa;

    /* Accent Colors */
    --accent: #8b5cf6;
    --accent-light: #a78bfa;

    /* Neutral Colors */
    --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;

    /* Semantic Colors */
    --success: #10b981;
    --success-bg: #d1fae5;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --info: #3b82f6;
    --info-bg: #dbeafe;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Typography */
    --font-primary: 'Inter', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-bengali: 'Noto Sans Bengali', 'Hind Siliguri', sans-serif;

    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Bengali Font Support */
body.lang-bn {
    font-family: var(--font-bengali), var(--font-primary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* ============================================
   Typography
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
}

.text-primary {
    color: var(--primary);
}

.text-secondary {
    color: var(--secondary);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-danger {
    color: var(--danger);
}

.text-muted {
    color: var(--gray-500);
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

/* ============================================
   Layout - Auth Pages (Login, Register, etc.)
   ============================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--gray-100) 100%);
}

.auth-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.auth-logo p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* ============================================
   Layout - Dashboard
   ============================================ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition-slow);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--gray-300);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
}

/* Header */
.header {
    background: white;
    height: var(--header-height);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    padding: 0.5rem;
}

.page-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 0.25rem;
    background: var(--gray-100);
    padding: 0.25rem;
    border-radius: var(--border-radius);
}

.lang-btn {
    padding: 0.375rem 0.75rem;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    border-radius: 6px;
    transition: var(--transition);
}

.lang-btn:hover {
    color: var(--gray-800);
}

.lang-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Notifications Dropdown */
.notifications-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    padding: 0.5rem;
}

.notifications-btn .badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.user-menu:hover {
    background: var(--gray-100);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-info {
    text-align: left;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-800);
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: capitalize;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 1.5rem;
    overflow-x: hidden;
    max-width: 100%;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    max-width: 100%;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.primary {
    background: var(--primary-bg);
    color: var(--primary);
}

.stat-icon.secondary {
    background: var(--secondary-bg);
    color: var(--secondary);
}

.stat-icon.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-icon.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-icon.info {
    background: var(--info-bg);
    color: var(--info);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    background: white;
    color: var(--gray-800);
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px var(--danger-bg);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.form-text {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
}

.invalid-feedback {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.375rem;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
}

/* File Input */
.file-input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius);
    background: var(--gray-50);
    cursor: pointer;
    transition: var(--transition);
}

.file-input-wrapper:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-input-icon {
    font-size: 2rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}

.file-input-text {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-light {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-light:hover {
    background: var(--gray-200);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   Tables
   ============================================ */
.table-responsive {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: var(--gray-50);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-actions .btn {
    padding: 0.375rem 0.625rem;
}

/* ============================================
   Badges & Tags
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-primary {
    background: var(--primary-bg);
    color: var(--primary);
}

.badge-secondary {
    background: var(--secondary-bg);
    color: var(--secondary);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

/* Status Badges */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-dot.active {
    background: var(--success);
}

.status-dot.inactive {
    background: var(--gray-400);
}

.status-dot.pending {
    background: var(--warning);
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-success {
    background: var(--success-bg);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background: var(--warning-bg);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-danger {
    background: var(--danger-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: var(--info-bg);
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.alert-dismissible {
    position: relative;
}

.alert-dismiss {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
}

.alert-dismiss:hover {
    opacity: 1;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    background: white;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.page-link:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-link.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* ============================================
   Dropdown
   ============================================ */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 100;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--gray-700);
    font-size: 0.875rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.dropdown-item i {
    width: 16px;
    color: var(--gray-400);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.5rem 0;
}

/* ============================================
   Attendance Grid
   ============================================ */
.attendance-grid {
    display: grid;
    gap: 0.5rem;
}

.attendance-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    gap: 1rem;
}

.attendance-student {
    flex: 1;
}

.attendance-options {
    display: flex;
    gap: 0.5rem;
}

.attendance-option {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background: white;
}

.attendance-option:hover {
    border-color: var(--gray-400);
}

.attendance-option.present.active {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.attendance-option.absent.active {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.attendance-option.late.active {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}

/* ============================================
   Modern UI Components - Student/Parent Pages
   ============================================ */

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #1e3a8a 100%);
    color: white;
    border-radius: var(--border-radius-lg);
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.3);
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-banner h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.welcome-banner p {
    opacity: 0.9;
    margin: 0;
    font-size: 0.95rem;
}

.welcome-banner .welcome-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.welcome-banner .welcome-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Child Overview Card */
.child-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.child-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.child-card-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.child-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.child-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.child-info small {
    color: var(--gray-500);
}

.child-card-body {
    padding: 1.25rem;
}

.child-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.child-stat {
    text-align: center;
    padding: 0.875rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.child-stat.homework {
    background: var(--warning-bg);
}

.child-stat.attendance {
    background: var(--success-bg);
}

.child-stat.attendance.low {
    background: var(--danger-bg);
}

.child-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.child-stat.homework .child-stat-value {
    color: var(--warning);
}

.child-stat.attendance .child-stat-value {
    color: var(--success);
}

.child-stat.attendance.low .child-stat-value {
    color: var(--danger);
}

.child-stat-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.child-card-footer {
    padding: 0.875rem 1.25rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
}

/* Info List Items */
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
}

.info-list-item:last-child {
    border-bottom: none;
}

.info-list-item:hover {
    background: var(--gray-50);
}

.info-list-item.pinned {
    background: linear-gradient(90deg, var(--primary-bg) 0%, transparent 100%);
    border-left: 3px solid var(--primary);
}

.info-list-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.info-list-icon.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.info-list-icon.info {
    background: var(--info-bg);
    color: var(--info);
}

.info-list-icon.success {
    background: var(--success-bg);
    color: var(--success);
}

.info-list-icon.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.info-list-content {
    flex: 1;
    min-width: 0;
}

.info-list-title {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.info-list-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.info-list-meta {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.info-list-action {
    flex-shrink: 0;
}

/* Fee Display Card */
.fee-display {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-bg) 0%, white 100%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--primary-light);
}

.fee-amount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.fee-label {
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.fee-status {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.875rem;
}

.fee-status.paid {
    background: var(--success);
    color: white;
}

.fee-status.partial {
    background: var(--warning);
    color: white;
}

.fee-status.pending {
    background: var(--danger);
    color: white;
}

.fee-status.none {
    background: var(--gray-200);
    color: var(--gray-600);
}

/* Progress Circle */
.progress-circle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-circle-bg {
    fill: none;
    stroke: var(--gray-200);
}

.progress-circle-fill {
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-circle-text {
    position: absolute;
    font-weight: 700;
    font-size: 1.25rem;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.dashboard-grid-full {
    grid-column: 1 / -1;
}

/* Profile Card */
.profile-header {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-bottom: 1px solid var(--gray-100);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.profile-role {
    color: var(--gray-500);
    text-transform: capitalize;
}

/* Attendance Summary Boxes */
.attendance-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.attendance-summary-box {
    text-align: center;
    padding: 1.25rem;
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
}

.attendance-summary-box:hover {
    transform: translateY(-2px);
}

.attendance-summary-box.present {
    background: var(--success-bg);
}

.attendance-summary-box.absent {
    background: var(--danger-bg);
}

.attendance-summary-box.late {
    background: var(--warning-bg);
}

.attendance-summary-box.total {
    background: var(--gray-100);
}

.attendance-summary-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.attendance-summary-box.present .attendance-summary-value {
    color: var(--success);
}

.attendance-summary-box.absent .attendance-summary-value {
    color: var(--danger);
}

.attendance-summary-box.late .attendance-summary-value {
    color: var(--warning);
}

.attendance-summary-box.total .attendance-summary-value {
    color: var(--gray-700);
}

.attendance-summary-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Timeline Style for Announcements */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.625rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary-bg);
}

.timeline-item.pinned::before {
    background: var(--warning);
    box-shadow: 0 0 0 2px var(--warning-bg);
}

.timeline-content {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    transition: var(--transition);
}

.timeline-content:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.timeline-title {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.timeline-text {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.timeline-meta {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Notification List */
.notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notification-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
    cursor: pointer;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--gray-50);
}

.notification-item.unread {
    background: var(--primary-bg);
    border-left: 3px solid var(--primary);
}

.notification-item.unread:hover {
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--gray-50) 100%);
}

.notification-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
    background: var(--gray-100);
    color: var(--gray-600);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.notification-item.unread .notification-title {
    font-weight: 600;
}

.notification-text {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Cards Grid for Notes/Materials */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.note-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.note-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.note-card-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}

.note-card-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.note-card-subject {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

.note-card-body {
    padding: 1rem 1.25rem;
}

.note-card-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.5;
}

.note-card-footer {
    padding: 0.875rem 1.25rem;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--gray-100);
}

.note-card-date {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Homework Card */
.homework-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border-left: 4px solid var(--gray-300);
}

.homework-card:hover {
    box-shadow: var(--shadow-lg);
}

.homework-card.urgent {
    border-left-color: var(--danger);
}

.homework-card.soon {
    border-left-color: var(--warning);
}

.homework-card.normal {
    border-left-color: var(--success);
}

.homework-card-body {
    padding: 1.25rem;
}

.homework-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.homework-card-title {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 1rem;
    line-height: 1.4;
}

.homework-card-deadline {
    flex-shrink: 0;
}

.homework-card-subject {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--secondary);
    background: var(--secondary-bg);
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    margin-bottom: 0.5rem;
}

.homework-card-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.5;
}

.homework-card-footer {
    padding: 0.875rem 1.25rem;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--gray-100);
    gap: 1rem;
    flex-wrap: wrap;
}

.homework-card-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Responsive for new components */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .attendance-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .welcome-banner {
        padding: 1.25rem 1.5rem;
    }

    .welcome-banner h2 {
        font-size: 1.25rem;
    }

    .welcome-banner .welcome-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .child-stats {
        grid-template-columns: 1fr;
    }

    .child-card-header {
        flex-direction: column;
        text-align: center;
    }

    .fee-amount {
        font-size: 2.25rem;
    }

    .attendance-summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .attendance-summary-value {
        font-size: 1.5rem;
    }

    .notes-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .welcome-banner {
        padding: 1rem 1.25rem;
        margin-bottom: 1rem;
    }

    .welcome-banner h2 {
        font-size: 1.1rem;
    }

    .attendance-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .attendance-summary-box {
        padding: 0.875rem;
    }

    .attendance-summary-value {
        font-size: 1.25rem;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .profile-name {
        font-size: 1.25rem;
    }

    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-item::before {
        left: -1.375rem;
        width: 10px;
        height: 10px;
    }
}

/* ============================================
   Utilities
   ============================================ */
.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.p-0 {
    padding: 0;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.d-flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.w-100 {
    width: 100%;
}

.hidden {
    display: none !important;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
        width: 100%;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        display: none;
    }

    .sidebar.active+.sidebar-overlay {
        display: block;
    }

    /* Header adjustments */
    .header {
        padding: 0.75rem 1rem;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .page-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {

    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* Form layout */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Card header */
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .card-header .btn-group {
        width: 100%;
    }

    .card-header .btn {
        flex: 1;
    }

    /* Card body */
    .card-body {
        padding: 1rem;
    }

    /* Table improvements */
    .table-responsive {
        margin: 0 -1rem;
        padding: 0 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    .table th,
    .table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .table-actions {
        display: flex;
        gap: 0.25rem;
    }

    .table-actions .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }

    /* User info */
    .user-info {
        display: none;
    }

    /* Notifications dropdown */
    .notifications-dropdown {
        right: -100px;
        width: 280px;
    }

    /* Button groups */
    .btn-group {
        flex-wrap: wrap;
    }

    /* Dashboard welcome */
    .dashboard-welcome h2 {
        font-size: 1.25rem;
    }

    /* Stat cards */
    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    /* Filters row */
    .d-flex.gap-1 {
        flex-wrap: wrap;
    }

    .d-flex.gap-1>* {
        flex: 1 1 120px;
    }

    /* Subject cards */
    .subject-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Profile dropdown */
    .profile-dropdown .dropdown-menu {
        right: 0;
        min-width: 200px;
    }
}

@media (max-width: 576px) {

    /* Single column stats */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Page content padding */
    .page-content {
        padding: 0.75rem;
    }

    /* Auth card */
    .auth-card {
        padding: 1.25rem;
        margin: 0.5rem;
    }

    .auth-logo h1 {
        font-size: 1.5rem;
    }

    /* Modal adjustments */
    .modal {
        margin: 0.5rem;
    }

    .modal-content {
        max-width: 100% !important;
        margin: 1rem !important;
    }

    /* Card */
    .card {
        border-radius: var(--border-radius);
    }

    .card-header {
        padding: 0.875rem 1rem;
    }

    .card-title {
        font-size: 1rem;
    }

    /* Buttons */
    .btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }

    .btn-sm {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Forms */
    .form-control {
        padding: 0.625rem 0.75rem;
        font-size: 0.9rem;
    }

    .form-label {
        font-size: 0.85rem;
    }

    /* Badges */
    .badge {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    /* Tables - horizontal scroll */
    .table {
        min-width: 500px;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.375rem;
        font-size: 0.75rem;
    }

    /* Subject grid single column */
    .subject-grid {
        grid-template-columns: 1fr;
    }

    .subject-card-header {
        padding: 1rem;
    }

    .subject-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .subject-name {
        font-size: 1.1rem;
    }

    /* Empty state */
    .empty-state-icon {
        font-size: 2.5rem;
    }

    .empty-state-title {
        font-size: 1rem;
    }

    /* Pagination */
    .pagination {
        gap: 0.25rem;
    }

    .page-link {
        padding: 0.375rem 0.625rem;
        font-size: 0.8rem;
    }

    /* Action buttons uniform size */
    .table-actions .btn {
        width: 30px;
        height: 30px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Header compact */
    .header {
        padding: 0.5rem 0.75rem;
    }

    .page-title {
        font-size: 1rem;
    }

    /* Language switcher */
    .language-switcher .lang-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Filters */
    .d-flex.gap-1>* {
        flex: 1 1 100%;
    }

    /* Alerts */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    /* Dropdown menu */
    .dropdown-menu {
        min-width: 140px;
    }

    .dropdown-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Fee dashboard cards */
    .fee-stats-grid {
        grid-template-columns: 1fr !important;
    }

    .fee-stat-card {
        padding: 0.875rem !important;
    }
}

/* Extra small devices */
@media (max-width: 400px) {

    /* Very compact layout */
    .page-content {
        padding: 0.5rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .card-header {
        padding: 0.75rem;
    }

    .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .form-control {
        padding: 0.5rem 0.625rem;
    }

    /* Hide some text on very small screens */
    .table .btn-sm span,
    .table .btn span {
        display: none;
    }

    /* Sidebar narrower */
    .sidebar {
        width: 240px;
    }

    .nav-item {
        padding: 0.6rem 0.875rem;
        font-size: 0.85rem;
    }

    /* Auth page */
    .auth-card {
        padding: 1rem;
    }

    .auth-logo h1 {
        font-size: 1.25rem;
    }
}

/* Landscape phone orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        max-height: 100vh;
        overflow-y: auto;
    }

    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        margin: 0.5rem auto;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {

    .sidebar,
    .header,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .page-content {
        padding: 0;
    }

    .table {
        min-width: auto;
    }
}

/* ============================================
   Global Horizontal Scroll Prevention
   ============================================ */
html,
body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

.dashboard-wrapper,
.main-content,
.page-content,
.card,
.card-body,
.container {
    overflow-x: hidden;
    max-width: 100%;
}

/* Prevent tables from causing overflow */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.table {
    min-width: 100%;
    width: 100%;
}

/* Prevent form elements from overflowing */
.form-control,
input,
select,
textarea {
    max-width: 100%;
}

/* Prevent long text from causing overflow */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ensure flexbox layouts don't overflow */
.d-flex,
.form-row,
.stats-grid,
.dashboard-grid {
    max-width: 100%;
}

/* Mobile specific overflow fixes */
@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    .main-content {
        max-width: 100vw !important;
        width: 100% !important;
    }

    .page-content {
        padding: 1rem;
        max-width: 100%;
    }

    .card {
        max-width: 100%;
        overflow: hidden;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card-header .btn-group,
    .card-header .btn {
        width: 100%;
        justify-content: center;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row>.form-group {
        width: 100%;
    }

    .btn-group {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    img,
    video,
    iframe {
        max-width: 100%;
        height: auto;
    }

    pre,
    code {
        overflow-x: auto;
        max-width: 100%;
        word-break: break-word;
    }
}