/* ============================================================
   TheThing — Premium Visual Theme
   Target: Linear/Stripe aesthetic — clean, spacious, muted.
   Load AFTER DaisyUI CDN, BEFORE Tailwind browser.
   ============================================================ */

/* ----------------------------------------------------------
   1. CSS Custom Properties — Single source of truth
   ---------------------------------------------------------- */
:root {
  /* Page */
  --bg-page: #f8f9fb;
  --bg-card: #ffffff;
  --bg-card-hover: #fafbfc;
  --border-subtle: #e2e8f0;
  --border-muted: #f1f5f9;

  /* Text */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* Status — muted palette */
  --status-success: #6BCB77;
  --status-danger: #E15759;
  --status-warning: #F59E0B;
  --status-info: #6366f1;
  --status-neutral: #9CA3AF;
  --status-skip: #93c5fd;

  /* Status darks (for text on light bg) */
  --status-success-text: #059669;
  --status-danger-text: #dc2626;
  --status-warning-text: #d97706;
  --status-info-text: #4f46e5;

  /* Status light backgrounds */
  --status-success-bg: #f0fdf4;
  --status-danger-bg: #fef2f2;
  --status-warning-bg: #fffbeb;
  --status-info-bg: #eef2ff;
  --status-neutral-bg: #f3f4f6;

  /* Status borders */
  --status-success-border: #bbf7d0;
  --status-danger-border: #fecaca;
  --status-warning-border: #fde68a;
  --status-info-border: #c7d2fe;

  /* Accent — deep teal (distinctive, not "AI purple") */
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-soft: #ccfbf1;
  --accent-soft-border: #99f6e4;
  --accent-text: #0f766e;

  /* Chart pastel fills */
  --chart-success: #a7f3d0;
  --chart-success-risk: #bae6fd;
  --chart-warning: #fde68a;
  --chart-failure: #fecaca;
  --chart-missing: #fecdd3;
  --chart-in-progress: #c7d2fe;
  --chart-unknown: #e2e8f0;
  --chart-skip: #e0f2fe;

  /* Gauge */
  --gauge-good: #059669;
  --gauge-ok: #d97706;
  --gauge-bad: #E15759;
  --gauge-empty: #f1f5f9;
}

.th-help-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.th-help {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.th-help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.th-help-trigger:hover,
.th-help-trigger:focus-visible,
.th-help.is-open .th-help-trigger {
  outline: none;
  border-color: rgba(13, 148, 136, 0.45);
  background: rgba(240, 253, 250, 0.96);
  color: var(--accent-text);
  transform: translateY(-1px);
}

.th-help-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.5rem);
  transform: translateX(-50%) translateY(0.2rem);
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(203, 213, 225, 0.96);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: normal;
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.12),
    0 3px 8px rgba(15, 23, 42, 0.07);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 60;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.th-help-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 0.7rem;
  height: 0.7rem;
  margin-left: -0.35rem;
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid rgba(203, 213, 225, 0.96);
  border-bottom: 1px solid rgba(203, 213, 225, 0.96);
  transform: rotate(45deg);
}

.th-help:hover .th-help-bubble,
.th-help:focus-within .th-help-bubble,
.th-help.is-open .th-help-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
  .th-help-bubble {
    left: 0;
    right: auto;
    transform: translateX(0) translateY(0.2rem);
  }

  .th-help-bubble::after {
    left: 0.9rem;
    margin-left: 0;
  }

  .th-help:hover .th-help-bubble,
  .th-help:focus-within .th-help-bubble,
  .th-help.is-open .th-help-bubble {
    transform: translateX(0) translateY(0);
  }
}


/* ----------------------------------------------------------
   2. Base Styles
   ---------------------------------------------------------- */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-page) !important;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Override DaisyUI base colors for light theme */
[data-theme="business"] {
  --b1: 100% 0 0;          /* base-100: white */
  --b2: 98% 0.003 250;     /* base-200: warm off-white */
  --b3: 92% 0.004 250;     /* base-300: border gray */
  --bc: 20% 0.02 260;      /* base-content: dark text */
}


/* ----------------------------------------------------------
   2b. Typography Hierarchy — Premium tools use tight headings
   ---------------------------------------------------------- */
h1, .text-3xl, .text-4xl {
  font-size: 1.35rem !important;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
h2, .text-2xl {
  font-size: 1.1rem !important;
  font-weight: 600;
  letter-spacing: -0.005em;
}
h3, .text-xl {
  font-size: 0.95rem !important;
  font-weight: 600;
}
/* Keep KPI big numbers large */
.stat-value, .score-number, .sla-pct, .health-score {
  font-size: revert !important;
}


/* ----------------------------------------------------------
   3. Card Styling — Layered shadows like Stripe
   ---------------------------------------------------------- */
.card {
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.03),
    0 1px 3px rgba(0,0,0,0.04),
    0 2px 8px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.04);
}

.card-body {
  padding: 1.5rem;
}

/* Interactive container card hover lift (does NOT apply to inner list items) */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.03),
    0 2px 4px rgba(0,0,0,0.04),
    0 4px 16px rgba(0,0,0,0.06);
}


/* ----------------------------------------------------------
   4a. Form Controls — calmer, consistent inputs across pages
   ---------------------------------------------------------- */
.input,
.select,
.textarea,
.form-control {
  border-radius: 10px !important;
  border: 1px solid var(--border-subtle) !important;
  background: rgba(255,255,255,0.96) !important;
  color: var(--text-primary) !important;
  box-shadow:
    inset 0 1px 2px rgba(15,23,42,0.03),
    0 1px 0 rgba(255,255,255,0.85);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.input:hover,
.select:hover,
.textarea:hover,
.form-control:hover {
  border-color: #cbd5e1 !important;
}
.input:focus,
.select:focus,
.textarea:focus,
.form-control:focus {
  outline: none !important;
  border-color: rgba(13,148,136,0.55) !important;
  box-shadow:
    0 0 0 3px rgba(13,148,136,0.12),
    inset 0 1px 2px rgba(15,23,42,0.03) !important;
  background: #fff !important;
}
.input::placeholder,
.textarea::placeholder,
.form-control::placeholder {
  color: #94a3b8;
}
.input-sm,
.select-sm,
.form-control-sm {
  border-radius: 8px !important;
}
.input[type="file"] {
  padding-top: 0.38rem;
  padding-bottom: 0.38rem;
}


/* ----------------------------------------------------------
   4. Navbar — Frosted glass with active indicator
   ---------------------------------------------------------- */
.navbar {
  background: rgba(255,255,255,0.88) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle) !important;
  padding: 0 1rem;
  min-height: 3rem;
}

.navbar .btn-ghost {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  min-height: auto;
  height: auto;
}
.navbar .btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.04);
}
/* Active nav link — clear visual indicator */
.navbar .btn-ghost.nav-active {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--accent-soft);
  position: relative;
}
.navbar .btn-ghost.nav-active::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.navbar .btn-ghost.nav-active:hover {
  background: var(--accent-soft);
  color: var(--text-primary);
}

/* Subscribe button — tone down */
.navbar .btn-outline {
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  min-height: auto;
  height: auto;
  font-weight: 500;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}
.navbar .btn-outline:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}


/* ----------------------------------------------------------
   4b. Buttons — Softer, more refined
   ---------------------------------------------------------- */
.btn {
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  transition: all 0.15s ease;
}
.btn-sm {
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  min-height: auto;
  height: auto;
}
.btn-xs {
  font-size: 0.72rem;
}
/* Ghost buttons with subtle border */
.btn-ghost.border {
  border-color: var(--border-subtle) !important;
}
.btn-ghost.border:hover {
  background: var(--bg-card-hover);
  border-color: #cbd5e1 !important;
}


/* ----------------------------------------------------------
   4c. KPI Cards (Dashboard hero metrics)
   ---------------------------------------------------------- */
.kpi-hero {
  --kpi-accent: linear-gradient(90deg, rgba(148,163,184,0.65) 0%, rgba(148,163,184,0.08) 100%);
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.94) 100%);
  border: 1px solid rgba(203,213,225,0.78);
  border-radius: 18px;
  padding: 1.3rem 1.45rem 1.15rem;
  box-shadow:
    0 18px 38px rgba(15,23,42,0.08),
    0 4px 12px rgba(15,23,42,0.05),
    inset 0 1px 0 rgba(255,255,255,0.92);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  display: flex;
  align-items: flex-end;
  gap: 1.6rem;
  animation: fadeInUp 0.42s ease-out both;
}
.kpi-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0) 48%),
    linear-gradient(135deg, rgba(241,245,249,0.55) 0%, rgba(248,250,252,0) 52%);
  pointer-events: none;
}
.kpi-hero::after {
  content: "";
  position: absolute;
  left: 1.45rem;
  top: 0;
  width: 8.75rem;
  height: 3px;
  border-radius: 999px;
  background: var(--kpi-accent);
  opacity: 0.95;
}
.kpi-hero:nth-child(2) {
  animation-delay: 0.06s;
}
.kpi-hero.is-good {
  --kpi-accent: linear-gradient(90deg, rgba(5,150,105,0.72) 0%, rgba(5,150,105,0.08) 100%);
}
.kpi-hero.is-warn {
  --kpi-accent: linear-gradient(90deg, rgba(217,119,6,0.72) 0%, rgba(217,119,6,0.08) 100%);
}
.kpi-hero.is-bad {
  --kpi-accent: linear-gradient(90deg, rgba(220,38,38,0.62) 0%, rgba(220,38,38,0.08) 100%);
}
.kpi-hero.is-muted {
  --kpi-accent: linear-gradient(90deg, rgba(148,163,184,0.52) 0%, rgba(148,163,184,0.08) 100%);
}
.kpi-hero:hover {
  transform: translateY(-2px);
  border-color: rgba(148,163,184,0.42);
  box-shadow:
    0 22px 44px rgba(15,23,42,0.1),
    0 8px 16px rgba(15,23,42,0.05),
    inset 0 1px 0 rgba(255,255,255,0.94);
}

.kpi-hero-main {
  flex: 0 0 auto;
  min-width: 11.5rem;
  position: relative;
  z-index: 1;
}
.kpi-hero-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a98b1;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.55rem;
}
.kpi-hero-value {
  display: flex;
  align-items: flex-start;
  gap: 0.18rem;
  font-weight: 700;
  line-height: 0.92;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums lining-nums;
}
.kpi-hero-number {
  font-size: clamp(2.5rem, 4vw, 3.15rem);
}
.kpi-hero-unit {
  font-size: 1.08rem;
  font-weight: 650;
  color: rgba(100,116,139,0.72);
  padding-top: 0.38rem;
  letter-spacing: -0.01em;
}
.kpi-hero-value.is-good { color: #0f9f76; }
.kpi-hero-value.is-warn { color: #c98114; }
.kpi-hero-value.is-bad  { color: #d14f4f; }
.kpi-hero-value.is-muted { color: var(--text-muted); }

.kpi-hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.72rem;
  font-size: 0.73rem;
  color: #7b8aa4;
  font-variant-numeric: tabular-nums;
}
.kpi-hero-target-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.5rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(203,213,225,0.72);
  color: #64748b;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.kpi-hero-delta {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  letter-spacing: 0.01em;
}
.kpi-hero-delta-icon {
  font-size: 0.66rem;
  opacity: 0.9;
}
.kpi-hero-delta.up { color: #0f9f76; }
.kpi-hero-delta.down { color: #d14f4f; }
.kpi-hero-delta.flat { color: var(--text-muted); }

.kpi-hero-chart-shell {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-self: center;
  position: relative;
  z-index: 1;
}
.kpi-hero-chart-caption {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.68rem;
  color: #94a3b8;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-hero-chart-caption::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: rgba(148,163,184,0.6);
  flex: 0 0 auto;
}
.kpi-hero-spark {
  flex: 1 1 auto;
  min-width: 0;
  height: 72px;
  position: relative;
}
.kpi-hero-spark svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

@media (max-width: 720px) {
  .kpi-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  .kpi-hero-main {
    min-width: 0;
  }
  .kpi-hero-spark {
    height: 68px;
  }
}


/* ----------------------------------------------------------
   4d. Accent Cards — shared callout / briefing / status surfaces
   ---------------------------------------------------------- */
.accent-card {
  --accent-card-color: var(--accent);
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.94) 100%);
  border: 1px solid rgba(203,213,225,0.76) !important;
  border-radius: 14px;
  box-shadow:
    0 12px 28px rgba(15,23,42,0.06),
    0 3px 8px rgba(15,23,42,0.04),
    inset 0 1px 0 rgba(255,255,255,0.9);
}
.accent-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent-card-color) 0%, color-mix(in srgb, var(--accent-card-color) 65%, white) 100%);
}
.accent-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 130% at 0% 0%, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0) 46%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent-card-color) 10%, white) 0%, rgba(255,255,255,0) 48%);
  pointer-events: none;
}
.accent-card .card-body,
.accent-card > .card-body {
  position: relative;
  z-index: 1;
}
.accent-card-neutral { --accent-card-color: #cbd5e1; }
.accent-card-accent  { --accent-card-color: var(--accent); }
.accent-card-success { --accent-card-color: #22c55e; }
.accent-card-warning { --accent-card-color: #f59e0b; }
.accent-card-danger  { --accent-card-color: #ef4444; }
.accent-card-info    { --accent-card-color: #3b82f6; }
.accent-card-violet  { --accent-card-color: #8b5cf6; }


/* ----------------------------------------------------------
   4e. Premium Tab Strips — shared page-level navigation
   ---------------------------------------------------------- */
.premium-tab-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: 1rem;
  padding: .42rem;
  border: 1px solid rgba(203,213,225,0.76);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(248,250,252,0.95) 100%);
  box-shadow:
    0 14px 30px rgba(15,23,42,0.06),
    0 3px 8px rgba(15,23,42,0.03),
    inset 0 1px 0 rgba(255,255,255,0.9);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.premium-tab-strip::-webkit-scrollbar {
  display: none;
}
.premium-tab-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 52%),
    linear-gradient(135deg, rgba(241,245,249,0.45) 0%, rgba(248,250,252,0) 58%);
  pointer-events: none;
}
.premium-tab {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  min-height: 2.55rem;
  padding: .56rem 1rem;
  border: 1px solid rgba(226,232,240,0.78);
  border-radius: 12px;
  background: rgba(255,255,255,0.74);
  color: var(--text-muted);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .005em;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
  transition: color .15s, border-color .15s, background .15s, box-shadow .15s, transform .15s;
}
.premium-tab::before {
  content: "";
  position: absolute;
  left: .95rem;
  top: 0;
  width: 4.1rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(13,148,136,0.7) 0%, rgba(13,148,136,0.04) 100%);
  opacity: 0;
  transform: scaleX(.78);
  transform-origin: left center;
  transition: opacity .16s ease, transform .16s ease;
}
.premium-tab::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.52) 0%, rgba(255,255,255,0) 58%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.premium-tab:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.96);
  border-color: rgba(203,213,225,0.82);
  box-shadow:
    0 8px 18px rgba(15,23,42,0.05),
    inset 0 1px 0 rgba(255,255,255,0.94);
  transform: translateY(-1px);
}
.premium-tab:hover::after,
.premium-tab.is-active::after,
.premium-tab[aria-current="page"]::after {
  opacity: 1;
}
.premium-tab.is-active,
.premium-tab[aria-current="page"] {
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(236,253,245,0.92) 0%, rgba(255,255,255,0.98) 100%);
  border-color: rgba(13,148,136,0.24);
  box-shadow:
    0 10px 20px rgba(13,148,136,0.08),
    inset 0 1px 0 rgba(255,255,255,0.95);
}
.premium-tab.is-active::before,
.premium-tab[aria-current="page"]::before {
  opacity: 1;
  transform: scaleX(1);
}
.premium-tab .badge {
  border-radius: 999px;
  padding: .18rem .42rem;
  font-size: .62rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
}
.premium-tab .badge-danger {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.14);
  color: #b91c1c;
}


/* ----------------------------------------------------------
   5. Status Dots & Squares (Dashboard grid)
   ---------------------------------------------------------- */
.dots .dot, .dots .sq {
  width: 10px; height: 10px; display: inline-block;
  margin: 0 2px; vertical-align: middle;
  transition: transform .08s ease, filter .08s ease;
}
.dots .dot { border-radius: 9999px; }
.dots .sq  { border-radius: 2px; }
.dots .dot:hover, .dots .sq:hover {
  transform: translateY(-1px) scale(1.15);
  filter: brightness(1.05);
}

.ok   { background: var(--status-success); }
.miss { background: var(--status-danger); }
.fail { background: var(--status-danger); }
.warn { background: var(--status-warning); }
.unk  { background: var(--status-neutral); }
.pend { background: #c4b5fd; }
.skip { background: var(--status-skip); }

/* Today marker ring */
.latest { box-shadow: 0 0 0 1.5px rgba(0,0,0,0.20); }

/* Row labels */
.rowlabel { width: 56px; display: inline-block; opacity: .65; font-size: .78rem; }
.rowwrap  { white-space: nowrap; line-height: 14px; }


/* ----------------------------------------------------------
   6. Tables — Refined data presentation
   ---------------------------------------------------------- */
.table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}
.table td {
  vertical-align: middle;
  padding: 0.55rem 0.75rem;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--border-muted);
}
.table thead th { background: var(--bg-card); }
.table tbody tr,
.bw-table tbody tr {
  transition: background 0.12s ease;
}
.table tbody tr:hover,
.bw-table tbody tr:hover {
  background: var(--bg-card-hover);
}
.table tbody tr > td:first-child,
.bw-table tbody tr > td:first-child {
  position: relative;
}
.table tbody tr:hover > td:first-child::before,
.table tbody tr:focus-within > td:first-child::before,
.table tbody tr.is-selected > td:first-child::before,
.bw-table tbody tr:hover > td:first-child::before,
.bw-table tbody tr:focus-within > td:first-child::before,
.bw-table tbody tr.is-selected > td:first-child::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: linear-gradient(180deg, rgba(15,159,118,0.95) 0%, rgba(20,184,166,0.88) 100%);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.9);
}
.table tbody tr:last-child td { border-bottom: none; }

/* Monospace for server names, IDs */
.font-mono, code {
  font-size: 0.82em;
  color: var(--text-secondary);
}


/* ----------------------------------------------------------
   7. Inner List Items — subtle border + left accent (no heavy shadow)
   These appear inside container cards, so they should feel like list
   rows, not floating cards. Notion/Linear-style.
   ---------------------------------------------------------- */
.intel-card,
.server-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: none !important;
  transition: border-color .15s, background .15s;
}
.intel-card:hover,
.server-card:hover {
  background: var(--bg-card-hover);
  border-color: #cbd5e1;
  transform: none !important;
  box-shadow: none !important;
}

/* Severity / health left-border accent */
.intel-card.health-critical,
.intel-card.health-anomaly    { border-left-color: var(--status-danger); }
.intel-card.health-attention,
.intel-card.health-watch      { border-left-color: var(--status-warning); }
.intel-card.health-healthy    { border-left-color: var(--status-success); }
.intel-card.health-building,
.intel-card.health-insufficient { border-left-color: #a5b4fc; }

.server-card.sev-critical    { border-left-color: var(--status-danger); }
.server-card.sev-review      { border-left-color: var(--status-warning); }
.server-card.sev-investigate { border-left-color: var(--status-info); }


/* ----------------------------------------------------------
   8. Summary Pills
   ---------------------------------------------------------- */
.summary-pills { display: flex; gap: .5rem; flex-wrap: wrap; }
.summary-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .75rem; border-radius: 2rem;
  font-size: .85rem; font-weight: 500;
}
.pill-critical,
.pill-anomaly  { background: var(--status-danger-bg); color: var(--status-danger-text); border: 1px solid var(--status-danger-border); }
.pill-attention,
.pill-review,
.pill-watch    { background: var(--status-warning-bg); color: var(--status-warning-text); border: 1px solid var(--status-warning-border); }
.pill-healthy,
.pill-resolved { background: var(--status-success-bg); color: var(--status-success-text); border: 1px solid var(--status-success-border); }
.pill-building,
.pill-investigate { background: var(--status-info-bg); color: var(--status-info-text); border: 1px solid var(--status-info-border); }
.pill-total,
.pill-neutral  { background: var(--status-neutral-bg); color: #374151; border: 1px solid #d1d5db; }
a.summary-pill { cursor: pointer; transition: filter .15s, transform .15s; }
a.summary-pill:hover { filter: brightness(.93); transform: translateY(-1px); }


/* ----------------------------------------------------------
   9. Health Badges
   ---------------------------------------------------------- */
.health-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .72rem; font-weight: 600;
  padding: .15rem .5rem; border-radius: 1rem;
  text-transform: uppercase; letter-spacing: .03em;
}
.hb-critical  { background: var(--status-danger-bg); color: var(--status-danger-text); }
.hb-attention { background: var(--status-warning-bg); color: var(--status-warning-text); }
.hb-building  { background: var(--status-info-bg); color: var(--status-info); }
.hb-healthy   { background: var(--status-success-bg); color: var(--status-success-text); }


/* ----------------------------------------------------------
   10. Signal Tags
   ---------------------------------------------------------- */
.signal-tag {
  display: inline-flex; align-items: center; gap: .2rem;
  font-size: .7rem; padding: .1rem .4rem;
  border-radius: .25rem; font-weight: 500;
  margin: .1rem .15rem .1rem 0;
}
.sig-danger,
.signal-tag.sev-danger  { background: var(--status-danger-bg); color: var(--status-danger-text); }
.sig-warning,
.signal-tag.sev-warning { background: var(--status-warning-bg); color: var(--status-warning-text); }
.sig-info,
.signal-tag.sev-info    { background: var(--status-info-bg); color: var(--status-info-text); }


/* ----------------------------------------------------------
   11. Health Score Display
   ---------------------------------------------------------- */
.health-score {
  font-size: 2rem; font-weight: 700; line-height: 1;
}
.health-score.score-good { color: var(--status-success-text); }
.health-score.score-ok   { color: var(--status-warning-text); }
.health-score.score-bad  { color: var(--status-danger-text); }


/* ----------------------------------------------------------
   12. Detail Panels & Context
   ---------------------------------------------------------- */
.detail-panel { display: none; }
.detail-panel.open { display: block; }

.context-panel {
  background: var(--bg-page); border-radius: .5rem;
  padding: .6rem .85rem; margin-top: .35rem; font-size: .82rem;
}
.context-panel dt { font-weight: 600; font-size: .78rem; color: #374151; margin-top: .4rem; }
.context-panel dt:first-child { margin-top: 0; }
.context-panel dd { margin-left: 0; margin-bottom: .25rem; color: #4b5563; }


/* ----------------------------------------------------------
   13. Client Grid Row
   ---------------------------------------------------------- */
.client-row { transition: background .1s; cursor: pointer; }
.client-row:hover { background: var(--bg-card-hover); }


/* ----------------------------------------------------------
   14. SLA Mini Gauge
   ---------------------------------------------------------- */
.sla-mini-gauge {
  display: inline-block; width: 60px; height: 6px;
  background: var(--status-neutral-bg); border-radius: 3px;
  overflow: hidden; vertical-align: middle; margin-left: .35rem;
}
.sla-mini-fill { height: 100%; border-radius: 3px; }


/* ----------------------------------------------------------
   15. Sparklines / Spark Bars
   ---------------------------------------------------------- */
.spark-strip { display: flex; align-items: flex-end; gap: 2px; height: 32px; }
.spark-bar {
  width: 6px; border-radius: 2px 2px 0 0; background: #d1d5db;
}
.spark-bar.is-success { background: var(--status-success); }
.spark-bar.is-warning { background: var(--status-warning); }
.spark-bar.is-failure { background: var(--status-danger); }
.spark-bar.is-unknown { background: var(--status-neutral); }

/* Metric spark bars (ai_metric_preview) */
.metric-sparkbar.is-success { background: var(--status-success); }
.metric-sparkbar.is-warning { background: var(--status-warning); }
.metric-sparkbar.is-failure { background: var(--status-danger); }
.metric-sparkbar.is-unknown { background: var(--status-neutral); }


/* ----------------------------------------------------------
   16. History Dots (Actions page)
   ---------------------------------------------------------- */
.hist-strip { display: flex; align-items: center; gap: 0; }
.hist-label { font-size: .7rem; color: var(--text-muted); min-width: 3.2rem; }
.hist-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin: 0 1.5px; cursor: default;
}
.hist-sq {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  margin: 0 1.5px; cursor: default;
}
.hist-dot.ok, .hist-sq.ok     { background: var(--status-success); }
.hist-dot.miss, .hist-sq.miss { background: var(--status-danger); }
.hist-dot.fail, .hist-sq.fail { background: var(--status-danger); }
.hist-dot.warn, .hist-sq.warn { background: var(--status-warning); }
.hist-dot.unk, .hist-sq.unk   { background: var(--status-neutral); }
.hist-dot.pend, .hist-sq.pend { background: #c4b5fd; }
.hist-dot.skip, .hist-sq.skip { background: #e5e7eb; }


/* ----------------------------------------------------------
   17. Email Status (Actions page evidence)
   ---------------------------------------------------------- */
.email-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .5rem; border-bottom: 1px solid var(--border-muted);
  font-size: .8rem;
}
.email-row:last-child { border-bottom: none; }
.email-status {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}
.email-status.st-success { background: var(--status-success); }
.email-status.st-failure { background: var(--status-danger); }
.email-status.st-warning { background: var(--status-warning); }
.email-status.st-unknown { background: var(--status-neutral); }
.email-status.st-missing { background: var(--status-neutral); border: 1px dashed var(--text-muted); }
.email-subject { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #374151; }
.email-date { flex-shrink: 0; color: var(--text-muted); font-size: .75rem; font-family: monospace; }
.email-stlabel {
  flex-shrink: 0; font-size: .72rem; font-weight: 500;
  padding: .1rem .4rem; border-radius: .25rem;
}
.email-stlabel.st-success { background: var(--status-success-bg); color: var(--status-success-text); }
.email-stlabel.st-failure { background: var(--status-danger-bg); color: var(--status-danger-text); }
.email-stlabel.st-warning { background: var(--status-warning-bg); color: var(--status-warning-text); }
.email-stlabel.st-unknown { background: var(--status-neutral-bg); color: #6b7280; }


/* ----------------------------------------------------------
   18. Issue Rows (Actions page)
   ---------------------------------------------------------- */
.issue-row {
  padding: .45rem .65rem; border-radius: .375rem;
  margin-bottom: .3rem; font-size: .84rem;
}
.issue-row.sev-critical    { background: var(--status-danger-bg); }
.issue-row.sev-review      { background: var(--status-warning-bg); }
.issue-row.sev-investigate { background: var(--status-info-bg); }
.issue-row-click:hover { opacity: .8; }
.issue-detail { display: none; }
.issue-detail.open { display: block; }
.severity-section + .severity-section { margin-top: 1.5rem; }
.action-btn { font-size: .78rem; padding: .2rem .55rem; }


/* ----------------------------------------------------------
   19. Metric Rows (Backup Intelligence)
   ---------------------------------------------------------- */
.metric-row {
  padding: .4rem .65rem; border-radius: .375rem;
  margin-bottom: .25rem; font-size: .84rem;
}
.metric-row.health-anomaly       { background: var(--status-danger-bg); }
.metric-row.health-watch         { background: var(--status-warning-bg); }
.metric-row.health-healthy       { background: var(--status-success-bg); }
.metric-row.health-insufficient  { background: var(--status-neutral-bg); }
.metric-detail { display: none; }
.metric-detail.open { display: block; }
.metric-row-click:hover { opacity: .8; }


/* ----------------------------------------------------------
   20. Baseline Grid
   ---------------------------------------------------------- */
.baseline-grid {
  display: grid; grid-template-columns: auto 1fr;
  gap: .1rem .6rem; font-size: .78rem;
}
.baseline-label { color: #6b7280; }
.baseline-val { color: #374151; font-weight: 500; }
.health-section + .health-section { margin-top: 1.5rem; }


/* ----------------------------------------------------------
   21. Ticket Badge
   ---------------------------------------------------------- */
.ticket-badge {
  display: inline-flex; align-items: center; gap: .2rem;
  font-size: .7rem; padding: .1rem .45rem; border-radius: 1rem;
  background: #dbeafe; color: #1d4ed8;
}


/* ----------------------------------------------------------
   22. Evidence Body
   ---------------------------------------------------------- */
.evidence-body {
  background: var(--bg-page); border-top: 1px solid #e5e7eb;
  padding: .5rem .75rem; margin: 0 .25rem .35rem .25rem;
  border-radius: 0 0 .375rem .375rem;
}
.ev-body-text {
  font-size: .75rem; line-height: 1.5; color: #374151;
  white-space: pre-wrap; word-wrap: break-word;
  max-height: 300px; overflow-y: auto; margin: 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}


/* ----------------------------------------------------------
   23. Skeleton Loading States
   ---------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-heading { height: 20px; width: 40%; margin-bottom: 12px; }


/* ----------------------------------------------------------
   24. Card Entry Animation
   ---------------------------------------------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in {
  animation: fadeInUp 0.4s ease-out both;
}
.animate-in:nth-child(1) { animation-delay: 0s; }
.animate-in:nth-child(2) { animation-delay: 0.05s; }
.animate-in:nth-child(3) { animation-delay: 0.1s; }
.animate-in:nth-child(4) { animation-delay: 0.15s; }
.animate-in:nth-child(5) { animation-delay: 0.2s; }
.animate-in:nth-child(6) { animation-delay: 0.25s; }


/* ----------------------------------------------------------
   25. DaisyUI Component Overrides (badges, alerts, buttons)
   ---------------------------------------------------------- */

/* Badges — muted palette */
.badge-success {
  background: var(--status-success-bg) !important;
  color: var(--status-success-text) !important;
  border: 1px solid var(--status-success-border) !important;
}
.badge-warning {
  background: var(--status-warning-bg) !important;
  color: var(--status-warning-text) !important;
  border: 1px solid var(--status-warning-border) !important;
}
.badge-error {
  background: var(--status-danger-bg) !important;
  color: var(--status-danger-text) !important;
  border: 1px solid var(--status-danger-border) !important;
}
.badge-info {
  background: var(--status-info-bg) !important;
  color: var(--status-info-text) !important;
  border: 1px solid var(--status-info-border) !important;
}

/* Primary button — use accent color (deep teal) */
.btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}
.btn-primary:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
}

/* Alerts — softer */
.alert-success {
  background: var(--status-success-bg) !important;
  color: var(--status-success-text) !important;
  border: 1px solid var(--status-success-border) !important;
}
.alert-error {
  background: var(--status-danger-bg) !important;
  color: var(--status-danger-text) !important;
  border: 1px solid var(--status-danger-border) !important;
}


/* ----------------------------------------------------------
   26. Links & Inline Elements
   ---------------------------------------------------------- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover {
  color: var(--accent-hover);
}
/* Don't color nav links */
.navbar a { color: inherit; }
.navbar a:hover { color: inherit; }

/* Inline data links — subtle until hover */
.company-link, .server-link {
  color: var(--text-primary);
  font-weight: 500;
  border-bottom: 1px dotted transparent;
  transition: border-color 0.15s, color 0.15s;
}
.company-link:hover, .server-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.server-link {
  color: var(--accent);
  font-weight: 500;
}
.server-link:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

/* Top Actions row — clickable */
.top-actions-table tr.action-row {
  transition: background 0.12s;
}
.top-actions-table tr.action-row:hover {
  background: var(--bg-card-hover);
}

/* Subtle separator */
.divider-subtle {
  border-top: 1px solid var(--border-muted);
  margin: 1rem 0;
}

/* Page description text */
.page-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* Opacity utility overrides — DaisyUI opacity-70 is too transparent */
.opacity-70 { opacity: 0.55 !important; }
.opacity-50 { opacity: 0.45 !important; }

/* Smoother content appearance */
main {
  animation: fadeInUp 0.3s ease-out;
}


/* ----------------------------------------------------------
   27. Print Styles
   ---------------------------------------------------------- */
@media print {
  body { background: #fff !important; }
  .navbar { display: none !important; }
  .card { box-shadow: none !important; border: 1px solid #e2e8f0; }
  .animate-in { animation: none !important; }
  main { animation: none !important; }
  h1, h2, h3 { font-size: revert !important; }
}
