:root {
  color-scheme: light;
  --ink: #111318;
  --muted: #667085;
  --line: #d9dee8;
  --paper: #ffffff;
  --wash: #f4f6f8;
  --accent: #1f5eff;
  --accent-ink: #ffffff;
  --danger: #b42318;
  --success: #067647;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--wash);
  color: var(--ink);
}

a {
  color: inherit;
}

.topbar {
  min-height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.topbar strong {
  display: block;
  font-size: 18px;
}

.topbar span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

#sessionNav {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 22px 56px;
}

.login-panel {
  min-height: calc(100vh - 160px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 36px;
  align-items: center;
}

.login-panel h1,
.page-head h1 {
  margin: 0;
  font-size: 48px;
  line-height: 1.02;
  letter-spacing: 0;
}

.login-panel p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(16, 24, 40, .06);
}

form.card,
.article-form {
  padding: 24px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd6e2;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

input[type="file"] {
  padding: 10px 12px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  background: #d0d5dd;
  color: #475467;
}

.form-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--success);
}

.dashboard {
  display: grid;
  gap: 22px;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.date-control {
  width: 210px;
}

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

.stat {
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.workspace {
  display: grid;
  grid-template-columns: 440px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.section-head {
  padding: 22px 24px 0;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.table-wrap {
  overflow-x: auto;
  padding: 18px 24px 24px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 24px 0;
  border-bottom: 1px solid var(--line);
}

.primary-tabs {
  padding: 0;
  border-bottom: 0;
}

.primary-tabs button {
  min-height: 42px;
  padding: 0 18px;
}

.sub-tabs {
  padding-top: 14px;
}

.tabs button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.tabs button.active {
  border-color: var(--accent);
  background: #eef4ff;
  color: #1645c7;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td:last-child {
  min-width: 250px;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef4ff;
  color: #1645c7;
  font-size: 12px;
  font-weight: 800;
}

.row-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions button,
.button-row button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.row-actions a,
.button-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.button-link {
  padding: 0 12px;
}

.editor-actions {
  grid-column: 2;
}

.taxonomy-panel,
.tracker-panel {
  grid-column: 1 / -1;
}

.tracker-panel .stats-grid {
  padding: 18px 24px 24px;
}

.cost-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 18px 24px 0;
}

.cost-grid h3,
.table-wrap h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.action-body {
  padding: 18px 24px 24px;
}

.action-body p {
  color: var(--muted);
  line-height: 1.5;
}

.muted-panel {
  color: var(--muted);
  line-height: 1.55;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: 10px;
  margin-bottom: 8px;
}

.inline-form input,
.inline-form select {
  margin: 0;
}

.compact {
  padding: 12px 0 0;
}

.table-input,
.table-select {
  min-height: 34px;
  padding: 0 8px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .login-panel,
  .workspace,
  .stats-grid,
  .cost-grid {
    grid-template-columns: 1fr;
  }

  .login-panel h1,
  .page-head h1 {
    font-size: 36px;
  }

  .page-head {
    align-items: start;
    flex-direction: column;
  }
}
