:root {
  color-scheme: light;
  --ink: #17252d;
  --muted: #66777e;
  --paper: #ffffff;
  --soft: #f4f7f6;
  --line: #d8e1e2;
  --nav: #192a33;
  --teal: #2d766e;
  --teal-dark: #205b55;
  --teal-soft: #e3f0ed;
  --danger: #a7433f;
  --shadow: 0 24px 70px rgba(24, 44, 53, 0.15);
  font-family: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: #e8edef; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #6bb9af; outline-offset: 3px; }
h2[tabindex="-1"]:focus { outline: 3px solid #6bb9af; outline-offset: 5px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 20; left: 1rem; top: -5rem; padding: 0.75rem 1rem; color: white; background: var(--nav); }
.skip-link:focus { top: 1rem; }
.app-shell { min-height: 100vh; }
.state-card { width: min(620px, calc(100% - 2rem)); margin: 12vh auto; padding: clamp(2rem, 6vw, 4rem); background: var(--paper); border-left: 6px solid var(--teal); box-shadow: var(--shadow); }
.state-card h1 { margin: 0.2rem 0 1rem; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; }
.state-card p { color: var(--muted); font-size: 1.05rem; }
.error-card { border-left-color: var(--danger); }
.eyebrow { margin: 0 0 0.4rem; color: var(--teal); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.technical-note { font-family: ui-monospace, monospace; font-size: 0.82rem !important; }

.primary-button, .secondary-button, .text-button { border: 0; min-height: 44px; padding: 0.72rem 1.1rem; font-weight: 700; }
.primary-button { color: white; background: var(--teal); }
.primary-button:hover { background: var(--teal-dark); }
.secondary-button { color: var(--ink); background: var(--teal-soft); }
.text-button { padding-inline: 0; color: #b9cccf; background: transparent; text-align: left; }
button:disabled { cursor: wait; opacity: 0.6; }

.workspace { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { min-height: 100vh; display: flex; flex-direction: column; color: #c7d4d5; background: var(--nav); }
.brand { display: flex; gap: 0.8rem; align-items: center; padding: 1.25rem; border-bottom: 1px solid #ffffff16; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: var(--teal); font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { color: white; }
.brand small { color: #8fa4a8; }
.navigation { display: grid; gap: 0.2rem; padding: 1.2rem 0.7rem; }
.nav-button { min-height: 44px; padding: 0.7rem 0.9rem; color: #bdcacc; background: transparent; border: 0; border-left: 3px solid transparent; text-align: left; }
.nav-button.is-active { color: white; background: #2d766e44; border-left-color: #69b8ad; }
.user-card { margin-top: auto; display: grid; gap: 0.25rem; padding: 1.1rem 1.25rem; background: #122129; }
.user-card span { color: white; font-weight: 700; }
.user-card small { color: #8fa4a8; }

.main-column { min-width: 0; }
.topbar { min-height: 82px; display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem 1.5rem; background: white; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 1.5rem; }
.status-pill { margin: 0; padding: 0.45rem 0.7rem; color: var(--teal-dark); background: var(--teal-soft); font-size: 0.82rem; }
.content { padding: clamp(1rem, 3vw, 2rem); }
.view { max-width: 1180px; margin: 0 auto; }
.section-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.section-heading h2 { margin: 0; font-size: 1.7rem; }
.section-heading > p { color: var(--muted); }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); box-shadow: 0 12px 35px rgba(24, 44, 53, 0.08); }
table { width: 100%; border-collapse: collapse; }
caption { padding: 1rem; color: var(--muted); text-align: left; }
th, td { padding: 0.8rem 0.9rem; border-top: 1px solid #e9eeee; text-align: left; }
th { color: var(--muted); background: #f7f9f8; font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.empty-state { margin: 0; padding: 2rem; color: var(--muted); text-align: center; }

.operation-form { max-width: 760px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding: 1.4rem; background: white; border: 1px solid var(--line); box-shadow: 0 12px 35px rgba(24, 44, 53, 0.08); }
.operation-form label { display: grid; gap: 0.4rem; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.operation-form select, .operation-form input { width: 100%; min-height: 44px; padding: 0.65rem 0.75rem; color: var(--ink); background: white; border: 1px solid #bfcdd0; }
.form-note { grid-column: 1 / -1; margin: 0; padding: 0.9rem; color: #66541f; background: #f7edd1; }
.operation-form button { justify-self: start; }

@media (max-width: 760px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
  .navigation { grid-template-columns: repeat(3, 1fr); }
  .user-card { display: flex; align-items: center; gap: 0.8rem; }
  .topbar, .section-heading { align-items: flex-start; flex-direction: column; }
  .operation-form { grid-template-columns: 1fr; }
}
