﻿:root {
  --bg: #f4f7ef;
  --ink: #0f1f1b;
  --card: #ffffff;
  --line: #d8e1d6;
  --accent: #1d6f5c;
  --accent2: #ff8a3d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 0 0, #ddeac8 0, transparent 35%),
    radial-gradient(circle at 100% 0, #e7d9c7 0, transparent 25%),
    var(--bg);
}
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #13231f, #1d352f);
  color: #e8f2ef;
  padding: 20px;
}
.brand {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 1px;
}
.sidebar nav { display: grid; gap: 6px; }
.sidebar a {
  color: #e8f2ef;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 8px;
}
.nav-group { display: grid; gap: 4px; }
.nav-group > summary {
  list-style: none;
}
.nav-group > summary::-webkit-details-marker {
  display: none;
}
.nav-toggle {
  width: 100%;
  text-align: left;
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  color: #e8f2ef;
  background: transparent;
  cursor: pointer;
}
.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(255,255,255,0.12);
}
.submenu {
  display: grid;
  margin-left: 10px;
  border-left: 1px solid rgba(232, 242, 239, 0.22);
  padding-left: 8px;
}
.nav-group:not([open]) .submenu { display: none; }
.submenu.open { gap: 4px; }
.submenu a {
  font-size: 13px;
  opacity: 0.95;
}
.sidebar a:hover { background: rgba(255,255,255,0.12); }
.content { padding: 26px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.topbar h1 { margin: 0; font-size: 30px; }
.meta { text-align: right; }
.meta small { color: #5e6f6a; }
.panel, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 10px 22px rgba(24, 43, 35, 0.05);
}
.grid.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.card h3 { margin: 0 0 8px; color: #4f6a62; font-size: 14px; }
.card p { margin: 0; font-size: 24px; font-weight: 700; }
h2 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 12px; }
.form-grid.three { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-grid.four { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
input, select, button {
  border: 1px solid #c7d3c8;
  border-radius: 8px;
  padding: 9px 10px;
  font-family: inherit;
}
button {
  background: linear-gradient(90deg, var(--accent), #2d9e83);
  color: white;
  border: 0;
  font-weight: 600;
  cursor: pointer;
}
button.remove-line {
  background: #ffe1d1;
  color: #7d2a00;
}
.alert {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid;
}
.alert.success { background: #e5f8ef; border-color: #9fdfbf; }
.alert.danger { background: #ffecec; border-color: #efb7b7; }
.status-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.wf-draft { background: #e8ece9; color: #31443e; }
.wf-pending { background: #ffe7b8; color: #6b4b00; }
.wf-checked { background: #d8f0dd; color: #1a5b2d; }
.wf-noted { background: #dce9ff; color: #1c3f74; }
.wf-rejected { background: #ffd7d7; color: #7a1b1b; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.login-card {
  width: min(92vw, 460px);
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.08);
}
.login-card h1 { margin-top: 0; }
.login-card p { margin-top: 0; color: #5b6f68; }
.login-card form { display: grid; gap: 8px; }

.prod-page .panel {
  background: transparent;
  box-shadow: none;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
}
.prod-page .panel h2 {
  margin: 0 0 8px;
  font-size: 19px;
}
.prod-page .form-grid {
  gap: 6px;
  margin-bottom: 8px;
}
.prod-page .form-grid.three {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.prod-page input,
.prod-page select,
.prod-page button {
  padding: 7px 9px;
  min-height: 34px;
  font-size: 13px;
}
.prod-page table th,
.prod-page table td {
  padding: 7px 6px;
  font-size: 13px;
}
.prod-page table th {
  background: transparent;
}
.prod-page .status-pill {
  font-size: 11px;
  padding: 3px 7px;
}
.prod-page td form {
  display: inline-flex;
  margin-right: 4px;
}
.prod-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.prod-recent-list {
  display: grid;
  gap: 6px;
  max-height: 580px;
  overflow: auto;
}
.prod-recent-item {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  text-decoration: none;
  color: inherit;
  background: transparent;
}
.prod-recent-item:hover {
  background: rgba(0, 0, 0, 0.04);
}
.prod-recent-item small {
  color: #4d5f59;
}
.prod-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
@media (max-width: 1200px) {
  .prod-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 20; }
  .sidebar nav { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}
