:root {
    --primary: #1a3a6e;
    --primary-light: #2355a0;
    --primary-dark: #0f2548;
    --accent: #f5a623;
    --accent-dark: #d48b10;
    --bg: #f0f4fa;
    --bg-white: #ffffff;
    --text: #1c2b4a;
    --text-light: #5a6a8a;
    --border: #dbe4f0;
    --success: #1a7a4a;
    --success-bg: #e6f7ee;
    --danger: #c0392b;
    --danger-bg: #fdf0ef;
    --warning: #d68910;
    --warning-bg: #fef9e7;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(26,58,110,0.1);
    --shadow-lg: 0 8px 32px rgba(26,58,110,0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =================== NAVBAR =================== */
.navbar {
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.5rem;
    height: 56px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-icon { font-size: 1.3rem; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex: 1;
    margin-left: 0.5rem;
}
.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.15s;
    white-space: nowrap;
}
.nav-links a:hover { background: rgba(255,255,255,0.12); color: white; }
.nav-links a.active { background: rgba(255,255,255,0.2); color: white; font-weight: 600; }
.nav-links .btn-apply {
    background: var(--accent);
    color: var(--primary-dark);
    font-weight: 700;
    padding: 0.4rem 0.9rem;
    margin-left: 0.25rem;
}
.nav-links .btn-apply:hover { background: var(--accent-dark); }
.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}
.user-name { font-size: 0.875rem; color: rgba(255,255,255,0.9); white-space: nowrap; }
.user-role {
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}
.role-admin { background: var(--accent); color: var(--primary-dark); }
.role-captain { background: rgba(255,255,255,0.2); color: white; }
.role-co_pilot { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.9); }
.btn-logout {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 0.28rem 0.6rem;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: white; }

/* Hamburger button (hidden on desktop) */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    margin-left: auto;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    transition: background 0.15s;
}
.nav-hamburger:hover { background: rgba(255,255,255,0.1); }
.nav-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav-drawer {
    display: none;
    position: fixed;
    top: 56px;
    left: 0; right: 0;
    background: var(--primary-dark);
    z-index: 99;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    flex-direction: column;
    gap: 0.25rem;
}
.mobile-nav-drawer.open { display: flex; }
.mobile-nav-drawer a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.15s;
    display: block;
}
.mobile-nav-drawer a:hover,
.mobile-nav-drawer a.active { background: rgba(255,255,255,0.12); color: white; }
.mobile-nav-drawer .mobile-apply {
    background: var(--accent);
    color: var(--primary-dark);
    font-weight: 700;
    margin-top: 0.5rem;
    text-align: center;
}
.mobile-nav-drawer .mobile-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 0.5rem;
}
.mobile-nav-drawer .mobile-logout {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    text-align: center;
    margin-top: 0.25rem;
}

/* =================== MAIN =================== */
.main-content {
    flex: 1;
    padding: 1.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}
.footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    background: var(--bg-white);
}

/* =================== LOGIN =================== */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--primary-dark);
}
.login-hero {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #1a5fa8 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}
.login-hero-content { position: relative; z-index: 1; text-align: center; }
.login-plane { font-size: 4rem; margin-bottom: 1rem; }
.login-hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 0.5rem; }
.login-hero p { font-size: 1rem; opacity: 0.8; line-height: 1.6; }
.login-form-wrap {
    width: 420px;
    min-width: 320px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
}
.login-form-box { width: 100%; }
.login-form-box h2 { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 0.25rem; }
.login-form-box p { color: var(--text-light); font-size: 0.88rem; margin-bottom: 1.5rem; }

/* =================== FORMS =================== */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--text);
    background: white;
    transition: border-color 0.15s;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}
.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235a6a8a' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.2rem;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(35,85,160,0.1);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.btn-primary {
    width: 100%;
    padding: 0.85rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover { background: var(--primary-light); }
.btn-primary:active { background: var(--primary-dark); }
.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.15s;
    touch-action: manipulation;
    white-space: nowrap;
}
.btn-edit { background: #e8f0fe; color: var(--primary); }
.btn-edit:hover { background: #d0e3ff; }
.btn-delete { background: var(--danger-bg); color: var(--danger); }
.btn-delete:hover { background: #f5c6c3; }
.btn-approve { background: var(--success-bg); color: var(--success); }
.btn-approve:hover { background: #c3e8d3; }
.btn-reject { background: var(--danger-bg); color: var(--danger); }
.btn-reject:hover { background: #f5c6c3; }
.btn-secondary {
    padding: 0.7rem 1.2rem;
    background: var(--bg);
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    touch-action: manipulation;
}
.btn-secondary:hover { background: var(--border); }

/* =================== ALERTS =================== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid #f5c6c3; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #b3dfc7; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #f9e49e; }

/* =================== PAGE HEADER =================== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.page-header p { font-size: 0.88rem; color: var(--text-light); margin-top: 0.2rem; }

/* =================== CARD =================== */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

/* =================== CALENDAR =================== */
.calendar-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.calendar-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: white;
    border: 1.5px solid var(--border);
    color: var(--primary);
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.15s;
    touch-action: manipulation;
}
.calendar-nav a:hover { background: var(--primary); color: white; border-color: var(--primary); }
.calendar-month {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 100px;
    text-align: center;
}
.cal-jump-form {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
/* Filter chips for multi-select */
.filter-group { display: flex; flex-direction: column; gap: 0.4rem; }
.filter-group-label { font-size: 0.8rem; font-weight: 600; color: var(--text-light); }
.filter-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 0.83rem;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    background: white;
    color: var(--text);
}
.filter-chip input[type=checkbox] { display: none; }
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: white; font-weight: 600; }
.filter-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; padding-top: 1.2rem; }
/* Export button */
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 1rem;
    border: 1.5px solid #38a169;
    background: white;
    color: #38a169;
    border-radius: 8px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.15s;
    cursor: pointer;
}
.btn-export:hover { background: #38a169; color: white; }
.calendar-legend {
    display: flex;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-light);
    flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 0.3rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-captain { background: #2355a0; }
.dot-copilot { background: #7b3fb5; }
.dot-full { background: var(--danger); }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.cal-header {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 0.5rem 0.2rem;
    font-size: 0.82rem;
    font-weight: 600;
}
.cal-day {
    background: white;
    min-height: 100px;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background 0.1s;
}
.cal-day:hover { background: #f8fafe; }
.cal-day.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-day.full-captain { background: #fff0f0; }
.cal-day.full-copilot { background: #f9f0ff; }
.cal-day.full-both { background: #fff0f0; }
.cal-day.day-blocked { background: #fef2f2; border: 1px solid #fca5a5; cursor: default; }
.cal-day.admin-day { cursor: pointer; }
.cal-day.admin-day:hover { background: #f0f5ff; box-shadow: 0 0 0 2px var(--accent); z-index: 1; }
.cal-day.day-blocked.admin-day:hover { background: #fee2e2; box-shadow: 0 0 0 2px #e53e3e; }
.admin-day-num { position: relative; }
.day-custom-dot { color: var(--accent); font-size: 0.5rem; margin-left: 3px; vertical-align: super; }
.day-blocked-badge { font-size: 0.72rem; font-weight: 700; color: #e53e3e; padding: 2px 4px; background: #fee2e2; border-radius: 4px; text-align: center; margin-top: 2px; }
.day-note { font-size: 0.65rem; color: var(--text-light); margin-top: 2px; line-height: 1.2; word-break: break-all; }
.cal-day-num {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
    margin-bottom: 1px;
}
.cal-day.today .cal-day-num {
    background: var(--accent);
    color: var(--primary-dark);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
}
.cal-quota { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 2px; }
.quota-badge {
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.quota-captain { background: #dce8ff; color: #1a3a8f; }
.quota-captain.full { background: #fee2e2; color: var(--danger); }
.quota-copilot { background: #ede8ff; color: #6b21a8; }
.quota-copilot.full { background: #fee2e2; color: var(--danger); }
.leave-chip {
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}
.chip-captain { background: #dce8ff; color: #1a3a8f; }
.chip-copilot { background: #ede8ff; color: #6b21a8; }
.cal-day.empty-day { background: #fafbfd; opacity: 0.5; }

/* =================== TABLES =================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 480px; }
thead { background: var(--primary); color: white; }
thead th { padding: 0.65rem 0.9rem; text-align: left; font-weight: 600; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:hover { background: #f5f8ff; }
tbody td { padding: 0.65rem 0.9rem; vertical-align: middle; }
.td-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

/* =================== BADGES =================== */
.badge {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-personal  { background: #dce8ff; color: #1a3a8f; }
.badge-wedding   { background: #fce8ff; color: #7b21a8; }
.badge-funeral   { background: #f0f0f0; color: #555; }
.badge-maternity { background: #ffeaee; color: #c0392b; }
.badge-approved  { background: var(--success-bg); color: var(--success); }
.badge-pending   { background: var(--warning-bg); color: var(--warning); }
.badge-rejected  { background: var(--danger-bg);  color: var(--danger); }
.badge-admin     { background: var(--accent); color: var(--primary-dark); }
.badge-captain   { background: #dce8ff; color: #1a3a8f; }
.badge-copilot   { background: #ede8ff; color: #6b21a8; }

/* =================== STATS ROW =================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}
.stat-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.stat-label { font-size: 0.78rem; color: var(--text-light); font-weight: 500; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-sub { font-size: 0.78rem; color: var(--text-light); }

/* =================== APPLY FORM =================== */
.apply-card {
    max-width: 680px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.form-actions .btn-primary  { width: auto; padding: 0.7rem 2rem; }
.form-actions .btn-secondary { flex: 1; min-width: 100px; text-align: center; }

/* =================== MODAL =================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
    -webkit-overflow-scrolling: touch;
}
.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    padding-right: 2.5rem;
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}
.modal-close:hover { background: var(--border); }

/* =================== DETAIL LIST =================== */
.detail-list { display: flex; flex-direction: column; gap: 0.75rem; }
.detail-row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.detail-label { font-size: 0.83rem; color: var(--text-light); min-width: 90px; font-weight: 500; flex-shrink: 0; }
.detail-value { font-size: 0.88rem; color: var(--text); flex: 1; min-width: 120px; }

/* =================== TABS =================== */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab {
    padding: 0.55rem 1.1rem;
    font-size: 0.88rem;
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

/* =================== USER LINK =================== */
.user-link {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}
.user-link:hover { text-decoration: underline; }

/* =================== TOGGLE SWITCH =================== */
.toggle-label,
.form-group label.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0;
}
.toggle-label input[type=checkbox] { display: none; }
.toggle-track {
    position: relative;
    width: 46px;
    height: 26px;
    background: #7a8fa8;
    border-radius: 13px;
    border: 2px solid #5a7290;
    transition: background 0.22s, border-color 0.22s;
    flex-shrink: 0;
}
.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 5px rgba(0,0,0,0.35);
    transition: transform 0.22s;
}
.toggle-label input[type=checkbox]:checked ~ .toggle-track {
    background: var(--primary-light);
    border-color: var(--primary-dark);
}
.toggle-label input[type=checkbox]:checked ~ .toggle-track .toggle-thumb {
    transform: translateX(20px);
}
.toggle-label.toggle-danger input[type=checkbox]:checked ~ .toggle-track {
    background: #e53e3e;
    border-color: #c0392b;
}
.toggle-text { font-size: 0.9rem; font-weight: 600; color: var(--text); }

/* =================== QUOTA NOTICE =================== */
.quota-notice {
    background: #fff8e6;
    border: 1px solid #f9e49e;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--warning);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* =================== RESPONSIVE: TABLET 768–1024px =================== */
@media (max-width: 1024px) {
    .nav-links a { padding: 0.4rem 0.6rem; font-size: 0.82rem; }
    .calendar-legend { margin-left: 0; }
}

/* =================== RESPONSIVE: MOBILE < 768px =================== */
@media (max-width: 768px) {
    /* Nav: hide desktop links, show hamburger */
    .nav-links { display: none; }
    .nav-user  { display: none; }
    .nav-hamburger { display: flex; }

    /* Main padding */
    .main-content { padding: 1rem; }

    /* Login: stack vertically */
    .login-page { flex-direction: column; }
    .login-hero {
        padding: 2rem 1.5rem;
        min-height: 0;
        flex: none;
    }
    .login-plane { font-size: 2.5rem; }
    .login-hero h1 { font-size: 1.6rem; }
    .login-hero p { font-size: 0.88rem; }
    .login-form-wrap {
        width: 100%;
        min-width: 0;
        padding: 1.5rem 1.25rem;
        flex: 1;
        align-items: flex-start;
    }

    /* Page header */
    .page-header { margin-bottom: 1rem; }
    .page-header h1 { font-size: 1.2rem; }
    .page-header .btn-primary { font-size: 0.88rem; padding: 0.55rem 1rem; width: auto; }

    /* Calendar: compact cells */
    .calendar-grid { gap: 2px; }
    .cal-day { min-height: 68px; padding: 0.25rem; gap: 1px; }
    .cal-day-num { font-size: 0.75rem; }
    .cal-quota { gap: 1px; }
    .quota-badge { font-size: 0.55rem; padding: 1px 3px; }
    .leave-chip { font-size: 0.58rem; padding: 1px 3px; }
    .calendar-month { font-size: 0.95rem; min-width: 80px; }
    .calendar-controls { gap: 0.5rem; }
    .calendar-legend { gap: 0.5rem; font-size: 0.72rem; }

    /* Stats: 2 columns on phone */
    .stats-row { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
    .stat-card { padding: 0.85rem 1rem; }
    .stat-value { font-size: 1.5rem; }

    /* Form: single column */
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .apply-card { padding: 1rem; box-shadow: var(--shadow); }
    .form-actions {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }
    .form-actions .btn-primary,
    .form-actions .btn-secondary { width: 100%; text-align: center; }

    /* Modal: full-width on mobile */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal {
        border-radius: var(--radius) var(--radius) 0 0;
        max-height: 92vh;
        padding: 1.25rem;
    }

    /* Tables: horizontal scroll */
    .table-wrap { margin: 0 -1.25rem; border-radius: 0; }
    table { font-size: 0.82rem; }
    thead th { padding: 0.55rem 0.75rem; }
    tbody td { padding: 0.55rem 0.75rem; }
    .btn-sm { font-size: 0.75rem; padding: 0.3rem 0.65rem; }

    /* Admin tabs */
    .tab { padding: 0.5rem 0.9rem; font-size: 0.85rem; }

    /* Cards */
    .card { padding: 1rem; margin-bottom: 1rem; }
}

/* =================== RESPONSIVE: SMALL PHONE < 400px =================== */
@media (max-width: 400px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 1.3rem; }
    .calendar-controls { flex-direction: column; align-items: flex-start; }
    .cal-day { min-height: 56px; }
    .quota-badge { display: none; }
    .cal-day-num { font-size: 0.7rem; }
    .login-hero { padding: 1.5rem 1rem; }
}
