/* ============================================================
   Laguna — Loja de Aquariofilia
   Tema aquático azul-esverdeado (deep teal / seafoam).
   Design: limpo, arejado, imagens em destaque.
   ============================================================ */
:root {
  --bg: #f5fafb;
  --surface: #ffffff;
  --surface-2: #f2f8f9;
  --surface-3: #e4f0f2;
  --text: #16292e;
  --muted: #5f7a80;
  --line: #dcebef;

  --primary: #0c7c7b;
  --primary-600: #0a6a69;
  --primary-700: #075453;
  --primary-soft: #dcf1f0;
  --accent: #2dd4a8;
  --accent-dark: #0f9d7c;
  --accent-soft: #d9f7ef;

  --success: #1f9d55;
  --success-soft: #d8f3e2;
  --warning: #c9821a;
  --warning-soft: #fceccf;
  --danger: #d64545;
  --danger-soft: #fbdcdc;
  --info: #2563a8;
  --info-soft: #d9e8fb;
  --violet: #6d4fc0;
  --violet-soft: #e6def6;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(9,60,70,.06), 0 1px 3px rgba(9,60,70,.08);
  --shadow: 0 6px 18px rgba(9,60,70,.10);
  --shadow-lg: 0 18px 44px rgba(9,60,70,.18);
  --maxw: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { margin: 0 0 .5rem; line-height: 1.2; font-weight: 700; }
p { margin: 0 0 1rem; }
button { font-family: inherit; }
::selection { background: var(--primary-soft); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.grid { display: grid; gap: 18px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }

/* ---------------- Buttons ---------------- */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--line);
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 600; cursor: pointer;
  transition: transform .04s ease, box-shadow .15s ease, background .15s ease, border-color .15s;
  white-space: nowrap; text-decoration: none; line-height: 1.2;
}
.btn:hover { box-shadow: var(--shadow-sm); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-primary { --btn-bg: var(--primary); --btn-fg:#fff; border-color: var(--primary-600); }
.btn-primary:hover { --btn-bg: var(--primary-600); }
.btn-accent { --btn-bg: var(--accent); --btn-fg:#06301f; border-color:var(--accent-dark); }
.btn-accent:hover { --btn-bg: var(--accent-dark); --btn-fg:#fff; }
.btn-danger { --btn-bg:#fff; --btn-fg: var(--danger); border-color: #f0c9c9; }
.btn-danger:hover { --btn-bg: var(--danger-soft); }
.btn-ghost { --btn-bg: transparent; border-color: transparent; }
.btn-ghost:hover { --btn-bg: var(--surface-2); box-shadow: none; }
.btn-sm { padding: 7px 11px; font-size: .85rem; }
.btn-lg { padding: 13px 22px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items:center; justify-content:center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  font-size: 1.05rem; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------------- Badges / pills ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .2px;
  background: var(--surface-3); color: var(--muted);
}
.badge-dot::before { content:""; width:7px; height:7px; border-radius:50%; background: currentColor; opacity:.9; }
.b-success { background: var(--success-soft); color: var(--success); }
.b-warning { background: var(--warning-soft); color: var(--warning); }
.b-danger  { background: var(--danger-soft);  color: var(--danger); }
.b-info    { background: var(--info-soft);    color: var(--info); }
.b-violet  { background: var(--violet-soft);  color: var(--violet); }
.b-primary { background: var(--primary-soft); color: var(--primary-700); }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }

/* ---------------- Forms ---------------- */
.field { margin-bottom: 14px; }
.field label { display:block; font-size:.86rem; font-weight:600; margin-bottom:6px; color: var(--text); }
.field .hint { font-size:.78rem; color: var(--muted); margin-top:5px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; font-size: .95rem; font-family: inherit;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; min-height: 84px; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.input.invalid, .select.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.input::placeholder { color: #9bb0b6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.checkbox { display:flex; align-items:center; gap:9px; font-size:.9rem; cursor:pointer; }
.checkbox input { width:18px; height:18px; }

/* ============================================================
   STOREFRONT
   ============================================================ */
.topbar {
  background: var(--primary-700); color: #d8eef1;
  font-size: .8rem; text-align: center; padding: 7px 0;
}
.topbar b { color: #fff; }

.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display:flex; align-items:center; gap:18px; height:66px; }
.brand { display:flex; align-items:center; gap:11px; font-weight:800; font-size:1.16rem; color:var(--text); }
.brand .logo {
  width:40px; height:40px; border-radius:11px; display:grid; place-items:center;
  background: linear-gradient(135deg, var(--primary), #1a9e9e);
  font-size:1.3rem; box-shadow: var(--shadow-sm);
}
.brand small { display:block; font-size:.66rem; font-weight:600; letter-spacing:.6px; color:var(--muted); text-transform:uppercase; }
.nav-links { display:flex; gap: 4px; margin-left: 10px; }
.nav-links a { padding:8px 12px; border-radius:9px; color:var(--muted); font-weight:600; font-size:.93rem; }
.nav-links a:hover { background: var(--surface-2); color: var(--text); text-decoration:none; }
.nav-links a.active { color: var(--primary-700); background: var(--primary-soft); }
.nav-actions { margin-left:auto; display:flex; align-items:center; gap:8px; }

.lang-toggle { display:inline-flex; border:1px solid var(--line); border-radius:999px; overflow:hidden; }
.lang-btn { border:none; background:transparent; color:var(--muted); font-size:.78rem; font-weight:700; padding:6px 10px; cursor:pointer; letter-spacing:.3px; }
.lang-btn.active { background: var(--primary); color:#fff; }
.lang-btn:not(.active):hover { background: var(--surface-2); color: var(--text); }

.searchbox { position: relative; }
.searchbox .input { padding-left: 38px; border-radius: 999px; }
.searchbox svg { position:absolute; left:13px; top:50%; transform:translateY(-50%); width:17px; height:17px; color:var(--muted); }

.cartbtn { position: relative; }
.cartbtn .count {
  position:absolute; top:-7px; right:-7px; min-width:20px; height:20px; padding:0 5px;
  background: var(--accent); color:#06301f; border-radius:999px;
  font-size:.72rem; font-weight:800; display:grid; place-items:center;
  border:2px solid #fff;
}

/* Hero — banner compacto com imagem de fundo */
.hero {
  position: relative; overflow: hidden;
  background:
    linear-gradient(90deg, rgba(4,32,38,.78) 0%, rgba(4,32,38,.45) 45%, rgba(4,32,38,.12) 100%),
    var(--hero-img, linear-gradient(120deg, #062e35 0%, #0c7c7b 60%, #1a9e9e 100%))
    center/cover no-repeat;
  color: #eafcff; border-radius: 0;
  padding: 40px 0 44px; margin-bottom: 14px;
}
.hero .container { position: relative; z-index: 2; }
.hero h1 { color:#fff; font-size: 2rem; margin-bottom: 8px; max-width: 560px; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.hero p { color: #d8f2f2; max-width: 480px; font-size: 1rem; margin-bottom: 18px; text-shadow: 0 1px 8px rgba(0,0,0,.3); }
.hero .hero-cta-row { margin-bottom: 4px; }

/* Sections */
.section { padding: 34px 0 42px; }
.section-head { display:flex; align-items:center; justify-content:space-between; margin: 6px 0 18px; }
.section-head h2 { font-size: 1.5rem; }
.section-head .muted { font-size:.9rem; }

/* Product grid + card */
.product-grid {
  display:grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px;
}
.pcard {
  background: var(--surface); border:1px solid var(--line); border-radius: var(--radius);
  overflow:hidden; display:flex; flex-direction:column; box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .15s ease; cursor: pointer;
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pcard .thumb {
  position:relative; aspect-ratio: 4/3; display:grid; place-items:center; font-size: 4rem;
  background: linear-gradient(140deg, #eaf6f8, #d6ecef);
}
.pcard .thumb img { width:100%; height:100%; object-fit: cover; }
.pcard .thumb .cat {
  position:absolute; top:10px; left:10px; background: rgba(255,255,255,.9);
  color: var(--primary-700); font-size:.72rem; font-weight:700; padding:4px 9px; border-radius:999px;
}
.pcard .thumb .stock { position:absolute; top:10px; right:10px; }
.pcard .body { padding: 14px 15px 16px; display:flex; flex-direction:column; gap:7px; flex:1; }
.pcard .name { font-weight:700; font-size:1.0rem; flex:1; }
.pcard .foot { display:flex; align-items:center; justify-content:space-between; margin-top:4px; }
.price { font-weight:800; font-size:1.18rem; color: var(--primary-700); }
.price .old { font-size:.82rem; color:var(--muted); text-decoration: line-through; font-weight:600; margin-left:6px; }
.price .iva { display:block; font-size:.7rem; font-weight:600; color: var(--muted); margin-top:-2px; }

/* Category strip — compact, airy */
.cat-strip { display:flex; gap:12px; overflow-x:auto; padding-bottom:6px; scroll-snap-type:x proximity; }
.cat-strip::-webkit-scrollbar { height:6px; }
.cat-strip::-webkit-scrollbar-thumb { background:var(--line); border-radius:999px; }
.cat-tile {
  flex:0 0 auto; display:flex; align-items:center; gap:11px; padding:12px 18px 12px 12px;
  background: var(--surface); border:1px solid var(--line); border-radius:999px; cursor:pointer;
  scroll-snap-align:start; transition: transform .1s, box-shadow .15s, border-color .15s;
}
.cat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--primary); }
.cat-tile .ic { width:40px; height:40px; border-radius:50%; display:grid; place-items:center; font-size:1.3rem; flex:0 0 auto; }
.cat-tile .nm { font-weight:700; white-space:nowrap; font-size:.95rem; }

/* Filters bar */
.filterbar {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  background: var(--surface); border:1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.filterbar .select { width: auto; min-width: 150px; }
.pill {
  padding:7px 13px; border-radius:999px; border:1px solid var(--line);
  background: var(--surface); font-size:.85rem; font-weight:600; color:var(--muted); cursor:pointer;
}
.pill.active { background: var(--primary); border-color: var(--primary); color:#fff; }

/* Product detail */
.detail { display:grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items:start; }
.detail .dthumb { border-radius: var(--radius); overflow:hidden; border:1px solid var(--line); background: linear-gradient(140deg,#eaf6f8,#d6ecef); }
.detail .dthumb .ph { aspect-ratio: 1/1; display:grid; place-items:center; font-size: 9rem; }
.detail .dthumb img { width:100%; aspect-ratio:1/1; object-fit:cover; }
.detail .dtitle { font-size: 1.9rem; }
.detail .dprice { font-size: 2rem; font-weight:800; color: var(--primary-700); }
.qty { display:inline-flex; align-items:center; border:1px solid var(--line); border-radius:999px; overflow:hidden; }
.qty button { width:40px; height:42px; border:none; background:var(--surface-2); font-size:1.2rem; cursor:pointer; color:var(--text); }
.qty button:hover { background: var(--surface-3); }
.qty .n { min-width:44px; text-align:center; font-weight:700; }

/* Cart drawer */
.drawer {
  position: fixed; top:0; right:0; height:100vh; width: 420px; max-width:92vw;
  background: var(--surface); box-shadow: var(--shadow-lg); z-index: 80;
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  display:flex; flex-direction:column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 18px 20px; border-bottom:1px solid var(--line); }
.drawer-body { padding: 16px 20px; overflow-y:auto; flex:1; }
.drawer-foot { padding: 18px 20px; border-top:1px solid var(--line); background: var(--surface-2); }
.overlay {
  position:fixed; inset:0; background: rgba(9,40,48,.45); z-index:70; opacity:0; visibility:hidden; transition:.25s;
}
.overlay.show { opacity:1; visibility:visible; }

.cart-item { display:flex; gap:12px; padding:13px 0; border-bottom:1px solid var(--line); }
.cart-item .ci-thumb { width:64px; height:64px; border-radius:11px; background:linear-gradient(140deg,#eaf6f8,#d6ecef); display:grid; place-items:center; font-size:2rem; flex:0 0 auto; overflow:hidden; }
.cart-item .ci-thumb img { width:100%; height:100%; object-fit:cover; }
.cart-item .ci-main { flex:1; min-width:0; }
.cart-item .ci-name { font-weight:700; font-size:.95rem; }
.cart-item .ci-price { color: var(--primary-700); font-weight:700; font-size:.9rem; }
.cart-item .ci-ctl { display:flex; align-items:center; justify-content:space-between; margin-top:8px; }
.cart-item .qty button { height:32px; width:32px; font-size:1rem; }
.cart-item .qty .n { min-width:30px; font-size:.9rem; }
.cart-empty { text-align:center; padding:50px 20px; color: var(--muted); }
.cart-empty .big { font-size:3.4rem; margin-bottom:10px; }

.summary { margin-bottom: 12px; }
.summary .line { display:flex; justify-content:space-between; font-size:.95rem; margin-bottom:8px; }
.summary .line.total { font-size:1.2rem; font-weight:800; padding-top:10px; border-top:1px dashed var(--line); margin-top:6px; }
.summary .line.total .v { color: var(--primary-700); }
.note-tax { font-size:.78rem; color:var(--muted); }

/* Checkout */
.steps { display:flex; gap:8px; margin-bottom:22px; }
.step { display:flex; align-items:center; gap:8px; font-size:.85rem; font-weight:700; color:var(--muted); }
.step .num { width:26px; height:26px; border-radius:50%; display:grid; place-items:center; background:var(--surface-3); color:var(--muted); font-size:.8rem; }
.step.active { color: var(--primary-700); }
.step.active .num { background: var(--primary); color:#fff; }
.step.done .num { background: var(--success); color:#fff; }
.step .bar { flex:1; height:2px; background: var(--line); min-width:24px; }

.pay-methods { display:grid; grid-template-columns: repeat(3,1fr); gap:10px; margin-bottom:6px; }
.pay-method { border:2px solid var(--line); border-radius: var(--radius-sm); padding:14px 12px; text-align:center; cursor:pointer; font-weight:700; background:var(--surface); }
.pay-method .em { font-size:1.6rem; display:block; margin-bottom:5px; }
.pay-method small { display:block; font-weight:500; color:var(--muted); font-size:.74rem; }
.pay-method.sel { border-color: var(--primary); background: var(--primary-soft); }

.cardform .brand-row { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.cardnum { letter-spacing:1px; }
.brandmark { font-size:1.4rem; }
.proc { position:fixed; inset:0; background:rgba(9,40,48,.5); z-index:100; display:grid; place-items:center; }
.proc .box { background:var(--surface); padding:34px 40px; border-radius: var(--radius-lg); box-shadow:var(--shadow-lg); text-align:center; max-width:340px; }
.spinner { width:46px; height:46px; border:4px solid var(--primary-soft); border-top-color:var(--primary); border-radius:50%; margin:0 auto 16px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.confirm { text-align:center; max-width:640px; margin: 40px auto; }
.confirm .ok { width:78px; height:78px; border-radius:50%; background: var(--success-soft); color:var(--success); font-size:2.4rem; display:grid; place-items:center; margin:0 auto 16px; }
.order-code { font-size:1.5rem; font-weight:800; letter-spacing:.5px; background:var(--surface-2); border:1px dashed var(--line); border-radius: var(--radius); padding:14px; margin:16px 0; }

/* Footer */
.foot { background:#062e35; color:#bfe6ea; margin-top:40px; padding:36px 0 22px; }
.foot h4 { color:#fff; }
.foot a { color:#bfe6ea; }
.foot-grid { display:grid; grid-template-columns: 2fr 1fr; gap:26px; }
.foot .bar { border-top:1px solid rgba(255,255,255,.14); margin-top:24px; padding-top:16px; font-size:.82rem; display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; }

/* Toasts */
.toasts { position:fixed; bottom:20px; right:20px; z-index:200; display:flex; flex-direction:column; gap:10px; }
.toast {
  background:#062e35; color:#eafcff; padding:13px 17px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-size:.92rem; display:flex; align-items:center; gap:10px;
  transform: translateY(20px); opacity:0; transition:.25s; max-width:340px;
}
.toast.show { transform: translateY(0); opacity:1; }
.toast.success { background: var(--success); color:#fff; }
.toast.error { background: var(--danger); color:#fff; }
.toast .em { font-size:1.15rem; }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin { display:grid; grid-template-columns: 250px 1fr; min-height:100vh; }
.sidenav { background:#062e35; color:#cfe9ec; padding:20px 14px; display:flex; flex-direction:column; gap:6px; position:sticky; top:0; height:100vh; }
.sidenav .sbrand { display:flex; align-items:center; gap:10px; color:#fff; font-weight:800; font-size:1.05rem; padding:6px 10px 18px; }
.sidenav .sbrand .logo { width:38px; height:38px; border-radius:10px; background: linear-gradient(135deg,var(--primary),#1a9e9e); display:grid; place-items:center; font-size:1.2rem; }
.sidenav .sbrand small { display:block; font-size:.64rem; letter-spacing:.5px; color:#7fb3ba; text-transform:uppercase; font-weight:600; }
.snav a { display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:10px; color:#cfe9ec; font-weight:600; font-size:.93rem; }
.snav a:hover { background: rgba(255,255,255,.08); text-decoration:none; }
.snav a.active { background: var(--primary); color:#fff; }
.snav a .em { width:22px; text-align:center; }
.snav .grp { font-size:.68rem; text-transform:uppercase; letter-spacing:.6px; color:#6ea7ae; padding:16px 12px 4px; font-weight:700; }
.sidenav .sfoot { margin-top:auto; padding:10px 12px; }

.admin-main { background: var(--bg); min-width:0; }
.topbar-admin { background: var(--surface); border-bottom:1px solid var(--line); padding:14px 26px; display:flex; align-items:center; gap:16px; }
.topbar-admin h1 { font-size:1.3rem; margin:0; }
.admin-content { padding: 26px; }

.stat-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap:16px; }
.stat { background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); padding:18px; box-shadow:var(--shadow-sm); }
.stat .lab { color:var(--muted); font-size:.82rem; font-weight:600; display:flex; align-items:center; gap:8px; }
.stat .val { font-size:1.7rem; font-weight:800; margin-top:6px; }
.stat .sub { font-size:.8rem; color:var(--muted); margin-top:4px; }
.stat .ic { width:38px; height:38px; border-radius:10px; display:grid; place-items:center; font-size:1.15rem; }

.panel { background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); box-shadow:var(--shadow-sm); }
.panel-head { padding:16px 20px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap:12px; }
.panel-head h3 { margin:0; font-size:1.05rem; }
.panel-body { padding: 0; }
.panel-body.pad { padding: 20px; }

/* Tables */
.table-wrap { overflow-x:auto; }
table.tbl { width:100%; border-collapse: collapse; font-size:.92rem; }
table.tbl th, table.tbl td { text-align:left; padding:12px 16px; border-bottom:1px solid var(--line); white-space:nowrap; }
table.tbl th { background: var(--surface-2); font-size:.76rem; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); font-weight:700; }
table.tbl tr:last-child td { border-bottom:none; }
table.tbl tr.click { cursor:pointer; }
table.tbl tr.click:hover { background: var(--surface-2); }
table.tbl td.num, table.tbl th.num { text-align:right; }
table.tbl .thumb { width:44px; height:44px; border-radius:10px; background:linear-gradient(140deg,#eaf6f8,#d6ecef); display:inline-grid; place-items:center; font-size:1.4rem; overflow:hidden; vertical-align:middle; }
table.tbl .thumb img { width:100%; height:100%; object-fit:cover; }
.td-prod { display:flex; align-items:center; gap:11px; }
.td-prod .nm { font-weight:600; }
.td-prod .sk { font-size:.76rem; color:var(--muted); }

/* Toolbar */
.toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.toolbar .searchbox { flex:1; min-width:220px; }
.toolbar .searchbox .input { padding-left:38px; }

/* Modal */
.modal { position:fixed; inset:0; z-index:120; display:none; place-items:center; padding:20px; }
.modal.open { display:grid; }
.modal .backdrop { position:absolute; inset:0; background:rgba(9,40,48,.5); }
.modal .box { position:relative; background:var(--surface); border-radius: var(--radius-lg); box-shadow:var(--shadow-lg); width:100%; max-width:640px; max-height:90vh; display:flex; flex-direction:column; }
.modal .box.wide { max-width: 860px; }
.modal-head { padding:18px 22px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; }
.modal-head h3 { margin:0; font-size:1.15rem; }
.modal-body { padding:22px; overflow-y:auto; }
.modal-foot { padding:16px 22px; border-top:1px solid var(--line); display:flex; justify-content:flex-end; gap:10px; background:var(--surface-2); border-radius:0 0 var(--radius-lg) var(--radius-lg); }

/* Login */
.login-wrap { min-height:100vh; display:grid; place-items:center; padding:20px;
  background: linear-gradient(135deg,#062e35,#0c7c7b 60%,#1a9e9e); }
.login-card { width:100%; max-width:410px; background:var(--surface); border-radius:var(--radius-lg); box-shadow:var(--shadow-lg); padding:34px 30px; }
.login-card .logo { width:56px; height:56px; border-radius:15px; background:linear-gradient(135deg,var(--primary),#1a9e9e); display:grid; place-items:center; font-size:1.8rem; margin:0 auto 16px; }
.login-card h1 { text-align:center; font-size:1.4rem; }
.login-card .sub { text-align:center; color:var(--muted); margin-bottom:24px; font-size:.9rem; }
.login-hint { margin-top:16px; background:var(--info-soft); color:var(--info); border-radius:10px; padding:12px 14px; font-size:.82rem; text-align:center; }

/* empty state */
.empty { text-align:center; padding:40px 20px; color:var(--muted); }
.empty .big { font-size:3rem; margin-bottom:8px; }

/* utility */
.tag { display:inline-block; font-size:.72rem; padding:3px 8px; border-radius:6px; background:var(--surface-3); color:var(--muted); font-weight:600; }
.divider { height:1px; background:var(--line); margin:18px 0; }
.kbd { font-family:ui-monospace, monospace; background:var(--surface-3); border:1px solid var(--line); border-radius:5px; padding:1px 6px; font-size:.82rem; }
.stockbar { height:6px; border-radius:999px; background:var(--surface-3); overflow:hidden; min-width:60px; }
.stockbar > i { display:block; height:100%; background:var(--success); }
.stockbar.low > i { background: var(--warning); }
.stockbar.out > i { background: var(--danger); }
.link-btn { background:none; border:none; color:var(--primary); font-weight:600; cursor:pointer; font-size:.85rem; padding:4px 6px; border-radius:6px; }
.link-btn:hover { background:var(--primary-soft); }
.link-btn.danger { color:var(--danger); }
.link-btn.danger:hover { background:var(--danger-soft); }

/* invoice preview */
.inv-preview { background:#fff; border:1px solid var(--line); border-radius:12px; padding:28px; }
.inv-preview .inv-head { display:flex; justify-content:space-between; align-items:flex-start; border-bottom:3px solid var(--primary); padding-bottom:16px; margin-bottom:18px; }
.inv-preview .inv-co { font-size:1.4rem; font-weight:800; color:var(--primary-700); }
.inv-preview .inv-meta { color:var(--muted); font-size:.82rem; line-height:1.5; }
.inv-parties { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-bottom:18px; }
.inv-parties .lab { font-size:.7rem; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); font-weight:700; margin-bottom:5px; }
.inv-table { width:100%; border-collapse:collapse; font-size:.88rem; margin-bottom:16px; }
.inv-table th { text-align:left; border-bottom:2px solid var(--line); padding:8px 10px; font-size:.74rem; text-transform:uppercase; color:var(--muted); }
.inv-table td { padding:10px; border-bottom:1px solid var(--line); }
.inv-table .r { text-align:right; }
.inv-totals { margin-left:auto; width:280px; }
.inv-totals .line { display:flex; justify-content:space-between; padding:5px 0; font-size:.9rem; }
.inv-totals .line.total { font-weight:800; font-size:1.15rem; border-top:2px solid var(--primary); padding-top:8px; margin-top:4px; color:var(--primary-700); }
.inv-sign { margin-top:40px; display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.inv-sign .box { border-top:1px solid var(--line); padding-top:8px; font-size:.78rem; color:var(--muted); }

/* Responsive */
@media (max-width: 900px) {
  .detail { grid-template-columns:1fr; }
  .foot-grid { grid-template-columns:1fr 1fr; }
  .form-row-3 { grid-template-columns:1fr; }
}
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .sidenav { position:static; height:auto; flex-direction:row; flex-wrap:wrap; align-items:center; }
  .sidenav .sbrand { padding-bottom:8px; width:100%; }
  .snav { display:flex; flex-wrap:wrap; gap:4px; }
  .snav .grp { width:100%; padding-top:8px; }
  .sidenav .sfoot { margin:0; }
  .nav-links { display:none; }
}
@media (max-width: 640px) {
  .hero h1 { font-size:1.9rem; }
  .form-row { grid-template-columns:1fr; }
  .pay-methods { grid-template-columns:1fr; }
  .foot-grid { grid-template-columns:1fr; }
  .inv-parties { grid-template-columns:1fr; }
  .inv-totals { width:100%; }
  .nav .searchbox { display:none; }
}
