:root {
  --cold-charcoal: #00040F;
  --deep-harbor: #0A3A62;
  --royal-ascent: #1162A6;
  --pinnacle-blue: #2D95EA;
  --summit-gold: #E9C170;
  --pure-white: #FFFFFF;
  --snowcap: #F5FBFC;
  --glacial-mist: #C7E3F9;
  --line: #dfe7ef;
  --text: #243447;
  --muted: #617286;
  --success: #2ca44f;
  --warning-bg: #fff7e6;
  --warning-text: #8b5a00;
  --danger-bg: #fff1f2;
  --danger-text: #a32535;
  --card-shadow: 0 10px 30px rgba(10, 58, 98, 0.08);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 999px;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Inter, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
  color: var(--text);
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--snowcap);
  display: grid;
  place-items: center;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  border: 1px solid var(--line);
}

.brand-mark img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--warning-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--deep-harbor);
  line-height: 1;
}

.brand-agency {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--snowcap);
  border: 1px solid var(--line);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workspace-switch,
.user-pill,
.top-button {
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.workspace-switch:hover,
.top-button:hover {
  background: var(--snowcap);
  cursor: pointer;
}

.workspace-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.financials-dot {
  background: var(--pinnacle-blue);
}

.operations-dot {
  background: var(--summit-gold);
}

.top-button.gold {
  background: linear-gradient(180deg, #fff9ee, #fff3d7);
  border-color: #f0ddb1;
  color: #7c5a10;
  font-weight: 600;
}

.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}

.sidebar {
  background: linear-gradient(180deg, #fbfdff 0%, #f3f8fd 100%);
  border-right: 1px solid var(--line);
  padding: 22px 18px;
}

.workspace-card {
  border: 1px solid #e5eef7;
  background: white;
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--card-shadow);
  margin-bottom: 18px;
}

.workspace-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.workspace-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--deep-harbor);
  margin-bottom: 8px;
}

.workspace-sub {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.side-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 20px 10px 10px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.nav-item.active {
  background: linear-gradient(180deg, #fff9ee, #fff4de);
  border-color: #f1dfb8;
  color: var(--deep-harbor);
}

.nav-item .count {
  background: #eef4fb;
  color: var(--royal-ascent);
  border-radius: 999px;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.nav-item.active .count {
  background: #fff;
  color: var(--warning-text);
  border: 1px solid #f1dfb8;
}

.main {
  padding: 24px;
}

.hero {
  border: 1px solid #e5eef7;
  background: linear-gradient(135deg, #ffffff 0%, #fbfcff 62%, #fff9ee 100%);
  border-radius: 24px;
  padding: 24px 26px;
  box-shadow: var(--card-shadow);
  margin-bottom: 18px;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--warning-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.hero-title {
  margin: 0;
  font-size: 31px;
  line-height: 1.05;
  font-weight: 700;
  color: var(--deep-harbor);
}

.hero-copy {
  margin-top: 10px;
  max-width: 820px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.button.primary {
  background: linear-gradient(180deg, var(--deep-harbor), #072f50);
  color: #fff;
  border-color: transparent;
}

.button.soft-gold {
  background: linear-gradient(180deg, #fff9ee, #fff3d7);
  color: #7c5a10;
  border-color: #f0ddb1;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.stat-card {
  border: 1px solid #e6eef8;
  background: rgba(255,255,255,0.88);
  border-radius: 18px;
  padding: 16px 18px;
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--deep-harbor);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-sub {
  font-size: 13px;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tab {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(255,255,255,0.82);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
}

.tab.active {
  background: linear-gradient(180deg, #fff9ee, #fff2d1);
  border-color: #efd69c;
  color: #7c5a10;
  box-shadow: 0 8px 20px rgba(233, 193, 112, 0.18);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 18px;
}

.card {
  border: 1px solid #e4edf7;
  background: white;
  border-radius: 22px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.card-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid #edf2f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--deep-harbor);
  margin: 0;
}

.card-subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.queue-toolbar {
  padding: 14px 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid #edf2f7;
  background: #fbfdff;
}

.search,
.filter-chip {
  min-height: 40px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
}

.search {
  min-width: 240px;
  flex: 1 1 260px;
  padding: 0 14px;
}

.filter-chip {
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}

.queue-list {
  padding: 10px;
}

.queue-item {
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  margin-bottom: 10px;
}

.queue-item.active {
  background: linear-gradient(180deg, #fff9ef, #fffefb);
  border-color: #efd69c;
  box-shadow: 0 10px 18px rgba(233, 193, 112, 0.14);
}

.queue-item:not(.active) {
  background: #fff;
  border-color: #edf2f7;
}

.queue-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.queue-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--deep-harbor);
}

.queue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.queue-note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 10px;
}

.queue-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pill {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.pill.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: #f2ddb0;
}

.pill.success {
  background: #ebf9ef;
  color: #247d3d;
  border-color: #cdeed6;
}

.pill.info {
  background: #eef5fd;
  color: var(--royal-ascent);
  border-color: #d8e7f8;
}

.detail-body {
  padding: 20px;
}

.record-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.record-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--deep-harbor);
}

.record-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.detail-section {
  border: 1px solid #edf2f7;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  background: #fcfdff;
}

.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 14px;
}

.kv-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px 16px;
  font-size: 14px;
  align-items: start;
}

.kv-label {
  color: var(--muted);
  font-weight: 600;
}

.kv-value {
  color: var(--text);
  font-weight: 500;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  align-items: start;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--summit-gold);
  margin-top: 5px;
  box-shadow: 0 0 0 4px #fff6df;
}

.timeline-card {
  border: 1px solid #edf2f7;
  background: white;
  border-radius: 16px;
  padding: 12px 14px;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 13px;
}

.timeline-title {
  font-weight: 700;
  color: var(--deep-harbor);
}

.timeline-time {
  color: var(--muted);
  white-space: nowrap;
}

.timeline-copy {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.mini-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

@media (max-width: 1200px) {
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero-top { flex-direction: column; }
}

@media (max-width: 640px) {
  .main { padding: 16px; }
  .topbar { padding: 0 16px; }
  .summary-strip { grid-template-columns: 1fr; }
  .hero-title { font-size: 26px; }
  .record-title { font-size: 22px; }
}