/* assets/css/style.css - UI Modernization */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;600;700&family=Manrope:wght@600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
    --primary: #0058be;
    --primary-fixed: #d8e2ff;
    --primary-container: #2170e4;
    --on-primary: #ffffff;
    --on-primary-container: #fefcff;
    
    --secondary: #4244df;
    --accent: #60d4fc;
    
    --success: #22C55E;
    --danger: #ba1a1a;
    --warning: #F59E0B;
    --info: #007f9e;
    
    --bg: #faf8ff;
    --surface: #F7FAFF;
    --surface-container-lowest: #ffffff;
    --surface-container: #eaedff;
    --surface-container-high: #e2e7ff;
    
    --text: #131b2e;
    --text-variant: #424754;
    --text-secondary: #64748B;
    
    --card-bg: #ffffff;
    --border: #E2E8F0;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0px 10px 30px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-pill: 9999px;
    
    --font-head: 'Manrope', sans-serif;
    --font-body: 'Hanken Grotesk', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    margin: 0; padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 14px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    font-weight: 700;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.02em;
}

/* Material Symbols */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  vertical-align: middle;
  font-size: 20px;
}
.material-symbols-filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  vertical-align: middle;
  font-size: 20px;
}
/* For backward compatibility with Phosphor classes still in HTML */
i.ph { font-family: 'Material Symbols Outlined', sans-serif !important; font-style: normal; }
i.ph::before { content: attr(data-icon); }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.hidden-desktop { display: none; }
.hidden-mobile  { display: block; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger);  }
.text-warning { color: var(--warning); }
.text-info    { color: var(--info);    }
.text-primary { color: var(--primary); }
.text-muted   { color: var(--text-secondary); }
.mt-4 { margin-top: 1.25rem; }
.mb-4 { margin-bottom: 1.25rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 0.75rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.w-full { width: 100%; }
.gradient-text {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.gradient-bg {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: white;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.6rem 1.125rem;
    border-radius: var(--radius-pill);
    font-weight: 600; font-size: 0.875rem;
    font-family: var(--font-body);
    cursor: pointer; text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}
.btn i, .btn span.material-symbols-outlined { font-size: 1.15rem; }
.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: white; border-color: transparent;
}
.btn-primary:hover  { transform: scale(0.98); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: scale(0.95); }
.btn-secondary { background: var(--surface-container); color: var(--primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-container-high); }
.btn-danger  { background: #ffe4e6; color: var(--danger); border-color: #fecdd3; }
.btn-danger:hover  { background: #fecdd3; }
.btn-success { background: #dcfce7; color: var(--success); border-color: #bbf7d0; }
.btn-success:hover { background: #bbf7d0; }
.btn-outline { border: 1px solid var(--border); color: var(--primary); background: var(--surface-container-lowest); box-shadow: none; }
.btn-outline:hover { background: var(--surface-container); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.75rem; }
.btn-block { width: 100%; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.375rem; font-weight: 600; color: var(--text-variant); font-size: 0.8125rem; }
.form-control {
    width: 100%; padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    background: var(--surface-container-lowest);
    border-radius: var(--radius-md);
    box-sizing: border-box; font-size: 1rem;
    font-size: 0.875rem; font-family: inherit; color: var(--text);
    transition: all 0.2s ease;
}
.form-control::placeholder { color: var(--text-secondary); }
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 88, 190, 0.1);
}
.input-icon-wrap { position: relative; }
.input-icon {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--text-secondary); font-size: 1.25rem; pointer-events: none;
}
.form-control-icon { padding-left: 2.75rem !important; }
.pwd-input { padding-right: 2.75rem !important; }
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 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 1rem center; background-size: 1rem;
    padding-right: 2.5rem;
}

.pwd-toggle {
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--text-secondary); cursor: pointer;
    background: none; border: none; padding: 0.25rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: all 0.2s;
}
.pwd-toggle:hover { color: var(--primary); background: var(--surface-container); }

/* ============================================================
   MESSAGES / TOASTS
   ============================================================ */
.msg {
    padding: 1rem 1.25rem; border-radius: var(--radius-md);
    margin-bottom: 1.25rem; font-size: 0.875rem; font-weight: 600;
    display: flex; align-items: center; gap: 0.5rem;
}
.msg.error   { background: #ffdad6; color: #93000a; }
.msg.success { background: #d1fae5; color: #065f46; }

.toast {
    position: fixed; bottom: 5.5rem; left: 50%; transform: translateX(-50%);
    padding: 0.75rem 1.5rem; border-radius: var(--radius-pill);
    font-size: 0.875rem; font-weight: 600;
    box-shadow: var(--shadow-lg); z-index: 9999;
    display: flex; align-items: center; gap: 0.5rem;
    opacity: 0; transition: opacity 0.3s; pointer-events: none;
    white-space: nowrap;
}
.toast.visible { opacity: 1; pointer-events: auto; }
.toast.success { background: var(--success); color: white; }
.toast.error   { background: var(--danger); color: white; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh;
    background: var(--bg);
    padding: 1.25rem;
}
.login-container {
    background: var(--surface-container-lowest);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    width: 100%; max-width: 420px;
    border: 1px solid var(--border);
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-logo-wrap { margin-bottom: 1.25rem; }
.login-logo-icon {
    display: inline-flex; justify-content: center; align-items: center;
    width: 72px; height: 72px; border-radius: 1.25rem;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white; font-size: 2.5rem;
    box-shadow: 0 10px 25px rgba(0, 88, 190, 0.2);
}
.login-header h2 { font-size: 1.75rem; color: var(--text); }
.login-header p { margin: 0.5rem 0 0; color: var(--text-secondary); font-size: 1rem; }
.form-options {
    display: flex; align-items: center;
    margin-bottom: 1.5rem; font-size: 0.875rem;
}
.remember-label {
    display: flex; align-items: center; gap: 0.5rem;
    cursor: pointer; color: var(--text-variant); font-weight: 600;
}
.remember-check { width: 1.25rem; height: 1.25rem; accent-color: var(--primary); cursor: pointer; }
.login-btn { padding: 1rem 1.5rem; font-size: 1rem; width: 100%; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-body { overflow-x: hidden; }
.app-container { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; flex-shrink: 0;
    z-index: 200; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed; top: 0; bottom: 0; left: 0;
}
.sidebar-header { padding: 1rem 1rem; display: flex; align-items: center; gap: 0.75rem; }
.sidebar-header .avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--surface-container-high);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.875rem; color: var(--primary);
    overflow: hidden; flex-shrink: 0;
}
.sidebar-header .avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-header .user-info h2 { font-size: 0.95rem; color: var(--primary); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
.sidebar-header .user-info p { font-size: 0.75rem; color: var(--text-variant); margin: 0; }

.logo { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.logo-icon {
    color: white; background: linear-gradient(135deg, var(--secondary), var(--primary));
    padding: 0.375rem; border-radius: 0.5rem; display: flex; font-size: 1.125rem;
}
.logo-text { font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--text); }

.sidebar-nav { padding: 0.25rem 0.75rem; flex: 1; overflow-y: auto; }
.nav-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-item { margin: 0; }
.nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 1rem; color: var(--text-variant);
    text-decoration: none; border-radius: var(--radius-md);
    font-weight: 600; font-size: 1rem;
    transition: all 0.2s;
}
.nav-link i, .nav-link span.material-symbols-outlined { font-size: 22px; }
.nav-link:hover { background: var(--surface-container); color: var(--primary); }
.nav-link.active {
    background: var(--surface-container);
    color: var(--primary);
    border-right: 4px solid var(--primary);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.sidebar-footer { padding: 0.75rem 1rem; border-top: 1px solid var(--border); }
.close-sidebar { cursor: pointer; display: none; }

/* TOP HEADER */
.main-content {
    flex: 1; display: flex; flex-direction: column; min-width: 0;
    margin-left: 280px; /* Width of sidebar */
}
.top-header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 0.75rem 1.25rem;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}
.header-left { display: flex; align-items: center; gap: 1rem; flex: 1; }
.header-left h2 { font-size: 1.125rem; color: var(--primary); margin: 0; font-family: var(--font-head);}
.mobile-menu-btn {
    cursor: pointer; color: var(--primary);
    display: none; padding: 0.5rem;
    background: transparent; border: none; border-radius: 50%;
    transition: background 0.2s;
}
.mobile-menu-btn:hover { background: var(--surface-container); }
.header-right { display: flex; align-items: center; gap: 1rem; }

.user-profile { display: flex; align-items: center; gap: 0.5rem; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%; font-size: 0.8rem;
    background: var(--surface-container-high); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--primary);
    cursor: pointer; transition: opacity 0.2s; flex-shrink: 0;
}
.avatar:hover { opacity: 0.8; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-size: 0.875rem; font-weight: 600; color: var(--text); }

.content-area { padding: 1rem 1.25rem; max-width: 1280px; margin: 0 auto; width: 100%; }

/* ============================================================
   GRID
   ============================================================ */
.grid { display: grid; gap: 0.75rem; }
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================================
   STAT CARDS — Bento Style
   ============================================================ */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 0.875rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex; flex-direction: column; justify-content: space-between;
    aspect-ratio: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    margin-bottom: 0.5rem; font-size: 1.125rem;
}
.stat-icon.primary { background: var(--primary-container); color: white; }
.stat-icon.success { background: #d1fae5; color: var(--success); }
.stat-icon.warning { background: #fef3c7; color: var(--warning); }
.stat-icon.danger  { background: #fee2e2; color: var(--danger); }
.stat-icon.accent  { background: #e0f2fe; color: #0284c7; }
.stat-info { margin-top: auto; }
.stat-label {
    color: var(--text-variant); font-size: 0.75rem; font-weight: 700; margin: 0 0 0.25rem;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.stat-value { font-family: var(--font-head); font-size: 1.375rem; font-weight: 700; color: var(--text); margin: 0; line-height: 1.2; }
.stat-desc { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem;}
.card-title  { font-family: var(--font-head); margin: 0; font-size: 1rem; font-weight: 700; color: var(--text); }
.card-body { overflow-x: auto; }

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0 0.5rem; text-align: left; font-size: 13px; }
.table th { padding: 0.5rem 0.75rem; color: var(--text-secondary); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.table td { padding: 0.5rem 0.75rem; background: var(--surface-container-lowest); vertical-align: middle; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.table td:first-child { border-left: 1px solid var(--border); border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.table td:last-child  { border-right: 1px solid var(--border); border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }
.table tbody tr { transition: transform 0.2s, box-shadow 0.2s; }
.table tbody tr:hover td { background: var(--surface); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex; align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
}
.badge-present         { background: #dcfce7; color: #166534; }
.badge-absent-student  { background: #fee2e2; color: #991b1b; }
.badge-absent-teacher  { background: #7f1d1d; color: #fef2f2; }
.badge-holiday-weekly  { background: #fef3c7; color: #92400e; }
.badge-holiday-festival{ background: #ffedd5; color: #9a3412; }
.badge-paid    { background: #dcfce7; color: #166534; }
.badge-pending { background: #fee2e2; color: #991b1b; }
.badge-advance { background: #fef3c7; color: #92400e; }

/* ============================================================
   TEACHER ATTENDANCE — STEP UI
   ============================================================ */
.att-student-row {
    background: var(--surface-container-lowest);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
    transition: background 0.2s;
}
.att-student-row:hover { background: var(--surface); }

.att-student-info { display: flex; align-items: center; gap: 1rem; }
.att-student-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--surface-container); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem;
}
.att-student-name  { font-weight: 700; font-size: 1rem; color: var(--text); margin: 0; }
.att-student-class { font-size: 0.875rem; color: var(--text-secondary); margin: 0; }

.att-controls { display: flex; align-items: center; gap: 0.5rem; background: var(--surface-container); padding: 0.25rem; border-radius: var(--radius-pill); border: 1px solid var(--border); }
.att-btn {
    padding: 0.5rem 1rem; border-radius: var(--radius-pill);
    border: none; background: transparent;
    font-size: 0.875rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s; color: var(--text-variant);
    display: inline-flex; align-items: center; gap: 0.25rem;
}
.att-btn i, .att-btn span.material-symbols-outlined { font-size: 1.1rem; }
.att-btn:hover { color: var(--text); }
.att-btn.sel-present  { background: var(--success); color: white; box-shadow: var(--shadow-sm); }
.att-btn.sel-absent   { background: var(--danger); color: white; box-shadow: var(--shadow-sm); }
.att-btn.sel-holiday  { background: var(--warning); color: white; box-shadow: var(--shadow-sm); }
.att-btn.sel-teacher  { background: #7f1d1d; color: white; }
.att-btn.sel-festival { background: #ea580c; color: white; }

.att-sub { display: none; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.att-sub.visible { display: flex; }

.att-save-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 1.5rem; padding: 1.25rem;
    background: var(--surface-container-lowest); border-radius: var(--radius-lg);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    flex-wrap: wrap; gap: 1rem;
}
.att-legend { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ============================================================
   STUDENT ATTENDANCE — CALENDAR VIEW
   ============================================================ */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.cal-nav-btn { background: var(--surface-container); border: none; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.2s; }
.cal-nav-btn:hover { background: var(--surface-container-high); }
.cal-month-label { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; color: var(--text); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day-header { text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; padding: 0.5rem 0; }
.cal-day {
    aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-radius: var(--radius-md); font-size: 1rem; font-weight: 600; cursor: default;
    min-height: 40px;
}
.cal-day.empty { background: transparent; }
.cal-day.today { border: 2px solid var(--primary); }
.cal-day.status-present        { background: #dcfce7; color: #166534; }
.cal-day.status-student-absent { background: #fee2e2; color: #991b1b; }
.cal-day.status-teacher-absent { background: #7f1d1d; color: #fef2f2; }
.cal-day.status-weekly         { background: #fef3c7; color: #92400e; }
.cal-day.status-festival       { background: #ffedd5; color: #9a3412; }
.cal-day.status-none           { background: var(--surface-container); color: var(--text-variant); }

.cal-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.cal-legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 600; color: var(--text-variant); }
.cal-legend-dot { width: 12px; height: 12px; border-radius: 50%; }
.leg-present        { background: #22c55e; }
.leg-student-absent { background: #ef4444; }
.leg-teacher-absent { background: #7f1d1d; }
.leg-weekly         { background: #f59e0b; }
.leg-festival       { background: #ea580c; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 2px; background: currentColor; opacity: 0.6; }


/* ============================================================
   BOTTOM NAV (STUDENT)
   ============================================================ */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    display: flex; justify-content: space-around; align-items: center;
    padding: 0.5rem 0.75rem; padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    z-index: 100; box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    border-top: 1px solid var(--border);
}
.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    text-decoration: none; color: var(--text-secondary);
    font-size: 0.6875rem; font-weight: 600; line-height: 1;
    transition: all 0.2s ease;
    padding: 6px 16px;
    border-radius: 50px;
    flex: 1; max-width: 90px;
}
.bottom-nav-item.active {
    background: var(--primary-container); color: var(--primary);
}
.bottom-nav-item span.material-symbols-outlined, .bottom-nav-item i { font-size: 20px; }
.bottom-nav-item:not(.active):hover { background: var(--surface-container-high); color: var(--text); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(19, 27, 46, 0.5); backdrop-filter: blur(4px);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; padding: 1rem;
    opacity: 0; visibility: hidden; transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--surface-container-lowest); border-radius: var(--radius-xl);
    width: 100%; max-width: 480px; max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95); transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header { padding: 1rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title  { margin: 0; font-family: var(--font-head); font-size: 1.0625rem; }
.modal-close  { background: var(--surface-container); border: none; color: var(--text-secondary); cursor: pointer; padding: 0.5rem; border-radius: 50%; display: flex; }
.modal-close:hover { background: var(--surface-container-high); color: var(--text); }
.modal-body   { padding: 1rem; overflow-y: auto; }
.modal-footer { padding: 0.75rem 1rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; background: var(--bg); border-bottom-left-radius: var(--radius-xl); border-bottom-right-radius: var(--radius-xl); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .main-content { margin-left: 0; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .close-sidebar { display: block; background: none; border: none; font-size: 1.5rem; color: var(--text-secondary); cursor: pointer; padding: 0.5rem;}
    .top-header { padding: 0.625rem 0.75rem; }
    .mobile-menu-btn { display: flex; }
    .hidden-desktop { display: flex; }
    .hidden-mobile { display: none !important; }
}

@media (max-width: 768px) {
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-3 { grid-template-columns: 1fr; }
    .content-area { padding: 10px; padding-bottom: 4.5rem; }
    .stat-card { aspect-ratio: auto; gap: 0.5rem; flex-direction: row; align-items: center; justify-content: flex-start;}
    .stat-icon { margin-bottom: 0; margin-right: 1rem;}
    .att-controls { width: 100%; justify-content: space-between; }
    .att-btn { flex: 1; text-align: center; justify-content: center; }
    
    .login-container { padding: 1.5rem 1rem; border-radius: var(--radius-lg); }
    .card { padding: 10px; }
    
    .table { font-size: 13px; }
    .table td, .table th { padding: 8px 10px; }
    
    .btn { padding: 0.5rem 1rem; font-size: 0.8125rem; }
    .form-control { padding: 0.6rem 0.75rem; font-size: 0.9rem; }
}

@media (max-width: 480px) {
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-2 { grid-template-columns: 1fr; }
    .stat-card { padding: 0.75rem; }
    .stat-value { font-size: 1.25rem; }
    .stat-icon { width: 32px; height: 32px; font-size: 1rem; margin-bottom: 0; }
    .bottom-nav { padding: 4px 4px; }
    .bottom-nav-item { padding: 5px 10px; font-size: 0.625rem; max-width: 80px; }
    .bottom-nav-item span.material-symbols-outlined { font-size: 18px; }
    .btn { padding: 0.5rem 0.875rem; font-size: 0.75rem; }
    .header-left h2 { font-size: 1rem; }
}

@media (max-width: 360px) {
    .cal-grid { gap: 2px; }
    .cal-day { font-size: 0.875rem; min-height: 32px; border-radius: var(--radius-sm); }
}

/* ============================================================
   STITCH UI - SPECIFIC CLASSES
   ============================================================ */
.dashboard-greeting h2 { font-size: 1.5rem; color: var(--text); margin-bottom: 0.25rem; }
.dashboard-greeting p { font-size: 1rem; color: var(--text-secondary); margin: 0; }
.section-title { font-size: 1.25rem; font-weight: 700; color: var(--text); }

.attention-card {
    transition: border-color 0.2s;
    margin-bottom: 0.75rem;
}
.attention-card:hover { border-color: rgba(0, 88, 190, 0.3); }
.icon-wrap { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bg-surface { background-color: var(--surface); }
.bg-success-light { background-color: #dcfce7; }
.bg-warning-light { background-color: #fef3c7; }
.bg-danger-light { background-color: #fee2e2; }
.text-on-surface { color: var(--text); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.m-0 { margin: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.p-4 { padding: 1rem; }
.rounded-xl { border-radius: var(--radius-xl); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.border { border: 1px solid var(--border); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.max-w-xs { max-width: 200px; }

.gradient-bg-subtle {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-container-lowest) 100%);
    border: 1px solid rgba(0, 88, 190, 0.1);
}
