@font-face {
  font-family: "Inter Tight";
  src: url("/fonts/inter-tight-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Tight";
  src: url("/fonts/inter-tight-latin-ext.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

/* ================================================================
   Modern SaaS Light Theme Design System
   ================================================================ */
:root {
  color-scheme: light !important;

  /* Surfaces & Backgrounds */
  --paper: #f8fafc;           /* Slate 50 clean app background */
  --surface: #ffffff;         /* Pure white cards */
  --surface-hover: #f1f5f9;   /* Slate 100 */
  --surface-alt: #f8fafc;     /* Slate 50 */
  
  /* Text & Typography */
  --ink: #0f172a;             /* Slate 900 */
  --ink-secondary: #334155;   /* Slate 700 */
  --muted: #64748b;           /* Slate 500 */
  --subtle: #94a3b8;          /* Slate 400 */

  /* Dividers & Borders */
  --line: #e2e8f0;            /* Slate 200 */
  --line-strong: #cbd5e1;     /* Slate 300 */
  --soft: #f1f5f9;            /* Slate 100 */

  /* Primary Brand (SaaS Indigo) */
  --accent: #4f46e5;          /* Indigo 600 */
  --accent-hover: #4338ca;    /* Indigo 700 */
  --accent-soft: #eef2ff;     /* Indigo 50 */
  --accent-line: #c7d2fe;     /* Indigo 200 */
  --accent-ink: #ffffff;

  /* Status: Active (Emerald Green) */
  --active: #10b981;          /* Emerald 500 */
  --active-soft: #ecfdf5;     /* Emerald 50 */
  --active-line: #a7f3d0;     /* Emerald 200 */
  --active-ink: #047857;      /* Emerald 700 */

  /* Status: Idle (Amber Gold) */
  --idle: #f59e0b;            /* Amber 500 */
  --idle-soft: #fffbeb;       /* Amber 50 */
  --idle-line: #fde68a;       /* Amber 200 */
  --idle-ink: #b45309;        /* Amber 700 */

  /* Status: Offline / Away (Slate) */
  --off: #94a3b8;             /* Slate 400 */
  --off-soft: #f8fafc;        /* Slate 50 */
  --off-line: #e2e8f0;        /* Slate 200 */
  --off-ink: #475569;         /* Slate 600 */

  /* Danger / Remove (Rose) */
  --danger: #ef4444;          /* Red 500 */
  --danger-hover: #dc2626;    /* Red 600 */
  --danger-soft: #fef2f2;     /* Red 50 */
  --danger-line: #fecaca;     /* Red 200 */
  --danger-ink: #b91c1c;      /* Red 700 */

  /* SaaS Elevation Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

/* Strictly enforce Light Theme (disable dark mode auto-inversion) */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light !important;
  }
}

* {
  box-sizing: border-box;
  font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
  color-scheme: light !important;
  font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-secondary);
  font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3, h4, p { margin: 0; }
h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.2;
}
h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink);
}
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ================================================================
   SaaS Shell & Navigation Bar
   ================================================================ */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.top-in {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 62px;
  flex-wrap: wrap;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(79, 70, 229, 0.3);
}

.brand-mark {
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.nav a {
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-weight: 550;
  font-size: 14px;
  color: var(--muted);
  transition: all 0.15s ease-in-out;
}

.nav a:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.acct {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.user-role-tag {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

main.wrap {
  padding-top: 30px;
  padding-bottom: 90px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.page-head .sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ================================================================
   SaaS KPI Metrics Grid (Team Overview)
   ================================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.18s ease-in-out;
  user-select: none;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.kpi-card.active-filter {
  border-color: var(--accent);
  background: #fbfbfe;
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-sm);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.kpi-badge.total { background: var(--soft); color: var(--muted); }
.kpi-badge.active { background: var(--active-soft); color: var(--active-ink); }
.kpi-badge.idle { background: var(--idle-soft); color: var(--idle-ink); }
.kpi-badge.away { background: var(--off-soft); color: var(--off-ink); }

.kpi-val {
  font-size: 28px;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* ================================================================
   Modern SaaS Buttons & Controls
   ================================================================ */
.btn {
  appearance: none;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--muted);
}

.btn.primary {
  background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
  border-color: #4338ca;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn.primary:hover {
  background: linear-gradient(180deg, #4338ca 0%, #3730a3 100%);
  box-shadow: 0 3px 6px rgba(79, 70, 229, 0.4);
}

.btn.danger {
  color: var(--danger-ink);
  background: var(--danger-soft);
  border-color: var(--danger-line);
}

.btn.danger:hover {
  background: #fee2e2;
  border-color: var(--danger);
}

.btn.small {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.btn.ghost:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Modern Input Controls */
input, select {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 9px 13px;
  min-width: 0;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

.toolbar input[type="search"] {
  flex: 1;
  min-width: 240px;
  max-width: 420px;
  padding-left: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 18px 18px;
}

.error {
  color: var(--danger);
  font-weight: 550;
  font-size: 13.5px;
  min-height: 1.4em;
}

/* ================================================================
   Modern Status Pills with Glowing Pulse
   ================================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 650;
  padding: 3px 9px;
  border-radius: 999px;
  width: fit-content;
  border: 1px solid transparent;
}

.dot {
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  background: var(--off);
  flex: none;
}

.pill.active {
  background: var(--active-soft);
  color: var(--active-ink);
  border-color: var(--active-line);
}
.pill.active .dot {
  background: var(--active);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulse-dot 2s infinite;
}

.pill.idle {
  background: var(--idle-soft);
  color: var(--idle-ink);
  border-color: var(--idle-line);
}
.pill.idle .dot {
  background: var(--idle);
}

.pill.offline {
  background: var(--off-soft);
  color: var(--off-ink);
  border-color: var(--off-line);
}
.pill.offline .dot {
  background: var(--off);
}

.pill.offhours {
  background: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
}
.pill.offhours .dot {
  border-radius: 2px;
  background: #94a3b8;
}

.pill.paused {
  background: #faf5ff;
  color: #7c3aed;
  border-color: #e9d5ff;
}
.pill.paused .dot {
  border-radius: 2px;
  background: #a855f7;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ================================================================
   Team Roster (Employee Table)
   ================================================================ */
.roster {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.r-head, .r-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1.3fr) minmax(230px, 2.5fr) 96px;
  gap: 20px;
  align-items: center;
  padding: 15px 22px;
}

.r-head {
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.r-row {
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: background 0.15s ease-in-out;
}

.r-row:first-of-type {
  border-top: none;
}

.r-row:hover {
  background: #f8fafc;
}

.r-who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4338ca;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.r-who-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.r-who-text strong {
  font-size: 15.5px;
  font-weight: 650;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dept-tag {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.r-now {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.r-now .line {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.r-time {
  text-align: right;
  display: flex;
  flex-direction: column;
}

.r-time strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.r-time span {
  font-size: 12px;
  color: var(--muted);
}

.ticks {
  position: relative;
  height: 16px;
}

.ticks span {
  position: absolute;
  top: 0;
  font-size: 11px;
  font-weight: 550;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.strip svg {
  display: block;
  width: 100%;
  height: 28px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.c-a { fill: var(--active); }
.c-i { fill: var(--idle); }
.c-now { fill: var(--ink); }

.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
}

.empty p {
  margin-bottom: 16px;
  font-size: 15px;
}

.summary {
  color: var(--muted);
  font-size: 14px;
}

/* ================================================================
   Employee Detail View & KPI Stat Cards
   ================================================================ */
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  transition: color 0.15s ease;
}

.crumb:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.who-line {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.manage {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.manage label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--ink-secondary);
}

.manage select {
  padding: 6px 10px;
  font-size: 13px;
}

.date-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 26px 0 20px;
}

.date-nav .label {
  font-weight: 650;
  font-size: 15px;
  color: var(--ink);
  margin-left: 6px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat strong {
  display: block;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--ink);
}

.stat span {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid var(--accent-line);
}

.chip button {
  border: 0;
  background: #ffffff;
  color: var(--accent);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cols {
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: 20px;
  margin-bottom: 24px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.cols .panel { margin-bottom: 0; }
.panel > h2 { margin-bottom: 6px; }
.panel > .hint { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

/* Day Grid Heatmap */
.day-grid {
  display: grid;
  grid-template-columns: 54px repeat(6, 1fr);
  gap: 4px;
  align-items: center;
}

.gh {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
}

.gl {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  font-variant-numeric: tabular-nums;
  border: 0;
  background: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.gl:hover {
  color: var(--accent);
  text-decoration: underline;
}

.cell {
  height: 28px;
  border: 0;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  padding: 0;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.cell:hover {
  transform: scale(1.1);
  z-index: 2;
}

.cell.a {
  background: var(--active);
  background: color-mix(in srgb, var(--active) calc(var(--o) * 100%), #ecfdf5);
}

.cell.i {
  background: var(--idle);
  background: color-mix(in srgb, var(--idle) calc(var(--o) * 100%), #fffbeb);
}

.cell[aria-pressed="true"] {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.legend {
  display: flex;
  gap: 18px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -2px;
}

/* App Breakdown Bars */
.bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bar-row .top-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
}

.bar-row .top-line span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 550;
}

.bar {
  height: 7px;
  border-radius: 4px;
  background: #f1f5f9;
  margin-top: 6px;
  overflow: hidden;
}

.bar > div {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 100%);
  border-radius: 4px;
}

/* Screenshots Gallery */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.shot {
  border: 1px solid var(--line);
  padding: 6px;
  background: var(--surface);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease-in-out;
}

.shot:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.shot img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  border-radius: 6px;
  background: #f1f5f9;
}

.shot span {
  display: block;
  margin-top: 6px;
  padding: 0 4px;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* Activity Log Table */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 650;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 13.5px;
}

tr:hover td {
  background: #f8fafc;
}

tr:last-child td {
  border-bottom: 0;
}

td.t {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 500;
}

td.title {
  word-break: break-word;
  color: var(--ink);
  font-weight: 550;
}

td.title small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
  font-size: 12.5px;
}

.tag {
  font-size: 11.5px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--active-soft);
  color: var(--active-ink);
  border: 1px solid var(--active-line);
  white-space: nowrap;
}

.tag.idle {
  background: var(--idle-soft);
  color: var(--idle-ink);
  border-color: var(--idle-line);
}

.more { margin-top: 14px; }

/* ================================================================
   Modals, Dialogs & Lightbox
   ================================================================ */
dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  width: min(92vw, 500px);
  box-shadow: var(--shadow-xl);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-in {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-in h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
}

.field .help {
  font-size: 12.5px;
  color: var(--muted);
}

.steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.keybox {
  display: flex;
  gap: 8px;
}

.keybox input {
  flex: 1;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  background: #f8fafc;
}

dialog.lightbox {
  width: auto;
  max-width: 96vw;
  background: var(--surface);
  border-radius: var(--radius-lg);
}

.lb-in {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lb-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.lb-cap {
  font-weight: 650;
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70vw;
}

.lb-in img {
  display: block;
  max-width: 92vw;
  max-height: 76vh;
  border-radius: var(--radius-md);
  margin: 0 auto;
  border: 1px solid var(--line);
}

.lb-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* ================================================================
   Settings & Form Pages
   ================================================================ */
.settings {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 800px;
}

.settings .panel {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.inline input[type="number"] { width: 95px; }
.inline input[type="time"] { width: 140px; }

.seg {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.seg button[aria-pressed="true"] {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.days {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.days label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 550;
  font-size: 14px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

/* ================================================================
   SaaS Login Page
   ================================================================ */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 0%, #eef2ff 0%, #f8fafc 60%);
}

.login {
  width: min(100%, 400px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 34px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-xl);
}

.login h1 {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 6px;
}

.login .muted {
  font-size: 14px;
}

.login .btn.primary {
  width: 100%;
  padding: 11px;
  font-size: 15px;
  margin-top: 4px;
}

/* Toast Notifications */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13.5px;
  z-index: 50;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease-out;
}

.toast.err {
  background: var(--danger);
  color: #ffffff;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ================================================================
   Responsive Breakpoints
   ================================================================ */
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  main.wrap { padding-top: 20px; }
  .r-head { display: none; }
  .r-row {
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 16px;
  }
  .r-now {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .r-strip {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  h1 { font-size: 22px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .wrap { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
