:root {
  --bg: #08111f;
  --panel: #111d2f;
  --panel-2: #17263d;
  --text: #eef5ff;
  --muted: #9fb0c7;
  --line: rgba(255,255,255,.12);
  --brand: #4ade80;
  --brand-2: #22c55e;
  --danger: #ef4444;
  --shadow: 0 24px 80px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(74,222,128,.18), transparent 28%),
    radial-gradient(circle at 90% 8%, rgba(96,165,250,.16), transparent 26%),
    linear-gradient(135deg, #07101f 0%, #091426 52%, #050914 100%);
  min-height: 100vh;
}

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 9, 20, .82);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 46px rgba(0,0,0,.22);
}

.header-inner {
  width: min(1220px, calc(100% - 32px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand, .main-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  text-decoration: none;
  min-width: 260px;
}

.brand-logo-wrap {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(74,222,128,.32);
  background: rgba(255,255,255,.06);
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 1.18rem;
  font-weight: 950;
  letter-spacing: -.02em;
}

.brand-copy small {
  color: var(--muted);
  font-weight: 750;
  font-size: .8rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #06120a;
  background: var(--brand);
}

.main-nav {
  justify-content: flex-end;
}

.main-nav a, nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 750;
}

.main-nav a:hover, .footer-col a:hover {
  color: var(--brand);
}

.nav-pill, .company-pill, .count-pill, .role-chip {
  color: var(--bg);
  background: var(--brand);
  padding: 9px 13px;
  border-radius: 999px;
  font-weight: 850;
}

.ghost-pill {
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1px solid var(--line);
}

.company-pill {
  background: rgba(74, 222, 128, .14);
  color: var(--brand);
  border: 1px solid rgba(74,222,128,.28);
}

.count-pill {
  background: #dbeafe;
  color: #08203f;
}

.role-chip {
  display: inline-flex;
  margin-top: 5px;
  background: rgba(255,255,255,.09);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: .72rem;
  padding: 4px 8px;
}

.page {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 60px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 28px;
  align-items: stretch;
  padding-top: 48px;
}

.hero-copy, .card, .customer-card, .shopping-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(23,38,61,.94), rgba(17,29,47,.94));
  box-shadow: var(--shadow);
  border-radius: 28px;
}

.hero-copy { padding: 54px; }

.hero-card {
  padding: 34px;
  border-radius: 28px;
  background: rgba(74, 222, 128, .11);
  border: 1px solid rgba(74, 222, 128, .28);
}

h1 {
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  line-height: .95;
  margin: 8px 0 18px;
}

h2 { margin: 0 0 14px; }

h3 {
  margin: 0;
  font-size: 1.1rem;
}

.eyebrow {
  color: var(--brand);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: .75rem;
  margin: 0 0 8px;
}

.hero-text, .muted, .helper { color: var(--muted); }

.hero-text {
  font-size: 1.18rem;
  max-width: 720px;
}

.hero-actions, .inline-form, .filters, .dash-head, .section-head, .order-actions, .search-header, .search-row, .mini-head, .form-footer {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.button {
  appearance: none;
  border: 0;
  background: var(--brand);
  color: #06120a;
  padding: 12px 18px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button.secondary {
  background: #dbeafe;
  color: #08203f;
}

.button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.button.danger {
  background: var(--danger);
  color: white;
}

.button.small {
  padding: 10px 12px;
  border-radius: 12px;
  white-space: nowrap;
}

.check-list {
  padding-left: 20px;
  color: var(--text);
  line-height: 1.9;
}

.auth-shell {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
}

.form-card {
  width: min(520px, 100%);
  padding: 30px;
}

.card {
  padding: 24px;
  margin-bottom: 20px;
}

.flash-wrap { margin-bottom: 18px; }

.flash {
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 10px;
  background: rgba(255,255,255,.12);
}

.flash.success { border: 1px solid rgba(74,222,128,.45); }
.flash.error { border: 1px solid rgba(239,68,68,.55); }

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 750;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(5, 9, 20, .62);
  color: var(--text);
  padding: 12px 13px;
  font: inherit;
  outline: none;
}

textarea { resize: vertical; }

input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(74,222,128,.13);
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.grid-form .wide { grid-column: 1 / -1; }

.grid-form.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hidden { display: none !important; }

.dash-head {
  justify-content: space-between;
  margin-bottom: 22px;
}

.dash-head h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.admin-panel {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 18px;
  margin-bottom: 20px;
}

.company-card, .search-card, .user-card {
  box-shadow: none;
}

.mini-head, .search-header {
  justify-content: space-between;
  margin-bottom: 14px;
}

.user-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(5,9,20,.32);
}

.user-row strong, .user-row span {
  display: block;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(170px, auto) auto;
}

.customer-list {
  display: grid;
  gap: 18px;
}

.customer-card {
  padding: 0;
  overflow: hidden;
}

.customer-toggle {
  width: 100%;
  border: 0;
  color: inherit;
  background: transparent;
  padding: 22px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  text-align: left;
}

.customer-toggle:hover {
  background: rgba(255,255,255,.04);
}

.customer-toggle h2 {
  font-size: 1.55rem;
  margin: 0 0 5px;
}

.summary-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.summary-pills span {
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: .85rem;
  font-weight: 800;
}

.toggle-indicator {
  color: var(--brand);
  font-weight: 900;
  min-width: 76px;
  text-align: right;
}

.customer-body {
  padding: 0 22px 22px;
  display: block;
}

.customer-card.collapsed .customer-body {
  display: none;
}

.save-customer {
  margin-top: 14px;
}

.form-footer {
  justify-content: space-between;
}

.notes textarea {
  background: rgba(74,222,128,.08);
  border-color: rgba(74,222,128,.25);
}

.shopping-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.shopping-card {
  padding: 16px;
  box-shadow: none;
  border-radius: 18px;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.item-row {
  display: grid;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.item-row-filter {
  grid-template-columns: minmax(64px, 1fr) auto minmax(64px, 1fr) auto minmax(64px, 1fr) minmax(72px, .8fr) auto;
}

.item-row-type {
  grid-template-columns: minmax(200px, 1fr) minmax(72px, .35fr) auto;
}

.add-row {
  padding: 10px;
  border: 1px dashed rgba(74,222,128,.35);
  border-radius: 16px;
  background: rgba(74,222,128,.06);
}

.saved-item {
  padding: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(5,9,20,.26);
  margin-bottom: 10px;
}

.times {
  color: var(--muted);
  font-weight: 900;
}

.item-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}

.link-danger {
  background: transparent;
  border: 0;
  color: #fecaca;
  padding: 8px 0 0;
  cursor: pointer;
  text-decoration: underline;
}

.order-actions {
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.empty {
  text-align: center;
  color: var(--muted);
}

.empty-small {
  margin: 8px 0 0;
  font-size: .95rem;
}

.small-text {
  font-size: .82rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(5, 9, 20, .76);
  margin-top: 30px;
}

.footer-inner {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(150px, .7fr));
  gap: 28px;
}

.footer-logo {
  width: 86px;
  max-height: 62px;
  object-fit: contain;
  margin-bottom: 12px;
}

.footer-brand h2 {
  margin: 0 0 8px;
}

.footer-brand p {
  color: var(--muted);
  max-width: 430px;
  line-height: 1.65;
  margin: 0;
}

.footer-col {
  display: grid;
  gap: 10px;
  align-content: start;
}

.footer-col h3 {
  color: var(--brand);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.footer-col a, .footer-col span {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.footer-bottom {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .88rem;
}

@media (max-width: 900px) {
  .header-inner { padding: 12px 0; min-height: 72px; align-items: flex-start; flex-direction: column; }
  .main-nav { justify-content: flex-start; }
  .brand { min-width: 0; }
  .hero { grid-template-columns: 1fr; padding-top: 10px; }
  .hero-copy { padding: 30px; }
  .grid-form, .grid-form.compact, .search-row, .admin-panel, .user-row, .footer-inner { grid-template-columns: 1fr; }
  .customer-toggle { flex-direction: column; }
  .summary-pills { justify-content: flex-start; }
  .item-row-filter, .item-row-type {
    grid-template-columns: 1fr;
  }
  .times {
    display: none;
  }
}
