/* SimpleTime × Zeus — app-level component styles that build on zeus-tokens.css */

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-primary); color: var(--fg-main); }
button { font-family: inherit; }

/* =========================================================
   Re-usable primitive classes
   ========================================================= */

/* Buttons */
.st-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--radius-md); border: 1px solid transparent;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  white-space: nowrap;
}
.st-btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.st-btn.lg { height: 40px; padding: 0 16px; font-size: 14px; }
.st-btn-primary { background: var(--primary); color: #fff; }
.st-btn-primary:hover { background: var(--primary-strong-1); }
.st-btn-secondary { background: var(--surface-neutral-3); color: var(--fg-main); border-color: var(--border-muted-1); }
.st-btn-secondary:hover { border-color: var(--border-main); }
.st-btn-ghost { background: transparent; color: var(--fg-main); }
.st-btn-ghost:hover { background: var(--neutral-muted-4); }
.st-btn-danger { background: var(--error); color: #fff; }
.st-btn-icon { width: 32px; padding: 0; }
.st-btn .i { width: 16px; height: 16px; }

/* Tag / chip */
.st-chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 500;
  background: var(--neutral-muted-4); color: var(--fg-main);
  border: 1px solid var(--border-muted-1);
}
.st-chip.primary { background: var(--primary-muted-3); color: var(--primary-strong-1); border-color: var(--primary-muted-2); }
.st-chip.success { background: var(--success-muted-3); color: var(--success-strong-1); border-color: var(--success-muted-2); }
.st-chip.warning { background: var(--warning-muted-3); color: var(--warning-strong-1); border-color: var(--warning-muted-2); }
.st-chip.error   { background: var(--error-muted-3);   color: var(--error-strong-1);   border-color: var(--error-muted-2); }
.st-chip.info    { background: var(--tertiary-muted-3); color: var(--tertiary-strong-1); border-color: var(--tertiary-muted-2); }
.st-chip.dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; display: inline-block;
}

/* Input */
.st-input, .st-select {
  height: 32px; padding: 0 10px;
  border: 1px solid var(--border-muted-1);
  border-radius: var(--radius-sm);
  background: var(--surface-neutral-3);
  font-size: 13px; color: var(--fg-main);
  font-family: inherit;
  width: 100%;
}
.st-input:focus, .st-select:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.st-input::placeholder { color: var(--neutral-muted-2); }
.st-label { font-size: 12px; font-weight: 500; color: var(--fg-main); margin-bottom: 4px; display: block; }
.st-hint { font-size: 11px; color: var(--fg-muted-1); margin-top: 4px; }
.st-required { color: var(--error); margin-left: 2px; }

/* Searchable select (typeahead) */
.st-searchable-select { position: relative; }
.st-searchable-select-list {
  position: absolute; top: calc(100% + 2px); left: 0; right: 0;
  max-height: 240px; overflow-y: auto;
  background: var(--surface-neutral-3);
  border: 1px solid var(--border-muted-1);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  z-index: 50;
  list-style: none; margin: 0; padding: 4px 0;
}
.st-searchable-select-item {
  padding: 6px 10px;
  font-size: 13px; color: var(--fg-main);
  cursor: pointer;
}
.st-searchable-select-item.hidden { display: none; }
.st-searchable-select-item:hover,
.st-searchable-select-item.active { background: var(--primary-muted-3); color: var(--primary-strong-1); }
.st-searchable-select-empty { padding: 8px 10px; font-size: 12px; color: var(--fg-muted-1); }

/* Card */
.st-card {
  background: var(--surface-neutral-3);
  border: 1px solid var(--border-muted-1);
  border-radius: var(--radius-md);
}
.st-card-header { padding: 14px 16px; border-bottom: 1px solid var(--border-muted-1); display: flex; align-items: center; justify-content: space-between; }
.st-card-title { font-size: 14px; font-weight: 600; color: var(--fg-strong); margin: 0; }
.st-card-sub { font-size: 12px; color: var(--fg-muted-1); margin: 2px 0 0; }
.st-card-body { padding: 16px; }

/* Table */
.st-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px;
  border: 1px solid var(--border-muted-1); border-radius: var(--radius-md); overflow: hidden; }
/* Inside a card body the card edge *is* the border — bleed table to card edges */
.st-card-body .st-table { border: none; border-radius: 0;
  margin-left: -16px; margin-right: -16px; margin-bottom: -16px; width: calc(100% + 32px); }
.st-card-body .st-table:first-child { margin-top: -16px; }
.st-table th {
  text-align: left; font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--fg-muted-1);
  padding: 8px 12px;
  background: var(--neutral-muted-4);
  border-bottom: 1px solid var(--border-muted-1);
  border-top: 1px solid var(--border-muted-1);
  white-space: nowrap;
}
.st-table th:first-child { border-top-left-radius: 6px; }
.st-table th:last-child  { border-top-right-radius: 6px; }
.st-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-muted-1);
  color: var(--fg-main);
  vertical-align: middle;
}
.st-table tr:last-child td { border-bottom: none; }
.st-table tbody tr:hover td { background: var(--neutral-muted-4); }
.st-table.compact td { padding: 6px 12px; font-size: 12.5px; }
.st-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.st-table .mono { font-family: var(--font-mono); font-size: 12px; }
.st-table .st-group-header td { background: var(--neutral-muted-4); font-weight: 600; }
.st-table .st-group-header:hover td { background: var(--neutral-muted-3); }
.rotate-90 { transform: rotate(90deg); }

/* Row actions */
.st-row-actions { display: inline-flex; gap: 2px; }

/* Inline-editable cell */
.st-editable-cell { cursor: text; }
.st-editable-cell .st-input { height: 26px; padding: 0 6px; font-size: 12.5px; }

/* Avatars — colour rotation via nth-child for visual variety */
.st-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-muted-2); color: var(--primary-strong-1);
  font-size: 9px; font-weight: 600; letter-spacing: -0.02em;
  flex-shrink: 0;
}
.st-avatar.lg { width: 32px; height: 32px; font-size: 12px; }
/* Colour rotation for stacked avatars */
.st-avatar-stack .st-avatar:nth-child(6n+1) { background: #dbeafe; color: #1e40af; }
.st-avatar-stack .st-avatar:nth-child(6n+2) { background: #d1fae5; color: #065f46; }
.st-avatar-stack .st-avatar:nth-child(6n+3) { background: #fef3c7; color: #92400e; }
.st-avatar-stack .st-avatar:nth-child(6n+4) { background: #ede9fe; color: #5b21b6; }
.st-avatar-stack .st-avatar:nth-child(6n+5) { background: #fce7f3; color: #9d174d; }
.st-avatar-stack .st-avatar:nth-child(6n+6) { background: #e0e7ff; color: #3730a3; }
.st-avatar-stack { display: inline-flex; }
.st-avatar-stack .st-avatar { border: 2px solid var(--surface-neutral-3); margin-left: -8px; }
.st-avatar-stack .st-avatar:first-child { margin-left: 0; }

/* Sparkline bar */
.st-bar {
  display: inline-block; height: 6px; background: var(--primary-muted-2);
  border-radius: var(--radius-full); position: relative; vertical-align: middle;
}
.st-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); border-radius: var(--radius-full); }

/* Icon wrapper */
.i-zd { width: 16px; height: 16px; flex-shrink: 0; }
.i-zd-sm { width: 14px; height: 14px; flex-shrink: 0; }
.i-zd-lg { width: 20px; height: 20px; flex-shrink: 0; }

/* Keyboard */
kbd.st-kbd {
  display: inline-block; padding: 1px 6px; font-family: var(--font-mono);
  font-size: 11px; background: var(--neutral-muted-4); color: var(--fg-muted-1);
  border: 1px solid var(--border-muted-1); border-radius: 4px;
}

/* BAU vs Roadmap legend swatches */
.st-legend-swatch  { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.st-legend-bau     { background: #f5b731; }
.st-legend-roadmap { background: #3b82f6; }

/* Simple progress */
.st-progress { height: 4px; background: var(--neutral-muted-4); border-radius: 2px; overflow: hidden; }
.st-progress-fill { height: 100%; background: var(--primary); }
.st-progress-fill.success { background: var(--success); }
.st-progress-fill.warning { background: var(--warning); }
.st-progress-fill.error   { background: var(--error); }

/* Kicker */
.st-kicker {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-muted-1);
}

/* Consolidation note callout */
.st-note {
  display: flex; gap: 10px; padding: 10px 12px;
  background: var(--primary-muted-3); border: 1px solid var(--primary-muted-2);
  border-radius: var(--radius-md);
  font-size: 12px; color: var(--primary-strong-1);
}
.st-note .lbl { font-weight: 600; margin-right: 4px; }

/* Segmented control — works with both <button> and <a> children */
.st-seg { display: inline-flex; border: 1px solid var(--border-muted-1); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-neutral-3); }
.st-seg > a, .st-seg > button {
  border: 0; background: transparent; padding: 0 12px; height: 30px; font-size: 12px; font-weight: 500; color: var(--fg-muted-1); cursor: pointer;
  border-right: 1px solid var(--border-muted-1);
  display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap;
}
.st-seg > a:last-child, .st-seg > button:last-child { border-right: 0; }
.st-seg > a.is-active, .st-seg > button.is-active { background: var(--state-selected-bg); color: var(--primary-strong-1); }

/* Sidebar */
.st-sidebar { width: 220px; background: var(--surface-neutral-3); border-right: 1px solid var(--border-muted-1); display: flex; flex-direction: column; flex-shrink: 0; transition: width 150ms ease; }
.st-app-main { margin-left: 220px; transition: margin-left 150ms ease; }
.st-sidebar-brand {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid var(--border-muted-1);
}
.st-sidebar-toggle {
  width: 100%; background: transparent; border: 0; cursor: pointer;
  font-family: inherit; text-align: left; color: inherit;
}
.st-sidebar-toggle:hover { background: var(--neutral-muted-4); }

/* Collapsed sidebar — icons only */
body.sidebar-collapsed .st-sidebar { width: 56px; }
body.sidebar-collapsed .st-app-main { margin-left: 56px; }
body.sidebar-collapsed .st-sidebar-brand { padding: 14px 0; justify-content: center; }
body.sidebar-collapsed .st-sidebar-brand-text { display: none; }
body.sidebar-collapsed .st-sidebar-group { padding: 10px 4px 4px; }
body.sidebar-collapsed .st-sidebar-group-title { display: none; }
body.sidebar-collapsed .st-sidebar-item { justify-content: center; padding: 8px 0; gap: 0; }
body.sidebar-collapsed .st-sidebar-item-label { display: none; }
body.sidebar-collapsed .st-sidebar-footer { padding: 12px 0; justify-content: center; }
body.sidebar-collapsed .st-sidebar-footer > :not(.st-avatar) { display: none; }
.st-sidebar-brand-mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--brand-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.st-sidebar-brand-text { font-weight: 700; color: var(--fg-strong); font-size: 15px; letter-spacing: -0.01em; }
.st-sidebar-group { padding: 10px 8px 4px; }
.st-sidebar-group-title { font-size: 10px; text-transform: uppercase; font-weight: 600; color: var(--neutral-muted-2); letter-spacing: 0.08em; padding: 6px 10px; }
.st-sidebar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--fg-main); text-decoration: none; cursor: pointer;
}
.st-sidebar-item:hover { background: var(--neutral-muted-4); }
.st-sidebar-item.is-active { background: var(--state-selected-bg); color: var(--primary-strong-1); font-weight: 500; }
.st-sidebar-footer { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--border-muted-1); display: flex; align-items: center; gap: 10px; font-size: 12px; }

/* Page container */
.st-page { padding: 20px 24px; }
.st-page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; gap: 16px; }
.st-page-title { font-size: 22px; font-weight: 700; color: var(--fg-strong); margin: 0; letter-spacing: -0.01em; }
.st-page-breadcrumb { font-size: 12px; color: var(--fg-muted-1); margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.st-page-breadcrumb .sep { color: var(--neutral-muted-2); }

/* Modal — backdrop handled by Tailwind fixed/flex utilities; panel uses Zeus card sizing */
.st-modal {
  width: 100%; max-width: 540px; background: var(--surface-neutral-3);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.st-modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border-muted-1); display: flex; align-items: center; justify-content: space-between; }
.st-modal-header h2, .st-modal-header h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--fg-strong); }
.st-modal-body { padding: 20px; }
.st-modal-footer { padding: 14px 20px; border-top: 1px solid var(--border-muted-1); display: flex; justify-content: flex-end; gap: 8px; background: var(--neutral-muted-4); }

/* Stat card */
.st-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; }
.st-stat-label { font-size: 11px; font-weight: 500; color: var(--fg-muted-1); text-transform: uppercase; letter-spacing: 0.04em; }
.st-stat-value { font-size: 22px; font-weight: 700; color: var(--fg-strong); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.st-stat-delta { font-size: 11px; color: var(--success-strong-1); display: inline-flex; align-items: center; gap: 2px; }
.st-stat-delta.down { color: var(--error-strong-1); }

/* App shell */
.st-artboard-root { background: var(--surface-neutral-3); color: var(--fg-main); min-height: 100%; }

/* Utility: divider */
.st-div { height: 1px; background: var(--border-muted-1); margin: 12px 0; }
.st-vdiv { width: 1px; background: var(--border-muted-1); align-self: stretch; }

/* Tab strip */
.st-tabs { display: flex; align-items: center; gap: 0; border-bottom: 1px solid var(--border-muted-1); }
.st-tab {
  padding: 0 14px; height: 38px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--fg-muted-1); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  text-decoration: none;
}
.st-tab.is-active { color: var(--primary-strong-1); border-bottom-color: var(--primary); }
.st-tab:hover:not(.is-active) { color: var(--fg-main); }

/* Icon coloring via mask (for svgs using currentColor natively this is optional) */
.icon-inherit { color: currentColor; }

/* Empty / placeholder pattern */
.st-placeholder {
  background: repeating-linear-gradient(45deg, var(--neutral-muted-4), var(--neutral-muted-4) 8px, #fff 8px, #fff 16px);
  border: 1px dashed var(--border-muted-1);
  border-radius: var(--radius-md);
  color: var(--fg-muted-1); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

/* Compact icon button */
.st-iconbtn {
  width: 24px; height: 24px; border-radius: 4px; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--fg-muted-1);
}
.st-iconbtn:hover { background: var(--neutral-muted-4); color: var(--primary); }
.st-iconbtn.danger:hover { background: var(--error-muted-2, #fef2f2); color: var(--error); }

/* Tree view */
.st-tree { font-size: 13px; }
.st-tree-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 4px; }
.st-tree-row:hover { background: var(--neutral-muted-4); }
.st-tree-row.is-sel { background: var(--state-selected-bg); color: var(--primary-strong-1); }
.st-tree-indent { display: inline-block; width: 14px; flex-shrink: 0; }
.st-tree-chev { width: 14px; height: 14px; flex-shrink: 0; color: var(--neutral-muted-2); }
.st-org-tree-panel { width: 272px; flex-shrink: 0; max-height: calc(100vh - 140px); overflow-y: auto; }

/* Muted small text */
.muted { color: var(--fg-muted-1); }
.mono { font-family: var(--font-mono); }

/* Annotation callout */
.st-callout {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: var(--radius-full);
  background: var(--tertiary-muted-3); border: 1px solid var(--tertiary-muted-2);
  color: var(--tertiary-strong-1); font-size: 11px; font-weight: 500;
}

/* Nav icon container */
.nav-ic { width: 16px; height: 16px; display: inline-block; flex-shrink: 0; }

/* Auth screen two-pane shell */
.st-auth-shell { display: flex; min-height: 100vh; }
.st-auth-brand-panel {
  width: 44%; min-height: 100vh; padding: 48px;
  display: flex; flex-direction: column; justify-content: center;
}
.st-auth-form-panel {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 48px; background: var(--surface-neutral-3);
}
.st-auth-form-inner { width: 100%; max-width: 360px; }
.st-auth-panel-0 { background-color: #f5b731; color: #1a1a1a; } /* Boldly Go Beyond — dark text on amber */
.st-auth-panel-1 { background-color: #1f7fd1; color: #fff; }    /* Dare to Simplify */
.st-auth-panel-2 { background-color: #2fb5b8; color: #fff; }    /* Win Together */
.st-auth-panel-3 { background-color: #f26a2e; color: #fff; }    /* Be a Good Human */
.st-auth-behaviour-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.st-auth-behaviour-list li { padding: 3px 0; opacity: 0.85; }
.st-auth-behaviour-list li::before { content: "—"; margin-right: 6px; opacity: 0.6; }
.st-auth-principle-name { font-size: 22px; font-weight: 700; margin: 0 0 12px; letter-spacing: -0.01em; }
.st-auth-principle-stmt { font-size: 14px; line-height: 1.6; max-width: 340px; margin: 0 0 20px; opacity: 0.9; }

/* Flash message banner */
.st-flash {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  border: 1px solid;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.st-flash.notice { background: var(--success-muted-3); color: var(--success-strong-1); border-color: var(--success-muted-2); }
.st-flash.alert  { background: var(--error-muted-3);   color: var(--error-strong-1);   border-color: var(--error-muted-2); }

/* Form validation error block */
.st-form-errors {
  margin-bottom: 14px; padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--error-muted-3); border: 1px solid var(--error-muted-2);
  color: var(--error-strong-1); font-size: 12px;
}
.st-form-errors ul { margin: 4px 0 0; padding-left: 16px; }

/* Gantt chart scroll container */
.st-gantt-scroll { height: calc(100vh - 220px); overflow-x: scroll; overflow-y: auto; }

/* Confirm dialog panel */
.st-confirm {
  width: 100%; max-width: 400px; background: var(--surface-neutral-3);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-3); overflow: hidden;
}
.st-confirm-body { padding: 20px; font-size: 13px; color: var(--fg-main); }
.st-confirm-footer { padding: 12px 20px; border-top: 1px solid var(--border-muted-1); display: flex; justify-content: flex-end; gap: 8px; background: var(--neutral-muted-4); }
