:root {
  --bg: #f6f4ef;
  --panel: #fffdf8;
  --panel-2: #fdfaf4;
  --ink: #20201d;
  --muted: #6c6a62;
  --line: #e4ded2;
  --line-strong: #d1c7b7;
  --accent: #285d58;
  --accent-2: #e9f1ee;
  --warn: #bb4b38;
  --warn-bg: #fbebe7;
  --ok: #2f6f4e;
  --ok-bg: #e9f3eb;
  --blue-bg: #eaf1f8;
  --shadow: 0 14px 40px rgba(42, 35, 25, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a { color: inherit; }

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 22px 56px;
}

.topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand-mark {
  font-weight: 760;
  letter-spacing: .01em;
  color: var(--accent);
  font-size: 18px;
}
.role-label { color: var(--muted); font-size: 14px; }

.top-actions { display: flex; align-items: center; gap: 12px; }
.help { color: var(--muted); font-size: 13px; white-space: nowrap; }
.language {
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--panel);
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
}
.language strong { color: var(--ink); }
.language a { text-decoration: none; color: inherit; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, .8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.hero-card, .summary-card, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card { padding: 28px; position: relative; overflow: hidden; }
.hero-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 7px;
  background: linear-gradient(var(--accent), #79a39b);
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 720;
  margin-bottom: 8px;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  margin: 0 0 12px;
  letter-spacing: -.035em;
}
h2 { margin: 0; font-size: 20px; letter-spacing: -.015em; }
h3 { margin: 0 0 10px; font-size: 15px; }
p { margin: 0; }

.lead { font-size: 17px; color: #393731; max-width: 760px; }

.meta-strip { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.meta-chip {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}
.meta-chip strong { color: var(--ink); }

.summary-card { padding: 18px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.summary-item {
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.summary-label { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.summary-value { font-weight: 740; }

.main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }

.card { padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.section-kicker { font-size: 13px; color: var(--muted); margin-top: 4px; }

.action-banner {
  display: grid;
  gap: 10px;
  background: var(--accent-2);
  border: 1px solid #cfded8;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
.action-banner .topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 720;
  padding: 6px 9px;
  line-height: 1;
  white-space: nowrap;
}
.badge.required { background: #fff6dc; border: 1px solid #ebd690; color: #765a04; }
.badge.secure { background: var(--blue-bg); border: 1px solid #c9d9e8; color: #264b69; }
.badge.done { background: var(--ok-bg); border: 1px solid #c6dec9; color: var(--ok); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 650; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
}
textarea { min-height: 92px; resize: vertical; }
.full { grid-column: 1 / -1; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 740;
  padding: 11px 14px;
  background: var(--accent);
  color: #fff;
  min-height: 42px;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-weight: 740;
}
.btn.secondary { background: #fff; color: var(--accent); border-color: #a9c4be; }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); }

.product-table { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; }
.product-header, .product-row {
  display: grid;
  grid-template-columns: 78px minmax(190px, 1.45fr) minmax(170px, 1fr) 110px 105px minmax(150px, 1fr);
  gap: 12px;
  align-items: center;
}
.product-header {
  background: var(--panel-2);
  padding: 10px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.product-row { padding: 12px 14px; border-top: 1px solid var(--line); }
.product-media { width: 68px; height: 62px; border-radius: 12px; overflow: hidden; background: #f3f1ec; border: 1px solid var(--line); }
.product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-title { font-weight: 800; letter-spacing: .02em; }

.small { font-size: 12px; }
.muted { color: var(--muted); }
.strong { font-weight: 740; }

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 730;
  border: 1px solid var(--line);
  line-height: 1.1;
}
.pill.alert { background: var(--warn-bg); border-color: #f0bdb3; color: var(--warn); }
.pill.ok { background: var(--ok-bg); border-color: #c8ddcb; color: var(--ok); }
.pill.neutral { background: var(--blue-bg); border-color: #c9d9e8; color: #32556d; }

.doc-list { display: grid; gap: 10px; }
.doc-slot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px;
}
.doc-name { font-weight: 760; }
.doc-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }

.dropzone {
  margin-top: 14px;
  border: 1.5px dashed #b8afa0;
  border-radius: 16px;
  background: #fff;
  padding: 22px;
  text-align: center;
}
.dropzone-title { font-weight: 800; margin-bottom: 4px; }
.dropzone label { justify-self: center; text-align: left; margin-top: 12px; max-width: 360px; }

.timeline { display: grid; gap: 14px; margin-top: 8px; }
.timeline-step { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-2);
  border: 1px solid #cdded8;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}
.dot.pending { background: #fff; border-color: var(--line-strong); color: var(--muted); }
.step-title { font-weight: 760; }

.callout {
  background: #fff7e6;
  border: 1px solid #eedca9;
  border-radius: 15px;
  padding: 13px;
  font-size: 13px;
  color: #6b5627;
}

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #c6dec9;
  background: var(--ok-bg);
  color: var(--ok);
  margin-bottom: 18px;
  font-weight: 700;
}

.expired-card {
  max-width: 560px;
  margin: 60px auto 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.expired-card h1 { font-size: 28px; }

.sticky-actions { display: none; }

/* Manager skeleton */
.manager-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.manager-nav a {
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}
.section-links { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.section-links a { color: var(--accent); }

.data-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.data-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.data-table a { color: var(--accent); font-weight: 700; }

.customer-form h3 { margin-top: 20px; }
.form-grid h3 { grid-column: 1 / -1; }
label.inline { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-weight: 650; }
label.inline input { width: auto; }
.radio-row { display: flex; gap: 16px; }
.radio-row .inline { font-weight: 650; }

.field-error { color: var(--warn); font-size: 12px; font-weight: 650; }
.form-error {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #f0bdb3;
  background: var(--warn-bg);
  color: var(--warn);
  margin-bottom: 16px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .hero, .main-grid { grid-template-columns: 1fr; }
  .product-header { display: none; }
  .product-table { display: grid; gap: 10px; border: 0; background: transparent; }
  .product-row {
    grid-template-columns: 84px 1fr;
    gap: 10px 12px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 16px;
  }
  .product-media { grid-row: span 5; width: 84px; height: 84px; }
  .product-cell, .product-note { grid-column: 2; }
  .product-note { color: var(--muted); font-size: 13px; }
}

@media (max-width: 640px) {
  .page { padding: 12px 12px 92px; }
  .topbar { align-items: flex-start; }
  .brand { display: grid; gap: 2px; }
  .help { display: none; }
  .hero-card, .summary-card, .card { border-radius: 16px; padding: 16px; }
  .summary-grid, .form-grid { grid-template-columns: 1fr; }
  .action-banner .topline { align-items: flex-start; flex-direction: column; }
  .card-head { display: grid; }
  .button-row { display: none; }
  .sticky-actions {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: rgba(255,253,248,.96);
    border-top: 1px solid var(--line);
    padding: 10px 12px 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    z-index: 9;
    backdrop-filter: blur(8px);
  }
  h1 { font-size: 30px; }
  .lead { font-size: 15px; }
  .doc-slot { grid-template-columns: 1fr; }
}
