@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");

:root {
  color-scheme: dark;
  /* Design language migrated 2026-08-03 to match the VINA IT SOLUTIONS marketing site
     (cyan -> violet gradient system) — this supersedes the previous orange-brand decision. */
  --vina-bg: #0B0F14;
  --vina-surface: #111827;
  --vina-surface-strong: #111827;
  /* rgb companion so fixed glass surfaces (topbar, nav drawer, dropdowns) can be genuinely
     translucent — an opaque --vina-surface-strong made their backdrop-filter blur invisible
     since there was no transparency for it to blur through. */
  --vina-surface-strong-rgb: 17, 24, 39;
  --vina-border: #1F2937;
  --vina-text: #FFFFFF;
  --vina-muted: #94A3B8;
  --vina-hover: #1e293b;
  /* Nested/recessed panel background (Charges & Payment, Jewellery Details, table header,
     scan bar, etc.) — a distinct token from --vina-hover, which is reserved for actual
     :hover/active states. Reusing --vina-hover as a resting background for whole sections
     was the root cause of light theme's cards flooding peach (see fix below). */
  --vina-surface-soft: #0e1524;
  /* Primary brand tokens — cyan/violet, matching the marketing site's .btn-primary /
     .text-gradient. -rgb companions exist so translucent borders/shadows/rings can use
     rgba(var(--vina-primary-rgb), alpha) instead of hardcoding a duplicate hex everywhere. */
  --vina-primary: #22d3ee;
  --vina-primary-rgb: 34, 211, 238;
  --vina-primary-2: #38bdf8;
  --vina-accent: #a78bfa;
  --vina-accent-rgb: 167, 139, 250;
  --vina-gradient-primary: linear-gradient(135deg, #38bdf8 0%, #22d3ee 55%, #8b5cf6 100%);
  --vina-gradient-text: linear-gradient(92deg, #67e8f9 0%, #60a5fa 42%, #a78bfa 100%);
  /* Kept as aliases (still referenced by name in a handful of rules below) so nothing
     that reads var(--vina-orange)/var(--vina-blue) needs to change — only the color does. */
  --vina-blue: var(--vina-primary);
  --vina-orange: var(--vina-primary);
  --vina-green: #31d6a3;
  /* Border tone for fixed glass overlays (global search, dropdowns) that sit above the
     regular card system. */
  --vina-glass-border: rgba(255, 255, 255, .12);
  --vina-radius-sm: 12px;
  --vina-radius: 16px;
  --vina-radius-lg: 24px;
  --vina-shadow: 0 1px 2px rgba(0,0,0,.24), 0 8px 24px rgba(0,0,0,.28), 0 24px 48px -12px rgba(0,0,0,.32);
  /* Three transition tiers so every interactive element picks from the same small set
     instead of the ad-hoc .18s/.2s/.22s/.3s durations that had accumulated: fast for
     button/input press-and-release feedback, base for nav/menu surfaces, slow for
     larger card lifts and primary-CTA hovers. */
  --vina-ease-fast: 160ms ease;
  --vina-ease: 250ms ease;
  --vina-ease-slow: 320ms ease;
  --vina-topbar-height: 64px;
  /* One height for every input/select/button inside the POS page, so rows made of mixed
     controls (label + input + stepper + button) always align on the same baseline. */
  --vina-control-h: 42px;
  --mobile-header-height: 96px;
  --mobile-footer-height: 70px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --vina-bg: #F7F8FA;
  --vina-surface: #ffffff;
  --vina-surface-strong: #ffffff;
  --vina-surface-strong-rgb: 255, 255, 255;
  --vina-border: #E5E7EB;
  --vina-text: #111827;
  --vina-muted: #667085;
  /* Was a peach tint (#fff1e6) left over from the orange brand — hover/active surfaces
     (nav drawer links, topbar menu button, dropdown items) now wash cyan instead. */
  --vina-hover: #e6f4f7;
  --vina-surface-soft: #f3f5f8;
  /* Darker cyan/violet stops than dark mode so text/icons/borders keep AA contrast on a
     white surface; --vina-gradient-primary stays a touch brighter since it always sits
     under white button text rather than being read as text/icon color itself. */
  --vina-primary: #0e7490;
  --vina-primary-rgb: 14, 116, 144;
  --vina-primary-2: #0369a1;
  --vina-accent: #7c3aed;
  --vina-accent-rgb: 124, 58, 237;
  --vina-gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 55%, #8b5cf6 100%);
  --vina-gradient-text: linear-gradient(92deg, #0e7490 0%, #0369a1 42%, #7c3aed 100%);
  --vina-blue: var(--vina-primary);
  --vina-orange: var(--vina-primary);
  --vina-green: #16a34a;
  --vina-glass-border: rgba(15, 23, 42, .08);
  --vina-shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 12px rgba(16,24,40,.06), 0 16px 32px -8px rgba(16,24,40,.08);
}

:root[data-theme="light"] .glass-card,
:root[data-theme="light"] section[class*="bg-white/"],
:root[data-theme="light"] div[class*="bg-white/5"][class*="border"] {
  background: var(--vina-surface) !important;
  box-shadow: var(--vina-shadow) !important;
  border: 1px solid var(--vina-border) !important;
}

:root[data-theme="light"] .glass-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--vina-primary-rgb), 0.35) !important;
  box-shadow: 0 20px 40px -4px rgba(0, 0, 0, 0.08) !important;
}

:root[data-theme="light"] body > header,
:root[data-theme="light"] body > div > header {
  background: rgba(255, 255, 255, 0.76) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border-bottom: 1px solid var(--vina-border) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

:root[data-theme="light"] button[class*="bg-blue"],
:root[data-theme="light"] a[class*="bg-blue"] {
  background: var(--vina-gradient-primary) !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(var(--vina-primary-rgb), 0.28) !important;
}

/* "brand" and legacy "blue"/"orange-600" buttons are all the same primary action semantically
   (Dashboard's "New Sale" CTA, Settings' "Upload Logo"/"Create Backup", etc.) — unified onto
   one gradient so light mode matches dark mode's single primary treatment. */
:root[data-theme="light"] button[class*="bg-brand"],
:root[data-theme="light"] a[class*="bg-brand"] {
  background: var(--vina-gradient-primary) !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(var(--vina-primary-rgb), 0.28) !important;
}

:root[data-theme="light"] button[class*="bg-emerald"],
:root[data-theme="light"] a[class*="bg-emerald"] {
  background: var(--vina-green) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.25) !important;
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  background: rgba(255, 255, 255, .8) !important;
  border: 1px solid #cbd5e1 !important;
  color: var(--vina-text) !important;
}

:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] textarea:focus {
  border-color: var(--vina-primary) !important;
  box-shadow: 0 0 0 3px rgba(var(--vina-primary-rgb), 0.15) !important;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--vina-primary-rgb), 0.35) transparent;
}

html {
  background: var(--vina-bg);
  /* Belt-and-suspenders alongside body's own overflow-x:hidden: the off-canvas nav drawer
     is position:fixed + translateX(100%) to sit just past the right edge when closed, and
     Chrome still counts that transformed box toward the document's scrollable overflow,
     which let window/programmatic horizontal scroll actually move the page sideways. */
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--vina-bg) !important;
  color: var(--vina-text);
  font-family: Inter, "Segoe UI", sans-serif;
  letter-spacing: 0;
  animation: vina-page-in 0.38s ease both;
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 8% 5%, rgba(var(--vina-primary-rgb), 0.11), transparent 28rem),
    radial-gradient(circle at 91% 8%, rgba(var(--vina-accent-rgb), 0.09), transparent 25rem),
    linear-gradient(145deg, #f6f9fd, var(--vina-bg)) !important;
}

h1, h2, h3, h4 {
  font-family: Inter, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

/* Gradient heading text, matching the marketing site's .text-gradient. Opt-in class —
   apply to a <span> around the emphasis word/phrase inside a heading. */
.text-gradient {
  background: var(--vina-gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Small uppercase tracked label above a section/page heading, matching the marketing
   site's eyebrow tag (e.g. "Enterprise Product Engineering"). */
.vina-eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--vina-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.glass-card,
section[class*="bg-white/"],
div[class*="bg-white/5"][class*="border"] {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--vina-border) !important;
  border-radius: var(--vina-radius) !important;
  background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.035)) !important;
  box-shadow: var(--vina-shadow) !important;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  transition: transform var(--vina-ease), border-color var(--vina-ease), box-shadow var(--vina-ease);
}

.glass-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--vina-primary-rgb), 0.28) !important;
  box-shadow: 0 28px 80px rgba(0,0,0,.4), 0 0 0 1px rgba(var(--vina-primary-rgb), .05) !important;
}

/* Ambient background blobs, matching the marketing site's .orb — used sparingly on
   low-density screens (auth pages) only, never on dense table/dashboard content. */
.vina-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  animation: vina-orb-float 9s ease-in-out infinite;
}
@keyframes vina-orb-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.06); }
}
@media (max-width: 768px) {
  .vina-orb { display: none; }
}

/* Dashboard "Quick Actions" tile grid - had zero CSS defined, rendering as a bare
   unstyled list of links. */
.vina-dashboard-actions { margin-top: 24px; }
.vina-dashboard-actions h2 { font-size: 14px; font-weight: 700; color: var(--vina-text); margin-bottom: 12px; }
.vina-dashboard-actions > div {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.vina-dashboard-actions > div > a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  border: 1px solid var(--vina-border);
  border-radius: var(--vina-radius);
  background: var(--vina-surface);
  color: var(--vina-text);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: transform var(--vina-ease), border-color var(--vina-ease), box-shadow var(--vina-ease);
}
.vina-dashboard-actions > div > a:hover {
  transform: translateY(-2px);
  border-color: var(--vina-orange);
  box-shadow: var(--vina-shadow);
}
.vina-dashboard-actions > div > a svg,
.vina-dashboard-actions > div > a i {
  width: 22px;
  height: 22px;
  color: var(--vina-orange);
}

body > header,
body > div > header {
  border-color: var(--vina-border) !important;
  background: rgba(15, 19, 28, 0.92) !important;
  box-shadow: 0 10px 35px rgba(0,0,0,.18);
  backdrop-filter: blur(24px) saturate(140%) !important;
}

/* The app-shell page-header treatment above also matches the decorative <header> inside the
   login/register card (structurally the same "body > div > header" shape), boxing it in an
   unwanted translucent panel. Auth pages don't have a page-header bar at all, so reset it. */
body.vina-auth-page header {
  background: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Many pages give their own content header "sticky top-0" (Tailwind utilities). With the
   global .vina-topbar now always present and already sticky, a second stacked sticky bar
   is redundant and was paint-glitching (page-owned header rendering its text at its
   pre-sticky position while its layout box reported the correct offset - a real,
   reproducible sticky+scroll rendering bug, not a screenshot artifact). Simplest correct
   fix: page-owned headers scroll normally instead of also being sticky. */
body.vina-app-shell > header:not(.vina-topbar),
body.vina-app-shell > div > header {
  position: static !important;
  z-index: auto;
}

:root[data-theme="light"] body.vina-auth-page header { background: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; box-shadow: none !important; border: 0 !important; }

:root[data-theme="light"] .text-white,
:root[data-theme="light"] .text-slate-100 { color: #0f172a !important; }
:root[data-theme="light"] .text-slate-200,
:root[data-theme="light"] .text-slate-300 { color: #334155 !important; }
:root[data-theme="light"] .text-slate-400,
:root[data-theme="light"] .text-slate-500 { color: #64748b !important; }
/* Pale "-100" badge/banner text (amber-100, emerald-100, etc.) is tuned for a dark tinted
   chip like bg-amber-500/10 on a near-black page — on a light surface that same pale text
   reads as almost-invisible. Darken each family to a solid, theme-appropriate shade so
   warning/success/danger/info banners stay legible without changing which color family is
   used for which state (amber stays "warning", red/rose stays "danger", etc.). */
:root[data-theme="light"] .text-amber-100,
:root[data-theme="light"] .text-amber-200,
:root[data-theme="light"] .text-amber-300,
:root[data-theme="light"] .text-orange-200,
:root[data-theme="light"] .text-orange-300,
:root[data-theme="light"] .text-yellow-200,
:root[data-theme="light"] .text-yellow-300 { color: #92400e !important; }
:root[data-theme="light"] .text-emerald-100,
:root[data-theme="light"] .text-emerald-200,
:root[data-theme="light"] .text-emerald-300,
:root[data-theme="light"] .text-green-200,
:root[data-theme="light"] .text-green-300 { color: #065f46 !important; }
:root[data-theme="light"] .text-red-100,
:root[data-theme="light"] .text-red-200,
:root[data-theme="light"] .text-red-300,
:root[data-theme="light"] .text-rose-100,
:root[data-theme="light"] .text-rose-200,
:root[data-theme="light"] .text-rose-300 { color: #991b1b !important; }
:root[data-theme="light"] .text-sky-100,
:root[data-theme="light"] .text-sky-200,
:root[data-theme="light"] .text-sky-300 { color: #075985 !important; }
:root[data-theme="light"] .text-cyan-100,
:root[data-theme="light"] .text-cyan-200,
:root[data-theme="light"] .text-cyan-300 { color: #155e75 !important; }
:root[data-theme="light"] .text-blue-100,
:root[data-theme="light"] .text-blue-200,
:root[data-theme="light"] .text-blue-300 { color: #1e3a8a !important; }
:root[data-theme="light"] .text-violet-100,
:root[data-theme="light"] .text-violet-200,
:root[data-theme="light"] .text-violet-300,
:root[data-theme="light"] .text-purple-100,
:root[data-theme="light"] .text-purple-200,
:root[data-theme="light"] .text-purple-300 { color: #5b21b6 !important; }
:root[data-theme="light"] [class*="bg-blue"] .text-white,
:root[data-theme="light"] button[class*="bg-blue"],
:root[data-theme="light"] button[class*="bg-brand"],
:root[data-theme="light"] button[class*="bg-emerald"],
:root[data-theme="light"] button[class*="bg-orange-600"],
:root[data-theme="light"] button[class*="bg-amber"],
:root[data-theme="light"] a[class*="bg-blue"],
:root[data-theme="light"] a[class*="bg-brand"],
:root[data-theme="light"] a[class*="bg-orange-600"],
:root[data-theme="light"] a[class*="bg-amber"] { color: #fff !important; }

button, a[class*="rounded"] {
  position: relative;
  overflow: hidden;
  border-radius: var(--vina-radius-sm) !important;
  transition: transform var(--vina-ease-fast), filter var(--vina-ease-fast), background-color var(--vina-ease-fast), border-color var(--vina-ease-fast) !important;
}

button:hover, a[class*="rounded"]:hover { transform: translateY(-1px); filter: brightness(1.08); }
button:active, a[class*="rounded"]:active { transform: translateY(0) scale(.98); }

/* Disabled buttons previously kept their full-strength gradient/color and hover lift, so a
   disabled "Save"/"Next" button looked exactly as clickable as an enabled one. */
button:disabled, a[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
  filter: grayscale(.2);
}
button:disabled:hover, a[aria-disabled="true"]:hover {
  transform: none !important;
  filter: grayscale(.2) !important;
}
button:disabled:active, a[aria-disabled="true"]:active { transform: none !important; }

/* Keyboard-focus outline for every interactive element that doesn't already draw its own
   focus ring (inputs/selects/textareas keep their existing box-shadow ring below, so they're
   excluded here to avoid a doubled-up outline). Only shows for keyboard/programmatic focus
   (:focus-visible), not mouse clicks, so it never appears as a "flash" on a button tap. */
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(var(--vina-primary-rgb), .85);
  outline-offset: 2px;
}

/* "bg-blue", "bg-brand" (this app's tailwind.config `brand` used to alias orange) and the
   solid "bg-orange-600" primary-action class are all the same semantic — the single primary
   action button — now unified onto one cyan/violet gradient matching the marketing site's
   .btn-primary, instead of three separate legacy color treatments. */
button[class*="bg-blue"], a[class*="bg-blue"],
button[class*="bg-brand"], a[class*="bg-brand"],
button[class*="bg-orange-600"], a[class*="bg-orange-600"] {
  border: 1px solid rgba(var(--vina-primary-rgb), .35);
  background: var(--vina-gradient-primary) !important;
  box-shadow: 0 10px 28px rgba(var(--vina-primary-rgb), .28);
}

/* Super Admin's plan-choice toggle (Create Client form) sets/removes these two literal
   classes via JS to mark the selected billing plan — repainted here so the "selected" pill
   uses the brand primary instead of orange, without touching the toggle logic itself. */
button[class*="border-orange-400"] { border-color: rgba(var(--vina-primary-rgb), .6) !important; }
button[class*="bg-orange-500/20"] { background: rgba(var(--vina-primary-rgb), .18) !important; }

/* Settings' "Active" invoice-template card highlight (an <article>, not a button, so the
   button-scoped rules above don't reach it) used the same literal orange brand-tint classes. */
[class*="border-brand-400"] { border-color: rgba(var(--vina-primary-rgb), .5) !important; }
[class*="bg-brand-500/10"] { background: rgba(var(--vina-primary-rgb), .1) !important; }

/* A handful of pages hardcode a literal dark navy background (footers, the non-selected
   Settings template cards, POS's search-results dropdown) instead of a theme token — fine in
   dark mode where it happens to match, but it stays dark-on-dark forever in light mode since
   there's no light variant to switch to. */
:root[data-theme="light"] footer[class*="bg-slate-950"],
:root[data-theme="light"] [class*="bg-slate-950/70"] { background: var(--vina-surface) !important; }
:root[data-theme="light"] [class*="bg-slate-950/95"] { background: var(--vina-surface-strong) !important; }

/* Secondary/ghost buttons across the whole app rest on translucent white (bg-white/10,
   bg-white/5) so they read as a soft filled pill on the dark background they were designed
   against. On a light surface that same translucency is white-on-white — the button becomes
   invisible, leaving only floating text with no clickable-looking boundary. */
:root[data-theme="light"] button[class*="bg-white/10"],
:root[data-theme="light"] a[class*="bg-white/10"],
:root[data-theme="light"] button[class*="bg-white/5"],
:root[data-theme="light"] a[class*="bg-white/5"] {
  background: var(--vina-surface-soft) !important;
  border: 1px solid var(--vina-border) !important;
}
:root[data-theme="light"] button[class*="hover:bg-white/10"]:hover,
:root[data-theme="light"] a[class*="hover:bg-white/10"]:hover {
  background: var(--vina-hover) !important;
}

/* Native checkbox/radio accent-color is a separate rendering path from background — the
   button-repaint rules above never touch it, so any accent-brand, accent-orange or
   accent-blue utility class (Settings invoice-style radios, Backup's checkbox, etc.)
   still drew its dot/check in literal orange or blue. */
input[class*="accent-brand"], input[class*="accent-orange"], input[class*="accent-blue"] {
  accent-color: var(--vina-primary) !important;
}

button[class*="bg-amber"], a[class*="bg-amber"] {
  background: linear-gradient(135deg, #ff9b32, #f97316) !important;
  box-shadow: 0 10px 28px rgba(249, 115, 22, .22);
}

/* Same gap existed for the solid emerald "confirm/save" buttons (Save Invoice, etc.) in dark
   mode — the light theme already had a dedicated treatment further up, dark mode had none. */
button[class*="bg-emerald-600"], a[class*="bg-emerald-600"] {
  border: 1px solid rgba(110, 231, 183, .3);
  background: linear-gradient(135deg, #34d399, #059669) !important;
  box-shadow: 0 10px 28px rgba(5, 150, 105, .26);
}

/* Danger buttons (Delete/Restore/Cancel) had no unified treatment at all. Scoped to the solid
   "-600" weight only, so the intentionally-subtle soft-tinted variants (bg-red-500/10 etc.,
   used for lower-emphasis inline row actions) keep their quieter look untouched. */
button[class*="bg-red-600"], a[class*="bg-red-600"],
button[class*="bg-rose-600"], a[class*="bg-rose-600"] {
  border: 1px solid rgba(253, 164, 175, .32);
  background: linear-gradient(135deg, #fb7185, #e11d48) !important;
  box-shadow: 0 10px 28px rgba(225, 29, 72, .26);
}

/* Named primary/outline button classes matching the marketing site's .btn-primary /
   .btn-outline, for pages (auth screens, dashboard CTAs) that reach for a class directly
   instead of a Tailwind bg-* utility. */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  background: var(--vina-gradient-primary) !important;
  color: #020617;
  font-weight: 700;
  transition: transform var(--vina-ease-slow), box-shadow var(--vina-ease-slow), filter var(--vina-ease-slow) !important;
}
:root[data-theme="light"] .btn-primary { color: #fff; }
.btn-primary:hover { transform: translateY(-1px) scale(1.005); box-shadow: 0 0 20px rgba(var(--vina-primary-rgb), .35); filter: none; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none !important; box-shadow: none; }

/* Soft/tinted secondary CTA (e.g. "Try Free Demo") — theme-aware via var(--vina-primary),
   which is a bright cyan in dark mode and a darkened cyan in light mode. Using a literal
   Tailwind text-cyan-200/bg-cyan-400 pairing here would look right only in dark mode and
   wash out to near-invisible on a light card background. */
.btn-soft-primary {
  border: 1px solid rgba(var(--vina-primary-rgb), .35);
  background: rgba(var(--vina-primary-rgb), .1);
  color: var(--vina-primary);
  transition: background var(--vina-ease-slow), border-color var(--vina-ease-slow) !important;
}
.btn-soft-primary:hover { background: rgba(var(--vina-primary-rgb), .18); }

/* Same reasoning for inline text links (Forgot password, Contact sales, etc.) — a themed
   link color instead of a fixed-brightness Tailwind cyan utility. */
.vina-link {
  color: var(--vina-primary);
  font-weight: 600;
  transition: color var(--vina-ease-fast);
}
.vina-link:hover { color: var(--vina-primary-2); }

input, select, textarea {
  min-height: 42px;
  border: 1px solid var(--vina-border) !important;
  border-radius: var(--vina-radius-sm) !important;
  background: rgba(2, 6, 23, .54) !important;
  color: var(--vina-text) !important;
  outline: none;
  transition: border-color var(--vina-ease-fast), box-shadow var(--vina-ease-fast), background var(--vina-ease-fast);
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(var(--vina-primary-rgb), .72) !important;
  box-shadow: 0 0 0 3px rgba(var(--vina-primary-rgb), .13) !important;
}

option {
  background: #0f172a;
  color: #f8fafc;
}

:root[data-theme="light"] option {
  background: #ffffff;
  color: #0f172a;
}

.text-slate-300,
.text-slate-400 {
  text-wrap: pretty;
}

.vina-toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: grid;
  width: min(420px, calc(100vw - 28px));
  gap: 10px;
  pointer-events: none;
}

.vina-toast {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--vina-border);
  border-radius: var(--vina-radius);
  color: #f8fafc;
  background: var(--vina-surface-strong);
  box-shadow: 0 20px 60px rgba(0,0,0,.38);
  pointer-events: auto;
  animation: vina-toast-in .22s ease both;
}

.vina-toast strong {
  display: block;
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.vina-toast p {
  margin: 5px 0 0;
  color: inherit;
  font-size: 14px;
  line-height: 1.35;
}

/* Table wrapper marker — js/theme.js tags every table's .overflow-x-auto ancestor with this
   class, but it previously had no CSS at all, so pages that rely on it alone (rather than
   also hand-authoring bg/border utility classes on the wrapper) rendered a bare unstyled
   div around their table instead of a themed container. */
.vina-table-shell {
  overflow-x: auto;
  border: 1px solid var(--vina-border);
  border-radius: var(--vina-radius);
  background: var(--vina-surface);
  box-shadow: var(--vina-shadow);
}
.vina-table-shell table { width: 100%; }

.vina-toast button {
  flex: 0 0 auto;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px !important;
  color: inherit;
  background: rgba(255,255,255,.08);
}

.vina-toast-success { border-color: rgba(16,185,129,.45); background: #064e3b; }
.vina-toast-error { border-color: rgba(248,113,113,.55); background: #7f1d1d; }
.vina-toast-warning { border-color: rgba(251,191,36,.55); background: #78350f; }
.vina-toast-info { border-color: rgba(96,165,250,.45); background: #1e3a8a; }
.vina-toast.closing { animation: vina-toast-out .18s ease both; }

:root[data-theme="light"] .vina-toast {
  color: #0f172a;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15,23,42,.16);
}

:root[data-theme="light"] .vina-toast-success { color: #052e16; background: #dcfce7; }
:root[data-theme="light"] .vina-toast-error { color: #450a0a; background: #fee2e2; }
:root[data-theme="light"] .vina-toast-warning { color: #451a03; background: #fef3c7; }
:root[data-theme="light"] .vina-toast-info { color: #172554; background: #dbeafe; }

.vina-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.vina-action-card {
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--vina-border);
  border-radius: var(--vina-radius) !important;
  color: var(--vina-text);
  background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  box-shadow: var(--vina-shadow);
  text-align: left;
}

.vina-action-card svg {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  color: var(--vina-primary);
}

.vina-action-card strong {
  display: block;
  color: var(--vina-text);
  font-size: 14px;
}

.vina-action-card small {
  display: block;
  margin-top: 3px;
  color: var(--vina-muted);
  font-size: 12px;
  line-height: 1.3;
}

.vina-action-card:disabled {
  cursor: progress;
  opacity: .65;
  filter: grayscale(.25);
}

:root[data-theme="light"] .vina-action-card {
  background: rgba(255,255,255,.9);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

thead { background: rgba(148,163,184,.06); }
tbody tr { transition: background var(--vina-ease-fast); }
tbody tr:hover { background: rgba(var(--vina-primary-rgb), .055); }

.vina-auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.vina-auth-brand img { width: 48px; height: 48px; object-fit: contain; }
.vina-auth-brand div { text-align: left; }
.vina-auth-brand strong { display: block; font: 800 15px Manrope, sans-serif; color: var(--vina-text); }
.vina-auth-brand span { display: block; margin-top: 2px; color: var(--vina-orange); font-size: 10px; font-weight: 700; text-transform: uppercase; }

body.vina-auth-page > div[class*="max-w-"],
body.vina-auth-page > main[class*="max-w-"] {
  width: min(calc(100% - 32px), 448px) !important;
  max-width: calc(100vw - 32px) !important;
}

body.vina-auth-page {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body.vina-auth-page > * {
  min-width: 0;
}

/* The old left sidebar reserved 280px via padding-left; the new shell is a slim top bar
   (see .vina-topbar below) plus an off-canvas right drawer, so content now uses the full
   width and only needs room reserved at the top instead. */
body.vina-app-shell { padding-top: var(--vina-topbar-height, 64px); }
body.vina-app-shell main > div[class*="max-w-7xl"],
body.vina-app-shell main[class*="max-w-7xl"] { max-width: 1600px !important; }

.vina-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.32);
  pointer-events: none;
  transform: scale(0);
  animation: vina-ripple .55s linear;
}

.vina-demo-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 55;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(245,158,11,.35);
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(120,53,15,.92);
  color: #fef3c7;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 14px 35px rgba(0,0,0,.35);
}

.vina-skeleton {
  color: transparent !important;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(148,163,184,.08), rgba(148,163,184,.2), rgba(148,163,184,.08));
  background-size: 220% 100%;
  animation: vina-shimmer 1.35s infinite;
}

dialog, [role="dialog"], div[class*="fixed"][class*="inset-0"] > div {
  border-color: var(--vina-border) !important;
  border-radius: var(--vina-radius-lg) !important;
  backdrop-filter: blur(24px);
}

@keyframes vina-page-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes vina-ripple { to { transform: scale(4); opacity: 0; } }
@keyframes vina-toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes vina-toast-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes vina-shimmer { to { background-position: -220% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body.vina-drawer-open { overflow: hidden; }

.vina-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 54;
  border: 0;
  padding: 0;
  background: rgba(4, 8, 16, .55);
  backdrop-filter: blur(2px);
  transition: opacity var(--vina-ease);
}
.vina-drawer-overlay.open { display: block; }

/* ============ Global top bar (replaces the old left sidebar entirely) ============ */
.vina-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  height: var(--vina-topbar-height);
  padding: 0 20px;
  background: rgba(var(--vina-surface-strong-rgb), .82);
  border-bottom: 1px solid var(--vina-border);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  transition: box-shadow var(--vina-ease);
}
.vina-topbar.scrolled { box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.vina-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--vina-text);
  text-decoration: none;
  font: 800 14px Manrope, sans-serif;
}
.vina-topbar-brand img { width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto; }
.vina-topbar-brand-copy { white-space: nowrap; }
.vina-topbar-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  text-align: center;
  line-height: 1.25;
}
.vina-topbar-center strong { font: 700 13px Manrope, sans-serif; color: var(--vina-text); }
.vina-topbar-center span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 60vw;
  font-size: 12px;
  font-weight: 600;
  color: var(--vina-muted);
}
.vina-topbar-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--vina-border);
  border-radius: var(--vina-radius-sm);
  background: var(--vina-surface);
  color: var(--vina-text);
  font-size: 13px;
  font-weight: 700;
  transition: background var(--vina-ease), border-color var(--vina-ease);
}
.vina-topbar-menu-btn:hover { background: var(--vina-hover); border-color: var(--vina-orange); }
.vina-topbar-menu-btn svg { width: 18px; height: 18px; }

@media (max-width: 640px) {
  .vina-topbar-brand-copy { display: none; }
  .vina-topbar-menu-btn span { display: none; }
  .vina-topbar-menu-btn { padding: 9px; }
}

/* ============ Right-side navigation drawer ============ */
.vina-nav-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 55;
  display: flex;
  flex-direction: column;
  width: 320px;
  max-width: 100vw;
  background: rgba(var(--vina-surface-strong-rgb), .88);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-left: 1px solid var(--vina-border);
  box-shadow: -24px 0 60px rgba(0,0,0,.28);
  transform: translateX(100%);
  transition: transform var(--vina-ease);
}
.vina-nav-drawer.open { transform: translateX(0); }
.vina-nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--vina-topbar-height);
  padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--vina-border);
  font: 700 14px Manrope, sans-serif;
  color: var(--vina-text);
}
.vina-nav-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--vina-radius-sm);
  color: var(--vina-muted);
  transition: background var(--vina-ease), color var(--vina-ease);
}
.vina-nav-drawer-close:hover { background: var(--vina-hover); color: var(--vina-text); }
.vina-nav-drawer-close svg { width: 18px; height: 18px; }
.vina-nav-drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.vina-nav-drawer-label {
  margin: 14px 12px 6px;
  color: var(--vina-muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.vina-nav-drawer-body > .vina-nav-drawer-label:first-child { margin-top: 4px; }
.vina-nav-drawer-link,
.vina-nav-drawer-foot .vina-nav-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 2px 0;
  padding: 10px 12px;
  border-radius: var(--vina-radius-sm);
  color: var(--vina-text);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--vina-ease), color var(--vina-ease);
}
.vina-nav-drawer-link svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--vina-muted); }
.vina-nav-drawer-link:hover { background: var(--vina-hover); }
.vina-nav-drawer-link.active {
  background: var(--vina-hover);
  color: var(--vina-orange);
  font-weight: 700;
}
.vina-nav-drawer-link.active svg { color: var(--vina-orange); }
.vina-nav-drawer-foot {
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--vina-border);
}
.vina-nav-drawer-foot .vina-logout-action { color: #f87171; }
.vina-nav-drawer-foot .vina-logout-action svg { color: #f87171; }

@media (max-width: 640px) {
  .vina-nav-drawer { width: 100vw; }
}

/* Shared portal dropdown (e.g. Documents "More" menu) — appended to <body> so it escapes
   .glass-card's overflow:hidden clipping instead of nesting inside the card. */
.vina-more-menu {
  overflow: hidden;
  border-radius: var(--vina-radius-sm);
  border: 1px solid var(--vina-border);
  background: rgba(var(--vina-surface-strong-rgb), .92);
  box-shadow: var(--vina-shadow);
  padding: 6px;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}
.vina-more-menu-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--vina-text);
  background: transparent;
}
.vina-more-menu-item:hover { background: var(--vina-surface); }
.vina-more-menu-danger { color: #fb7185; }
.vina-more-menu-danger:hover { background: rgba(244, 63, 94, 0.12); }

/* Super Admin's in-page section jump nav had no CSS at all — its anchor links rendered as
   plain, unstyled, run-together inline text instead of a tab bar. */
.vina-admin-mobile-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.vina-admin-mobile-nav a {
  padding: 8px 14px;
  border: 1px solid var(--vina-border);
  border-radius: var(--vina-radius-sm);
  background: var(--vina-surface);
  color: var(--vina-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--vina-ease), border-color var(--vina-ease);
}
.vina-admin-mobile-nav a:hover { background: var(--vina-hover); border-color: rgba(var(--vina-primary-rgb), .4); }

/* Global command-palette-style search (Ctrl/Cmd+K or "/") — js/theme.js builds this markup
   on every page but it previously shipped with zero CSS, so the overlay rendered as
   unstyled browser-default boxes wherever it was triggered. */
.vina-global-search {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(4, 8, 16, .6);
  backdrop-filter: blur(3px);
}
.vina-global-search[hidden] { display: none; }
.vina-global-search section {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: 70vh;
  overflow: hidden;
  border: 1px solid var(--vina-glass-border);
  border-radius: var(--vina-radius-lg);
  background: rgba(var(--vina-surface-strong-rgb), .92);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}
.vina-global-search-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--vina-border);
}
.vina-global-search-input > svg:first-child { width: 18px; height: 18px; color: var(--vina-muted); flex: 0 0 auto; }
.vina-global-search-input input {
  flex: 1;
  min-height: 0 !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  font-size: 14px;
}
.vina-global-search-input input:focus { box-shadow: none !important; }
.vina-global-search-input button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--vina-muted);
}
.vina-global-search-input button:hover { background: var(--vina-hover); color: var(--vina-text); }
.vina-global-search-results {
  overflow-y: auto;
  padding: 8px;
}
.vina-global-search-results a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--vina-radius-sm);
  color: var(--vina-text);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.vina-global-search-results a svg:first-child { width: 16px; height: 16px; color: var(--vina-primary); flex: 0 0 auto; }
.vina-global-search-results a svg:last-child { width: 14px; height: 14px; margin-left: auto; color: var(--vina-muted); flex: 0 0 auto; }
.vina-global-search-results a:hover,
.vina-global-search-results a:focus-visible { background: var(--vina-hover); }
.vina-global-search-results p { padding: 24px 12px; text-align: center; color: var(--vina-muted); font-size: 13px; }
body.vina-search-open { overflow: hidden; }

@media (max-width: 640px) {
  header > div { gap: 10px; padding-top: 12px !important; padding-bottom: 12px !important; }
  header h1 { font-size: 15px !important; }
  main { width: 100%; }
  .glass-card { border-radius: var(--vina-radius) !important; }
}

@media print {
  .vina-topbar, .vina-nav-drawer, .vina-drawer-overlay, .vina-toast { display: none !important; }
  body.vina-app-shell { padding-top: 0 !important; }
}

/* ============================================================================
   POS / Create Invoice — full rebuild (2nd pass). Every input/select/button in
   this page shares one control height (--vina-control-h) so mixed rows (label +
   input + stepper + icon button) always land on the same baseline.
   ============================================================================ */
.vina-pos-page {
  width: min(100%, 1800px);
  margin-inline: auto;
  padding-inline: clamp(14px, 2vw, 28px);
  padding-bottom: 40px;
}
.vina-pos-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.vina-pos-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.vina-pos-meta > span {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--vina-border);
  border-radius: 8px;
  background: var(--vina-surface);
  font-weight: 600;
}

/* Left 68-70% / preview 30-32%, capped so the preview column can never grow past a sane
   reading width on very wide screens — any leftover space goes to the 1fr left column
   instead of sitting empty next to a narrower, centered preview stage. */
.vina-pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px minmax(380px, var(--vina-pos-preview-width, min(32%, 620px)));
  gap: clamp(16px, 1.6vw, 24px);
  align-items: start;
}
.vina-pos-workspace, .vina-pos-preview-column { min-width: 0; }
.vina-pos-workspace { display: flex; flex-direction: column; gap: 16px; }

/* One card shell for every section — replaces the ad-hoc glass-card + p-4/p-6 Tailwind mix
   with one consistent, compact padding everywhere. */
.vina-pos-card {
  border: 1px solid var(--vina-border);
  border-radius: var(--vina-radius);
  background: var(--vina-surface);
  box-shadow: var(--vina-shadow);
  padding: 18px 20px;
}
.vina-pos-section-title { font: 700 15px/1.3 Manrope, Inter, sans-serif; color: var(--vina-text); }
.vina-pos-section-hint { margin-top: 2px; font-size: 12.5px; color: var(--vina-muted); }
.vina-pos-subsection-title { font: 700 12.5px/1.3 Manrope, Inter, sans-serif; color: var(--vina-text); text-transform: uppercase; letter-spacing: .03em; }
.vina-pos-divider { margin: 16px 0; border-top: 1px solid var(--vina-border); }

/* Every text input / select / textarea / button in the POS page shares one height so a
   label+input pair next to a stepper next to an icon button always align. Textareas and
   the item-name/notes fields opt out of the fixed height via min-height instead. */
.vina-pos-page input:not([type="checkbox"]):not([type="date"]),
.vina-pos-page select,
.vina-pos-page .vina-pos-btn {
  height: var(--vina-control-h);
}
.vina-pos-page input[type="date"] { height: var(--vina-control-h); }
.vina-pos-page input,
.vina-pos-page select,
.vina-pos-page textarea {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--vina-border) !important;
  border-radius: 10px !important;
  background: var(--vina-surface) !important;
  color: var(--vina-text) !important;
  font-size: 13.5px;
}
.vina-pos-page textarea { height: auto; padding: 10px 12px; line-height: 1.4; }
.vina-pos-page label { display: block; font-size: 12.5px; font-weight: 600; color: var(--vina-muted); }
.vina-pos-page label > span { display: block; margin-bottom: 5px; }

/* Standard button (Select from Inventory / Add Manual Item / Clear / Print / PDF / etc.) —
   one consistent height/radius/weight everywhere in this page instead of the mix of
   px-3/px-4, py-2/py-3, text-xs/text-sm sizes that had accumulated. */
.vina-pos-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  border: 1px solid var(--vina-border);
  border-radius: var(--vina-radius-sm);
  background: var(--vina-surface);
  color: var(--vina-text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background var(--vina-ease), border-color var(--vina-ease), filter var(--vina-ease);
}
.vina-pos-btn:hover { background: var(--vina-hover); }
.vina-pos-btn-sm { height: 34px; padding: 0 12px; font-size: 12.5px; }

/* ---------------- Invoice + Customer (merged into one card) ---------------- */
.vina-pos-doc-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
/* Template keeps its own row — names ("Jewellery Invoice (Legacy)", or any custom name a
   user creates) need real room, and native <select> hard-clips instead of ellipsizing
   when its column is too narrow, which a 4-across row could not reliably guarantee. */
.vina-pos-template-row { margin-top: 12px; max-width: 420px; }
.vina-pos-customer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.vina-pos-customer-grid.vina-pos-2col { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------------- Billing Items toolbar ---------------- */
.vina-pos-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.vina-pos-toolbar .vina-pos-search { flex: 1 1 260px; min-width: 0; }
.vina-pos-mode-tabs { display: inline-flex; flex: 0 0 auto; gap: 6px; padding: 4px; border-radius: 12px; background: var(--vina-surface-soft); }
/* The inactive tab's own bg-white/5 Tailwind class is invisible in light mode (white-on-white)
   — give every tab a themed resting background here so it reads in both themes; the active
   tab's gradient (via button[class*="bg-orange-600"] above, !important) still wins over this. */
.vina-pos-mode-tabs button { height: 34px; padding: 0 14px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--vina-muted); background: var(--vina-surface); }
.vina-pos-mode-tabs button.bg-orange-600 { color: #fff; }
.vina-scan-card {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  height: 36px;
  border: 1px solid var(--vina-border);
  border-radius: var(--vina-radius-sm);
  background: var(--vina-surface-soft);
}
.vina-scan-card input { height: 26px !important; min-height: 0; border: 0 !important; background: transparent !important; padding: 0 !important; font-size: 13px; }
.vina-scan-card button { flex: 0 0 auto; height: 26px; padding: 0 12px; font-size: 12px; }

/* ---------------- Manual item form ---------------- */
.vina-manual-item-form {
  width: 100%;
  padding: 16px;
  border-radius: var(--vina-radius);
  background: var(--vina-surface-soft);
  border: 1px solid var(--vina-border);
}
/* Fixed column counts (not auto-fit) so a floor-width track never has to fight the
   lg:col-span-4 / sm:col-span-2 spans already on Name/Description/jewellery-fields below. */
.vina-manual-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1023px) { .vina-manual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .vina-manual-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------------- Billing items — compact ERP-style table ---------------- */
.vina-pos-items-shell {
  overflow: hidden;
  border: 1px solid var(--vina-border);
  border-radius: var(--vina-radius);
}
.vina-pos-table-head, .vina-pos-item-row {
  display: grid;
  grid-template-columns: 20px minmax(120px, 1.7fr) 78px 76px 78px 62px 54px 86px 60px;
  gap: 8px;
  align-items: center;
}
.vina-pos-table-head {
  padding: 8px 12px;
  background: var(--vina-surface-soft);
  color: var(--vina-muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.vina-pos-table-head > span:nth-child(8) { text-align: right; }
.vina-pos-item-list { display: flex; flex-direction: column; }
.vina-pos-item-row {
  padding: 8px 12px;
  border-top: 1px solid var(--vina-border);
  background: var(--vina-surface);
}
.vina-pos-item-row:hover { background: var(--vina-hover); }
.vina-pos-line-number { font-size: 11px; font-weight: 800; color: var(--vina-muted); text-align: center; }
.vina-pos-item-main { min-width: 0; }
.vina-pos-name-input { font-weight: 700 !important; }
.vina-pos-item-meta { margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--vina-muted); font-size: 11px; }
.vina-pos-source-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  vertical-align: middle;
}
.vina-pos-source-badge.inventory { background: rgba(37, 99, 235, .14); color: #60a5fa; }
.vina-pos-source-badge.manual { background: rgba(22, 163, 74, .14); color: #4ade80; }
/* Every direct-child <input> in a row (Rate/Discount/GST) is already its own grid item by
   virtue of being a direct child of .vina-pos-item-row — this just sizes them uniformly. */
.vina-pos-item-row > input { height: 34px !important; padding: 0 8px !important; font-size: 12.5px; text-align: center; }
/* Unwraps a wrapper element (e.g. the GST <span data-gst-only>) so its child input becomes
   the direct grid item in that column instead of the wrapper itself taking the slot. */
.vina-pos-unwrap { display: contents; }
/* HSN/Unit share one column as a compact 2-row stack instead of each needing a full column. */
.vina-pos-cell-stack { display: grid; gap: 3px; }
.vina-pos-cell-stack input { height: 20px !important; padding: 0 6px !important; font-size: 10.5px; text-align: left; }
.vina-pos-qty { display: flex; align-items: center; justify-content: center; gap: 4px; }
.vina-pos-qty button {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1px solid var(--vina-border);
  background: var(--vina-surface);
  color: var(--vina-text);
  font-weight: 800;
}
.vina-pos-qty strong { min-width: 20px; text-align: center; font-size: 12.5px; }
.vina-pos-line-total { text-align: right; font-size: 12.5px; font-weight: 800; color: var(--vina-text); }
.vina-pos-line-actions { display: flex; gap: 4px; justify-content: center; }
.vina-pos-line-actions button {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  font-size: 10.5px;
}
.vina-pos-line-actions .delete { border: 1px solid rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .1); color: #fca5a5; }
.vina-pos-line-actions .edit { border: 1px solid var(--vina-border); background: var(--vina-surface-soft); color: var(--vina-muted); }

/* Jewellery-mode extra fields render as a tight sub-grid beneath the compact row, inside
   the same bordered row — still far less bulky than the old full-card treatment. */
.vina-pos-jewellery-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--vina-border);
}
.vina-pos-jewellery-grid input { height: 32px !important; padding: 0 8px !important; font-size: 12px; }
.vina-pos-jewellery-grid label > span { font-size: 10px; margin-bottom: 2px; }
.vina-pos-jewellery-grid .vina-pos-check { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 11.5px; }

.vina-pos-empty {
  display: grid;
  min-height: 110px;
  place-items: center;
  gap: 4px;
  text-align: center;
  padding: 16px;
}
.vina-pos-empty p:first-child { font-weight: 700; color: var(--vina-text); }
.vina-pos-empty p:last-child { font-size: 12.5px; color: var(--vina-muted); }

/* ---------------- Charges & Payment — one financial summary card ---------------- */
.vina-pos-field-group { border: 1px solid var(--vina-border); border-radius: var(--vina-radius); background: var(--vina-surface-soft); padding: 14px 16px; }
.vina-pos-charges-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
@media (max-width: 1279px) { .vina-pos-charges-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .vina-pos-charges-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .vina-pos-charges-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------------- Collapsible Jewellery Details ---------------- */
.vina-pos-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}
.vina-pos-details > summary::-webkit-details-marker { display: none; }
.vina-pos-details > summary .vina-pos-chevron { transition: transform var(--vina-ease); color: var(--vina-muted); }
.vina-pos-details[open] > summary .vina-pos-chevron { transform: rotate(180deg); }
.vina-pos-details > summary ~ * { margin-top: 14px; }

/* ---------------- Summary + Finalize ---------------- */
.vina-pos-summary-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.vina-pos-kv { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.vina-pos-kv-total { padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--vina-border); font-size: 15px; font-weight: 800; }

/* ---------------- Preview panel ---------------- */
.vina-pos-preview-sticky {
  position: sticky;
  top: calc(var(--vina-topbar-height, 64px) + 16px);
  max-height: calc(100vh - var(--vina-topbar-height, 64px) - 32px);
  overflow: auto;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vina-pos-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--vina-border);
  border-radius: 12px;
  background: var(--vina-surface);
  box-shadow: var(--vina-shadow);
}
.vina-pos-preview-toolbar-group { display: flex; align-items: center; gap: 4px; }
.vina-pos-preview-toolbar button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--vina-muted);
  font-size: 11.5px;
  font-weight: 700;
}
.vina-pos-preview-toolbar button:hover { background: var(--vina-hover); color: var(--vina-text); }
.vina-pos-preview-toolbar button.is-active { background: var(--vina-hover); color: var(--vina-orange); }
.vina-pos-preview-toolbar button svg { width: 14px; height: 14px; }
.vina-pos-preview-toolbar-divider { width: 1px; align-self: stretch; background: var(--vina-border); margin: 0 2px; }
.vina-pos-preview-toolbar .vina-pos-btn-primary { color: #fff; background: var(--vina-gradient-primary); }
.vina-pos-preview-toolbar .vina-pos-btn-primary:hover { filter: brightness(1.08); }

/* A5 portrait ratio (148:210mm) so the frame's box always hugs the real page — no cap here
   since the outer grid column above is already capped, so this can safely fill 100% of it
   without creating the dead space a second, smaller max-width used to leave beside it. */
.vina-pos-preview-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 148 / 210;
  border-radius: var(--vina-radius);
  overflow: hidden;
  box-shadow: var(--vina-shadow);
  background: #fff;
}
.vina-pos-preview-frame { width: 100%; height: 100%; display: block; }
/* Shown only while the iframe has no template to render (getDefaultHtmlTemplate() returned
   nothing) — previously the column just went fully blank with nothing in its place. */
.vina-pos-preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  text-align: center;
  background: var(--vina-surface-strong);
  color: var(--vina-muted);
}
.vina-pos-preview-placeholder svg { width: 40px; height: 40px; opacity: .55; }
.vina-pos-preview-placeholder strong { color: var(--vina-text); font-size: 14px; }
.vina-pos-preview-placeholder span { font-size: 12.5px; max-width: 34ch; }
.vina-pos-preview-placeholder.hidden, .vina-pos-preview-frame.hidden { display: none; }

/* ---------------- Mobile/tablet sticky action bar ---------------- */
.vina-pos-bottom-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--vina-border);
  background: var(--vina-surface-strong);
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 -10px 30px rgba(0,0,0,.25);
}
.vina-pos-bottom-bar button {
  flex: 1 1 0;
  min-height: 44px;
  border-radius: var(--vina-radius-sm);
  background: var(--vina-surface-soft);
  border: 1px solid var(--vina-border);
  color: var(--vina-text);
  font-size: 12.5px;
  font-weight: 700;
}
.vina-pos-bottom-bar button[data-pos-trigger="completeSale"] {
  flex: 1.3 1 0;
  background: linear-gradient(135deg, #34d399, #059669);
  border-color: rgba(110,231,183,.3);
  color: #fff;
}

@media (max-width: 1100px) {
  .vina-pos-layout { grid-template-columns: 1fr; }
  .vina-pos-preview-sticky { position: static; max-height: none; }
  .vina-pos-resizer { display: none; }
  .vina-pos-bottom-bar { display: flex; }
  .vina-pos-page { padding-bottom: 84px; }
  .vina-pos-summary-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .vina-pos-customer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .vina-pos-customer-grid { grid-template-columns: 1fr; }
}
/* Below ~760px the 9-column item row no longer has room to stay legible; let just this
   table scroll horizontally (a standard, contained ERP-table pattern) instead of forcing
   every column to compress into unreadable slivers or overflowing the whole page. */
@media (max-width: 900px) {
  .vina-pos-items-shell { overflow-x: auto; }
  .vina-pos-table-head, .vina-pos-item-row { width: max-content; min-width: 100%; }
}

@media (max-width: 640px) {
  /* js/theme.js's enhanceResponsiveTables() already tags every td with data-label and every
     table with .vina-data-table; this is the matching CSS to fold wide tables into a stacked
     card layout on phones, which was never written (tables just overflowed the page instead). */
  table.vina-data-table thead { display: none; }
  table.vina-data-table, table.vina-data-table tbody, table.vina-data-table tr, table.vina-data-table td {
    display: block; width: 100%;
  }
  table.vina-data-table tr {
    margin-bottom: 10px;
    border: 1px solid var(--vina-border);
    border-radius: 12px;
    padding: 6px 12px;
    background: var(--vina-surface);
  }
  table.vina-data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border: 0;
    border-top: 1px solid var(--vina-border);
    text-align: right;
  }
  table.vina-data-table td:first-child { border-top: 0; }
  table.vina-data-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--vina-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: left;
  }
}
