/* ============================================================
   G-Town Panipat — Liquor Inventory Management
   Design system & global styles
   ============================================================ */

:root {
  /* Brand / accent */
  --brand: #1d4ed8;
  --brand-600: #2563eb;
  --brand-700: #1e40af;
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;

  /* Semantic */
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #0891b2;
  --info-bg: #cffafe;

  /* Neutrals */
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;

  /* Layout */
  --sidebar-w: 256px;
  --topbar-h: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, .08), 0 2px 4px -2px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, .12), 0 8px 10px -6px rgba(15, 23, 42, .08);
  --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, .25);

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-600); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--text); }
::selection { background: var(--brand-100); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

/* ============================================================
   LOGIN
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: linear-gradient(135deg, #0b1f4d 0%, #1d4ed8 55%, #3b82f6 100%);
}
.auth-hero {
  position: relative;
  color: #fff;
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.auth-hero::after {
  content: "🍾";
  position: absolute;
  right: -40px; bottom: -50px;
  font-size: 360px;
  opacity: .08;
  transform: rotate(-12deg);
}
.auth-hero .brand-badge {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 28px;
}
.auth-hero .brand-badge .logo {
  width: 46px; height: 46px; border-radius: 12px;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center; font-size: 26px;
  backdrop-filter: blur(6px);
}
.auth-hero h1 { color: #fff; font-size: 40px; line-height: 1.1; letter-spacing: -1px; max-width: 14ch; }
.auth-hero p { color: rgba(255,255,255,.82); font-size: 16px; max-width: 42ch; margin-top: 16px; }
.auth-hero .feat-list { margin-top: 36px; display: grid; gap: 14px; }
.auth-hero .feat-list .row { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.92); font-size: 14.5px; }
.auth-hero .feat-list .tick {
  width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.18);
  display: grid; place-items: center; font-size: 12px; flex: none;
}
.auth-panel { background: var(--surface); display: grid; place-items: center; padding: 40px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 26px; letter-spacing: -.5px; }
.auth-card .sub { color: var(--text-2); margin: 8px 0 28px; }
.auth-card .demo-hint {
  margin-top: 22px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--brand-50); border: 1px dashed var(--brand-100); font-size: 12.5px; color: var(--text-2);
}
.auth-card .demo-hint b { color: var(--brand-700); }
.auth-card .demo-hint .chip { cursor: pointer; }

@media (max-width: 880px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

/* ============================================================
   APP SHELL
   ============================================================ */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  z-index: 30;
}
.sidebar .brand {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 11px;
  padding: 0 18px; border-bottom: 1px solid var(--border);
}
.sidebar .brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  display: grid; place-items: center; color: #fff; font-size: 18px; flex: none;
}
.sidebar .brand .name { font-weight: 800; color: var(--brand-700); font-size: 16px; letter-spacing: -.3px; line-height: 1; }
.sidebar .brand .name small { display: block; font-weight: 500; font-size: 10.5px; color: var(--text-3); letter-spacing: .3px; margin-top: 3px; }

.nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.nav .group-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--text-3); padding: 14px 12px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; font-size: 13.5px;
  margin-bottom: 2px; transition: background .12s, color .12s; position: relative;
}
.nav a .ico { width: 18px; text-align: center; font-size: 15px; flex: none; opacity: .85; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.nav a.active::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px;
  background: var(--brand-600); border-radius: 0 3px 3px 0;
}
.nav a.danger:hover { background: var(--danger-bg); color: var(--danger); }
.nav .badge-count {
  margin-left: auto; background: var(--brand-100); color: var(--brand-700);
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px;
}

/* Main column */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h); flex: none;
  background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.topbar .menu-toggle { display: none; }
.topbar .page-title { font-size: 16px; font-weight: 700; }
.topbar .crumbs { color: var(--text-3); font-size: 12px; margin-top: 1px; }
.topbar .spacer { flex: 1; }
.topbar .topbar-search {
  position: relative; width: 280px; max-width: 32vw;
}
.topbar .topbar-search input {
  width: 100%; height: 38px; border: 1px solid var(--border); border-radius: 99px;
  padding: 0 14px 0 36px; background: var(--surface-2); font-size: 13px;
}
.topbar .topbar-search .si { position: absolute; left: 12px; top: 9px; color: var(--text-3); }
.topbar .icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; cursor: pointer; position: relative;
  color: var(--text-2); font-size: 16px;
}
.topbar .icon-btn:hover { background: var(--surface-2); }
.topbar .icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid var(--surface); }
.topbar .user {
  display: flex; align-items: center; gap: 10px; padding-left: 6px;
}
.topbar .user .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700)); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.topbar .user .meta { line-height: 1.2; }
.topbar .user .meta .n { font-weight: 700; font-size: 13px; }
.topbar .user .meta .r { font-size: 11.5px; color: var(--text-3); }

.content { padding: 24px; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; letter-spacing: -.4px; }
.page-head .desc { color: var(--text-2); margin-top: 4px; font-size: 13.5px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Mobile sidebar */
.scrim { display: none; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: var(--sidebar-w);
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-xl);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 25; }
  .topbar .menu-toggle { display: grid; }
  .topbar .topbar-search { display: none; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: background .12s, box-shadow .12s, border-color .12s, transform .04s; white-space: nowrap;
  background: var(--surface); color: var(--text);
}
.btn:active { transform: translateY(1px); }
.btn .ico { font-size: 15px; }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-700); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-light { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-light:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 7px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 8px; border-color: var(--border); background: var(--surface); color: var(--text-2); }
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn-icon.del:hover { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   CARDS / PANELS
   ============================================================ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; }
.card-head .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.card-body { padding: 18px; }
.card-pad { padding: 18px; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; } }

/* Stat cards */
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat .icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; margin-bottom: 14px;
}
.stat .label { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-top: 3px; }
.stat .trend { font-size: 12px; margin-top: 8px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.stat .trend.up { color: var(--success); }
.stat .trend.down { color: var(--danger); }
.stat .trend.flat { color: var(--text-3); }
.ic-blue { background: var(--brand-50); color: var(--brand-700); }
.ic-green { background: var(--success-bg); color: var(--success); }
.ic-amber { background: var(--warning-bg); color: var(--warning); }
.ic-red { background: var(--danger-bg); color: var(--danger); }
.ic-cyan { background: var(--info-bg); color: var(--info); }
.ic-violet { background: #ede9fe; color: #7c3aed; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl thead th {
  text-align: left; font-weight: 700; color: var(--text-2); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .4px; padding: 11px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0;
}
table.tbl thead th.sortable { cursor: pointer; user-select: none; }
table.tbl thead th.sortable:hover { color: var(--text); }
table.tbl thead th .arr { opacity: .4; margin-left: 3px; }
table.tbl thead th.sorted .arr { opacity: 1; color: var(--brand-600); }
table.tbl tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr:hover { background: var(--brand-50); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .actions-cell { text-align: right; white-space: nowrap; }
table.tbl .actions-cell .btn-icon { margin-left: 4px; }
.row-muted td { color: var(--text-3); }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty-state .emoji { font-size: 44px; display: block; margin-bottom: 12px; opacity: .8; }
.empty-state h4 { color: var(--text-2); font-size: 15px; }
.empty-state p { margin: 6px 0 0; font-size: 13px; }

/* Toolbar above tables */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 160px; }
.search-box { position: relative; }
.search-box input { padding-left: 34px; }
.search-box .si { position: absolute; left: 11px; top: 9px; color: var(--text-3); pointer-events: none; }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; gap: 10px; }
.pager .pages { display: flex; gap: 6px; }
.pager .pages button { min-width: 32px; height: 32px; border: 1px solid var(--border); background: var(--surface); border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--text-2); }
.pager .pages button:hover { background: var(--surface-2); }
.pager .pages button.active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pager .pages button:disabled { opacity: .4; cursor: not-allowed; }

/* ============================================================
   FORMS
   ============================================================ */
.field { margin-bottom: 16px; }
.field > label { display: block; font-weight: 600; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.field .req { color: var(--danger); }
input, select, textarea {
  width: 100%; height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 12px; font-family: inherit; font-size: 13.5px; color: var(--text); background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:disabled, select:disabled { background: var(--surface-2); color: var(--text-2); cursor: not-allowed; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-grid { display: grid; gap: 0 18px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.input-prefix { position: relative; }
.input-prefix .pfx { position: absolute; left: 12px; top: 10px; color: var(--text-3); font-weight: 600; }
.input-prefix input { padding-left: 26px; }
.checkbox { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.checkbox input { width: 18px; height: 18px; }
.field-error { color: var(--danger); font-size: 11.5px; margin-top: 5px; }
input.invalid, select.invalid { border-color: var(--danger); }

/* ============================================================
   BADGES / PILLS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; line-height: 1.4; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge-green { background: var(--success-bg); color: #15803d; }
.badge-amber { background: var(--warning-bg); color: #b45309; }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-blue { background: var(--brand-50); color: var(--brand-700); }
.badge-cyan { background: var(--info-bg); color: #0e7490; }
.badge-gray { background: #f1f5f9; color: var(--text-2); }
.badge-violet { background: #ede9fe; color: #7c3aed; }

.cat-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 60; padding: 20px; animation: fade .15s ease;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  box-shadow: var(--shadow-xl); max-height: 92vh; display: flex; flex-direction: column; animation: pop .18s ease;
}
.modal.lg { max-width: 860px; }
.modal.xl { max-width: 1080px; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; }
.modal-head .sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.modal-head .x { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-3); line-height: 1; padding: 4px 8px; border-radius: 8px; }
.modal-head .x:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex-wrap: wrap; }
.modal-foot.between { justify-content: space-between; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ============================================================
   TOASTS
   ============================================================ */
#toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: flex-start; gap: 11px; background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--brand-600); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: 13px 15px; min-width: 280px; max-width: 380px; animation: slidein .22s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast .ti { font-size: 18px; line-height: 1.2; }
.toast .tc .tt { font-weight: 700; font-size: 13.5px; }
.toast .tc .tm { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.toast .tx { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--text-3); font-size: 16px; }
@keyframes slidein { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }

/* ============================================================
   MISC HELPERS
   ============================================================ */
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: "Consolas", "SF Mono", monospace; }
.fw-700 { font-weight: 700; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.tag-soft { font-size: 11px; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 7px; border-radius: 6px; }

/* Two-column page layout */
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 980px) { .split { grid-template-columns: 1fr; } }

/* POS & billing two-column layouts (responsive) */
.pos-layout, .bill-layout { display: grid; align-items: start; }
.pos-layout { grid-template-columns: 1.7fr 1fr; gap: 16px; }
.bill-layout { grid-template-columns: 1.7fr 1fr; gap: 18px; }
/* allow columns to shrink so inner tables scroll instead of overflowing the page */
.pos-layout > *, .bill-layout > *, .split > * { min-width: 0; }
@media (max-width: 980px) {
  .pos-layout, .bill-layout { grid-template-columns: 1fr; }
  .pos-layout .pos-summary { position: static !important; }
}

/* Definition list */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 13.5px; }
.dl dt { color: var(--text-3); font-weight: 600; }
.dl dd { margin: 0; font-weight: 600; text-align: right; }

/* Progress bar (e.g. stock level) */
.bar { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--brand-600); }
.bar.ok > span { background: var(--success); }
.bar.low > span { background: var(--warning); }
.bar.out > span { background: var(--danger); }

/* Chart */
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis { stroke: var(--border); stroke-width: 1; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .lbl { fill: var(--text-3); font-size: 10px; }
.chart .bar-rect { fill: var(--brand-600); transition: fill .15s; }
.chart .bar-rect:hover { fill: var(--brand-700); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend .li { display: flex; align-items: center; gap: 6px; }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; }

/* Line-item editor (billing / receiving) */
.li-table input, .li-table select { height: 34px; font-size: 13px; }
.li-table td { padding: 7px 8px; }
.li-add-row td { padding-top: 12px; }
.li-table .li-prod { min-width: 210px; }
.li-table .li-prod select { width: 100%; text-overflow: ellipsis; }

/* Totals box */
.totals { font-size: 13.5px; }
.totals .row { display: flex; justify-content: space-between; padding: 6px 0; }
.totals .row.grand { border-top: 2px solid var(--border-strong); margin-top: 6px; padding-top: 12px; font-size: 18px; font-weight: 800; }
.totals .row .lbl { color: var(--text-2); }

/* Calendar (dayoff) */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; padding-bottom: 4px; }
.cal .cell { aspect-ratio: 1 / .82; border: 1px solid var(--border); border-radius: 9px; padding: 7px; font-size: 12px; position: relative; background: var(--surface); }
.cal .cell.muted { background: var(--surface-2); color: var(--text-3); }
.cal .cell.today { border-color: var(--brand-600); box-shadow: 0 0 0 1px var(--brand-600) inset; }
.cal .cell.off { background: var(--danger-bg); border-color: #fecaca; }
.cal .cell.off .tagx { position: absolute; bottom: 6px; left: 7px; right: 7px; font-size: 9.5px; font-weight: 700; color: var(--danger); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .cell .dnum { font-weight: 700; }

/* Print invoice */
.invoice { font-size: 13px; color: #111; }
.invoice .inv-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.invoice h2 { font-size: 22px; }
.invoice table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.invoice table th, .invoice table td { border: 1px solid var(--border); padding: 8px 10px; font-size: 12.5px; }
.invoice table th { background: var(--surface-2); text-align: left; }

@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; left: 0; top: 0; width: 100%; padding: 20px; }
  .no-print { display: none !important; }
}

/* Segmented control */
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 3px; }
.segmented button { border: none; background: none; padding: 6px 14px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm); }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%); background-size: 400% 100%; animation: sk 1.3s infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
