/* ==========================================================================
   IT-Support Team — Design Tokens
   "Nova" theme — light, violet/indigo accent over a soft gradient-blob backdrop.
   Thai-first (font: Prompt).
   ========================================================================== */

:root {
  /* Outer frame — pale lavender-white, blurred gradient blobs float behind the app card */
  --outer-bg: #F4F1FC;
  --outer-ink: #3A3358;
  --outer-ink-muted: rgba(58,51,88,0.65);

  /* Neutrals (inside the app card) */
  --bg: #F6F4FC;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --panel-bg: #FFFFFF;
  --panel-glass: rgba(255,255,255,0.5);
  --ink: #2C2A4A;
  --ink-muted: #74708F;
  --ink-faint: #ACA8C4;
  --border: #ECE9F7;
  --border-strong: #DCD6F0;

  /* Brand — vivid indigo/violet, used for chrome + primary actions */
  --accent: #6C5DD3;
  --accent-strong: #5945B8;
  --accent-soft: #EEEAFC;
  --accent-ink: #4A3B9E;

  /* CTA — warm coral/pink (secondary highlight, echoes the backdrop blobs) */
  --cta: #FF6FA5;
  --cta-strong: #E85590;

  /* Semantic (state) */
  --info: #4C8FE0;
  --info-soft: #E7F0FC;
  --warning: #DE9A3C;
  --warning-soft: #FBEEDA;
  --success: #2FAE7A;
  --success-soft: #DFF4EC;
  --critical: #E15F5F;
  --critical-soft: #FCE6E6;
  --neutral-state: #78838D;
  --neutral-state-soft: #EEF1F2;

  /* Hero gradients (stay vivid in both themes, like a spotlight card) */
  --hero-teal: linear-gradient(135deg, #6C5DD3, #9B8CF0);
  --hero-peach: linear-gradient(135deg, #FFDE7A, #F5B942);

  /* Decorative backdrop blobs (behind the app card, blurred) */
  --blob-1: #6C5DD3;
  --blob-2: #FF6FA5;
  --blob-3: #F2A93C;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(58, 42, 120, 0.06);
  --shadow-md: 0 8px 24px -6px rgba(58, 42, 120, 0.12);
  --shadow-lg: 0 24px 56px -12px rgba(58, 42, 120, 0.22);

  --radius: 20px;
  --radius-sm: 12px;
  --radius-xl: 28px;
  --radius-panel: 32px;
  --font-ui: 'Prompt', 'Noto Sans Thai', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --outer-bg: #1A1730;
    --outer-ink: #F0EDFB;
    --outer-ink-muted: rgba(240,237,251,0.65);

    --bg: #211D3B;
    --surface: #272242;
    --surface-raised: #2E2850;
    --panel-bg: #1E1A36;
    --panel-glass: rgba(30,26,54,0.5);
    --ink: #EEEBFA;
    --ink-muted: #A79FC4;
    --ink-faint: #6E6690;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.17);

    --accent: #8B7CF0;
    --accent-strong: #A297F5;
    --accent-soft: rgba(139, 124, 240, 0.2);
    --accent-ink: #D7D0FA;

    --cta: #FF8FBB;
    --cta-strong: #FFA5C7;

    --info: #74B4F5;
    --info-soft: rgba(116, 180, 245, 0.16);
    --warning: #EAB558;
    --warning-soft: rgba(234, 181, 88, 0.16);
    --success: #4FCB9C;
    --success-soft: rgba(79, 203, 156, 0.16);
    --critical: #F0837F;
    --critical-soft: rgba(240, 131, 127, 0.16);
    --neutral-state: #9AA6AE;
    --neutral-state-soft: rgba(154, 166, 174, 0.14);

    --blob-1: #8B7CF0;
    --blob-2: #FF8FBB;
    --blob-3: #F2C46B;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px -8px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  --outer-bg: #1A1730;
  --outer-ink: #F0EDFB;
  --outer-ink-muted: rgba(240,237,251,0.65);

  --bg: #211D3B;
  --surface: #272242;
  --surface-raised: #2E2850;
  --panel-bg: #1E1A36;
  --panel-glass: rgba(30,26,54,0.5);
  --ink: #EEEBFA;
  --ink-muted: #A79FC4;
  --ink-faint: #6E6690;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.17);

  --accent: #8B7CF0;
  --accent-strong: #A297F5;
  --accent-soft: rgba(139, 124, 240, 0.2);
  --accent-ink: #D7D0FA;

  --cta: #FF8FBB;
  --cta-strong: #FFA5C7;

  --info: #74B4F5;
  --info-soft: rgba(116, 180, 245, 0.16);
  --warning: #EAB558;
  --warning-soft: rgba(234, 181, 88, 0.16);
  --success: #4FCB9C;
  --success-soft: rgba(79, 203, 156, 0.16);
  --critical: #F0837F;
  --critical-soft: rgba(240, 131, 127, 0.16);
  --neutral-state: #9AA6AE;
  --neutral-state-soft: rgba(154, 166, 174, 0.14);

  --blob-1: #8B7CF0;
  --blob-2: #FF8FBB;
  --blob-3: #F2C46B;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px -8px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.55);
}

:root[data-theme="light"] {
  --outer-bg: #F4F1FC;
  --outer-ink: #3A3358;
  --outer-ink-muted: rgba(58,51,88,0.65);

  --bg: #F6F4FC;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --panel-bg: #FFFFFF;
  --panel-glass: rgba(255,255,255,0.5);
  --ink: #2C2A4A;
  --ink-muted: #74708F;
  --ink-faint: #ACA8C4;
  --border: #ECE9F7;
  --border-strong: #DCD6F0;

  --accent: #6C5DD3;
  --accent-strong: #5945B8;
  --accent-soft: #EEEAFC;
  --accent-ink: #4A3B9E;

  --cta: #FF6FA5;
  --cta-strong: #E85590;

  --info: #4C8FE0;
  --info-soft: #E7F0FC;
  --warning: #DE9A3C;
  --warning-soft: #FBEEDA;
  --success: #2FAE7A;
  --success-soft: #DFF4EC;
  --critical: #E15F5F;
  --critical-soft: #FCE6E6;
  --neutral-state: #78838D;
  --neutral-state-soft: #EEF1F2;

  --blob-1: #6C5DD3;
  --blob-2: #FF6FA5;
  --blob-3: #F2A93C;

  --shadow-sm: 0 1px 2px rgba(58, 42, 120, 0.06);
  --shadow-md: 0 8px 24px -6px rgba(58, 42, 120, 0.12);
  --shadow-lg: 0 24px 56px -12px rgba(58, 42, 120, 0.22);
}

* { box-sizing: border-box; }
html, body { background: var(--outer-bg); color: var(--ink); }
body.app-body {
  background: var(--outer-bg) url('images/app-bg.jpg') center center / cover no-repeat scroll;
}
.outer-scrim { position: fixed; inset: 0; z-index: 0; background: rgba(15,10,30,0.28); pointer-events: none; }
body {
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  position: relative;
  transition: background .2s;
}
::selection { background: var(--accent-soft); color: var(--accent-ink); }

.tabular { font-variant-numeric: tabular-nums; }

/* Scrollbar (webkit) — quiet, on-brand */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* ---- Layout shell ("Nova" theme) ---- */

/* Decorative blurred gradient blobs, fixed behind the app card */
.circle-shell { display: flex; min-height: 100vh; background: transparent; position: relative; z-index: 1; overflow-x: hidden; }

/* App card — single rounded white card holding sidebar + content, floating over the blob backdrop */
.app-shell { flex: 1; display: flex; align-items: stretch; justify-content: center; padding: clamp(22px, 4vw, 56px); min-width: 0; }
.app-card {
  flex: 1; display: flex; background: var(--panel-glass); border: 1px solid var(--border);
  border-radius: var(--radius-panel); box-shadow: var(--shadow-lg); overflow: hidden; min-width: 0;
  max-width: 1680px;
  backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%);
}

/* Sidebar — persistent labeled nav on desktop, slide-in drawer on mobile (see .brand/.nav-item below) */
.icon-rail {
  width: 252px; flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--border); background: var(--surface);
}

/* Main column: slim top bar + scrollable content */
.circle-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.circle-topnav {
  display: flex; align-items: center; gap: 18px; flex-shrink: 0; min-height: 40px;
  padding: 16px 26px; border-bottom: 1px solid var(--border);
}
.back-btn {
  display: flex; align-items: center; gap: 8px; background: var(--bg); color: var(--ink);
  border-radius: 999px; padding: 9px 18px 9px 13px; font-size: 13px; font-weight: 600; cursor: pointer; border: none;
  transition: background .12s; flex-shrink: 0; font-family: var(--font-ui);
}
.back-btn:hover { background: var(--border); }
.back-btn svg { width: 15px; height: 15px; }

.top-tabs { display: flex; align-items: center; gap: 26px; margin: 0 auto; overflow-x: auto; }
.top-tab {
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-faint); cursor: pointer; text-decoration: none; padding: 8px 2px;
  border-bottom: 2px solid transparent; transition: color .12s, border-color .12s; white-space: nowrap;
}
.top-tab:hover { color: var(--ink); }
.top-tab.active { color: var(--accent); border-color: var(--accent); }

.topnav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.topnav-right .icon-btn { color: var(--ink-muted); }
.topnav-right .icon-btn:hover { background: var(--bg); color: var(--ink); }

.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -10px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.member-count { font-size: 12.5px; color: var(--ink-muted); font-weight: 500; margin-left: 8px; white-space: nowrap; }

.circle-panel { flex: 1; overflow-y: auto; min-height: 0; padding: 26px 30px; }

.brand {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0; box-shadow: var(--shadow-sm);
}
.brand-text { line-height: 1.15; }
.brand-text .name { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.brand-text .sub { font-size: 11.5px; color: var(--ink-faint); }

.nav-scroll { flex: 1; overflow-y: auto; padding: 16px 14px; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group-title {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: 0 12px; margin-bottom: 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 999px;
  color: var(--ink-muted); font-size: 14px; font-weight: 500;
  cursor: pointer; user-select: none; position: relative;
  transition: background .12s, color .12s;
  margin-bottom: 3px;
}
.nav-item:hover { background: var(--accent-soft); color: var(--accent-ink); }
.nav-item.active { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.nav-item.active .chip { background: rgba(255,255,255,0.25); color: #fff; }
.nav-item svg { flex-shrink: 0; width: 19px; height: 19px; }
.nav-item .chip {
  margin-left: auto; font-size: 11px; font-weight: 600;
  background: var(--critical-soft); color: var(--critical);
  padding: 1px 7px; border-radius: 999px; line-height: 1.5;
}
.role-gate { display: none; }

.nav-subitem {
  display: block;
  padding: 8px 14px 8px 44px;
  border-radius: 999px;
  color: var(--ink-faint); font-size: 13px; font-weight: 500;
  text-decoration: none;
  margin-bottom: 2px;
  transition: background .12s, color .12s;
}
.nav-subitem:hover { background: var(--accent-soft); color: var(--accent-ink); }
.nav-subitem.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-item .nav-caret { margin-left: auto; flex-shrink: 0; transition: transform .15s; }
.nav-item.active .nav-caret { transform: rotate(90deg); }

.sidebar-footer {
  padding: 14px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
}

.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted); background: transparent; border: 1px solid transparent;
  cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); border-color: var(--border); }
.icon-btn svg { width: 19px; height: 19px; }

.search-field {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 12px; height: 38px;
  color: var(--ink-faint); width: 280px; max-width: 40vw;
}
.search-field input {
  border: none; background: transparent; outline: none; color: var(--ink);
  font-size: 13.5px; width: 100%; font-family: var(--font-ui);
}
.search-field svg { width: 17px; height: 17px; flex-shrink: 0; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-faint); }
.breadcrumb .current { color: var(--ink); font-weight: 600; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; border-radius: var(--radius-sm);
  padding: 9px 16px; cursor: pointer; border: 1px solid transparent;
  transition: background .12s, border-color .12s, color .12s, transform .05s;
  font-family: var(--font-ui);
}
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg); }
.btn-ghost { background: transparent; color: var(--ink-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-danger { background: transparent; color: var(--critical); }
.btn-danger:hover { background: var(--critical-soft); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Cards / surfaces ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}

/* ---- Stat tile ---- */
.stat-tile { padding: 18px 20px; }
.stat-tile .stat-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-tile .stat-icon {
  width: 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.stat-tile .stat-icon svg { width: 20px; height: 20px; }
.stat-tile .stat-value { font-size: 28px; font-weight: 700; margin-top: 14px; letter-spacing: -.02em; }
.stat-tile .stat-label { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.delta.good { background: var(--success-soft); color: var(--success); }
.delta.bad { background: var(--critical-soft); color: var(--critical); }
.delta svg { width: 12px; height: 12px; }

/* ---- Status / priority pills ---- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; }
.pill-info { background: var(--info-soft); color: var(--info); } .pill-info::before { background: var(--info); }
.pill-warning { background: var(--warning-soft); color: var(--warning); } .pill-warning::before { background: var(--warning); }
.pill-success { background: var(--success-soft); color: var(--success); } .pill-success::before { background: var(--success); }
.pill-critical { background: var(--critical-soft); color: var(--critical); } .pill-critical::before { background: var(--critical); }
.pill-neutral { background: var(--neutral-state-soft); color: var(--neutral-state); } .pill-neutral::before { background: var(--neutral-state); }
.pill-accent { background: var(--accent-soft); color: var(--accent-ink); } .pill-accent::before { background: var(--accent); }

.priority-stripe { width: 4px; border-radius: 4px; flex-shrink: 0; align-self: stretch; }

/* ---- Table ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-faint); padding: 11px 14px;
  border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface);
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--ink); vertical-align: middle; }
.data-table th:first-child, .data-table td:first-child { min-width: 240px; }
.data-table tbody tr { transition: background .1s; cursor: pointer; }
.data-table tbody tr:hover { background: var(--bg); }
.data-table tbody tr:last-child td { border-bottom: none; }

.avatar {
  width: 28px; height: 28px; border-radius: 999px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; color: #fff;
}

/* ---- Modal / dialog ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 18, 40, 0.55);
  backdrop-filter: blur(2px); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .15s;
  padding: 20px;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.dialog {
  background: var(--surface-raised); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 780px; max-height: 88vh; display: flex; flex-direction: column;
  transform: translateY(8px) scale(.98); transition: transform .15s;
  border: 1px solid var(--border);
}
.overlay.open .dialog { transform: translateY(0) scale(1); }
.dialog-sm { max-width: 420px; }

.tab-btn {
  font-size: 13.5px; font-weight: 600; color: var(--ink-faint);
  padding: 10px 4px; border-bottom: 2px solid transparent; cursor: pointer;
}
.tab-btn.active { color: var(--accent-ink); border-color: var(--accent); }

.field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-muted); margin-bottom: 6px; display: block; }
.field-input, .field-select, .field-textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13.5px;
  color: var(--ink); font-family: var(--font-ui); outline: none;
  transition: border-color .12s;
}
.field-input:focus, .field-select:focus, .field-textarea:focus { border-color: var(--accent); }

/* Toggle switch (theme etc.) */
.switch { width: 42px; height: 24px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px; background: #fff; transition: transform .15s; box-shadow: var(--shadow-sm); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); }

/* Skeleton loading shimmer (for perceived data-loading states) */
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

.mobile-menu-btn { display: none; }

@media (max-width: 1024px) {
  .app-shell { padding: 0; }
  .app-card { border-radius: 0; border: none; min-height: 100vh; }
  .circle-topnav { padding: 14px 16px; }
  .circle-panel { padding: 16px; }
  .top-tabs { display: none; }
  .back-btn span { display: none; }

  .icon-rail {
    position: fixed; left: 16px; top: 16px; height: calc(100vh - 32px);
    width: 264px; z-index: 90; border: 1px solid var(--border); border-right: 1px solid var(--border);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
    transform: translateX(calc(-100% - 32px)); transition: transform .2s ease;
  }
  .icon-rail.mobile-open { transform: translateX(0); }
  .search-field { display: none !important; }
  .mobile-menu-btn { display: flex; }
}

.scrim {
  position: fixed; inset: 0; background: rgba(15,18,40,.5); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.scrim.show { opacity: 1; pointer-events: auto; }

/* ---- Calendar / Booking ---- */
.cal-weekday-row, .cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
}
.cal-weekday-row { border-bottom: 1px solid var(--border); }
.cal-weekday-row div {
  padding: 9px 0; text-align: center; font-size: 11.5px; font-weight: 600;
  letter-spacing: .04em; color: var(--ink-faint); text-transform: uppercase;
}
.cal-cell {
  min-height: 96px; min-width: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 7px; display: flex; flex-direction: column; gap: 4px; cursor: pointer;
  transition: background .12s; overflow: hidden;
}
.cal-cell:hover { background: var(--bg); }
.cal-grid > .cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.other-month { background: var(--bg); }
.cal-cell.other-month .cal-daynum { color: var(--ink-faint); }
.cal-daynum { font-size: 12.5px; font-weight: 600; }
.cal-cell.is-today .cal-daynum {
  display: inline-flex; align-items: center; justify-content: center;
  width: 21px; height: 21px; border-radius: 999px; background: var(--accent); color: #fff;
}
.cal-event {
  font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5;
}
.cal-event.ev-due { background: var(--critical-soft); color: var(--critical); }
.cal-event.ev-cal { background: var(--accent-soft); color: var(--accent-ink); }
.cal-event.ev-routine { background: var(--info-soft); color: var(--info); }
.cal-event.ev-booking { background: var(--accent-soft); color: var(--accent-ink); }
.cal-event.ev-training { background: var(--warning-soft); color: var(--warning); }
.cal-more { font-size: 10.5px; color: var(--ink-faint); font-weight: 600; padding-left: 6px; }

.legend-dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }

.resource-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.resource-row:last-child { border-bottom: none; }
.resource-icon {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--ink-muted);
}
.cal-nav-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--ink-muted); cursor: pointer; background: var(--surface);
  transition: background .12s;
}
.cal-nav-btn:hover { background: var(--bg); }

/* ---- Project Team task list (Planner-style) ---- */
.task-row {
  display: grid; grid-template-columns: 1fr 108px 110px 120px 130px 96px;
  align-items: center; gap: 14px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background .12s; position: relative;
}
.task-row > div:not(.task-name-cell):not(.quicklook-inline) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--bg); }
.task-row.selected {
  box-shadow: inset 0 0 0 1.5px var(--accent); border-radius: 8px; background: var(--accent-soft);
}
.task-row.selected:hover { background: var(--accent-soft); }

.task-checkbox {
  width: 19px; height: 19px; border-radius: 999px; border: 1.5px solid var(--border-strong);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--surface); transition: background .12s, border-color .12s; cursor: pointer;
}
.task-checkbox svg { width: 11px; height: 11px; opacity: 0; transition: opacity .12s; }
.task-checkbox.checked { background: var(--accent); border-color: var(--accent); }
.task-checkbox.checked svg { opacity: 1; }

.task-name-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.task-name { font-size: 13.5px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-name.done { color: var(--ink-faint); text-decoration: line-through; }

.quicklook-inline { display: flex; align-items: center; justify-content: flex-end; gap: 9px; color: var(--ink-faint); font-size: 12.5px; }
.quicklook-inline svg { width: 15px; height: 15px; }
.quicklook-inline .frac { display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }

.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.task-list-head {
  display: grid; grid-template-columns: 1fr 108px 110px 120px 130px 96px; gap: 14px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint);
}
.task-list-head > div, .task-list-head > a { white-space: nowrap; }
.task-list-head .qh { text-align: right; }

.checklist-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.checklist-item .task-checkbox { width: 17px; height: 17px; }
.checklist-item span { font-size: 13px; }
.checklist-item.done span { color: var(--ink-faint); text-decoration: line-through; }

/* ---- Hero cards (illustrated, "Circle" theme) ---- */
.hero-card { border-radius: var(--radius-xl); padding: 26px 30px; position: relative; }
.hero-card.teal { background: var(--hero-teal); color: #fff; }
.hero-card.peach { background: var(--hero-peach); color: #3B2A20; }
.hero-label { font-size: 13.5px; font-weight: 600; opacity: .9; }
.hero-value-row { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; }
.hero-value { font-size: 42px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.hero-badge {
  font-size: 11.5px; font-weight: 700; background: rgba(255,255,255,.35); color: inherit;
  padding: 2px 8px; border-radius: 999px; margin-top: 4px;
}
.hero-stats { display: flex; gap: 10px; margin-top: 22px; position: relative; z-index: 1; }
.hero-stat-chip { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.22); padding: 8px 12px; border-radius: 12px; font-size: 11.5px; }
.hero-stat-chip .chip-icon { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hero-stat-chip .chip-icon svg { width: 15px; height: 15px; }
.hero-stat-chip b { font-size: 14px; display: block; line-height: 1.3; }
.hero-illustration { position: absolute; right: 22px; bottom: 6px; width: 150px; height: 150px; opacity: .92; color: rgba(255,255,255,.85); }
.hero-illustration svg { width: 100%; height: 100%; }
.hero-cta {
  position: absolute; right: 26px; bottom: -18px; display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-strong); color: #fff; border-radius: 999px; padding: 12px 20px; font-size: 12.5px;
  font-weight: 700; letter-spacing: .02em; text-transform: uppercase; box-shadow: var(--shadow-md);
  border: none; cursor: pointer; font-family: var(--font-ui);
}
.hero-desc { font-size: 12.5px; line-height: 1.65; margin-top: 12px; max-width: 92%; opacity: .95; }
.hero-panel-btn {
  display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.55); border-radius: 999px;
  padding: 8px 8px 8px 16px; margin-top: 18px; font-size: 11.5px; line-height: 1.5; color: #3B2A20;
}
.hero-panel-btn .go-btn {
  width: 34px; height: 34px; border-radius: 999px; background: var(--cta); color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; border: none; cursor: pointer;
}

/* ---- Gauge (semi-circle speedometer) ---- */
.gauge { position: relative; width: 148px; height: 82px; flex-shrink: 0; }
.gauge svg { width: 100%; height: 100%; overflow: visible; }
.gauge-track { fill: none; stroke: rgba(59, 42, 32, .12); stroke-width: 11; stroke-linecap: round; }
.gauge-fill { fill: none; stroke: var(--cta); stroke-width: 11; stroke-linecap: round; }
.gauge-tip { fill: #fff; stroke: var(--cta-strong); stroke-width: 3; }

/* ---- Top performers ---- */
.performer-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.performer-row:last-child { border-bottom: none; padding-bottom: 0; }
.performer-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.performer-status { font-size: 11.5px; color: var(--ink-faint); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.performer-status .dot-online { width: 7px; height: 7px; border-radius: 999px; background: var(--success); flex-shrink: 0; }
.score-pill {
  margin-left: auto; background: var(--warning-soft); color: var(--cta-strong); font-weight: 700;
  font-size: 13px; padding: 6px 14px; border-radius: 999px; font-variant-numeric: tabular-nums; flex-shrink: 0;
}

/* ---- Targeting / map card ---- */
.map-card { position: relative; background: var(--bg); border-radius: var(--radius-sm); height: 224px; overflow: hidden; }
.map-blob { position: absolute; border-radius: 42% 58% 55% 45% / 45% 40% 60% 55%; background: var(--border-strong); opacity: .7; }
.map-pin { position: absolute; width: 12px; height: 12px; border-radius: 999px; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 6px var(--accent-soft); }
.map-info-card {
  position: absolute; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  padding: 10px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border);
}
.map-info-thumb { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

/* ---- Hero banner ---- */
.hero-banner {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-radius: var(--radius-xl); padding: 30px 34px; color: #fff;
  position: relative; overflow: hidden; box-shadow: var(--shadow-md);
}
.hero-banner h2 { font-size: 23px; font-weight: 700; margin-bottom: 9px; }
.hero-banner p { font-size: 13.5px; opacity: .92; max-width: 58%; line-height: 1.65; }
.hero-banner .hero-link {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 12px;
  font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px;
}
.hero-banner .hero-icon {
  position: absolute; right: 26px; bottom: -6px; width: 108px; height: 108px;
  opacity: .95; color: rgba(255,255,255,0.9);
}
.hero-banner .hero-icon svg { width: 100%; height: 100%; }

/* ---- Ring stat (circular progress) ---- */
.ring-item { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.ring-stat { position: relative; width: 82px; height: 82px; flex-shrink: 0; }
.ring-stat svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--border); stroke-width: 8; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.ring-value {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.ring-item-label { font-size: 12px; color: var(--ink-muted); line-height: 1.35; }

/* ---- Timeline (calendar agenda) ---- */
.timeline { position: relative; padding-left: 52px; }
.timeline-line { position: absolute; left: 16px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 14px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-time { position: absolute; left: -52px; top: 8px; width: 40px; font-size: 11px; color: var(--ink-faint); text-align: right; font-variant-numeric: tabular-nums; }
.timeline-dot { position: absolute; left: 12px; top: 12px; width: 9px; height: 9px; border-radius: 999px; background: var(--accent); border: 2px solid var(--surface); z-index: 1; }
.timeline-card { background: var(--bg); border-radius: var(--radius-sm); padding: 11px 14px; }
.timeline-card.active { background: var(--accent); color: #fff; }
.timeline-card .tc-title { font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.timeline-card .tc-sub { font-size: 11px; opacity: .8; margin-top: 3px; display: flex; align-items: center; gap: 5px; }

/* ---- Upcoming list item ---- */
.upcoming-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.upcoming-item:last-child { border-bottom: none; padding-bottom: 0; }
.upcoming-thumb {
  width: 42px; height: 42px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-ink);
}
.upcoming-title { font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.upcoming-meta { font-size: 11px; color: var(--ink-faint); margin-top: 5px; display: flex; align-items: center; gap: 5px; }
