:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #687068;
  --paper: #f3f0e8;
  --panel: #fffdf8;
  --line: #d9d5c9;
  --green: #77dd2c;
  --green-dark: #315c18;
  --navy: #19334a;
  --danger: #aa3c2d;
  --shadow: 0 20px 60px rgba(40, 48, 42, .12);
  font-family: "Avenir Next", "DIN Alternate", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 12% 10%, #e4edd6 0, transparent 32%), var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(460px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,253,248,.94); box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 8px; color: var(--green-dark); font-size: 12px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; }
.login-card h1 { margin: 0; font-size: clamp(34px, 8vw, 58px); line-height: .92; letter-spacing: -.04em; }
.login-card p { color: var(--muted); line-height: 1.6; }
.field { display: grid; gap: 7px; margin-top: 18px; }
.field span { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
input, select, textarea { width: 100%; border: 1px solid #bdb8aa; border-radius: 13px; background: #fff; color: var(--ink); padding: 12px 14px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green-dark); box-shadow: 0 0 0 3px rgba(119,221,44,.18); }
.primary { border: 0; border-radius: 13px; background: var(--ink); color: var(--green); font-weight: 800; padding: 13px 18px; }
.secondary { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font-weight: 700; padding: 10px 14px; }
.login-card .primary { width: 100%; margin-top: 24px; }
.error { color: var(--danger)!important; font-weight: 700; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; background: var(--ink); color: #fff; }
.brand { padding: 0 10px 28px; border-bottom: 1px solid rgba(255,255,255,.16); }
.brand strong { display: block; font-size: 25px; letter-spacing: .16em; }
.brand span { color: #aeb9ae; font-size: 11px; letter-spacing: .16em; }
.nav { display: grid; gap: 6px; margin-top: 26px; }
.nav button { width: 100%; border: 0; border-radius: 12px; background: transparent; color: #aeb9ae; padding: 12px 14px; text-align: left; font-weight: 700; }
.nav button:hover, .nav button.is-active { background: rgba(119,221,44,.12); color: var(--green); }
.sidebar-footer { position: absolute; left: 20px; right: 20px; bottom: 24px; color: #9da79f; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.workspace { min-width: 0; padding: 34px clamp(24px, 5vw, 72px) 70px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.topbar h1 { margin: 0; font-size: clamp(34px, 5vw, 62px); letter-spacing: -.045em; line-height: 1; }
.topbar p { margin: 9px 0 0; color: var(--muted); }
.topbar-actions { display: flex; gap: 10px; }
.topbar-actions { flex-wrap: wrap; justify-content: flex-end; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric, .panel { border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.9); box-shadow: 0 8px 28px rgba(35,43,37,.06); }
.metric { min-height: 148px; padding: 20px; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.metric strong { display: block; margin-top: 20px; font-family: "DIN Alternate", monospace; font-size: 44px; }
.metric small { color: var(--green-dark); }
.grid-two { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; margin-top: 18px; }
.panel { padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 21px; }
.status-list { display: grid; gap: 10px; }
.status-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.status-row:last-child { border-bottom: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #aaa; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 5px rgba(119,221,44,.14); }
.dot.bad { background: #e07259; }
.status-row small { color: var(--muted); }
.release-card { padding: 20px; border-radius: 16px; background: linear-gradient(135deg, #e8f7d8, #fffdf8); border: 1px solid #c9dfb5; }
.release-card strong { display: block; font-family: "DIN Alternate", monospace; font-size: 34px; }
.release-card p { color: var(--muted); line-height: 1.5; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.toolbar input { max-width: 320px; }
.toolbar select { width: auto; min-width: 160px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
td { font-size: 14px; }
.clickable-row { cursor: pointer; transition: background .16s ease; }
.clickable-row:hover, .clickable-row:focus-visible { background: #f0f8e7; outline: none; }
.tag { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 999px; background: #e9eddf; color: #405440; font-size: 12px; font-weight: 800; }
.tag.published, .tag.activated { background: #dff6c9; color: var(--green-dark); }
.tag.review { background: #fff0c9; color: #795d08; }
.tag.approved { background: #dbeaf5; color: var(--navy); }
.tag.archived { background: #e4e4e1; color: #5f645f; }
.tag.rma { background: #f7ddd7; color: var(--danger); }
.empty { padding: 48px 20px; color: var(--muted); text-align: center; }

.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(19,27,22,.48); backdrop-filter: blur(8px); z-index: 20; }
.modal { width: min(620px, 100%); max-height: 88vh; overflow: auto; padding: 28px; border-radius: 22px; background: var(--panel); box-shadow: var(--shadow); }
.modal-wide { width: min(760px, 100%); }
.modal h2 { margin: 0; font-size: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
textarea { min-height: 110px; resize: vertical; }
.notice { padding: 14px 16px; border: 1px solid #c9dfb5; border-radius: 13px; background: #f0f8e7; color: var(--green-dark); }
.timeline { display: grid; gap: 12px; }
.timeline article { padding: 14px 0 14px 20px; border-left: 2px solid var(--line); }
.timeline strong { display: block; }
.timeline small { color: var(--muted); }
.batch-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.batch-strip article { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,253,248,.9); }
.batch-strip span, .batch-strip small { display: block; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.batch-strip span { font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.batch-strip strong { display: block; margin: 8px 0 4px; font: 800 28px "DIN Alternate", monospace; }
.history { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.history h3 { margin: 0 0 10px; }
.history article { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.history article strong, .history article small { display: block; }
.history article small { margin-top: 3px; color: var(--muted); }
.upload-zone { display: grid; place-items: center; gap: 7px; min-height: 150px; margin-top: 20px; padding: 24px; border: 1px dashed #9eaa94; border-radius: 16px; background: #f0f8e7; text-align: center; cursor: pointer; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-zone span, .import-preview { color: var(--muted); font-size: 13px; }
.import-preview { margin-top: 12px; padding: 12px; border-radius: 12px; background: #eeece5; }
.text-button { border: 0; background: transparent; color: var(--green-dark); font-weight: 800; padding: 12px 0; }
.workflow-strip { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
.workflow-strip i { width: 26px; height: 1px; flex: 0 0 26px; background: #a7b49d; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 82px 1fr; }
  .sidebar { padding-inline: 12px; }
  .brand strong { font-size: 16px; }
  .brand span, .nav button span, .sidebar-footer { display: none; }
  .nav button { text-align: center; padding-inline: 4px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .grid-two { grid-template-columns: 1fr; }
  .batch-strip { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .shell { display: block; }
  .sidebar { position: fixed; inset: auto 0 0 0; z-index: 10; width: auto; height: 70px; padding: 8px; }
  .brand, .sidebar-footer { display: none; }
  .nav { grid-template-columns: repeat(6, 1fr); gap: 2px; margin: 0; }
  .nav button { padding: 8px 2px; font-size: 11px; }
  .workspace { padding: 24px 16px 92px; }
  .topbar { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .topbar h1 { font-size: 38px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { min-height: 120px; padding: 15px; }
  .metric strong { font-size: 34px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .batch-strip { grid-template-columns: 1fr; }
}
