/* Operations Hub — Cipher design system: one amber accent on warm neutrals, square corners, mono labels */

:root {
  /* Dark Mode Default: Low-saturation Plain Grayscale */
  --bg-base: #0C0C0B;
  --bg-surface: #151514;
  --bg-surface-subtle: #111110;
  --bg-hover: #1D1D1B;
  --border: #3A3A37;
  --border-light: #262624;

  --text-primary: #EDEBE6;
  --text-secondary: #9C9A93;
  --text-inverse: #0C0C0B;

  /* Primary action button (High-contrast B&W) */
  --btn-primary-bg: #FFB000;
  --btn-primary-text: #0C0C0B;
  --btn-primary-hover: #FFC640;

  /* Functional Colors — STRICTLY for Status & Intent */
  --color-urgent: #FF5C5C;
  --color-urgent-bg: transparent;
  --color-pending: #FF7A3D;
  --color-pending-bg: transparent;
  --color-done: #6FD08C;
  --color-done-bg: transparent;
  --color-neutral: #9C9A93;
  --color-neutral-bg: transparent;

  /* Typography Scale */
  --font-sans: "Segoe UI Variable Text", "Segoe UI", Inter, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;

  --text-title: 22px;
  --text-section: 15px;
  --text-body: 13.5px;
  --text-small: 12px;
  --text-meta: 11px;

  /* Spacing Scale (8px Grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --accent: #FFB000;
  --text-muted: #6B6A64;
  --bg-sidebar: #111110;

  --radius: 0px;
  --radius-sm: 0px;

  --sidebar-width: 240px;
  --topbar-height: 64px;
}

[data-theme="light"] {
  --bg-base: #F4F2EC;
  --bg-surface: #FFFFFF;
  --bg-surface-subtle: #FAF9F5;
  --bg-hover: #ECE9E1;
  --border: #C4C0B3;
  --border-light: #E0DDD3;

  --text-primary: #1A1915;
  --text-secondary: #55534B;
  --text-inverse: #FFFFFF;

  --btn-primary-bg: #9A5B00;
  --btn-primary-text: #FFFFFF;
  --btn-primary-hover: #7F4A00;

  --color-urgent: #C42B2B;
  --color-urgent-bg: transparent;
  --color-pending: #C2410C;
  --color-pending-bg: transparent;
  --color-done: #1F7A44;
  --color-done-bg: transparent;
  --color-neutral: #55534B;
  --color-neutral-bg: transparent;
  --accent: #9A5B00;
  --text-muted: #8A877C;
  --bg-sidebar: #FAF9F5;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

code, pre, .data-mono {
  font-family: var(--font-mono);
}

h1 {
  font-size: var(--text-title);
  font-weight: 600;
  line-height: 1.25;
}

h2 {
  font-size: var(--text-section);
  font-weight: 600;
  line-height: 1.35;
}

h3 {
  font-size: var(--text-body);
  font-weight: 600;
}

/* Accessibility Focus States */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 1px;
}

/* Layout Shell */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.sidebar-nav {
  padding: var(--space-3) var(--space-2);
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-title {
  font-size: var(--text-meta);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 var(--space-2) var(--space-1) var(--space-2);
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px var(--space-2);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-body);
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background-color 0.1s ease, color 0.1s ease;
}

.nav-link:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.nav-link.active {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  font-weight: 600;
}

.nav-link-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-badge-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--color-pending);
  background-color: var(--color-pending-bg);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.future-tag {
  font-size: 10px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}

.sidebar-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-footer a {
  font-size: var(--text-small);
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.sidebar-footer a:hover {
  color: var(--text-primary);
}

/* Topbar */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  height: var(--topbar-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-search {
  position: relative;
  width: 360px;
}

.search-input {
  width: 100%;
  background-color: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px var(--space-3) 6px 32px;
  border-radius: var(--radius-sm);
  font-size: var(--text-small);
  font-family: inherit;
}

.search-icon-wrap {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 360px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}

.search-item {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.search-item:hover {
  background-color: var(--bg-hover);
}

.search-item-title {
  font-weight: 600;
  font-size: var(--text-small);
  color: var(--text-primary);
}

.search-item-snippet {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mode-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--text-secondary);
  padding: 3px var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.mode-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-done);
}

.mode-tag.mode-mock .dot {
  background-color: var(--color-pending);
}

.topbar-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background-color: var(--color-pending);
  color: var(--text-inverse);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: var(--radius);
}

/* Page Container */
.page-content {
  padding: var(--space-6);
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.page-title {
  font-size: var(--text-title);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: var(--text-body);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Plain Metric Blocks */
.dashboard-metrics {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

/* Primary Metric: What needs attention */
.metric-primary-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-primary-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.metric-primary-label {
  font-size: var(--text-section);
  font-weight: 600;
  color: var(--text-primary);
}

.metric-primary-sub {
  font-size: var(--text-small);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Secondary Metrics Strip */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.metric-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
}

.metric-box-label {
  font-size: var(--text-small);
  color: var(--text-secondary);
}

.metric-box-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
}

/* Dense Triage List */
.triage-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
  overflow: hidden;
}

.triage-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-surface);
}

.triage-row:last-child {
  border-bottom: none;
}

.triage-row:hover {
  background-color: var(--bg-hover);
}

.triage-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.triage-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-small);
}

.triage-sender {
  font-weight: 600;
  color: var(--text-primary);
}

.triage-channel {
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.triage-time {
  color: var(--text-secondary);
}

.triage-message-text {
  font-size: var(--text-body);
  color: var(--text-primary);
  line-height: 1.4;
}

/* Proposed Task Line */
.triage-proposal-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background-color: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-small);
}

.triage-proposal-task {
  font-weight: 600;
  color: var(--text-primary);
}

.triage-proposal-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-secondary);
}

/* Actions in Row */
.triage-row-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-1);
}

.action-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Plain Functional Tags (Strictly for state) */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  line-height: 1.2;
}

.tag-pending {
  color: var(--color-pending);
  background-color: var(--color-pending-bg);
}

.tag-confirmed, .tag-done {
  color: var(--color-done);
  background-color: var(--color-done-bg);
}

.tag-urgent, .tag-failed {
  color: var(--color-urgent);
  background-color: var(--color-urgent-bg);
}

.tag-neutral {
  color: var(--color-neutral);
  background-color: var(--color-neutral-bg);
}

/* Priority Flags */
.priority-flag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
}

.priority-flag.urgent { color: var(--color-urgent); }
.priority-flag.high { color: var(--color-pending); }
.priority-flag.normal { color: var(--text-secondary); }
.priority-flag.low { color: var(--text-secondary); }

/* Buttons — Exactly Three Functional Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px var(--space-3);
  font-size: var(--text-small);
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: opacity 0.1s ease;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 1. Primary Action */
.btn-primary {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: 1px solid var(--btn-primary-bg);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
}

/* 2. Secondary Neutral Action */
.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-hover);
}

/* 3. Attention / Decline Action */
.btn-attention, .btn-danger {
  background-color: transparent;
  color: var(--color-urgent);
  border: 1px solid var(--color-urgent);
}

.btn-attention:hover:not(:disabled), .btn-danger:hover:not(:disabled) {
  background-color: var(--color-urgent-bg);
}

.btn-sm {
  padding: 3px var(--space-2);
  font-size: 11.5px;
}

/* Activity Detail Separation */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.detail-block {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.detail-block-title {
  font-size: var(--text-section);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  font-size: var(--text-small);
}

.detail-table-label {
  color: var(--text-secondary);
  font-size: 11px;
}

.detail-table-val {
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 1px;
}

/* Plain Filter Bar */
.filter-bar {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.filter-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 4px var(--space-2);
  font-size: var(--text-small);
  font-weight: 500;
  line-height: 1.4;
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  background-color: var(--bg-base);
  color: var(--text-primary);
  border-color: var(--border);
  font-weight: 600;
}

.filter-inputs {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Tables */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
  overflow-x: auto;
}

.plain-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--text-body);
}

.plain-table th {
  padding: var(--space-2) var(--space-4);
  background-color: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plain-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.plain-table tr:last-child td {
  border-bottom: none;
}

.plain-table tr:hover td {
  background-color: var(--bg-hover);
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.form-label {
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--text-primary);
}

.form-input, .form-select, .form-textarea {
  background-color: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 6px var(--space-2);
  font-size: var(--text-body);
  font-family: inherit;
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--text-primary);
}

.form-hint {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* Settings Theme Switcher */
.theme-switch-group {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.theme-switch-btn {
  padding: 6px var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--bg-base);
  color: var(--text-secondary);
  font-size: var(--text-small);
  cursor: pointer;
  font-weight: 500;
}

.theme-switch-btn.active {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-bg);
  font-weight: 600;
}

/* Empty State */
.empty-box {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  background-color: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-icon {
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
}

.empty-title {
  font-size: var(--text-section);
  font-weight: 600;
  color: var(--text-primary);
}

.empty-text {
  font-size: var(--text-body);
  color: var(--text-secondary);
  max-width: 440px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
}

.modal-dialog {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--text-section);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
}

.modal-body {
  padding: var(--space-4);
}

.modal-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  background-color: var(--bg-surface-subtle);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 9999;
}

.toast {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  color: var(--text-primary);
  font-size: var(--text-small);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 260px;
  max-width: 380px;
}

.toast.success { border-left: 3px solid var(--color-done); }
.toast.error { border-left: 3px solid var(--color-urgent); }
.toast.info { border-left: 3px solid var(--text-primary); }

/* Notifications Drawer */
.notif-drawer {
  position: absolute;
  top: calc(var(--topbar-height) + 2px);
  right: var(--space-6);
  width: 340px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: none;
  z-index: 300;
  max-height: 420px;
  overflow: hidden;
}

.notif-drawer-header {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface-subtle);
}

.notif-item {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
}

.notif-item:hover {
  background-color: var(--bg-hover);
}

/* Helper Utilities & Specific Component Classes (Zero inline styles) */
.u-mb-1 { margin-bottom: var(--space-1); }
.u-mb-2 { margin-bottom: var(--space-2); }
.u-mb-3 { margin-bottom: var(--space-3); }
.u-mb-4 { margin-bottom: var(--space-4); }
.u-mt-1 { margin-top: var(--space-1); }
.u-mt-2 { margin-top: var(--space-2); }
.u-mt-3 { margin-top: var(--space-3); }
.u-mt-4 { margin-top: var(--space-4); }
.u-flex-row { display: flex; align-items: center; gap: var(--space-2); height: 28px; }
.u-flex-row .form-hint { line-height: 28px; }
.u-flex-between { display: flex; align-items: center; justify-content: space-between; }
.u-flex-col { display: flex; flex-direction: column; gap: var(--space-2); }
.u-text-secondary { color: var(--text-secondary); }
.u-text-urgent { color: var(--color-urgent); }
.u-text-pending { color: var(--color-pending); }
.u-text-done { color: var(--color-done); }
.u-hidden { display: none !important; }
.u-cursor-pointer { cursor: pointer; }
.u-break-all { word-break: break-all; }

/* Filter components */
.filter-select-auto {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: auto;
  height: 28px;
  box-sizing: border-box;
  padding: 0 28px 0 8px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  line-height: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%238b8f97' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.filter-search-box { flex: 1; max-width: 240px; margin-left: auto; }
.filter-search-input { padding: 4px 8px; font-size: 12px; height: 28px; box-sizing: border-box; }

/* Detail screen components */
.back-link { font-size: 12px; text-decoration: none; color: var(--text-secondary); }
.back-link:hover { color: var(--text-primary); }
.message-bubble { font-size: 14px; background: var(--bg-surface-subtle); padding: var(--space-3); border-radius: var(--radius-sm); }
.reason-box { background: var(--bg-surface-subtle); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font-size: 12.5px; }
.history-row { font-size: 11.5px; padding: 4px 0; border-bottom: 1px solid var(--border-light); }
.code-box { font-size: 11px; overflow-x: auto; padding: 8px; background: var(--bg-base); border-radius: var(--radius-sm); color: var(--text-secondary); margin-top: 8px; }
.code-box-pre { font-size: 12px; background: var(--bg-base); padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 220px; overflow-y: auto; }
.alert-urgent-box { padding: 8px; background: var(--color-urgent-bg); border-radius: var(--radius-sm); font-size: 12px; color: var(--color-urgent); margin-top: var(--space-2); }
.alert-banner { display: none; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: var(--space-4); font-size: 12.5px; }

/* Topbar notifications */
.notif-btn-wrap { position: relative; }
.notif-title { font-size: 12px; font-weight: 600; }
.notif-scroll { max-height: 360px; overflow-y: auto; }
.notif-empty { padding: 16px; text-align: center; color: var(--text-secondary); font-size: 12px; }

/* Setup & Settings components */
.setup-list-wrap { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-4); }
.setup-intro-box { padding: var(--space-3) var(--space-4); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.setup-cta-wrap { text-align: center; padding: var(--space-4) 0; }
.setup-cta-btn { padding: 8px 24px; font-size: 14px; }
.webhook-box { background: var(--bg-base); padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; font-family: var(--font-mono); word-break: break-all; }
.matched-user-row { padding: 6px var(--space-2); background: var(--bg-base); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; }
.table-empty-cell { padding: 16px; text-align: center; color: var(--text-secondary); }
.empty-box-borderless { border: none; }

/* Font size utilities */
.font-size-11 { font-size: 11px; }
.font-size-12 { font-size: 12px; }
.font-size-12-5 { font-size: 12.5px; }
.font-size-13 { font-size: 13px; }
.tag-cloud { flex-wrap: wrap; margin-top: var(--space-1); }
.db-uri-box { font-size: 11px; word-break: break-all; margin-top: 2px; }

/* Responsive */
@media (max-width: 900px) {
  .app-sidebar {
    width: 60px;
  }
  .brand-title, .nav-label, .nav-section-title, .future-tag, .sidebar-footer {
    display: none;
  }
  .nav-link {
    justify-content: center;
    padding: 10px;
  }
  .detail-layout, .metrics-strip {
    grid-template-columns: 1fr;
  }
}

/* ---- Cipher look: overrides ---- */
h1, h2, .page-title, .detail-block-title { font-family: var(--font-mono); letter-spacing: 0.3px; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline-color: var(--accent);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

.app-sidebar { background-color: var(--bg-sidebar); border-right-color: var(--border-light); }
.sidebar-header { height: auto; padding: 20px 20px 16px; border-bottom: none; align-items: flex-end; gap: 4px; flex-wrap: wrap; }
.brand-word { font-family: var(--font-mono); font-size: 22px; letter-spacing: 3px; line-height: 1; color: var(--text-primary); }
.brand-accent {
  font-family: var(--font-mono); font-size: 15px; font-weight: 700; letter-spacing: 1px; line-height: 1;
  color: var(--btn-primary-text); background-color: var(--accent); padding: 2px 5px; margin-bottom: 1px;
}
.brand-sub { flex-basis: 100%; font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--text-muted); margin-top: 4px; }

.nav-section-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.2px; color: var(--text-muted); padding-left: 10px; }
.nav-link { padding: 10px 12px; border-left: 2px solid transparent; }
.nav-link.active { border-left-color: var(--accent); }
.nav-link.active .nav-icon { color: var(--accent); }

.app-topbar { border-bottom-color: var(--border-light); }
.tag, .mode-tag { font-family: var(--font-mono); letter-spacing: 0.8px; text-transform: uppercase; border: 1px solid currentColor; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-hover); }
::-webkit-scrollbar-thumb:hover { background: var(--border); }
