/* ═══════════════════════════════════════════════════════════
   StudentVaultX — Main App Styles
   ✅ Full scroll fix  ✅ Mobile + Desktop  ✅ Dark/Light
   ═══════════════════════════════════════════════════════════ */

/* ── RESET ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  overflow-y: auto;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* ══════════════════════════════════════════════════
   THEMES
══════════════════════════════════════════════════ */
body.dark {
  --bg:       #020617;
  --bg2:      #0f172a;
  --bg3:      #1e293b;
  --card:     #0f172a;
  --card2:    #1e293b;
  --card3:    #293548;
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(255,255,255,0.12);
  --text:     #f1f5f9;
  --text2:    #94a3b8;
  --text3:    #475569;
  --accent:   #6366f1;
  --accent2:  #818cf8;
  --accentbg: rgba(99,102,241,0.12);
  --danger:   #f87171;
  --dangerbg: rgba(248,113,113,0.1);
  --success:  #34d399;
  --successbg:rgba(52,211,153,0.1);
  --warning:  #fbbf24;
  --warnbg:   rgba(251,191,36,0.1);
  --shadow:   0 4px 24px rgba(0,0,0,0.6);
  --shadow2:  0 2px 8px rgba(0,0,0,0.4);
  --navbg:    rgba(9,15,30,0.96);
  --sidebg:   #0b1120;
}

body.light {
  --bg:       #f0f4ff;
  --bg2:      #e8eef8;
  --bg3:      #dce4f5;
  --card:     #ffffff;
  --card2:    #f5f7ff;
  --card3:    #eef1ff;
  --border:   rgba(0,0,0,0.07);
  --border2:  rgba(99,102,241,0.2);
  --text:     #0f172a;
  --text2:    #475569;
  --text3:    #94a3b8;
  --accent:   #4f46e5;
  --accent2:  #6366f1;
  --accentbg: rgba(79,70,229,0.08);
  --danger:   #dc2626;
  --dangerbg: rgba(220,38,38,0.08);
  --success:  #059669;
  --successbg:rgba(5,150,105,0.08);
  --warning:  #d97706;
  --warnbg:   rgba(217,119,6,0.08);
  --shadow:   0 4px 24px rgba(99,102,241,0.12);
  --shadow2:  0 2px 8px rgba(0,0,0,0.06);
  --navbg:    rgba(255,255,255,0.96);
  --sidebg:   #f8faff;
}

/* ══════════════════════════════════════════════════
   APP LAYOUT — MOBILE FIRST
══════════════════════════════════════════════════ */
#app {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Mobile: single column, bottom nav, scroll in screen */
#main-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.screen {
  display: none;
  height: calc(100vh - 60px); /* full height minus bottom nav */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}
.screen.active { display: block; }

/* Screen entrance animation */
.screen.active {
  animation: screenIn 0.28s ease;
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── BOTTOM NAV (Mobile) ─────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--navbg);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px 4px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text3);
  font-family: inherit;
  transition: color 0.2s;
  position: relative;
  gap: 2px;
}
.nav-item.active { color: var(--accent); }
.nav-item.active .nav-icon-wrap {
  background: var(--accentbg);
  border-radius: 12px;
}
.nav-icon-wrap {
  width: 38px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.nav-icon  { font-size: 18px; line-height: 1; }
.nav-label { font-size: 9px; font-weight: 600; letter-spacing: 0.2px; }

/* ══════════════════════════════════════════════════
   DESKTOP SIDEBAR LAYOUT (≥ 900px)
══════════════════════════════════════════════════ */
@media (min-width: 900px) {
  body { overflow: hidden; }

  #app {
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
  }

  #sidebar {
    display: flex !important;
    flex-direction: column;
    width: 260px;
    min-width: 260px;
    height: 100vh;
    background: var(--sidebg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    position: relative;
    z-index: 50;
  }

  #main-content {
    flex: 1;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .screen {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 32px;
  }

  #bottom-nav { display: none !important; }
}

@media (max-width: 899px) {
  #sidebar { display: none !important; }
}

/* ── SIDEBAR CONTENT ──────────────────────────────── */
.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo-icon { font-size: 28px; }
.sidebar-logo-text { }
.sidebar-logo-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}
.sidebar-logo-tagline {
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: var(--text2);
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
  border-radius: 0;
  position: relative;
}
.sidebar-nav-item span.nav-icon { font-size: 18px; }
.sidebar-nav-item:hover { background: var(--card2); color: var(--text); }
.sidebar-nav-item.active {
  background: var(--accentbg);
  color: var(--accent);
  font-weight: 700;
  border-right: 3px solid var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
}
.sidebar-avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.sidebar-user-name  { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 11px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══════════════════════════════════════════════════
   SCREEN HEADER
══════════════════════════════════════════════════ */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.screen-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}
.header-actions { display: flex; gap: 8px; align-items: center; }
.header-btn {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.header-btn:hover  { background: var(--card3); }
.header-btn:active { transform: scale(0.9); }

/* ══════════════════════════════════════════════════
   CARDS & SECTIONS
══════════════════════════════════════════════════ */
.section { padding: 14px 18px; }
.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow2); }

.cards-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cards-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

@media (max-width: 899px) {
  .cards-grid-4 { grid-template-columns: 1fr 1fr; }
}

.stat-icon { font-size: 24px; margin-bottom: 6px; }
.stat-label { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-sub   { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* ══════════════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════════════ */
.greeting-banner {
  padding: 18px 18px 0;
}
.greeting-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
}
.greeting-date {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.today-class-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.today-class-row:hover { transform: translateX(3px); background: var(--card2); }
.class-color-dot {
  width: 4px;
  border-radius: 4px;
  align-self: stretch;
  min-height: 40px;
  flex-shrink: 0;
}
.class-info { flex: 1; min-width: 0; }
.class-name { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.class-meta { font-size: 11px; color: var(--text2); margin-top: 1px; }
.time-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 8px;
  color: var(--text2);
  white-space: nowrap;
}
.time-badge.now {
  background: var(--accentbg);
  color: var(--accent);
  border-color: var(--accent2);
  animation: pulse-badge 1.5s ease-in-out infinite;
}
@keyframes pulse-badge {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* ══════════════════════════════════════════════════
   ATTENDANCE
══════════════════════════════════════════════════ */
.att-overall-banner {
  margin: 14px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: #fff;
}
.att-ring { position: relative; width: 78px; height: 78px; flex-shrink: 0; }
.att-ring svg { transform: rotate(-90deg); }
.att-ring-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: #fff;
}
.att-overall-label { font-size: 11px; opacity: 0.8; margin-bottom: 2px; }
.att-overall-pct   { font-size: 30px; font-weight: 800; }
.att-overall-sub   { font-size: 11px; opacity: 0.75; }

.att-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}
.att-card.low { border-color: rgba(248,113,113,0.35); background: var(--dangerbg); }
.att-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.att-subname  { font-size: 14px; font-weight: 700; color: var(--text); }
.att-day      { font-size: 11px; color: var(--text3); margin-top: 1px; }
.att-pct      { font-size: 22px; font-weight: 800; }
.att-pct.low  { color: var(--danger); }
.att-pct.ok   { color: var(--success); }
.att-prog     { height: 5px; background: var(--card2); border-radius: 5px; overflow: hidden; margin-bottom: 10px; }
.att-prog-bar { height: 100%; border-radius: 5px; transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1); }
.att-btns     { display: flex; gap: 8px; align-items: center; }
.att-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.att-btn-p { background: var(--successbg); color: var(--success); border: 1px solid rgba(52,211,153,0.25); }
.att-btn-a { background: var(--dangerbg);  color: var(--danger);  border: 1px solid rgba(248,113,113,0.25); }
.att-btn-p:hover { background: var(--success); color: #fff; }
.att-btn-a:hover { background: var(--danger);  color: #fff; }
.att-count  { font-size: 11px; color: var(--text3); min-width: 52px; text-align: right; }
.att-warn   { font-size: 11px; color: var(--danger); font-weight: 600; margin-top: 5px; }
.att-safe   { font-size: 11px; color: var(--success); font-weight: 600; margin-top: 5px; }

/* ══════════════════════════════════════════════════
   TIMETABLE
══════════════════════════════════════════════════ */
.day-tabs-wrap {
  display: flex;
  overflow-x: auto;
  gap: 7px;
  padding: 10px 18px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.day-tabs-wrap::-webkit-scrollbar { display: none; }
.day-tab {
  flex-shrink: 0;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 7px 15px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.day-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 3px 12px rgba(99,102,241,0.4);
}

.tt-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 8px;
  transition: transform 0.15s;
}
.tt-card:hover { transform: translateX(3px); }
.tt-color-bar  { width: 4px; border-radius: 4px; align-self: stretch; min-height: 44px; flex-shrink: 0; }
.tt-info       { flex: 1; min-width: 0; }
.tt-name       { font-size: 14px; font-weight: 700; color: var(--text); }
.tt-meta       { font-size: 11px; color: var(--text2); margin-top: 2px; }
.tt-actions    { display: flex; gap: 5px; }
.tt-action-btn {
  width: 30px; height: 30px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  color: var(--text2);
}
.tt-action-btn:hover { background: var(--card3); }

/* ══════════════════════════════════════════════════
   NOTES
══════════════════════════════════════════════════ */
.filter-row {
  display: flex;
  overflow-x: auto;
  gap: 7px;
  padding: 6px 18px 10px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-pill {
  flex-shrink: 0;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 6px 13px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.note-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.note-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.note-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 7px; gap: 8px; }
.note-title { font-size: 15px; font-weight: 700; color: var(--text); flex: 1; }
.note-tag {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  color: #fff; white-space: nowrap; flex-shrink: 0;
}
.note-preview { font-size: 12px; color: var(--text2); line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-footer { display: flex; align-items: center; justify-content: space-between; }
.note-time { font-size: 10px; color: var(--text3); }
.note-thumb { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; cursor: pointer; border: 1px solid var(--border); }
.note-imgs-row { display: flex; gap: 5px; margin-bottom: 8px; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════
   TASKS
══════════════════════════════════════════════════ */
.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 8px;
  transition: all 0.2s;
}
.task-item.done { opacity: 0.5; }
.task-check {
  width: 22px; height: 22px;
  border: 2px solid var(--border2);
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}
.task-check:hover { border-color: var(--accent); }
.task-item.done .task-check { background: var(--success); border-color: var(--success); }
.task-check-inner { display: none; color: #fff; }
.task-item.done .task-check-inner { display: block; }
.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 600; color: var(--text); }
.task-item.done .task-title { text-decoration: line-through; }
.task-task-meta { font-size: 11px; color: var(--text3); margin-top: 1px; }
.task-priority { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; letter-spacing: 0.3px; white-space: nowrap; }
.priority-high   { background: var(--dangerbg);  color: var(--danger); }
.priority-medium { background: var(--warnbg);    color: var(--warning); }
.priority-low    { background: var(--successbg); color: var(--success); }
.task-del-btn {
  width: 26px; height: 26px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text3);
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.task-del-btn:hover { background: var(--dangerbg); color: var(--danger); border-color: var(--danger); }

.tasks-divider {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.tasks-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.quick-add-bar {
  position: sticky;
  bottom: 0;
  left: 0; right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 10px 18px;
  z-index: 20;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.quick-add-inner {
  display: flex;
  gap: 8px;
  background: var(--card);
  border: 1.5px solid var(--border2);
  border-radius: 14px;
  padding: 4px 4px 4px 14px;
  transition: border-color 0.2s;
}
.quick-add-inner:focus-within { border-color: var(--accent); }
.quick-add-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 8px 0;
}
.quick-add-input::placeholder { color: var(--text3); }
.quick-add-btn {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 22px;
  width: 38px; height: 38px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.quick-add-btn:hover { background: var(--accent2); transform: scale(1.05); }

/* ══════════════════════════════════════════════════
   HOLIDAYS
══════════════════════════════════════════════════ */
.holiday-month {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
}
.holiday-month-header {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}
.holiday-month-name { font-size: 15px; font-weight: 800; }
.holiday-month-count { font-size: 12px; opacity: 0.85; }
.holiday-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.holiday-item:last-child { border-bottom: none; }
.holiday-item:hover { background: var(--card2); }
.holiday-date-box {
  width: 42px; height: 48px;
  background: var(--accentbg);
  border-radius: 10px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.holiday-day-num { font-size: 18px; font-weight: 800; color: var(--accent); line-height: 1; }
.holiday-month-abbr { font-size: 9px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }
.holiday-info { flex: 1; min-width: 0; }
.holiday-name { font-size: 14px; font-weight: 700; color: var(--text); }
.holiday-day-name { font-size: 11px; color: var(--text3); margin-top: 1px; }
.holiday-type-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
}
.h-national { background: var(--dangerbg); color: var(--danger); }
.h-festival { background: var(--warnbg); color: var(--warning); }
.h-optional { background: var(--successbg); color: var(--success); }

.upload-holiday-card {
  background: var(--card);
  border: 2px dashed var(--border2);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}
.upload-holiday-card:hover { border-color: var(--accent); background: var(--accentbg); }
.upload-card-icon { font-size: 32px; margin-bottom: 8px; }
.upload-card-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.upload-card-sub { font-size: 12px; color: var(--text3); }

/* ══════════════════════════════════════════════════
   FAB
══════════════════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: 72px;
  right: 18px;
  width: 50px; height: 50px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99,102,241,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 40;
  transition: transform 0.2s, box-shadow 0.2s;
}
.fab:hover  { transform: scale(1.1); box-shadow: 0 6px 28px rgba(99,102,241,0.65); }
.fab:active { transform: scale(0.94); }
@media (min-width: 900px) { .fab { bottom: 24px; right: 32px; } }

/* ══════════════════════════════════════════════════
   MODALS / BOTTOM SHEETS
══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: overlayIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal-sheet {
  background: var(--card);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: sheetUp 0.32s cubic-bezier(0.34,1.56,0.64,1);
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-handle {
  width: 38px; height: 4px;
  background: var(--card3);
  border-radius: 4px;
  margin: 12px auto 0;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 800; color: var(--text); }
.modal-close {
  width: 30px; height: 30px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  font-size: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-body { padding: 18px; }

@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
  .modal-sheet { border-radius: 24px; max-height: 88vh; margin: 20px; }
}

/* ── FORM ELEMENTS ──────────────────────────────── */
.form-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-row label { font-size: 11px; font-weight: 700; color: var(--text3); letter-spacing: 0.5px; text-transform: uppercase; }
.form-row input,
.form-row select,
.form-row textarea {
  background: var(--card2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 13px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accentbg);
}
.form-row select option { background: var(--card); }
.form-row textarea { resize: vertical; min-height: 80px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.modal-actions { display: flex; gap: 8px; margin-top: 6px; }
.btn-save {
  flex: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 3px 12px rgba(99,102,241,0.35);
}
.btn-save:hover { transform: translateY(-1px); box-shadow: 0 5px 18px rgba(99,102,241,0.5); }
.btn-cancel {
  background: var(--card2);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 18px;
  cursor: pointer;
}
.btn-danger-full {
  background: var(--dangerbg);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-danger-full:hover { background: var(--danger); color: #fff; }

/* ── UPLOAD AREA ─────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border2);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.upload-area:hover { border-color: var(--accent); background: var(--accentbg); }
.upload-area input { display: none; }
.upload-label-text { font-size: 12px; color: var(--text3); margin-top: 4px; }

.preview-imgs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.preview-img-wrap { position: relative; }
.preview-img-wrap img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }
.preview-remove {
  position: absolute; top: -5px; right: -5px;
  width: 17px; height: 17px;
  background: var(--danger); color: #fff;
  border: none; border-radius: 50%;
  font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.preview-files { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.preview-file-chip {
  display: flex; align-items: center; gap: 5px;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 9px;
  font-size: 12px; font-weight: 600; color: var(--text2);
}
.preview-file-rm {
  background: none; border: none;
  color: var(--text3); font-size: 12px;
  cursor: pointer; padding: 0; line-height: 1;
}
.preview-file-rm:hover { color: var(--danger); }

/* ── FILE PILLS ──────────────────────────────────── */
.file-pill {
  display: inline-flex;
  align-items: center; gap: 5px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 11px;
  margin: 3px;
  font-size: 12px; font-weight: 600;
  color: var(--text2);
  text-decoration: none;
  transition: background 0.15s;
  cursor: pointer;
}
.file-pill:hover { background: var(--card3); color: var(--text); }
.file-type-tag {
  font-size: 9px; font-weight: 800;
  background: var(--accent); color: #fff;
  padding: 1px 5px; border-radius: 4px;
}

/* ── NOTE DETAIL ─────────────────────────────────── */
.note-detail-body { padding: 18px; }
.note-detail-title { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.note-detail-subject { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; color: #fff; margin-bottom: 12px; }
.note-detail-content { font-size: 14px; color: var(--text2); line-height: 1.8; white-space: pre-wrap; margin-bottom: 16px; }
.note-detail-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.note-detail-img { max-width: 200px; height: 130px; border-radius: 12px; object-fit: cover; cursor: pointer; border: 1px solid var(--border); }

/* ── LIGHTBOX ─────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.94);
  z-index: 999;
  display: flex; align-items: center; justify-content: center;
  animation: overlayIn 0.2s ease;
}
.lightbox.hidden { display: none; }
.lightbox img { max-width: 95vw; max-height: 90vh; border-radius: 12px; }
.lb-close {
  position: fixed; top: 14px; right: 14px;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.12);
  border: none; border-radius: 50%;
  color: #fff; font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ── LOADING ──────────────────────────────────────── */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 1000;
  gap: 14px;
}
.load-logo { font-size: 52px; animation: loadBounce 1s ease-in-out infinite; }
.load-name { font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.load-bar { width: 100px; height: 3px; background: var(--card2); border-radius: 3px; overflow: hidden; }
.load-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  animation: loadProgress 1.4s ease-in-out infinite;
}
@keyframes loadBounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
@keyframes loadProgress {
  0%   { width: 0; margin-left: 0; }
  50%  { width: 55%; margin-left: 0; }
  100% { width: 0; margin-left: 100%; }
}

/* ── SPINNER ──────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 9999;
  white-space: nowrap;
  transition: transform 0.32s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.warning { border-color: var(--warning); color: var(--warning); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ── EMPTY STATE ─────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 50px 20px; text-align: center;
}
.empty-icon  { font-size: 50px; opacity: 0.45; margin-bottom: 10px; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.empty-sub   { font-size: 13px; color: var(--text2); line-height: 1.5; margin-bottom: 18px; }

/* ── SEARCH ──────────────────────────────────────── */
.search-wrap { padding: 6px 18px; }
.search-input {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 9px 13px 9px 36px;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }

/* ── PROFILE ─────────────────────────────────────── */
.profile-avatar-xl {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff;
  margin: 0 auto 10px;
}
.profile-name-display { font-size: 18px; font-weight: 800; color: var(--text); text-align: center; }
.profile-email-display { font-size: 13px; color: var(--text3); text-align: center; margin-top: 2px; }
.setting-row {
  display: flex; align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 8px;
}
.setting-label { font-size: 14px; font-weight: 600; color: var(--text); }
.setting-sub   { font-size: 11px; color: var(--text3); margin-top: 1px; }
.toggle-sw {
  width: 44px; height: 24px;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 12px; position: relative; cursor: pointer;
  transition: background 0.25s;
}
.toggle-sw.on { background: var(--accent); border-color: var(--accent); }
.toggle-knob {
  width: 18px; height: 18px;
  background: var(--text3); border-radius: 50%;
  position: absolute; top: 2px; left: 2px;
  transition: transform 0.25s, background 0.25s;
}
.toggle-sw.on .toggle-knob { transform: translateX(20px); background: #fff; }
.btn-logout {
  width: 100%;
  background: var(--dangerbg);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px; font-weight: 700;
  padding: 13px; cursor: pointer;
  transition: all 0.15s; margin-top: 6px;
}
.btn-logout:hover { background: var(--danger); color: #fff; }

/* ── SCROLLBAR ────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card2); border-radius: 4px; }

/* ── UTIL ─────────────────────────────────────────── */
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════
   DESKTOP ENHANCEMENTS
══════════════════════════════════════════════════ */
@media (min-width: 900px) {
  .screen-header { padding: 16px 28px; }
  .section { padding: 14px 28px; }
  .day-tabs-wrap { padding: 10px 28px; }
  .filter-row { padding: 6px 28px 10px; }
  .search-wrap { padding: 6px 28px; }
  .quick-add-bar { padding: 10px 28px; }
  .greeting-banner { padding: 20px 28px 0; }
  .att-overall-banner { margin: 14px 28px; }
  .cards-grid-2 { grid-template-columns: repeat(4, 1fr); }
}

/* ══════════════════════════════════════════════════
   PDF PARSE MODAL
══════════════════════════════════════════════════ */
.pdf-parse-progress {
  text-align: center;
  padding: 20px;
}
.pdf-parse-icon { font-size: 40px; margin-bottom: 8px; }
.pdf-parse-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.pdf-parse-sub { font-size: 12px; color: var(--text3); }
.pdf-progress-bar {
  width: 100%; height: 4px;
  background: var(--card2); border-radius: 4px;
  overflow: hidden; margin-top: 14px;
}
.pdf-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 4px;
  transition: width 0.4s ease;
}

.parsed-subject-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 6px;
}
.parsed-sub-name { font-size: 13px; font-weight: 700; color: var(--text); }
.parsed-sub-meta { font-size: 11px; color: var(--text3); margin-top: 1px; }
.parsed-sub-toggle {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: transparent;
  transition: all 0.15s;
}
.parsed-sub-toggle.selected {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
