/* ============================================================
   ALINEDS Proposal Operations — Neumorphic Design System
   Replaces glass.css (Liquid Glass).
   Design tokens extracted from TextPop (textpop.base44.app).
   ============================================================ */

/* --- Reset & base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Canvas */
  --canvas:       #E0E5EC;
  --canvas-deep:  #D1D6DD;

  /* Shadows — the neumorphic core */
  --sh-dark:      #B8BCC4;
  --sh-light:     #FFFFFF;
  --raised:       8px 8px 16px var(--sh-dark), -8px -8px 16px var(--sh-light);
  --raised-sm:    4px 4px 8px var(--sh-dark),  -4px -4px 8px var(--sh-light);
  --raised-xs:    2px 2px 4px var(--sh-dark),  -2px -2px 4px var(--sh-light);
  --inset:        inset 4px 4px 8px var(--sh-dark), inset -4px -4px 8px var(--sh-light);
  --inset-sm:     inset 2px 2px 4px var(--sh-dark), inset -2px -2px 4px var(--sh-light);

  /* Radii */
  --r-card:       16px;
  --r-btn:        12px;
  --r-pill:       9999px;

  /* Accent */
  --accent:       #FF5707;
  --accent-hover: #E04D06;
  --accent-light: #FFF0EB;

  /* Agent lane colors */
  --teal:         #0A8F83;
  --teal-bg:      #E6F5F3;
  --blue:         #0071E3;
  --blue-bg:      #E8F2FD;
  --amber:        #C4820E;
  --amber-bg:     #FDF4E6;
  --purple:       #7B3FBF;
  --purple-bg:    #F3ECF9;
  --green:        #1B873A;
  --green-bg:     #E9F7ED;
  --red:          #D12C2C;
  --red-bg:       #FDECEC;

  /* Neutral text */
  --t1:           #2D3142;
  --t2:           #5A5F72;
  --t3:           #8E92A4;

  /* Typography */
  --font:         ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --hero:         72px;
  --kpi:          32px;
  --body:         14px;
  --small:        12px;
  --lh:           1.55;

  /* Layout */
  --page-max:     1280px;
  --gap:          20px;
  --topbar-h:     56px;
}

html {
  background: var(--canvas);
  color: var(--t1);
  font-family: var(--font);
  font-size: var(--body);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100dvh; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* --- App shell -------------------------------------------- */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* --- Topbar (header) -------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 24px;
  background: var(--canvas);
  box-shadow: 0 4px 8px var(--sh-dark);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--t1) !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1a2744 0%, #2d3e5e 100%);
  color: var(--teal);
  font-weight: 800;
  font-size: 18px;
}

/* --- Navigation pills ------------------------------------- */
.nav-pills {
  display: flex;
  gap: 4px;
  margin-left: 24px;
}

.nav-pill {
  padding: 6px 16px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--t2);
  transition: all .2s ease;
}
.nav-pill:hover {
  color: var(--t1);
  background: var(--canvas-deep);
  box-shadow: var(--inset-sm);
}
.nav-pill.active {
  color: var(--accent);
  background: var(--canvas);
  box-shadow: var(--inset);
  font-weight: 600;
}

/* --- Topbar right actions --------------------------------- */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: none;
  border-radius: var(--r-btn);
  background: var(--canvas);
  box-shadow: var(--raised-xs);
  color: var(--t2);
  cursor: pointer;
  transition: all .15s ease;
  position: relative;
}
.icon-btn:hover { box-shadow: var(--raised-sm); color: var(--t1); }
.icon-btn:active { box-shadow: var(--inset-sm); }

/* --- Notification bell ------------------------------------ */
.notif-wrap { position: relative; }

.bell-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

.notif-panel {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  width: 360px;
  max-height: 440px;
  border-radius: var(--r-card);
  background: var(--canvas);
  box-shadow: var(--raised);
  overflow: hidden;
  z-index: 200;
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--canvas-deep);
}
.notif-title { font-weight: 700; font-size: 15px; }

.notif-list {
  list-style: none;
  overflow-y: auto;
  max-height: 320px;
  padding: 0;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--canvas-deep);
  transition: background .15s;
}
.notif-item:hover { background: var(--canvas-deep); }

.notif-dot {
  flex-shrink: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 6px;
}
.notif-dot-teal   { background: var(--teal); }
.notif-dot-blue   { background: var(--blue); }
.notif-dot-amber  { background: var(--amber); }
.notif-dot-red    { background: var(--red); }
.notif-dot-green  { background: var(--green); }
.notif-dot-muted  { background: var(--t3); }

.notif-body { flex: 1; min-width: 0; }
.notif-row { font-size: 13px; }
.notif-detail { font-size: 12px; margin-top: 2px; }
.notif-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
}
.notif-empty { padding: 24px 16px; text-align: center; color: var(--t3); }
.notif-foot {
  display: block;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  border-top: 1px solid var(--canvas-deep);
}
.notif-foot:hover { background: var(--accent-light); }

/* Notification transition (Alpine) */
.notif-trans-enter       { transition: all .2s ease; }
.notif-trans-enter-start { opacity: 0; transform: translateY(-4px) scale(.97); }
.notif-trans-enter-end   { opacity: 1; transform: translateY(0) scale(1); }
.notif-trans-leave       { transition: all .15s ease; }
.notif-trans-leave-start { opacity: 1; }
.notif-trans-leave-end   { opacity: 0; transform: translateY(-4px) scale(.97); }

/* --- User chip & menu ------------------------------------- */
.user-wrap { position: relative; }

.user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--raised-xs);
  transition: box-shadow .15s ease;
}
.user-chip:hover { box-shadow: var(--raised-sm); }
.user-chip:active { box-shadow: var(--inset-sm); }

.user-menu {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  width: 240px;
  border-radius: var(--r-card);
  background: var(--canvas);
  box-shadow: var(--raised);
  padding: 16px;
  z-index: 200;
}
.user-menu-name  { font-weight: 700; font-size: 15px; }
.user-menu-email { font-size: 12px; color: var(--t3); margin-top: 2px; }
.user-menu-method { font-size: 12px; color: var(--t3); margin-top: 6px; display: flex; align-items: center; }
.user-menu-divider { height: 1px; background: var(--canvas-deep); margin: 12px 0; }
.user-menu-link {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--t2);
  padding: 6px 0;
}
.user-menu-link:hover { color: var(--accent); }

/* --- Main page area --------------------------------------- */
.page {
  flex: 1;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--gap) 24px 40px;
}
.page-full { max-width: none; }

/* --- Footer ----------------------------------------------- */
.footbar {
  text-align: center;
  padding: 16px 24px;
  font-size: 12px;
  color: var(--t3);
  border-top: 1px solid var(--canvas-deep);
}

/* --- Flash messages --------------------------------------- */
.flash {
  padding: 10px 16px;
  border-radius: var(--r-btn);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  box-shadow: var(--raised-xs);
}
.flash-ok {
  background: var(--green-bg);
  color: var(--green);
  border-left: 3px solid var(--green);
}
.flash-error {
  background: var(--red-bg);
  color: var(--red);
  border-left: 3px solid var(--red);
}

/* ============================================================
   COMPONENT LIBRARY
   ============================================================ */

/* --- Neumorphic card -------------------------------------- */
.card {
  background: var(--canvas);
  border-radius: var(--r-card);
  box-shadow: var(--raised);
  padding: 24px;
}
.card-sm {
  background: var(--canvas);
  border-radius: var(--r-card);
  box-shadow: var(--raised-sm);
  padding: 16px;
}
.card-inset {
  background: var(--canvas);
  border-radius: var(--r-card);
  box-shadow: var(--inset);
  padding: 20px;
}

/* --- Pills ------------------------------------------------ */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}
.pill-teal   { background: var(--teal-bg);   color: var(--teal); }
.pill-blue   { background: var(--blue-bg);   color: var(--blue); }
.pill-amber  { background: var(--amber-bg);  color: var(--amber); }
.pill-purple { background: var(--purple-bg); color: var(--purple); }
.pill-green  { background: var(--green-bg);  color: var(--green); }
.pill-red    { background: var(--red-bg);    color: var(--red); }
.pill-muted  { background: var(--canvas-deep); color: var(--t3); }
.pill-accent { background: var(--accent-light); color: var(--accent); }

/* --- KPI metric cards ------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}

.kpi-card {
  background: var(--canvas);
  border-radius: var(--r-card);
  box-shadow: var(--raised);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--t3);
}
.kpi-value {
  font-size: var(--kpi);
  font-weight: 700;
  line-height: 1.1;
  color: var(--t1);
}
.kpi-sub {
  font-size: var(--small);
  color: var(--t2);
  margin-top: 2px;
}

/* --- Hero metric (dashboard home) ------------------------- */
.hero-metric {
  font-size: var(--hero);
  font-weight: 700;
  line-height: 1;
  color: var(--t1);
}

/* --- Section headers -------------------------------------- */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 16px;
}
.section-sub {
  font-size: 13px;
  color: var(--t3);
  margin-top: -12px;
  margin-bottom: 16px;
}

/* --- Agent cards ------------------------------------------ */
.agent-card {
  background: var(--canvas);
  border-radius: var(--r-card);
  box-shadow: var(--raised);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.agent-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--raised-xs);
  flex-shrink: 0;
}
.agent-avatar-lg { width: 64px; height: 64px; }

.agent-name { font-weight: 700; font-size: 15px; }
.agent-role { font-size: 12px; color: var(--t3); }

.agent-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}
.agent-status-dot.online  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.agent-status-dot.offline { background: var(--t3); }

/* --- Agent stat grid -------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.stat-item {
  text-align: center;
  padding: 10px;
  border-radius: var(--r-btn);
  box-shadow: var(--inset-sm);
}
.stat-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--t1);
}
.stat-label {
  font-size: 11px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* --- Progress bar ----------------------------------------- */
.progress-track {
  height: 6px;
  border-radius: 3px;
  background: var(--canvas);
  box-shadow: var(--inset-sm);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}
.progress-fill-teal   { background: var(--teal); }
.progress-fill-blue   { background: var(--blue); }
.progress-fill-amber  { background: var(--amber); }
.progress-fill-accent { background: var(--accent); }

/* --- Tables (opportunities, function log) ----------------- */
.neu-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.neu-table thead th {
  position: sticky;
  top: 0;
  background: var(--canvas);
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--t3);
  border-bottom: 2px solid var(--canvas-deep);
  white-space: nowrap;
}
.neu-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--canvas-deep);
  vertical-align: middle;
}
.neu-table tbody tr {
  transition: background .15s;
}
.neu-table tbody tr:hover {
  background: var(--canvas-deep);
}
.neu-table tbody tr:last-child td {
  border-bottom: none;
}
.neu-table a { color: var(--t1); font-weight: 500; }
.neu-table a:hover { color: var(--accent); }

/* Table wrapper for scroll */
.table-wrap {
  background: var(--canvas);
  border-radius: var(--r-card);
  box-shadow: var(--raised);
  overflow-x: auto;
}

/* --- Pipeline swim lanes ---------------------------------- */
.lane {
  margin-bottom: 24px;
}
.lane-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.lane-name {
  font-size: 15px;
  font-weight: 700;
}
.lane-count {
  font-size: 12px;
  color: var(--t3);
}

.lane-stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.stage-well {
  background: var(--canvas);
  border-radius: var(--r-card);
  box-shadow: var(--inset);
  padding: 12px;
  min-height: 80px;
}
.stage-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--t3);
  margin-bottom: 8px;
}

.pipe-card {
  background: var(--canvas);
  border-radius: var(--r-btn);
  box-shadow: var(--raised-xs);
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--t3);
  transition: box-shadow .15s;
  display: block;
  color: var(--t1);
}
.pipe-card:hover { box-shadow: var(--raised-sm); color: var(--t1); }
.pipe-card:last-child { margin-bottom: 0; }

.pipe-card-teal   { border-left-color: var(--teal); }
.pipe-card-blue   { border-left-color: var(--blue); }
.pipe-card-amber  { border-left-color: var(--amber); }
.pipe-card-purple { border-left-color: var(--purple); }

.pipe-rfp { font-size: 12px; font-weight: 700; }
.pipe-title { font-size: 12px; color: var(--t2); margin-top: 2px;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-meta { font-size: 11px; color: var(--t3); margin-top: 4px; }

/* --- Detail page ------------------------------------------ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 300px;
  gap: var(--gap);
}
@media (max-width: 960px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.detail-field {
  margin-bottom: 14px;
}
.detail-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--t3);
  margin-bottom: 2px;
}
.detail-value {
  font-size: 14px;
  color: var(--t1);
}

/* --- Event timeline --------------------------------------- */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 4px; bottom: 4px;
  width: 2px;
  background: var(--canvas-deep);
  border-radius: 1px;
}
.timeline-item {
  position: relative;
  padding-bottom: 16px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -20px; top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--canvas);
  box-shadow: 0 0 0 2px var(--t3);
}
.timeline-dot-teal   { box-shadow: 0 0 0 2px var(--teal);   background: var(--teal); }
.timeline-dot-blue   { box-shadow: 0 0 0 2px var(--blue);   background: var(--blue); }
.timeline-dot-amber  { box-shadow: 0 0 0 2px var(--amber);  background: var(--amber); }
.timeline-dot-red    { box-shadow: 0 0 0 2px var(--red);    background: var(--red); }
.timeline-dot-green  { box-shadow: 0 0 0 2px var(--green);  background: var(--green); }
.timeline-dot-purple { box-shadow: 0 0 0 2px var(--purple); background: var(--purple); }

.timeline-time {
  font-size: 11px;
  color: var(--t3);
}
.timeline-body {
  font-size: 13px;
  color: var(--t2);
  margin-top: 2px;
}

/* --- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border: none;
  border-radius: var(--r-btn);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  background: var(--canvas);
  box-shadow: var(--raised-sm);
  color: var(--t1);
}
.btn:hover { box-shadow: var(--raised); }
.btn:active { box-shadow: var(--inset-sm); }

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 4px 4px 8px rgba(255, 87, 7, .3), var(--raised-sm);
}
.btn-accent:hover {
  background: var(--accent-hover);
  box-shadow: 6px 6px 12px rgba(255, 87, 7, .35), var(--raised);
}
.btn-accent:active { box-shadow: var(--inset); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { color: var(--red); }

/* --- Search / Filter -------------------------------------- */
.search-input {
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: var(--r-btn);
  background: var(--canvas);
  box-shadow: var(--inset);
  font-size: 14px;
  font-family: var(--font);
  color: var(--t1);
  outline: none;
  transition: box-shadow .15s;
}
.search-input:focus {
  box-shadow: var(--inset), 0 0 0 2px var(--accent);
}
.search-input::placeholder { color: var(--t3); }

/* Filter pill row */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.filter-pill {
  padding: 5px 14px;
  border-radius: var(--r-pill);
  border: none;
  background: var(--canvas);
  box-shadow: var(--raised-xs);
  font-size: 12px;
  font-weight: 500;
  color: var(--t2);
  cursor: pointer;
  transition: all .15s;
}
.filter-pill:hover { box-shadow: var(--raised-sm); color: var(--t1); }
.filter-pill.active {
  color: var(--accent);
  box-shadow: var(--inset-sm);
  font-weight: 600;
}

/* --- Tabs (agents page) ----------------------------------- */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--canvas);
  border-radius: var(--r-btn);
  box-shadow: var(--inset);
  margin-bottom: 20px;
}
.tab-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--t2);
  cursor: pointer;
  transition: all .2s ease;
}
.tab-btn:hover { color: var(--t1); }
.tab-btn.active {
  background: var(--canvas);
  box-shadow: var(--raised-sm);
  color: var(--accent);
  font-weight: 600;
}

/* --- Login page ------------------------------------------- */
.login-card {
  max-width: 400px;
  margin: 80px auto;
  padding: 40px;
  background: var(--canvas);
  border-radius: var(--r-card);
  box-shadow: var(--raised);
  text-align: center;
}
.login-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 24px; }

.input-field {
  width: 100%;
  padding: 10px 16px;
  margin-bottom: 12px;
  border: none;
  border-radius: var(--r-btn);
  background: var(--canvas);
  box-shadow: var(--inset);
  font-size: 14px;
  font-family: var(--font);
  color: var(--t1);
  outline: none;
}
.input-field:focus {
  box-shadow: var(--inset), 0 0 0 2px var(--accent);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--t3);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--canvas-deep);
}

.sso-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--r-btn);
  background: var(--canvas);
  box-shadow: var(--raised-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s ease;
}
.sso-btn:hover { box-shadow: var(--raised); color: var(--t1); }
.sso-btn:active { box-shadow: var(--inset); }

.sso-btn svg { flex-shrink: 0; }

/* --- Budget bar ------------------------------------------- */
.budget-bar {
  margin-top: 16px;
}
.budget-track {
  height: 10px;
  border-radius: 5px;
  background: var(--canvas);
  box-shadow: var(--inset-sm);
  overflow: hidden;
}
.budget-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--green) 0%, var(--accent) 60%, var(--red) 100%);
  transition: width .5s ease;
}
.budget-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--t3);
  margin-top: 4px;
}

/* --- System health dots ----------------------------------- */
.health-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}
.health-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.health-dot.ok      { background: var(--green); box-shadow: 0 0 6px var(--green); }
.health-dot.warn    { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.health-dot.err     { background: var(--red);   box-shadow: 0 0 6px var(--red); }
.health-dot.unknown { background: var(--t3); }

/* --- Two-column layout ------------------------------------ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--gap);
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}

/* --- Text utilities --------------------------------------- */
.t2 { color: var(--t2); }
.t3 { color: var(--t3); }
.mono { font-family: var(--mono); }
.muted-link { color: var(--t3); font-size: 12px; }
.muted-link:hover { color: var(--accent); }
.text-accent { color: var(--accent); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--t2);
  margin-bottom: 16px;
}
.back-link:hover { color: var(--accent); }

/* --- Textarea --------------------------------------------- */
textarea.input-field {
  resize: vertical;
  min-height: 80px;
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 768px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .nav-pills { display: none; }
  .page { padding: var(--gap) 12px 32px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .notif-panel { width: calc(100vw - 24px); right: -60px; }
  .hero-metric { font-size: 48px; }
}

/* --- Alpine x-cloak --------------------------------------- */
[x-cloak] { display: none !important; }

/* --- Scrollbar -------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sh-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--t3); }

/* --- Print ------------------------------------------------ */
@media print {
  .topbar, .footbar, .notif-wrap, .user-wrap, .icon-btn { display: none !important; }
  .page { max-width: none; padding: 0; }
  .card, .card-sm, .kpi-card, .table-wrap { box-shadow: none; border: 1px solid #ccc; }
}
