:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #172026;
  --muted: #66717d;
  --line: #d9dee5;
  --accent: #176b5b;
  --accent-dark: #0f4e43;
  --danger: #b42318;
  --soft: #eef4f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 42px rgba(20, 35, 45, 0.08);
}

h1,
h2 {
  margin: 0 0 10px;
  letter-spacing: 0;
}

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

.form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.error {
  min-height: 20px;
  color: var(--danger);
}

.text-button,
.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid transparent;
}

.secondary {
  border-color: var(--line);
  color: var(--ink);
  background: #fff;
}

.text-button:hover,
.secondary:hover {
  background: var(--soft);
  color: var(--accent-dark);
}

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

.sidebar {
  background: #20272d;
  color: #fff;
  padding: 20px 14px;
}

.brand {
  font-weight: 700;
  padding: 0 10px 18px;
}

.nav-item {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #dce2e8;
  margin: 3px 0;
}

.nav-item:hover,
.nav-item.active {
  background: #33414a;
  color: #fff;
}

.main {
  min-width: 0;
}

.topbar {
  height: 76px;
  padding: 16px 26px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  font-size: 21px;
  font-weight: 700;
}

.page-subtitle {
  margin-top: 4px;
  color: var(--muted);
}

.page {
  padding: 24px 26px;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.side-panel {
  display: grid;
  gap: 14px;
  background: #f9fbfa;
}

.queue-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.retention,
.hint {
  color: var(--muted);
  font-size: 13px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.segment {
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}

.segment.active {
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 700;
}

.style-results {
  display: grid;
  gap: 6px;
}

.style-option {
  text-align: left;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 9px 10px;
}

.style-option.selected {
  background: var(--soft);
  border-color: var(--accent);
}

.mini-list,
.table {
  display: grid;
  gap: 8px;
}

.mini-item,
.table-row,
.file-row {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px;
  display: grid;
  gap: 5px;
  background: #fff;
}

.side-panel .mini-item {
  background: #f2f6f4;
  border-color: #d5e2dc;
}

.side-panel .mini-item:hover {
  background: #e9f2ee;
  border-color: var(--accent);
  color: var(--accent-dark);
}

.table-row {
  grid-template-columns: 1.2fr 120px 145px 145px 120px;
  align-items: center;
}

.status {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  background: #edf1f5;
  color: #34404a;
  font-size: 13px;
}

.status.succeeded {
  background: #e7f5ee;
  color: #176b3f;
}

.status.failed {
  background: #fdecec;
  color: var(--danger);
}

.status.running,
.status.queued {
  background: #edf3ff;
  color: #2451a6;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.job-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin: 14px 0 20px;
}

.files {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.file-row {
  text-align: center;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  min-height: 56px;
  align-content: center;
}

.file-row:hover {
  color: var(--accent-dark);
  background: var(--soft);
  border-color: var(--accent);
}

.account-panel {
  max-width: 560px;
}

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

  .sidebar {
    display: flex;
    gap: 10px;
    align-items: center;
    overflow-x: auto;
  }

  .sidebar nav {
    display: flex;
    gap: 6px;
  }

  .nav-item {
    white-space: nowrap;
  }

  .two-column,
  .table-row,
  .files {
    grid-template-columns: 1fr;
  }
}
