/* =========================================================
   ENHANCEMENTS: admin menu, alert scroll, daily task panel
   ========================================================= */

/* --- 1. Sidebar footer always visible / menu scrolls --- */
.app-sidebar {
    display: flex;
    flex-direction: column;
}
.app-sidebar .sidebar-menu {
    flex: 1 1 auto;
    overflow-y: auto;
}
.app-sidebar .sidebar-footer {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    background: inherit;
    backdrop-filter: blur(6px);
}

/* --- 2. Attention Required: its own scrollbar --- */
.dashboard-column-right .issues-list {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
}
.dashboard-column-right .issues-list::-webkit-scrollbar { width: 8px; }
.dashboard-column-right .issues-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.18);
    border-radius: 8px;
}
@media (max-width: 768px) {
    .dashboard-column-right .issues-list { max-height: 300px; }
}

/* --- 3. Admin dropdown in header --- */
.header-user { position: relative; }
.header-avatar { cursor: pointer; }
.admin-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,.16);
    z-index: 3000;
    overflow: hidden;
}
.admin-dropdown.d-none { display: none; }
.admin-dd-head {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
.admin-dd-head .admin-dd-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary-color, #ff7b00);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; overflow: hidden;
}
.admin-dd-head .admin-dd-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-dd-head h5 { margin: 0; font-size: .95rem; }
.admin-dd-head p { margin: 0; font-size: .75rem; opacity: .65; }
.admin-dd-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 13px 16px;
    background: none; border: 0; cursor: pointer;
    font-size: .9rem; text-align: left; min-height: 48px;
    color: inherit;
}
.admin-dd-item:hover { background: rgba(0,0,0,.05); }
.admin-dd-item.danger { color: #d32f2f; }
.admin-dd-sep { height: 1px; background: rgba(0,0,0,.07); }
.admin-dd-lang { display: flex; gap: 8px; padding: 10px 16px; }
.admin-dd-lang button {
    flex: 1; min-height: 40px; border-radius: 10px;
    border: 1px solid rgba(0,0,0,.12); background: #fff; cursor: pointer;
}
.admin-dd-lang button.active {
    background: var(--primary-color, #ff7b00); color: #fff; border-color: transparent;
}

/* --- 4. Daily Task panel --- */
.dt-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.dt-tab {
    padding: 12px 18px; border-radius: 12px; border: 1px solid rgba(0,0,0,.12);
    background: #fff; cursor: pointer; min-height: 48px; font-weight: 600;
}
.dt-tab.active { background: var(--primary-color, #ff7b00); color: #fff; border-color: transparent; }
.dt-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.dt-toolbar input, .dt-toolbar select {
    min-height: 48px; padding: 0 12px; border-radius: 10px;
    border: 1px solid rgba(0,0,0,.14); background: #fff; font-size: .95rem;
}
.dt-session-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.dt-chip {
    padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(0,0,0,.12);
    background: #fff; cursor: pointer; min-height: 44px; font-weight: 600;
}
.dt-chip.active { background: #2ec4b6; color: #fff; border-color: transparent; }
.dt-att-table { width: 100%; border-collapse: collapse; }
.dt-att-table th, .dt-att-table td {
    padding: 12px 10px; border-bottom: 1px solid rgba(0,0,0,.07); text-align: left;
}
.dt-att-table input[type="checkbox"] { transform: scale(1.5); cursor: pointer; }
.dt-empty { padding: 40px 16px; text-align: center; opacity: .6; }
.dt-receipt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.dt-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.dt-actions button { min-height: 48px; }
@media (max-width: 768px) {
    .dt-att-table thead { display: none; }
    .dt-att-table tr { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
    .dt-att-table td { border: 0; }
    .dt-att-table tr { border-bottom: 1px solid rgba(0,0,0,.07); }
}

/* --- 5. Password eye toggle --- */
.pw-eye-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
    color: #7a7a7a;
    font-size: 1rem;
    z-index: 5;
}
.pw-eye-btn:hover { color: #333; }
.form-group input[type="password"], .form-group input[type="text"] { padding-right: 40px; }

/* --- 6. Confirm (delete warning) dialog --- */
.vss-confirm-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(15,23,42,.55);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.vss-confirm-box {
    background: #fff; border-radius: 18px; padding: 28px 24px;
    max-width: 420px; width: 100%; text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.vss-confirm-icon {
    width: 62px; height: 62px; margin: 0 auto 14px;
    border-radius: 50%; background: #fff1f1; color: #e53935;
    display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.vss-confirm-box h3 { margin: 0 0 8px; font-size: 1.15rem; }
.vss-confirm-box p { margin: 0 0 22px; font-size: .95rem; opacity: .75; line-height: 1.5; }
.vss-confirm-actions { display: flex; gap: 12px; }
.vss-confirm-actions button { flex: 1; min-height: 48px; border-radius: 12px; cursor: pointer; font-weight: 600; }
.btn-danger-confirm { background: #e53935; color: #fff; border: 0; }
.btn-danger-confirm:hover { background: #c62828; }

/* --- 7. Excel import / export card --- */
.excel-tools-card { margin-bottom: 20px; }
.excel-tools-body { padding: 18px 20px 22px; }
.excel-hint { margin: 0 0 16px; font-size: .92rem; opacity: .75; line-height: 1.55; }
.excel-tools-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-excel {
    flex: 1 1 200px; min-height: 52px; border: 0; border-radius: 12px;
    font-weight: 600; font-size: .95rem; cursor: pointer; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
}
.btn-excel.primary { background: #1f6feb; }
.btn-excel.warn { background: #ef6c00; }
.btn-excel.ok { background: #1b8a4b; }
.btn-excel:hover { filter: brightness(1.08); }
@media (max-width: 600px) { .btn-excel { flex: 1 1 100%; } }

/* --- 8. Daily attendance: own scrollbar --- */
.dt-att-scroll {
    max-height: 55vh;
    overflow-y: auto;
    border: 1px solid rgba(0,0,0,.07);
    border-radius: 12px;
    scrollbar-width: thin;
}
.dt-att-scroll::-webkit-scrollbar { width: 9px; }
.dt-att-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 8px; }
.dt-att-scroll thead th {
    position: sticky; top: 0; background: #fff; z-index: 2;
}

/* --- 9. Student full-detail editor --- */
.vss-edit-box { max-width: 720px; text-align: left; }
.vss-edit-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px; max-height: 60vh; overflow-y: auto; padding-right: 6px; margin-bottom: 18px;
}
.vss-edit-grid label { display: block; font-size: .8rem; opacity: .7; margin-bottom: 4px; }
.vss-edit-grid input { width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid rgba(0,0,0,.14); padding: 0 12px; }

/* --- 10. Avatar placeholder (no initials) --- */
.table-avatar-badge i, #prof-avatar i { opacity: .35; }

/* =========================================================
   THEME v9 — Navy + Royal Blue dashboard scheme
   ========================================================= */
:root {
    --primary-color: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: #EAF1FE;
    --secondary-color: #1B3A6B;
    --secondary-hover: #16305a;
    --bg-main: #F4F6FA;
    --bg-sidebar: #1B3A6B;
    --border-color: #E6EAF2;
    --text-color: #101828;
    --text-muted: #667085;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(16,40,80,.06);
    --shadow-md: 0 6px 18px rgba(16,40,80,.07);
    --shadow-lg: 0 18px 40px rgba(16,40,80,.10);
}

/* Sidebar: navy panel, white pill for active item */
.app-sidebar { background-color: var(--bg-sidebar); color: #C3D3EA; }
.sidebar-header { border-bottom-color: rgba(255,255,255,.12); }
.sidebar-footer { border-top-color: rgba(255,255,255,.12); }
.sidebar-logo p, .user-info p, .btn-sidebar-toggle, .btn-logout-sidebar { color: #A9C0DE; }
.menu-item { color: #C3D3EA; border-radius: 999px; }
.menu-item:hover { background-color: rgba(255,255,255,.10); color: #fff; }
.menu-item.active {
    background-color: #fff;
    color: var(--secondary-color);
    font-weight: 700;
    box-shadow: 0 6px 14px rgba(0,0,0,.15);
}
.menu-item.active i { color: var(--primary-color); }
.sidebar-logo i { color: #fff; }
.user-avatar { background-color: var(--primary-color); box-shadow: 0 4px 10px rgba(37,99,235,.35); }

/* Header + surfaces */
.app-header { border-bottom: 1px solid var(--border-color); box-shadow: none; }
.app-main-content { background-color: var(--bg-main); }
.content-card, .controls-card, .stat-card, .profile-bio-card, .document-card, .excel-tools-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.content-card:hover, .stat-card:hover { box-shadow: var(--shadow-md); }

/* Highlight first KPI card like the reference */
.stats-grid .stat-card:first-child {
    background: linear-gradient(135deg, #1B3A6B, #24508F);
    border-color: transparent;
    color: #fff;
}
.stats-grid .stat-card:first-child h3,
.stats-grid .stat-card:first-child p { color: #fff; }
.stats-grid .stat-card:first-child .stat-icon {
    background: rgba(255,255,255,.15) !important;
    color: #fff !important;
}
.stat-icon { border-radius: 14px; }

/* Buttons + inputs */
.btn-primary { background-color: var(--primary-color); border-radius: var(--radius-md); }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary, .form-control, .search-box input, .select-wrapper select {
    border-radius: var(--radius-md);
}
.form-control:focus, .search-box input:focus, .input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.lang-btn.active, .dt-tab.active, .admin-dd-lang button.active {
    background: var(--primary-color) !important;
    border-color: transparent !important;
    color: #fff !important;
}
.dt-chip.active { background: var(--secondary-color) !important; }

/* Tables */
.data-table th {
    background: #F7F9FC;
    color: var(--secondary-color);
    text-transform: none;
    letter-spacing: 0;
}
.data-table tbody tr:hover { background-color: var(--primary-light); }
.table-avatar-badge { background: var(--primary-light) !important; color: var(--primary-color) !important; }

/* Tabs */
.tab-btn.active { color: var(--primary-color); border-color: var(--primary-color); }

/* Chart legend recolor to match blue scheme */
.dot.green { background-color: #16A34A !important; }
.dot.orange { background-color: #2563EB !important; }
.dot.red { background-color: #E11D48 !important; }

/* ============ Attendance: taking (Daily Task) ============ */
.dt-att-note{
    background:#EFF4FF;border:1px solid #C7D8FF;color:#1B3A6B;
    padding:10px 14px;border-radius:12px;font-weight:700;margin:10px 0;
}
.dt-saved-banner{
    background:#E7F8EE;border:1px solid #A7E3C1;color:#116B3A;
    padding:9px 14px;border-radius:12px;font-weight:600;margin-bottom:10px;
}
.dt-att-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:10px;}
.dt-att-search{
    flex:1;min-width:180px;min-height:44px;padding:8px 14px;
    border:1px solid #D8DEE9;border-radius:12px;font-size:15px;
}
.dt-att-counter{display:flex;gap:8px;flex-wrap:wrap;}
.dt-att-counter span{border-radius:999px;padding:6px 12px;font-weight:700;font-size:13px;}
.dt-att-counter .pill-present{background:#E7F8EE;color:#116B3A;}
.dt-att-counter .pill-absent{background:#FDE8EC;color:#B3123A;}
.dt-att-counter .pill-total{background:#EEF2F8;color:#1B3A6B;}
.dt-att-row.is-absent{background:#FDE8EC;}
.dt-att-row.is-absent td{color:#B3123A;font-weight:700;}
.dt-att-check{width:22px;height:22px;accent-color:#E11D48;cursor:pointer;}
.vss-confirm-icon.is-info{background:#EFF4FF;color:#2563EB;}

/* ============ Attendance: progress-report calendar ============ */
.vss-cal-nav{
    display:flex;align-items:center;justify-content:space-between;
    gap:10px;margin:6px 0 10px;font-size:15px;color:#1B3A6B;
}
.vss-cal-nav button{
    min-width:40px;min-height:40px;border-radius:10px;border:1px solid #D8DEE9;
    background:#fff;color:#1B3A6B;cursor:pointer;
}
.vss-cal-nav button:hover{background:#EEF2F8;}
.calendar-day-cell.has-dots{
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
    background:#F4F6FA;color:#41506B;border-radius:10px;
}
.calendar-day-cell.has-dots .cal-day-num{font-size:12px;font-weight:700;line-height:1;}
.cal-dots{display:flex;gap:3px;}
.cal-dot{width:6px;height:6px;border-radius:50%;display:inline-block;background:#CBD4E1;}
.cal-dot.ok{background:#16A34A;}
.cal-dot.no{background:#E11D48;}
.cal-dot.na{background:#CBD4E1;}
.calendar-day-cell.all-present{background:#E7F8EE;}
.calendar-day-cell.has-absent{background:#FDE8EC;}
.vss-cal-summary{margin-top:12px;display:flex;flex-direction:column;gap:8px;}
.vss-cal-legend,.vss-cal-stats{display:flex;gap:14px;flex-wrap:wrap;font-size:13px;color:#5A6782;}
.vss-cal-legend span,.vss-cal-stats span{display:flex;align-items:center;gap:6px;}
.vss-cal-stats span{background:#F4F6FA;border-radius:999px;padding:5px 12px;}
.vss-cal-stats b{color:#1B3A6B;}

/* hide legacy attendance legend (replaced by session legend) */
.attendance-legend{display:none !important;}

/* ---- Brand logo ---- */
.auth-logo .brand-logo-lg{
  display:block;margin:0 auto 10px;width:auto;height:110px;max-width:100%;
  object-fit:contain;
}
.sidebar-logo .brand-logo-sm{
  width:40px;height:40px;object-fit:contain;flex:0 0 auto;border-radius:8px;background:transparent;
}
@media (max-width:640px){
  .auth-logo .brand-logo-lg{height:84px}
}

/* --- 11. Password eye alignment + fingerprint login --- */
.input-wrapper { position: relative; }
.pw-eye-btn{
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  width:34px; height:34px; display:flex; align-items:center; justify-content:center;
  padding:0; line-height:1; border-radius:8px; background:transparent; border:0;
}
.pw-eye-btn:hover{ background:rgba(0,0,0,.05); }
#password{ padding-right:44px !important; }
.vss-fp-login{
  width:100%; min-height:50px; margin-top:12px; border-radius:12px;
  display:flex; align-items:center; justify-content:center; gap:10px;
  font-weight:700; font-size:1rem;
}
.vss-fp-help{ margin:10px 0 0; font-size:.8rem; opacity:.7; line-height:1.5; }
.badge.green{ background:#E7F8EE; color:#116B3A; }
