@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ============================================================================
   DESIGN TOKENS
   ============================================================================ */
:root {
  --paper: #FFFFFF;
  --paper-soft: #FAF8F4;
  --ink: #181411;
  --sub: #726B62;
  --border: #E8E2D6;

  --red: #C21E1E;
  --red-dark: #8A1414;
  --red-soft: #FBE7E4;

  --yellow: #F0B429;
  --yellow-dark: #946204;
  --yellow-soft: #FCF0CE;

  --green: #1E7C34;
  --green-soft: #EAF6EC;

  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(24,20,17,.04);
  --shadow-md: 0 6px 20px rgba(24,20,17,.07);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper-soft);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: inherit; }
button { font: inherit; }
::selection { background: var(--yellow-soft); }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fadeIn .15s ease both; }
/* kept for compatibility with any leftover markup */
.fade-up, .fade-up-delay-1, .fade-up-delay-2 { animation: fadeIn .15s ease both; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin .7s linear infinite; display: inline-flex; }
.btn-spinner {
  width: 14px; height: 14px; border-radius: 50%; display: inline-block;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .6s linear infinite;
}

/* ============================================================================
   LOGIN LAYOUT
   ============================================================================ */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--paper);
  width: 100%;
}
/* Tablet and below: brand panel becomes a shorter header instead of a full
   side panel, everything stacks to a single column. */
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel { min-height: 240px; padding: 32px 28px 28px 40px; }
  .demo-list { margin-top: 20px; }
}
/* Phones: tighter spacing, smaller title, no side rail padding. */
@media (max-width: 560px) {
  .brand-panel { min-height: 200px; padding: 24px 20px 20px 26px; }
  .brand-title { font-size: 32px; }
  .brand-copy { font-size: 14px; }
  .form-panel { padding: 28px 18px; }
}

.brand-panel {
  position: relative;
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(13,10,8,.95), rgba(13,10,8,.95)),
    url(../assets/campus-bg.jpg);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  color: #fff;
  padding: 48px 44px 40px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
/* faint ledger grid */
.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .06;
  background-image:
    repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, #fff 0 1px, transparent 1px 40px);
}
/* perforated "index card" binding strip along the left edge */
.brand-panel::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 26px;
  background-image: radial-gradient(circle, rgba(255,255,255,.18) 3px, transparent 3.2px);
  background-size: 26px 26px;
  background-position: 13px 13px;
  border-right: 1px dashed rgba(255,255,255,.14);
}

.brand-mark { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.brand-mark .mark {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 2px; color: var(--yellow); }
.brand-title {
  font-family: var(--font-display); font-weight: 700; font-size: 42px; line-height: 1.05;
  margin: 18px 0 6px; position: relative; z-index: 1;
}
.brand-sub { font-family: var(--font-mono); font-size: 12.5px; color: #B9B2A6; letter-spacing: .5px; margin: 0 0 14px; position: relative; z-index: 1; }
.brand-copy { font-size: 15px; color: #D8D3CB; max-width: 360px; line-height: 1.65; position: relative; z-index: 1; }

.demo-list { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 9px; }
.demo-label { font-family: var(--font-mono); font-size: 11px; color: #9C968D; letter-spacing: 1px; margin-bottom: 2px; }
.demo-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  border-radius: 5px; padding: 9px 12px; cursor: pointer; text-align: left;
  color: #EFEBE4; transition: background .15s, transform .1s;
}
.demo-chip:hover { background: rgba(255,255,255,.11); }
.demo-chip:active { transform: scale(.98); }
.demo-chip .who { display: flex; align-items: center; gap: 10px; font-size: 13px; }

.form-panel { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.form-wrap { width: 100%; max-width: clamp(380px, 30vw, 480px); }

.mode-switch { display: flex; gap: 4px; margin-bottom: 26px; background: var(--paper-soft); border-radius: 6px; padding: 4px; }
.mode-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 0; border-radius: 4px; border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
  background: transparent; color: var(--sub);
}
.mode-btn.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.msg { margin-bottom: 18px; padding: 10px 12px; border-radius: 5px; font-size: 13.5px; border: 1px solid transparent; }
.msg.error { background: var(--red-soft); color: var(--red-dark); border-color: #F4C7C2; }
.msg.success { background: var(--green-soft); color: var(--green); border-color: #C7E8CE; }
.msg.hint { font-size: 12.5px; color: var(--sub); background: transparent; padding: 0; margin-bottom: 16px; line-height: 1.5; }

/* cookie / privacy consent gate */
.consent-box {
  display: flex; align-items: flex-start; gap: 10px; background: var(--paper-soft);
  border: 1px solid var(--border); border-radius: 5px; padding: 12px 14px; margin-bottom: 18px;
}
.consent-box.warn { border-color: var(--red-soft); background: var(--red-soft); }
.consent-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 12.8px; line-height: 1.55; color: var(--ink); }
.consent-check input[type="checkbox"] { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--red); cursor: pointer; flex-shrink: 0; }
.link-btn { background: none; border: none; padding: 0; color: var(--red); text-decoration: underline; cursor: pointer; font: inherit; font-weight: 600; }
.link-btn:hover { color: var(--red-dark); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(24,20,17,.55); display: flex;
  align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-card {
  background: #fff; border-radius: 8px; max-width: 460px; width: 100%;
  max-height: 80vh; display: flex; flex-direction: column; box-shadow: var(--shadow-md);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-family: var(--font-display); font-size: 16px; display: flex; align-items: center; gap: 8px; }
.modal-close { background: transparent; border: none; cursor: pointer; color: var(--sub); padding: 4px; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 16px 18px; overflow-y: auto; font-size: 13px; line-height: 1.65; color: var(--sub); }
.modal-body h4 { color: var(--ink); font-size: 13px; margin: 14px 0 4px; }
.modal-body h4:first-child { margin-top: 0; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

/* ============================================================================
   FORM ATOMS
   ============================================================================ */
.field { display: block; margin-bottom: 14px; }
.field-label {
  font-family: var(--font-mono); font-size: 11px; color: var(--sub); margin-bottom: 6px;
  letter-spacing: .4px; text-transform: uppercase;
}
.input, select.input {
  width: 100%; font-family: var(--font-body); font-size: 14px;
  padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 4px;
  background: #fff; color: var(--ink); transition: border-color .15s;
}
.input:focus { border-color: var(--red); }

/* password show/hide */
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 40px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer; padding: 6px;
  color: var(--sub); display: flex; align-items: center; border-radius: 4px;
}
.pw-toggle:hover { color: var(--ink); background: var(--paper-soft); }

/* PUP email compose field */
.email-compose { display: flex; align-items: stretch; }
.email-compose .input { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none; }
.email-domain {
  display: flex; align-items: center; white-space: nowrap; padding: 0 10px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--sub);
  background: var(--paper-soft); border: 1.5px solid var(--border); border-left: none;
  border-top-right-radius: 4px; border-bottom-right-radius: 4px;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
  font-family: var(--font-body); font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 4px;
  padding: 10px 18px; font-size: 14px; transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--border); }
.btn-danger { background: transparent; color: var(--red); border: 1.5px solid var(--red-soft); }

/* ============================================================================
   ROLE TAB / STATUS CHIP (index-card motif)
   ============================================================================ */
.role-tab {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .5px; font-weight: 500;
  padding: 3px 12px 3px 8px; text-transform: uppercase; display: inline-block;
  clip-path: polygon(0 0, 100% 0, 90% 100%, 0% 100%);
}
.role-tab.superadmin { background: var(--red); color: #fff; }
.role-tab.admin { background: var(--yellow); color: var(--ink); }
.role-tab.user { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); clip-path: none; padding: 2.5px 10px; }

.chip-status { font-family: var(--font-mono); font-size: 11px; padding: 3px 8px; border-radius: 3px; font-weight: 500; display: inline-block; }
.chip-status.approved, .chip-status.active { background: var(--green-soft); color: var(--green); }
.chip-status.pending { background: var(--yellow-soft); color: var(--yellow-dark); }
.chip-status.inactive { background: var(--red-soft); color: var(--red-dark); }

.tag-chip {
  font-family: var(--font-mono); font-size: 11px; background: var(--paper-soft);
  border: 1px solid var(--border); padding: 4px 9px; border-radius: 3px; display: inline-flex; align-items: center; gap: 4px;
}

/* ============================================================================
   DASHBOARD SHELL
   ============================================================================ */
/* ============================================================================
   APP SHELL — sidebar + topbar + content (replaces the old top-tabs layout)
   ============================================================================ */
.app-shell { display: flex; min-height: 100vh; background: var(--paper-soft); }

.sidebar {
  width: 232px; flex-shrink: 0; background: var(--ink); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand {
  padding: 20px 20px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-brand .mark { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mark-img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.sidebar-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1; }
.sidebar-subtitle { font-family: var(--font-mono); font-size: 9.5px; color: #9C968D; margin-top: 4px; letter-spacing: .4px; }

.menu-toggle {
  display: none; background: transparent; border: none; color: #fff; cursor: pointer;
  padding: 7px; border-radius: 5px; align-items: center; justify-content: center; flex-shrink: 0;
}
.menu-toggle:hover { background: rgba(255,255,255,.08); }

.sidebar-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 5px; border: none;
  background: transparent; color: #C9C3B8; font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
  cursor: pointer; text-align: left; transition: background .15s, color .15s; width: 100%;
}
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-link:active { transform: scale(.98); }
.side-link.active { background: var(--red); color: #fff; }
.side-link .badge-count {
  margin-left: auto; background: rgba(255,255,255,.16); font-family: var(--font-mono); font-size: 10.5px;
  padding: 1px 7px; border-radius: 10px; flex-shrink: 0;
}
.side-link.active .badge-count { background: rgba(255,255,255,.26); }

.sidebar-foot { padding: 14px 14px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.sidebar-user-name { font-size: 12.5px; font-weight: 600; color: #fff; line-height: 1.35; }
.sidebar-logout {
  width: 100%; justify-content: center;
  background: transparent; border: 1.5px solid rgba(255,255,255,.24); color: #fff;
}
.sidebar-logout:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; padding: 16px 28px; background: #fff;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; }

.content { padding: 16px; max-width: 1500px; width: 100%; margin: 0 auto; }
.content.wide { max-width: 1500px; }
.content.narrow { max-width: 640px; }

/* ============================================================================
   PANEL GRID — dense, edge-to-edge dashboard panels (icon-badge header bar +
   body), zebra-striped tables and status pills. Used across every dashboard
   tab instead of loosely-spaced standalone cards.
   ============================================================================ */
.dash-grid { display: grid; gap: 12px; }
.dash-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.dash-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.dash-grid.cols-2-1 { grid-template-columns: 2fr 1fr; }
.dash-grid.cols-1-2 { grid-template-columns: 1fr 2fr; }
.dash-grid.top-strip { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 12px; }
@media (max-width: 860px) {
  .dash-grid.cols-2, .dash-grid.cols-3, .dash-grid.cols-2-1, .dash-grid.cols-1-2 { grid-template-columns: 1fr; }
}

.panel {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; display: flex; flex-direction: column; min-width: 0;
}
.panel-header {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  background: var(--paper-soft); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.panel-icon {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; background: var(--ink); color: #fff;
}
.panel-icon.accent-yellow { background: var(--yellow); color: var(--ink); }
.panel-icon.accent-red { background: var(--red); color: #fff; }
.panel-title { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; color: var(--ink); }
.panel-header .panel-extra { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.panel-body { padding: 14px 16px; flex: 1; min-width: 0; }
.panel-body.flush { padding: 0; }
.panel-body.scroll { max-height: 360px; overflow-y: auto; }

/* stat strip — compact panels styled after "Overall Status / Overall Progress" */
.stat-panel-body { display: flex; align-items: center; gap: 12px; padding: 13px 16px; }
.stat-panel-icon {
  width: 34px; height: 34px; border-radius: 7px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.stat-panel-num { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.1; }
.stat-panel-label { font-family: var(--font-mono); font-size: 10px; color: var(--sub); letter-spacing: .3px; }

/* zebra-striped data table */
.zebra-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.zebra-table th {
  text-align: left; padding: 9px 14px; font-family: var(--font-mono); font-size: 10px;
  color: #fff; background: var(--ink); letter-spacing: .4px; font-weight: 500; text-transform: uppercase;
}
.zebra-table td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.zebra-table tbody tr:nth-child(even) { background: var(--paper-soft); }
.zebra-table tbody tr:hover { background: var(--red-soft); }
.zebra-table tbody tr:last-child td { border-bottom: none; }

/* color-coded status pills for table cells */
.pill { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 10.5px; font-weight: 600; font-family: var(--font-mono); white-space: nowrap; }
.pill-green { background: #DCF3E1; color: #1E7C34; }
.pill-yellow { background: var(--yellow-soft); color: var(--yellow-dark); }
.pill-red { background: var(--red-soft); color: var(--red-dark); }
.pill-gray { background: var(--paper-soft); color: var(--sub); border: 1px solid var(--border); }

.panel-empty { padding: 28px 16px; text-align: center; color: var(--sub); font-size: 12.5px; }
.panel-empty svg { margin: 0 auto 8px; opacity: .4; }

/* Below this width, the sidebar collapses to a slim top bar with a hamburger
   toggle instead of a cramped horizontally-scrolling row of nav links. */
@media (max-width: 880px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: column; }
  .menu-toggle { display: flex; }
  .sidebar-nav, .sidebar-foot { display: none; }
  .sidebar.menu-open .sidebar-nav { display: flex; }
  .sidebar.menu-open .sidebar-foot { display: block; }
  .side-link { white-space: normal; }
}

/* two-column top section on the User dashboard: stats + profile side by side */
.user-top-grid { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; margin-bottom: 24px; }
@media (max-width: 720px) { .user-top-grid { grid-template-columns: 1fr; } }
.profile-panel { text-align: left; }

/* two-up card grid for Admin's Manage Students list */
.grid-cards-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }

.greeting { margin-bottom: 20px; }
.greeting h2 { font-family: var(--font-display); font-size: 21px; margin: 0 0 3px; }
.greeting p { margin: 0; color: var(--sub); font-size: 13.5px; }

.quick-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 24px; }
.quick-stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 16px; display: flex; align-items: center; gap: 11px;
}
.quick-stat .qs-icon {
  width: 34px; height: 34px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.quick-stat .qs-num { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.1; }
.quick-stat .qs-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--sub); letter-spacing: .3px; margin-top: 1px; }

.search-box { position: relative; margin-bottom: 16px; max-width: 320px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--sub); }
.search-box input { padding-left: 34px; }

.course-select {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink); background: var(--paper-soft);
  border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px; cursor: pointer;
}
.course-select:hover { border-color: var(--red); }
.course-select:focus { border-color: var(--red); outline: none; }

/* ============================================================================
   GALLERY — library-style browsing of submitted Capstone/Thesis projects
   ============================================================================ */
.gallery-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.gallery-card {
  position: relative; background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 16px 14px 14px; display: flex; flex-direction: column; gap: 8px; overflow: hidden;
  transition: box-shadow .15s, transform .15s;
}
.gallery-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--red); }
.gallery-card.type-thesis::before { background: var(--yellow); }
.gallery-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.gallery-icon {
  width: 40px; height: 40px; border-radius: 8px; background: var(--paper-soft);
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.gallery-name {
  font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gallery-meta { font-size: 12px; color: var(--sub); margin-top: -4px; }
.gallery-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.gallery-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--border); }
.gallery-date { font-family: var(--font-mono); font-size: 10.5px; color: var(--sub); }

.section-label {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--sub); letter-spacing: .5px;
  margin: 0 0 12px; text-transform: uppercase;
}

/* ============================================================================
   CARDS / GRIDS
   ============================================================================ */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card.accent-top { border-top: 4px solid var(--red); }
.card.accent-top-muted { border-top: 4px solid var(--border); }
.card.accent-top-yellow { border-top: 4px solid var(--yellow); }

.card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.stack-14 { display: flex; flex-direction: column; gap: 14px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }

.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid-auto-sm { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.grid-auto-stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.grid-two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 720px) { .grid-two { grid-template-columns: 1fr; } }

.upload-slot { border: 1px solid var(--border); border-radius: 5px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; }
.file-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; background: var(--paper-soft); padding: 7px 10px; border-radius: 4px; }
.file-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .date { font-family: var(--font-mono); font-size: 11px; color: var(--sub); }
.file-view-btn {
  background: transparent; border: none; cursor: pointer; color: var(--sub); padding: 4px;
  border-radius: 4px; display: flex; align-items: center; flex-shrink: 0;
}
.file-view-btn:hover { color: var(--red); background: #fff; }

.upload-error {
  display: flex; align-items: center; gap: 5px; color: var(--red); font-size: 11.5px;
  margin-top: 6px; line-height: 1.4;
}

.empty-state { text-align: center; padding: 36px 20px; color: var(--sub); }
.empty-state svg { margin: 0 auto 10px; opacity: .4; }
.empty-state .text { font-size: 13.5px; }

.notif-row { display: flex; align-items: center; gap: 12px; padding: 14px; }
.notif-row .msg-text { flex: 1; font-size: 13.5px; }
.notif-row .when { font-family: var(--font-mono); font-size: 11px; color: var(--sub); }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th {
  padding: 10px 14px; font-family: var(--font-mono); font-size: 11px; color: var(--sub);
  font-weight: 500; text-align: left; background: var(--paper-soft);
}
table.data-table td { padding: 10px 14px; border-top: 1px solid var(--border); }

.stat-tile { text-align: center; }
.stat-num { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.stat-label { font-family: var(--font-mono); font-size: 11px; color: var(--sub); margin-bottom: 6px; }
.stat-sub { font-size: 11.5px; color: var(--sub); }

.banner-error { position: sticky; top: 0; z-index: 20; background: var(--red); color: #fff; font-size: 12.5px; text-align: center; padding: 6px 0; }

@media (max-width: 560px) {
  .content { padding: 12px; }
  .topbar { padding: 14px 16px; }
}

@media (max-width: 480px) {
  .greeting h2 { font-size: 18px; }
  .quick-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================================
   SKELETON LOADING (shown briefly right after login / on page entry)
   ============================================================================ */
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }
.skel {
  background: linear-gradient(90deg, var(--paper-soft) 25%, #F1ECE2 37%, var(--paper-soft) 63%);
  background-size: 400px 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 4px;
}
.skel-shell { display: flex; min-height: 100vh; }
.skel-sidebar { width: 232px; flex-shrink: 0; background: var(--ink); }
.skel-sidebar .skel { background: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.1) 37%, rgba(255,255,255,.05) 63%); background-size: 400px 100%; }
.skel-main { flex: 1; }
.skel-topbar { height: 62px; border-bottom: 1px solid var(--border); border-radius: 0; }
.skel-line { height: 12px; margin-bottom: 8px; }
.skel-card { height: 96px; border-radius: var(--radius); }
.skel-stat { height: 62px; border-radius: var(--radius); }

/* ============================================================================
   PAGE-LOAD OVERLAY (brief spinner right after a successful sign-in)
   ============================================================================ */
.page-loading {
  position: fixed; inset: 0; background: var(--paper); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; z-index: 100;
}
.page-loading .label { font-family: var(--font-mono); font-size: 12px; color: var(--sub); letter-spacing: .5px; }
