:root {
  color-scheme: light;
  --bg: #f3efe6;
  --ink: #17202a;
  --muted: #62707d;
  --panel: #fffdf9;
  --panel-border: #d9cfbd;
  --accent: #0d3b66;
  --accent-2: #b5651d;
  --success: #1d7a46;
  --danger: #a12c2c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(181, 101, 29, 0.12), transparent 28%),
    linear-gradient(135deg, #f7f2e8 0%, #ede3d0 100%);
  color: var(--ink);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.sidebar {
  padding: 32px 28px;
  background: linear-gradient(180deg, #102640 0%, #17395d 100%);
  color: #f3efe6;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.brand-subtitle,
.sidebar-copy,
.section-heading p,
.topbar p,
.eyebrow {
  color: rgba(243, 239, 230, 0.76);
}

.sidebar-copy {
  margin-top: 32px;
  line-height: 1.6;
}

.content {
  padding: 32px;
}

.panel {
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: 0 18px 60px rgba(28, 33, 41, 0.08);
}

.auth-panel {
  max-width: 420px;
  padding: 28px;
}

.topbar {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
}

.topbar h1,
.auth-panel h1,
.section-heading h2 {
  margin: 0 0 8px;
  font-family: "IBM Plex Serif", Georgia, serif;
}

.app {
  display: grid;
  gap: 20px;
}

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

.lower-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
}

.wide {
  min-width: 0;
}

.section-heading,
.stacked-form,
#accounts-table,
#rules-table,
#listings-table,
#runs-table,
.run-details {
  padding: 0 24px 24px;
}

.section-heading {
  padding-top: 24px;
}

.stacked-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid #cabfae;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid rgba(13, 59, 102, 0.18);
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, #1e5d91 100%);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

button.ghost {
  background: transparent;
  border: 1px solid #c8b99f;
  color: var(--ink);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.split {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox input {
  width: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #ece1d3;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.notice,
.error {
  padding: 14px 16px;
  border-radius: 14px;
}

.notice {
  background: rgba(29, 122, 70, 0.11);
  color: var(--success);
}

.error {
  background: rgba(161, 44, 44, 0.11);
  color: var(--danger);
}

.hidden {
  display: none;
}

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

.run-details pre {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.84rem;
  background: #fcf8f2;
  border: 1px solid #ece1d3;
  border-radius: 14px;
  padding: 14px;
}

@media (max-width: 1120px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 18px;
  }
}
