@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap');

:root {
  color-scheme: light;
  --paper: #f8f4e6;
  --ink: #11110f;
  --muted: #625d52;
  --orange: #e2472f;
  --yellow: #ffd83d;
  --blue: #315cff;
  --green: #28a67a;
  --line: rgba(17, 17, 15, .14);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
}

* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 30% 20%, rgba(226, 71, 47, .08), transparent 352px),
    linear-gradient(90deg, rgba(17,17,15,.04) 1px, transparent 1px),
    linear-gradient(rgba(17,17,15,.035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 28px 28px, 28px 28px, auto;
  font-size: 15px;
}
button, input { font: inherit; }
h1, h2, strong { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
p { line-height: 1.5; }

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  color: var(--paper);
  background: var(--ink);
  border-bottom: 2px solid var(--ink);
}
.identity,.header-actions,.status-line,.controls,.dialog-head,.dialog-actions,.log-toolbar {
  display: flex;
  align-items: center;
}
.identity { gap: 13px; }
.identity strong,.identity span { display: block; }
.identity strong { font-size: 17px; font-weight: 900; letter-spacing: -.03em; text-transform: uppercase; }
.identity span { margin-top: 2px; color: rgba(248,244,230,.66); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--orange);
  font-size: 14px;
  font-weight: 900;
  transform: rotate(-3deg);
}
.brand-mark.small { width: 45px; height: 45px; }
.header-actions { gap: 16px; }
.header-actions .muted { color: rgba(248,244,230,.66); }

main { width: min(1460px, calc(100% - 48px)); margin: 26px auto 42px; }
.status-strip {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 24px;
  background: rgba(255,255,255,.46);
  border: 2px solid var(--ink);
  box-shadow: 7px 7px 0 var(--ink);
}
h1,h2,p { margin-top: 0; }
.status-strip h1 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.055em;
  text-transform: uppercase;
}
.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 9px;
  color: var(--ink);
  background: var(--yellow);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  transform: rotate(-1deg);
}
.status-line { gap: 13px; }
.status-dot {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  background: var(--orange);
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.status-dot.running { background: var(--green); }
.muted { color: var(--muted); }
.status-strip .muted { max-width: 700px; margin: 10px 0 0; font-size: 16px; }
.controls { flex-wrap: wrap; justify-content: flex-end; gap: 11px; }

button {
  min-height: 43px;
  padding: 10px 15px;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--blue);
  font-weight: 850;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
button:hover { transform: translate(-1px,-1px); box-shadow: 6px 6px 0 var(--blue); }
button:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--blue); }
button:focus-visible,input:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
button:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: 2px 2px 0 var(--muted); }
.secondary,.quiet {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--ink);
}
.danger { color: white; background: var(--orange); box-shadow: 4px 4px 0 var(--ink); }
.quiet { min-height: 35px; padding: 7px 11px; color: var(--ink); box-shadow: 3px 3px 0 var(--orange); }

.metrics {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  gap: 12px;
  margin: 26px 0;
}
.metric {
  min-width: 0;
  padding: 17px;
  background: rgba(255,255,255,.48);
  border: 2px solid var(--ink);
}
.metric:nth-child(1) { box-shadow: 5px 5px 0 var(--yellow); }
.metric:nth-child(2) { box-shadow: 5px 5px 0 var(--green); }
.metric:nth-child(3) { box-shadow: 5px 5px 0 var(--blue); }
.metric:nth-child(4) { box-shadow: 5px 5px 0 var(--orange); }
.metric:nth-child(5) { box-shadow: 5px 5px 0 var(--ink); }
.metric span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.metric strong { display: block; margin-top: 7px; font-size: 32px; font-weight: 900; letter-spacing: -.05em; }

.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  background: var(--ink);
  border: 2px solid var(--ink);
}
.tab {
  min-height: 48px;
  padding: 11px 18px;
  white-space: nowrap;
  color: rgba(248,244,230,.7);
  background: var(--ink);
  border: 0;
  border-right: 1px solid rgba(248,244,230,.24);
  box-shadow: none;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .05em;
}
.tab:hover { box-shadow: none; transform: none; color: white; }
.tab.active { color: var(--ink); background: var(--yellow); }
.workspace {
  min-height: 430px;
  background: rgba(255,255,255,.46);
  border: 2px solid var(--ink);
  border-top: 0;
  box-shadow: 7px 7px 0 var(--ink);
}
.panel { display: none; }
.panel.active { display: block; }
.table-wrap { overflow: auto; padding: 8px 18px 22px; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 17px 12px 12px;
  color: var(--ink);
  border-bottom: 3px solid var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .07em;
  text-align: left;
  text-transform: uppercase;
}
td { padding: 16px 12px; border-bottom: 1px solid rgba(17,17,15,.22); vertical-align: top; }
tbody tr:hover { background: rgba(255,216,61,.18); }
.track-title { font-size: 15px; font-weight: 850; letter-spacing: -.025em; }
.track-meta { margin-top: 5px; color: var(--muted); font-size: 12px; }
.badge {
  display: inline-block;
  max-width: 330px;
  padding: 5px 8px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  font-size: 11px;
  font-weight: 700;
}
.row-actions { white-space: nowrap; }
.row-actions button { min-height: 33px; margin-right: 6px; padding: 5px 9px; box-shadow: 3px 3px 0 var(--blue); font-size: 11px; }
.empty { padding: 70px 20px; color: var(--muted); text-align: center; }

.log-toolbar { justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 2px solid var(--ink); }
.log-toolbar input { width: min(440px,56%); }
input {
  padding: 11px 13px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 0;
  outline: none;
}
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.check input { accent-color: var(--orange); }
pre {
  height: 540px;
  margin: 18px;
  padding: 18px;
  overflow: auto;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--orange);
  font: 12px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace;
  white-space: pre-wrap;
}
.activity-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; padding:18px; }
.activity-grid h2 { margin:0 0 12px; font-size:22px; font-weight:900; text-transform:uppercase; }
.activity-list { display:grid; gap:10px; }
.activity-item { padding:13px; background:rgba(255,255,255,.46); border:2px solid var(--ink); }
.activity-item div { display:flex; justify-content:space-between; gap:10px; align-items:center; }
.activity-item p { margin:7px 0; color:var(--muted); }
.activity-item small { color:var(--muted); font-size:11px; }
.command-status { padding:3px 6px; border:1px solid var(--ink); font-size:10px; font-weight:900; text-transform:uppercase; }
.command-status.pending { background:var(--yellow); }
.command-status.processing { color:white; background:var(--blue); }
.command-status.done { color:white; background:var(--green); }
.command-status.failed { color:white; background:var(--orange); }

dialog {
  width: min(540px,calc(100% - 32px));
  padding: 23px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: 8px 8px 0 var(--ink);
}
dialog::backdrop { background: rgba(17,17,15,.55); }
.dialog-head { justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 13px; }
.dialog-head h2 { margin: 0; font-size: 25px; font-weight: 900; letter-spacing: -.04em; text-transform: uppercase; }
.icon { min-height: 34px; padding: 1px 9px; color: var(--ink); background: var(--paper); box-shadow: 3px 3px 0 var(--orange); font-size: 22px; }
#edit-form label { display: grid; gap: 6px; margin-top: 14px; color: var(--ink); font-size: 12px; font-weight: 800; text-transform: uppercase; }
#edit-form input { width: 100%; }
.dialog-actions { justify-content: flex-end; gap: 10px; margin-top: 22px; }
#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  padding: 12px 16px;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--orange);
  font-weight: 800;
  transform: translateY(100px);
  transition: transform 180ms ease;
}
#toast.show { transform: none; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-shell {
  width: min(470px,100%);
  padding: 28px;
  background: rgba(255,255,255,.5);
  border: 2px solid var(--ink);
  box-shadow: 9px 9px 0 var(--ink);
}
.login-shell .brand-mark { margin-bottom: 20px; }
.login-shell h1 { margin: 12px 0 8px; font-size: 42px; font-weight: 900; line-height: .98; letter-spacing: -.055em; text-transform: uppercase; }
.login-shell > .muted { margin-bottom: 0; font-size: 16px; }
.google-button { width: 100%; margin-top: 24px; }
.login-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  padding: 12px 16px;
  color: white;
  background: var(--orange);
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  font-weight: 800;
  transform: translate(-50%,100px);
  transition: transform 180ms ease;
}
.login-toast.show { transform: translate(-50%,0); }

@media(max-width:900px) {
  .topbar { padding: 12px 16px; }
  .header-actions #updated { display:none; }
  main { width:min(100% - 28px,1460px); margin-top:18px; }
  .status-strip { align-items:flex-start; flex-direction:column; padding:20px; box-shadow:5px 5px 0 var(--ink); }
  .controls { width:100%; display:grid; grid-template-columns:1fr 1fr; }
  .controls button:last-child { grid-column:1/-1; }
  .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .metric:last-child { grid-column:1/-1; }
  .row-actions button { display:block; width:100%; margin:0 0 7px; }
  .hide-mobile { display:none; }
  .activity-grid { grid-template-columns:1fr; }
}
@media(max-width:520px) {
  .topbar { min-height:68px; }
  .identity strong { font-size:14px; }
  .brand-mark.small { width:40px; height:40px; }
  .status-strip h1 { font-size:2.25rem; }
  .metrics { gap:9px; }
  .metric { padding:14px; }
  .metric strong { font-size:27px; }
  .log-toolbar { align-items:stretch; flex-direction:column; }
  .log-toolbar input { width:100%; }
  pre { height:470px; margin:12px; }
  .login-shell { padding:22px; box-shadow:6px 6px 0 var(--ink); }
  .login-shell h1 { font-size:35px; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { transition:none!important; }
}
