:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-strong: #eef4ff;
  --line: #dfeaf7;
  --text: #0f172a;
  --muted: #5f6f8c;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 16px 40px rgba(37, 99, 235, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button {
  border: none;
  cursor: pointer;
  font: inherit;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 5vw;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
}

.brand-wrap strong {
  display: block;
}

.brand-wrap small {
  display: block;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 10px;
}

.nav-button {
  padding: 10px 18px;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--text);
  font-weight: 600;
}

.nav-button.active {
  background: var(--primary);
  color: white;
}

main {
  padding: 32px 5vw 64px;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  align-items: center;
  gap: 36px;
  min-height: 80vh;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.1;
  margin: 0 0 18px;
}

.lead {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 620px;
}

.cta-row {
  display: flex;
  gap: 12px;
  margin-top: 26px;
}

.primary, .secondary, .checkout-button, .add-button {
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
}

.primary, .checkout-button, .add-button {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

.secondary {
  background: #e2e8f0;
  color: var(--text);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.stats div {
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 16px;
}

.stats strong {
  display: block;
  font-size: 1.5rem;
}

.stats span {
  color: var(--muted);
}

.hero-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 18px;
}

.panel-header {
  display: flex;
  gap: 8px;
  padding-bottom: 18px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot.green { background: #22c55e; }
.dot.yellow { background: #fbbf24; }
.dot.red { background: #ef4444; }

.mini-card {
  border-radius: 16px;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  padding: 20px;
}

.mini-card h3 {
  margin-top: 0;
}

.mini-card ul {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--muted);
}

.manager-panel {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
}

.panel-form, .panel-list, .catalog-panel, .cart-panel {
  background: rgba(255,255,255,0.82);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.product-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-row.grouped {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.product-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
}

.product-form input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stats-strip div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.stats-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.table-wrap {
  overflow-x: auto;
}

.product-table {
  width: 100%;
  border-collapse: collapse;
}

.product-table th, .product-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}

.product-table th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.cell-actions {
  display: flex;
  gap: 8px;
}

.mini-button {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.mini-button.edit {
  background: #dbeafe;
  color: var(--primary-dark);
}

.mini-button.delete {
  background: #fee2e2;
  color: var(--danger);
}

.pos-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.catalog-panel, .cart-panel {
  background: rgba(255,255,255,0.82);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.section-title-row h2 {
  margin: 0;
}

.status-pill {
  background: #dcfce7;
  color: #166534;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

.product-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.product-badge {
  display: inline-block;
  background: #dbeafe;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.7rem;
  font-weight: 700;
}

.product-card h3 {
  margin: 14px 0 10px;
}

.product-price {
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 1.2rem;
  margin: 0 0 8px;
}

.meta {
  margin: 0 0 16px;
  color: var(--muted);
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.cart-item strong, .cart-item small {
  display: block;
}

.cart-item small {
  color: var(--muted);
}

.cart-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.remove-button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fee2e2;
  color: var(--danger);
  font-size: 1.2rem;
}

.link-button {
  background: transparent;
  color: var(--primary-dark);
  font-weight: 700;
}

.empty-state {
  color: var(--muted);
  padding: 20px 0;
}

.totals {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 16px;
}

.totals div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
}

.checkout-button {
  width: 100%;
  margin-top: 20px;
}

.toast {
  min-height: 22px;
  color: var(--success);
  font-weight: 600;
  margin: 10px 0 0;
}

@media (max-width: 900px) {
  .hero, .pos-layout, .manager-panel {
    grid-template-columns: 1fr;
  }

  .field-row.grouped {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}
