:root {
  color-scheme: light;
  --bg: #f4f7fa;
  --bg-top: #eef4f8;
  --surface: #ffffff;
  --surface-strong: #f8fbfd;
  --text: #16202a;
  --muted: #5b6876;
  --border: #d7e0e8;
  --border-strong: #c4d1de;
  --accent: #1f6feb;
  --accent-dark: #174ea6;
  --accent-soft: #edf6ff;
  --success: #177245;
  --success-soft: #ecf8f1;
  --warning: #9a5b00;
  --warning-soft: #fff7e8;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow: 0 14px 34px rgba(30, 43, 56, 0.08);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, var(--bg-top) 0, #f8fafc 360px), var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

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

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent);
  outline-offset: 3px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.brand,
.primary-nav,
.operator-menu,
.status-pill,
.button,
.tag,
.source-cell {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid #b8c9dc;
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 850;
  white-space: nowrap;
}

.status-pill {
  gap: 7px;
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid #c7e4d2;
  border-radius: 999px;
  background: var(--success-soft);
  color: #135a37;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.primary-nav {
  gap: 6px;
  margin-left: auto;
}

.primary-nav a {
  border-radius: 6px;
  color: #344153;
  font-size: 0.9rem;
  font-weight: 780;
  padding: 7px 9px;
  text-decoration: none;
  white-space: nowrap;
}

.primary-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.primary-nav a:hover {
  background: #eef3f8;
}

.operator-menu {
  gap: 8px;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #1a2735;
  font-weight: 750;
}

.page {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 34px 32px 48px;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.55rem);
  line-height: 1.08;
}

.summary {
  margin-top: 8px;
  color: var(--muted);
  font-size: 1.02rem;
}

.button {
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 15px;
  font-weight: 820;
  text-decoration: none;
}

.button:hover {
  text-decoration: none;
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-secondary {
  border-color: var(--border-strong);
  background: #fff;
  color: #1b314a;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.panel,
.approval-card,
.empty-state {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.panel h2 {
  font-size: 1.08rem;
}

.panel p {
  margin-top: 6px;
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.toolbar p {
  color: var(--muted);
}

.approval-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.approval-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.approval-card h2 {
  font-size: 1.12rem;
  overflow-wrap: anywhere;
}

.approval-card p {
  color: #344153;
  overflow-wrap: anywhere;
}

.card-meta,
.card-actions,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.card-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.card-actions {
  padding-top: 4px;
}

.tag {
  justify-content: center;
  width: max-content;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.tag-blue {
  background: var(--accent-soft);
  color: #174ea6;
}

.tag-red {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag-green {
  background: var(--success-soft);
  color: var(--success);
}

.tag-gray {
  background: #eef2f6;
  color: #536170;
}

.empty-state {
  padding: 28px;
}

.empty-state h2 {
  font-size: 1.18rem;
}

.empty-state p {
  margin-top: 8px;
  color: var(--muted);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #e2e9f0;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.source-cell {
  gap: 8px;
  font-weight: 780;
}

.digest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.metric-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.metric-value {
  margin-top: 8px;
  font-size: 1.45rem;
  font-weight: 880;
  line-height: 1.1;
}

.muted {
  color: var(--muted);
}

@media (max-width: 900px) {
  .page-header,
  .layout,
  .digest-grid {
    grid-template-columns: 1fr;
  }

  .page-header .button {
    width: max-content;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    padding: 0 16px;
  }

  .status-pill {
    display: none;
  }

  .primary-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .page {
    padding: 26px 16px 36px;
  }

  .page-header .button,
  .card-actions .button {
    width: 100%;
  }

  .approval-card header {
    grid-template-columns: 1fr;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
