/* ============================================================
   AVISSEE — POS Terminal Theme
   ============================================================ */
:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --surface2: #1f2b47;
  --ink: #e8e8e8;
  --muted: #8892a4;
  --line: #2a3a5c;
  --accent: #e94560;
  --accent-dark: #c73a52;
  --accent-soft: rgba(233,69,96,.12);
  --success: #2ecc71;
  --success-soft: rgba(46,204,113,.12);
  --danger: #e74c3c;
  --danger-soft: rgba(231,76,60,.12);
  --info: #3498db;
  --info-soft: rgba(52,152,219,.12);
  --warn: #f39c12;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(0,0,0,.3);
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-display: 'Quicksand', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14.5px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }
h1, h2, h3 { line-height: 1.25; }

.muted { color: var(--muted); }
.w-100 { width: 100%; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(231,76,60,.25); }
.alert-success { background: var(--success-soft); color: var(--success); border: 1px solid rgba(46,204,113,.25); }

/* ── Login ──────────────────────────────────────────────── */
.pos-login-body { display: grid; place-items: center; min-height: 100vh; background: var(--bg); }
.pos-login {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 36px 32px; width: 380px; max-width: 92vw;
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
}
.pos-login-brand { text-align: center; margin-bottom: 24px; }
.pos-login-brand strong { font-family: var(--font-display); font-size: 22px; display: block; }
.pos-login-brand small { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.pos-login .field { margin-bottom: 16px; }
.pos-login .field label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; color: var(--muted); }
.pos-login .field input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; background: var(--surface2); color: var(--ink);
}
.pos-login .field input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: 10px; padding: 11px 20px;
  font-weight: 700; font-size: 13.5px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-outline { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #27ae60; }

/* ── Shell (main layout) ────────────────────────────────── */
.pos-shell { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.pos-side {
  background: #0f1629; color: #cfc6bb; padding: 22px 14px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.pos-brand { display: block; padding: 4px 8px 20px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 16px; color: #fff; }
.pos-brand strong { font-family: var(--font-display); font-weight: 700; font-size: 17px; display: block; }
.pos-brand small { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: #6b7a96; font-weight: 600; }
.pos-nav { display: flex; flex-direction: column; gap: 3px; }
.pos-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 10px; font-weight: 600; font-size: 14px; color: #cfc6bb;
}
.pos-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.pos-nav a.on { background: var(--accent); color: #fff; }
.nav-ico { width: 20px; text-align: center; font-size: 16px; opacity: .9; }
.pos-side-foot {
  margin-top: auto; display: flex; flex-direction: column; gap: 2px;
  border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px;
}
.pos-side-foot a { padding: 8px 12px; border-radius: 8px; font-size: 13px; color: #b3a89c; }
.pos-side-foot a:hover { color: #fff; background: rgba(255,255,255,.06); }

.pos-main { display: flex; flex-direction: column; min-width: 0; }
.pos-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.pos-topbar h1 { font-size: 18px; }
.pos-topbar p { color: var(--muted); font-size: 12.5px; }
.pos-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.pos-user strong, .pos-user small { display: block; }
.pos-user small { color: var(--muted); font-size: 11.5px; }

.pos-content { padding: 20px 24px 32px; flex: 1; }
.pos-footer {
  padding: 14px 24px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px; background: var(--surface);
}

/* ── POS Grid (sale page: products + cart) ──────────────── */
.pos-grid { display: grid; grid-template-columns: 1fr 380px; gap: 0; height: calc(100vh - 60px); }
.pos-products { display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--line); }

/* ── Search Bar ─────────────────────────────────────────── */
.pos-search-bar {
  display: flex; gap: 10px; padding: 16px 24px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.pos-search-bar input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; background: var(--surface2); color: var(--ink); font-size: 15px;
}
.pos-search-bar input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

/* ── Product Results Grid ───────────────────────────────── */
.pos-results {
  flex: 1; overflow-y: auto; padding: 16px 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; align-content: start;
}
.pos-results .pos-empty,
.pos-cart-items .pos-empty {
  grid-column: 1 / -1; text-align: center; color: var(--muted);
  padding: 60px 20px; font-size: 14px;
}

.pos-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column; gap: 6px;
}
.pos-item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.pos-item-img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px;
  background: var(--surface2);
}
.pos-item-img.no-img {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--muted); font-size: 28px;
}
.pos-item-name { font-weight: 700; font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pos-item-meta { font-size: 11.5px; color: var(--muted); }
.pos-item-price { font-weight: 800; font-size: 15px; color: var(--accent); }
.pos-item-mrp { font-size: 11.5px; color: var(--muted); text-decoration: line-through; }
.pos-item-stock { font-size: 11px; color: var(--success); }

/* ── Cart Panel ─────────────────────────────────────────── */
.pos-cart {
  display: flex; flex-direction: column; background: var(--surface);
  height: calc(100vh - 60px);
}
.pos-cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.pos-cart-head h2 { font-size: 16px; }

.pos-cart-items {
  flex: 1; overflow-y: auto; padding: 12px 16px;
}

.pos-cart-line {
  display: grid; grid-template-columns: 1fr auto; gap: 6px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  align-items: start;
}
.pos-cart-line:last-child { border-bottom: 0; }
.pos-cart-line-name { font-weight: 700; font-size: 13px; }
.pos-cart-line-meta { font-size: 11.5px; color: var(--muted); }
.pos-cart-line-price { font-weight: 700; font-size: 13px; text-align: right; }
.pos-cart-line-qty {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.pos-cart-line-qty button {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface2); color: var(--ink); cursor: pointer;
  display: grid; place-items: center; font-size: 16px; font-weight: 700;
}
.pos-cart-line-qty button:hover { border-color: var(--accent); color: var(--accent); }
.pos-cart-line-qty span { font-weight: 700; font-size: 14px; min-width: 24px; text-align: center; }
.pos-cart-line-remove {
  background: none; border: 0; color: var(--danger); cursor: pointer;
  font-size: 12px; font-weight: 700; padding: 0; margin-left: auto;
}

/* ── Cart Summary ───────────────────────────────────────── */
.pos-cart-summary {
  padding: 16px 20px; border-top: 1px solid var(--line);
}
.pos-summary-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0; font-size: 13.5px;
}
.pos-summary-row strong { font-size: 14px; }
.pos-summary-row.pos-grand {
  border-top: 2px solid var(--line); margin-top: 8px; padding-top: 10px;
}
.pos-summary-row.pos-grand strong { font-size: 20px; color: var(--accent); }
.pos-disc-input {
  width: 90px; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 8px; background: var(--surface2); color: var(--ink);
  text-align: right; font-size: 13px;
}
.pos-disc-input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* ── Cart Actions ───────────────────────────────────────── */
.pos-cart-actions {
  padding: 16px 20px; border-top: 1px solid var(--line);
}
.pos-cart-actions .field { margin-bottom: 10px; }
.pos-cart-actions .field label { display: block; font-size: 11.5px; font-weight: 700; margin-bottom: 4px; color: var(--muted); }
.pos-cart-actions select,
.pos-cart-actions input {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 12px; background: var(--surface2); color: var(--ink);
}

/* ── Cart channel / platform tag ───────────────────────── */
.pos-cart-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; margin-top: 2px;
}
.pos-tag-online  { background: var(--info-soft); color: var(--info); }
.pos-tag-offline { background: var(--success-soft); color: var(--success); }

/* ── Report profit / loss ───────────────────────────────── */
.pos-profit { color: var(--success); font-weight: 700; }
.pos-loss { color: var(--danger); font-weight: 700; }
tfoot td { border-top: 2px solid var(--line); }

/* ── Product Picker Modal ──────────────────────────────── */
.pos-picker {
  text-align: left; min-width: 520px; max-width: 640px;
  padding: 28px; position: relative;
}
.pos-picker-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: 0; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px;
}
.pos-picker-close:hover { color: var(--ink); }

.pos-picker-head {
  display: flex; gap: 14px; align-items: center; margin-bottom: 4px;
}
.pos-picker-img {
  width: 68px; height: 68px; border-radius: 10px; object-fit: cover;
  background: var(--surface2); flex-shrink: 0;
}
.pos-picker-head h2 { font-size: 16px; line-height: 1.3; }
.pos-picker-head .muted { font-size: 12.5px; margin-top: 2px; }

.pos-picker-section { margin-top: 18px; }
.pos-picker-section > label {
  display: block; font-size: 11.5px; font-weight: 700; color: var(--muted);
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em;
}

.pos-tile-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-tile {
  border: 1.5px solid var(--line); background: var(--surface2); color: var(--ink);
  border-radius: 10px; padding: 10px 16px; cursor: pointer;
  font-weight: 700; font-size: 13px; text-align: center;
  transition: all .12s; min-width: 56px;
}
.pos-tile:hover { border-color: var(--accent); color: var(--accent); }
.pos-tile.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pos-tile:disabled { opacity: .35; cursor: not-allowed; }
.pos-size-tile { display: flex; flex-direction: column; gap: 2px; min-width: 72px; }
.pos-size-tile strong { font-size: 15px; }
.pos-size-tile small { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.pos-size-tile.on small { color: var(--accent); }

.pos-channel-tabs { display: flex; gap: 8px; }
.pos-channel-tabs button {
  flex: 1; padding: 11px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--surface2);
  color: var(--muted); font-weight: 800; font-size: 13.5px; cursor: pointer;
  transition: all .12s;
}
.pos-channel-tabs button:hover { border-color: var(--info); color: var(--ink); }
.pos-channel-tabs button.on {
  border-color: var(--info); background: var(--info-soft); color: var(--info);
}

.pos-platform-pay-note {
  margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.5;
  padding-left: 4px;
}
.pos-picker-add { margin-top: 22px; }

/* ── Modal ──────────────────────────────────────────────── */
.pos-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: grid; place-items: center; z-index: 100;
}
.pos-modal-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 40px 48px; text-align: center; min-width: 320px; box-shadow: 0 12px 48px rgba(0,0,0,.5);
}
.pos-modal-icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--success-soft);
  color: var(--success); font-size: 32px; display: grid; place-items: center;
  margin: 0 auto 16px;
}
.pos-modal-box h2 { margin-bottom: 8px; }
.pos-modal-box p { color: var(--muted); margin-bottom: 24px; font-size: 14px; }

/* ── Report Page ────────────────────────────────────────── */
.report-filters { margin-bottom: 20px; }
.report-filters-form {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
}
.report-filters .field { margin-bottom: 0; }
.report-filters .field label { display: block; font-size: 11.5px; font-weight: 700; margin-bottom: 4px; color: var(--muted); }
.report-filters input,
.report-filters select {
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px;
  background: var(--surface2); color: var(--ink);
}
.pos-report-btns { display: flex; gap: 8px; margin-left: auto; }

@media (max-width: 720px) {
  .report-filters-form .field { flex: 1 1 100%; }
  .pos-report-btns { margin-left: 0; }
}

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.stat-card span { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-card strong { display: block; font-size: 24px; margin-top: 4px; }

.card-section {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card-section h2 { font-size: 15px; margin-bottom: 14px; }

/* ── Tables ─────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); padding: 8px 10px;
  border-bottom: 2px solid var(--line);
}
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table small { display: block; color: var(--muted); font-size: 11.5px; }
.table tr:hover td { background: rgba(255,255,255,.02); }
.empty-note { text-align: center; color: var(--muted); padding: 30px !important; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; background: var(--surface2); color: var(--muted);
}
.badge-cash { background: var(--success-soft); color: var(--success); }
.badge-upi { background: var(--info-soft); color: var(--info); }
.badge-card { background: rgba(155,89,182,.12); color: #9b59b6; }
.badge-other { background: rgba(243,156,18,.12); color: var(--warn); }
.badge-online { background: var(--info-soft); color: var(--info); }
.badge-offline { background: var(--success-soft); color: var(--success); }
.badge-mixed { background: rgba(243,156,18,.12); color: var(--warn); }
.badge-amazon { background: rgba(243,156,18,.12); color: var(--warn); }
.badge-flipkart { background: rgba(52,152,219,.12); color: var(--info); }
.badge-meesho { background: var(--success-soft); color: var(--success); }

/* ── Payment Breakdown ──────────────────────────────────── */
.payment-breakdown { display: flex; gap: 16px; flex-wrap: wrap; }
.pb-item {
  background: var(--surface2); border-radius: 10px; padding: 14px 20px;
  min-width: 140px; display: flex; flex-direction: column; gap: 2px;
}
.pb-method { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.pb-item strong { font-size: 18px; }
.pb-item small { font-size: 11px; color: var(--muted); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .pos-grid { grid-template-columns: 1fr; }
  .pos-cart { height: auto; max-height: 50vh; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .pos-picker { min-width: 0; width: 92vw; padding: 22px; }
}
