:root {
  --bg: #0f1c24;
  --bg-soft: #162832;
  --panel: #1a303c;
  --panel-2: #21404f;
  --line: rgba(232, 241, 245, 0.1);
  --text: #e8f1f5;
  --muted: #8aa3b0;
  --accent: #ff6b4a;
  --accent-2: #2dd4a8;
  --warn: #f5c542;
  --danger: #ff5d6c;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(45, 212, 168, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 107, 74, 0.16), transparent 50%),
    linear-gradient(160deg, #0c171d 0%, #13232c 45%, #0f1c24 100%);
  min-height: 100vh;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #7ff0d0; }

.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: rgba(15, 28, 36, 0.92);
  border-right: 1px solid var(--line);
  padding: 1.4rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.7rem 1.2rem;
}
.brand span { color: var(--accent); }
.nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  margin-bottom: 0.25rem;
  opacity: 0.85;
}
.nav a:hover, .nav a.active {
  background: var(--panel);
  opacity: 1;
  color: #fff;
}
.nav .section {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1rem 0.85rem 0.4rem;
}
.main { padding: 1.4rem 1.6rem 2.5rem; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.topbar h1 {
  font-family: var(--display);
  font-size: 1.7rem;
  margin: 0;
  font-weight: 650;
}
.meta { color: var(--muted); font-size: 0.92rem; }
.card {
  background: linear-gradient(180deg, rgba(33, 64, 79, 0.55), rgba(26, 48, 60, 0.85));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.stat-value {
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0.3rem 0 0;
}
.stat-label { color: var(--muted); font-size: 0.85rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #1a0d0a; }
.btn-primary:hover { filter: brightness(1.08); color: #1a0d0a; }
.btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 0.6rem; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
input, select, textarea {
  width: 100%;
  background: #0f1c24;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
.form-row { margin-bottom: 0.9rem; }
.form-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }

.flash {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
}
.flash-success { background: rgba(45, 212, 168, 0.15); color: #b8ffe8; }
.flash-error { background: rgba(255, 93, 108, 0.15); color: #ffc2c8; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--panel-2);
  color: var(--muted);
}
.badge-ok { background: rgba(45, 212, 168, 0.2); color: #8ef0d2; }
.badge-warn { background: rgba(245, 197, 66, 0.2); color: #ffe08a; }
.badge-err { background: rgba(255, 93, 108, 0.2); color: #ffb0b8; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}
.auth-card {
  width: min(480px, 100%);
  animation: rise 0.5s ease;
}
.auth-card h1 {
  font-family: var(--display);
  margin: 0 0 0.3rem;
}
.hero-landing {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}
.hero-landing header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 8vw;
}
.hero-landing .hero {
  display: grid;
  align-content: center;
  padding: 4vh 8vw 10vh;
  max-width: 900px;
  animation: rise 0.6s ease;
}
.hero-landing h1 {
  font-family: var(--display);
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 1.02;
  margin: 0 0 0.8rem;
}
.hero-landing h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-landing p {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 36rem;
  margin: 0 0 1.5rem;
}
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.pos-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }
.cart-line { display: grid; grid-template-columns: 1fr 70px 90px 36px; gap: 0.4rem; align-items: center; margin-bottom: 0.5rem; }
.search-results { max-height: 280px; overflow: auto; margin-top: 0.6rem; }
.search-results button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  padding: 0.7rem 0.4rem;
  cursor: pointer;
  font: inherit;
}
.search-results button:hover { background: rgba(255,255,255,0.04); }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .grid-3, .grid-2, .pos-layout { grid-template-columns: 1fr; }
}
