/* ══════════════════════════════════════════════════════════════
   FertiliserERP — Modern Professional Theme
   ══════════════════════════════════════════════════════════════ */
:root {
  --sidebar-width: 240px;
  --sidebar-bg: #0f172a;
  --sidebar-brand-bg: #1e293b;
  --sidebar-hover: rgba(255,255,255,.06);
  --sidebar-active: rgba(99,102,241,.15);
  --sidebar-active-border: #6366f1;
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #e2e8f0;
  --topnav-height: 52px;
  --topbar-height: 48px;
  --page-bg: #f1f5f9;
  --card-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,.08);
  --primary: #6366f1;
  --primary-soft: rgba(99,102,241,.1);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 15px; } }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--page-bg);
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════════════════════
   DESKTOP TOP NAVBAR
   ══════════════════════════════════════════════════════════════ */
.topnav {
  height: var(--topnav-height);
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 1040;
  gap: 0;
}
.topnav-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  padding-right: 1.25rem;
  margin-right: .5rem;
  border-right: 1px solid rgba(255,255,255,.1);
  white-space: nowrap;
  letter-spacing: -.02em;
}
.topnav-brand i { font-size: 1.25rem; color: var(--primary); }
.topnav-brand:hover { color: #fff; }

.topnav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
}
.topnav-menu::-webkit-scrollbar { display: none; }

.topnav-link {
  display: flex;
  align-items: center;
  gap: .375rem;
  padding: .4375rem .75rem;
  border-radius: .375rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .8rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color .15s, background .15s;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.topnav-link:hover {
  color: var(--sidebar-text-hover);
  background: var(--sidebar-hover);
}
.topnav-link.active {
  color: #fff;
  background: var(--sidebar-active);
}
.topnav-link i:first-child { font-size: .9375rem; }
.topnav-caret { font-size: .55rem; margin-left: .125rem; opacity: .6; }

/* ── Dropdown ── */
.topnav-dropdown { position: relative; }
.topnav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: .25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 200px;
  padding: .375rem;
  z-index: 1050;
}
.topnav-dropdown-menu-wide { min-width: 220px; }
.topnav-dropdown.open > .topnav-dropdown-menu { display: block; }
.topnav-dd-section { padding: .375rem .75rem .125rem; font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; margin-top: .25rem; }
.topnav-dd-section:first-child { margin-top: 0; }
.topnav-dd-divider { height: 1px; background: #e2e8f0; margin: .25rem .5rem; }

.topnav-dd-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4375rem .75rem;
  border-radius: .375rem;
  color: #334155;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 500;
  transition: background .1s, color .1s;
}
.topnav-dd-item:hover { background: var(--primary-soft); color: var(--primary); }
.topnav-dd-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.topnav-dd-item i { font-size: .875rem; width: 1.125rem; text-align: center; flex-shrink: 0; }

.topnav-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
  padding-left: .75rem;
  white-space: nowrap;
}
.topnav-user {
  display: flex;
  align-items: center;
  gap: .375rem;
  color: var(--sidebar-text);
  font-size: .8rem;
  font-weight: 500;
}
.topnav-user i { font-size: 1.25rem; }

/* ══════════ MOBILE SIDEBAR (unchanged, only shown < md) ══════════ */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease;
  overflow: hidden;
  transform: translateX(-100%);
}
.sidebar.show { transform: translateX(0); }
.sidebar-brand {
  padding: 1rem 1.25rem;
  background: var(--sidebar-brand-bg);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand i { font-size: 1.3rem; color: var(--primary); }
.sidebar-menu { padding: .5rem 0; overflow-y: auto; flex: 1; }
.sidebar-menu .nav-section {
  padding: 1.25rem 1.25rem .375rem;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #475569;
}
.sidebar-menu .nav-item {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem 1.25rem;
  margin: 1px .5rem;
  border-radius: .375rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .8125rem;
  font-weight: 500;
  transition: all .15s ease;
}
.sidebar-menu .nav-item:hover {
  color: var(--sidebar-text-hover);
  background: var(--sidebar-hover);
}
.sidebar-menu .nav-item.active {
  color: #fff;
  background: var(--sidebar-active);
  box-shadow: inset 3px 0 0 var(--sidebar-active-border);
}
.sidebar-menu .nav-item i { font-size: 1rem; width: 1.25rem; text-align: center; flex-shrink: 0; }
.sidebar-menu .nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer {
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: auto;
}
.avatar-sm { font-size: 1.5rem; color: #64748b; }

/* ══════════ MOBILE TOP BAR ══════════ */
.mobile-topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

/* ══════════ MAIN CONTENT ══════════ */
.main-content { min-height: calc(100vh - var(--topnav-height)); display: flex; flex-direction: column; }

/* ── On mobile, no topnav so adjust ── */
@media (max-width: 767.98px) {
  .main-content { min-height: calc(100vh - var(--topbar-height)); }
}

/* ══════════ TOP BAR (legacy, kept for topbar-title reuse) ══════════ */
.topbar-title { font-size: 1rem; font-weight: 600; margin: 0; color: #1e293b; }

/* ══════════ PAGE BODY ══════════ */
.page-body { padding: 1.5rem; flex: 1; }

/* ══════════ CARDS ══════════ */
.card { border: 1px solid #e2e8f0; border-radius: .5rem; box-shadow: var(--card-shadow); background: #fff; }
.card-header { background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-weight: 600; font-size: .875rem; padding: .75rem 1rem; }

/* ── KPI Cards ── */
.kpi-card { border: none; border-radius: .75rem; overflow: hidden; padding: 1.25rem; transition: transform .15s ease, box-shadow .15s ease; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-hover); }
.kpi-card > .card-body { padding: 0; }
.kpi-icon { width: 48px; height: 48px; border-radius: .625rem; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.kpi-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: #0f172a; }
.kpi-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin-bottom: .25rem; }
.kpi-sub { font-size: .75rem; font-weight: 500; color: #64748b; margin-top: .125rem; }
.kpi-primary { background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%); }
.kpi-primary .kpi-icon { background: #6366f1; color: #fff; }
.kpi-success { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); }
.kpi-success .kpi-icon { background: #10b981; color: #fff; }
.kpi-warning { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); }
.kpi-warning .kpi-icon { background: #f59e0b; color: #fff; }
.kpi-info    { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); }
.kpi-info .kpi-icon { background: #3b82f6; color: #fff; }
.kpi-danger  { background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); }
.kpi-danger .kpi-icon { background: #ef4444; color: #fff; }

/* ══════════ TABLES ══════════ */
.table-erp { font-size: .8125rem; margin-bottom: 0; }
.table-erp thead th { background: #f8fafc; border-bottom: 2px solid #e2e8f0; font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; padding: .625rem .75rem; white-space: nowrap; }
.table-erp tbody td { padding: .5rem .75rem; vertical-align: middle; border-bottom: 1px solid #f1f5f9; color: #334155; }
.table-erp tbody tr:hover { background: #f8fafc; }
.table-erp tbody tr:nth-child(even) { background-color: #f8fafc; }
.table-erp tbody tr:nth-child(even):hover { background-color: #f1f5f9; }
.table-erp tbody tr:last-child td { border-bottom: none; }
.table-erp tfoot td { background: #f8fafc; font-weight: 600; border-top: 2px solid #e2e8f0; }

/* ══════════ STATUS BADGES ══════════ */
.badge-status { font-size: .7rem; font-weight: 600; padding: .25rem .625rem; border-radius: 1rem; letter-spacing: .02em; }
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-finalized { background: #d1fae5; color: #065f46; }
.badge-dispatched { background: #dbeafe; color: #1e40af; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #f1f5f9; color: #64748b; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fff7ed; color: #9a3412; }
.badge-partial { background: #dbeafe; color: #1e40af; }

/* ══════════ FORMS ══════════ */
.form-label { font-weight: 500; font-size: .8125rem; color: #475569; margin-bottom: .25rem; }
.form-control, .form-select { border-color: #cbd5e1; border-radius: .375rem; font-size: .8125rem; padding: .5rem .75rem; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-section { background: #fff; border: 1px solid #e2e8f0; border-radius: .5rem; padding: 1.5rem; margin-bottom: 1.5rem; }
.form-section-title { font-size: .9375rem; font-weight: 600; margin-bottom: 1rem; padding-bottom: .625rem; border-bottom: 1px solid #e2e8f0; color: #1e293b; }

/* ══════════ PAGE HEADER ══════════ */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem; }
.page-header h2 { font-size: 1.25rem; font-weight: 700; margin: 0; color: #0f172a; }

/* ══════════ BUTTONS ══════════ */
.btn { font-size: .8125rem; font-weight: 500; border-radius: .375rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: #4f46e5; border-color: #4f46e5; }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-sm { font-size: .75rem; padding: .3rem .75rem; }
.btn-icon { display: inline-flex; align-items: center; gap: .375rem; }
.btn-action { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: .375rem; }

/* ══════════ SEARCH / FILTER BAR ══════════ */
.filter-bar { background: #fff; border: 1px solid #e2e8f0; border-radius: .5rem; padding: .75rem 1rem; margin-bottom: 1.25rem; display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; }
.filter-bar .form-control, .filter-bar .form-select { max-width: 220px; }

/* ══════════ PAGINATION ══════════ */
.pagination { gap: .125rem; }
.page-link { font-size: .75rem; padding: .375rem .75rem; border-radius: .375rem !important; color: #475569; border: 1px solid #e2e8f0; }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ══════════ LOGIN PAGE ══════════ */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%); position: relative; overflow: hidden; }
.login-page::before { content: ''; position: absolute; top: -50%; right: -50%; width: 100%; height: 100%; background: radial-gradient(circle, rgba(99,102,241,.15) 0%, transparent 60%); }
.login-card { width: 100%; max-width: 420px; border: none; border-radius: 1rem; box-shadow: 0 25px 50px rgba(0,0,0,.25); position: relative; z-index: 1; overflow: hidden; }
.login-card .card-body { padding: 2.5rem; }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo i { font-size: 2.5rem; color: var(--primary); }
.login-logo h3 { font-weight: 700; color: #0f172a; margin: .5rem 0 .25rem; font-size: 1.5rem; }
.login-logo p { color: #64748b; font-size: .8125rem; margin: 0; }

/* ══════════ EMPTY STATE ══════════ */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: #94a3b8; }
.empty-state i { font-size: 3rem; margin-bottom: 1rem; display: block; }
.empty-state h5 { color: #64748b; font-weight: 600; margin-bottom: .5rem; }
.empty-state p { font-size: .875rem; }

/* ══════════ DETAIL PAGES ══════════ */
.detail-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #64748b; margin-bottom: .125rem; }
.detail-value { font-size: .875rem; color: #1e293b; font-weight: 500; margin-bottom: .75rem; }

/* ══════════ ALERTS ══════════ */
.alert { border-radius: .5rem; font-size: .8125rem; border: none; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger  { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info    { background: #eff6ff; color: #1e40af; }

/* ══════════ RESPONSIVE ══════════ */
@media (max-width: 767.98px) {
  .filter-bar .form-control, .filter-bar .form-select { max-width: 100%; }
}

/* ══════════ PRINT ══════════ */
@media print {
  .topnav, .sidebar, .mobile-topbar, .btn, .pagination, .filter-bar, .alert, .impersonation-bar { display: none !important; }
  .main-content { margin-left: 0; }
  .page-body { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ══════════ IMPERSONATION BAR ══════════ */
.impersonation-bar {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: .5rem 1.5rem;
  font-size: .85rem;
  display: flex;
  align-items: center;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(245,158,11,.3);
}
.impersonation-bar .btn-light {
  font-size: .75rem;
  font-weight: 600;
  border: none;
}

/* ══════════ TENANT CARDS ══════════ */
.tenant-stat {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  background: var(--page-bg);
  border-radius: .5rem;
}
.tenant-stat i { font-size: 1.5rem; }
.tenant-stat .stat-value { font-size: 1.25rem; font-weight: 700; line-height: 1; }
.tenant-stat .stat-label { font-size: .7rem; color: #64748b; text-transform: uppercase; letter-spacing: .5px; }

/* ══════════ BACKDROP OVERLAY (mobile sidebar) ══════════ */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1039;
}
.sidebar-backdrop.show { display: block; }

/* ══════════════════════════════════════════════════════════════
   POINT OF SALE — Full-screen Terminal UI
   ══════════════════════════════════════════════════════════════ */
.pos-terminal {
  display: flex;
  height: calc(100vh - var(--topnav-height) - 3rem);
  gap: 1rem;
  min-height: 500px;
}
@media (max-width: 767.98px) {
  .pos-terminal { height: auto; }
}
.pos-left {
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pos-right {
  flex: 0 0 420px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

/* ── Product Search ── */
.pos-search-bar {
  margin-bottom: .75rem;
}
.pos-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pos-search-input-wrap > i {
  position: absolute;
  left: 1rem;
  color: #94a3b8;
  font-size: 1.1rem;
  pointer-events: none;
}
.pos-search-input-wrap input {
  padding: .875rem 1rem .875rem 2.75rem;
  font-size: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: .75rem;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.pos-search-input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.pos-kbd {
  position: absolute;
  right: .75rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: .25rem;
  padding: .125rem .5rem;
  font-size: .65rem;
  color: #64748b;
  font-family: inherit;
}
.pos-search-clear {
  position: absolute;
  right: 3.5rem;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  padding: .25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color .15s, background .15s;
}
.pos-search-clear:hover { color: var(--danger); background: rgba(239,68,68,.1); }

/* ── Product Grid ── */
.pos-products {
  flex: 1;
  overflow-y: auto;
  border-radius: .75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: .75rem;
}
.pos-empty-search {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #cbd5e1;
}
.pos-empty-search i { font-size: 2.5rem; display: block; margin-bottom: .75rem; }
.pos-empty-search p { font-weight: 600; color: #94a3b8; margin-bottom: .125rem; }
.pos-empty-search span { font-size: .75rem; color: #cbd5e1; }
.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .625rem;
}
.pos-product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem .75rem;
  border: 1px solid #e2e8f0;
  border-radius: .625rem;
  background: #fff;
  cursor: pointer;
  transition: all .15s ease;
  text-align: center;
  font-family: inherit;
  color: inherit;
}
.pos-product-card:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99,102,241,.15);
}
.pos-product-card:active {
  transform: translateY(0);
}
.pos-product-icon {
  width: 44px;
  height: 44px;
  border-radius: .5rem;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: .5rem;
}
.pos-product-name {
  font-size: .8125rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
  margin-bottom: .125rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pos-product-code {
  font-size: .6875rem;
  color: #94a3b8;
  margin-bottom: .375rem;
}
.pos-product-price {
  font-size: .875rem;
  font-weight: 700;
  color: var(--primary);
}
.pos-product-gst {
  font-size: .6rem;
  background: #f0fdf4;
  color: #15803d;
  padding: .125rem .375rem;
  border-radius: .25rem;
  margin-top: .25rem;
  font-weight: 600;
}
.pos-product-stock {
  font-size: .65rem;
  font-weight: 600;
  margin-top: .25rem;
}
.pos-out-of-stock {
  opacity: .5;
  pointer-events: none;
  position: relative;
}
.pos-out-of-stock::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.3);
  border-radius: .625rem;
}

/* ── Customer Bar ── */
.pos-customer-bar {
  padding: .75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.pos-customer-info {
  display: flex;
  align-items: center;
  gap: .625rem;
}
.pos-customer-icon {
  font-size: 2rem;
  color: #cbd5e1;
}
.pos-customer-name {
  font-weight: 600;
  font-size: .875rem;
  color: #1e293b;
}
.pos-customer-detail {
  font-size: .75rem;
  color: #94a3b8;
}

/* ── Cart ── */
.pos-cart {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pos-cart-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.pos-cart-title {
  font-weight: 600;
  font-size: .8125rem;
  color: #475569;
}
.pos-cart-count {
  font-size: .7rem;
  padding: .125rem .5rem;
  border-radius: 1rem;
}
.pos-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: .5rem;
}
.pos-cart-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #cbd5e1;
}
.pos-cart-empty i { font-size: 2.5rem; display: block; margin-bottom: .75rem; }
.pos-cart-empty p { font-weight: 600; color: #94a3b8; margin-bottom: .125rem; }
.pos-cart-empty span { font-size: .75rem; color: #cbd5e1; }

.pos-cart-item {
  padding: .625rem .5rem;
  border-bottom: 1px solid #f8fafc;
  border-radius: .375rem;
  transition: background .1s;
}
.pos-cart-item:hover { background: #f8fafc; }
.pos-cart-item-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}
.pos-cart-item-name {
  font-weight: 600;
  font-size: .8125rem;
  color: #1e293b;
}
.pos-cart-item-meta {
  font-size: .6875rem;
  color: #94a3b8;
  margin-top: .125rem;
}
.pos-cart-item-total {
  font-weight: 700;
  font-size: .875rem;
  color: #1e293b;
  white-space: nowrap;
}
.pos-cart-item-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .375rem;
}
.pos-qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: .375rem;
  overflow: hidden;
}
.pos-qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: .875rem;
  transition: background .1s;
}
.pos-qty-btn:hover { background: #e2e8f0; }
.pos-qty-value {
  width: 32px;
  text-align: center;
  font-weight: 600;
  font-size: .8125rem;
  color: #1e293b;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  line-height: 28px;
}

/* ── Totals ── */
.pos-totals {
  padding: .75rem 1rem;
  border-top: 2px solid #e2e8f0;
  background: #f8fafc;
}
.pos-total-row {
  display: flex;
  justify-content: space-between;
  padding: .25rem 0;
  font-size: .8125rem;
  color: #475569;
}
.pos-grand-total {
  font-size: 1.125rem;
  font-weight: 800;
  color: #0f172a;
  padding-top: .5rem;
  margin-top: .25rem;
  border-top: 1px solid #e2e8f0;
}

/* ── Action Buttons ── */
.pos-actions {
  display: flex;
  gap: .5rem;
  padding: .75rem;
  border-top: 1px solid #e2e8f0;
  flex-wrap: nowrap;
  min-width: 0;
}
.pos-actions .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  font-weight: 600;
  border: none;
  border-radius: .5rem;
  padding: .625rem .75rem;
  white-space: nowrap;
  min-width: 0;
}
.pos-actions kbd {
  background: rgba(255,255,255,.2);
  border: none;
  padding: .1rem .375rem;
  border-radius: .25rem;
  font-size: .6rem;
  font-family: inherit;
}
.pos-btn-hold {
  flex: 1 1 0;
  background: #f59e0b;
  color: #fff;
}
.pos-btn-hold:hover { background: #d97706; color: #fff; }
.pos-btn-hold:disabled { opacity: .5; pointer-events: none; }
.pos-btn-held {
  flex: 1 1 0;
  background: #475569;
  color: #fff;
  position: relative;
}
.pos-btn-held:hover { background: #334155; color: #fff; }
.pos-held-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: .65rem;
}
.pos-btn-credit {
  flex: 1 1 0;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}
.pos-btn-credit:hover { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
.pos-btn-credit:disabled { opacity: .5; pointer-events: none; }
.pos-btn-pay {
  flex: 1.5 1 0;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}
.pos-btn-pay:hover { background: linear-gradient(135deg, #059669 0%, #047857 100%); color: #fff; }
.pos-btn-pay:disabled { opacity: .5; pointer-events: none; }

/* ── Payment Modal ── */
.pos-payment-header {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border: none;
}
.pos-payment-amount-display {
  text-align: center;
  padding: 1rem;
  background: #f8fafc;
  border-radius: .75rem;
  border: 1px solid #e2e8f0;
}
.pos-payment-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.pos-payment-amount { font-size: 2rem; font-weight: 800; color: #0f172a; }
.pos-pay-summary-row { display: flex; justify-content: space-between; align-items: center; }
.pos-payment-input { font-size: 1.25rem; font-weight: 600; text-align: center; }
.pos-payment-methods {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
}
.pos-payment-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: .75rem .5rem;
  border: 2px solid #e2e8f0;
  border-radius: .5rem;
  cursor: pointer;
  transition: all .15s;
  font-size: .75rem;
  font-weight: 600;
  color: #64748b;
}
.pos-payment-method i { font-size: 1.25rem; }
.pos-payment-method:hover { border-color: var(--primary); color: var(--primary); }
.pos-payment-method.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.pos-change-display {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: .5rem;
  padding: .75rem 1rem;
}
.pos-change-amount { font-size: 1.25rem; font-weight: 700; color: var(--success); }
.pos-quick-cash-panel { background: #f8fafc; border-left: 1px solid #e2e8f0; }
.pos-quick-cash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .375rem;
}
.pos-quick-cash-btn {
  padding: .5rem;
  border: 1px solid #e2e8f0;
  border-radius: .375rem;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: .8125rem;
  transition: all .1s;
  font-family: inherit;
  color: #1e293b;
}
.pos-quick-cash-btn:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

/* ── Numpad ── */
.pos-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .375rem;
}
.pos-numpad-btn {
  padding: .625rem;
  border: 1px solid #e2e8f0;
  border-radius: .375rem;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: background .1s;
  font-family: inherit;
  color: #1e293b;
}
.pos-numpad-btn:hover { background: #e2e8f0; }
.pos-numpad-clear { background: #fee2e2; color: var(--danger); border-color: #fecaca; }
.pos-numpad-clear:hover { background: #fecaca; }

/* ── Receipt Modal ── */
.pos-success-icon { font-size: 4rem; color: var(--success); }
.pos-receipt-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  font-size: .875rem;
}
.pos-payment-footer { background: #f8fafc; }
.pos-btn-complete {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: .625rem 2rem;
}
.pos-btn-complete:hover { background: linear-gradient(135deg, #059669 0%, #047857 100%); color: #fff; }
.pos-btn-complete:disabled { opacity: .5; }

/* ── Customer Results ── */
.pos-customer-results { max-height: 320px; overflow-y: auto; }
.pos-customer-result {
  display: block;
  width: 100%;
  text-align: left;
  padding: .625rem .75rem;
  border: 1px solid #e2e8f0;
  border-radius: .375rem;
  background: #fff;
  cursor: pointer;
  margin-bottom: .375rem;
  transition: all .1s;
  font-family: inherit;
  color: inherit;
  outline: none;
}
.pos-customer-result:hover,
.pos-customer-result:focus { background: var(--primary-soft); border-color: var(--primary); }

/* ── Customer Searchable Dropdown ── */
.pos-customer-dropdown { position: relative; }
.pos-customer-dropdown-toggle {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  padding: .25rem .375rem;
  border-radius: .375rem;
  transition: background .15s;
  position: relative;
  padding-right: 1.5rem;
}
.pos-customer-dropdown-toggle:hover { background: rgba(0,0,0,.04); }
.pos-customer-caret {
  position: absolute;
  right: .25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .75rem;
  color: #94a3b8;
  transition: transform .2s;
}
.pos-customer-dropdown.show .pos-customer-caret { transform: translateY(-50%) rotate(180deg); }
.pos-customer-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + .25rem);
  left: 0; right: 0;
  min-width: 320px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,.12), 0 4px 10px rgba(0,0,0,.06);
  z-index: 1050;
  overflow: hidden;
}
.pos-customer-dropdown.show .pos-customer-dropdown-menu { display: block; }
.pos-customer-dropdown-search {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem .75rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.pos-customer-dropdown-search i { color: #94a3b8; font-size: .875rem; }
.pos-customer-dropdown-search .form-control {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: .125rem 0;
  font-size: .8125rem;
}
.pos-customer-dropdown-search .form-control:focus { box-shadow: none; }
.pos-customer-dropdown-list {
  max-height: 280px;
  overflow-y: auto;
  padding: .375rem;
}
.cledger-cust-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: .5rem .75rem;
  border: 1px solid transparent;
  border-radius: .375rem;
  background: #fff;
  cursor: pointer;
  margin-bottom: .25rem;
  transition: all .1s;
  outline: none;
}
.cledger-cust-item:hover,
.cledger-cust-item:focus { background: var(--primary-soft); border-color: var(--primary); }
/* ── Category Grid ── */
.pos-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}
.pos-category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem .75rem;
  border: 2px solid #e2e8f0;
  border-radius: .75rem;
  background: #fff;
  cursor: pointer;
  transition: all .15s ease;
  text-align: center;
  font-family: inherit;
  color: inherit;
  min-height: 110px;
}
.pos-category-card:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99,102,241,.15);
}
.pos-category-card:active { transform: translateY(0); }
.pos-category-icon {
  width: 48px;
  height: 48px;
  border-radius: .625rem;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  color: var(--primary);
  margin-bottom: .625rem;
}
.pos-category-name {
  font-size: .8125rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Category Breadcrumb ── */
.pos-category-breadcrumb {
  display: flex;
  align-items: center;
  padding: .5rem 0;
  margin-bottom: .625rem;
  gap: .25rem;
}

/* ══════════════════════════════════════════════════════════════
   SALES APPROVAL — Print Slip Styles
   ══════════════════════════════════════════════════════════════ */
.sa-print-area {
  padding: 1.5rem;
  font-size: .8125rem;
  color: #1e293b;
}
.sa-slip { max-width: 780px; margin: 0 auto; }
.sa-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #1e293b;
  padding-bottom: .5rem;
  margin-bottom: .75rem;
}
.sa-header h4 { margin: 0; font-size: 1.125rem; font-weight: 700; }
.sa-header-left { font-size: .8125rem; }
.sa-header-right { font-style: italic; font-size: .75rem; color: #64748b; }
.sa-info { margin-bottom: .75rem; }
.sa-info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: .25rem;
  font-size: .8125rem;
}
.sa-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: .75rem;
}
.sa-table th, .sa-table td {
  border: 1px solid #cbd5e1;
  padding: .375rem .5rem;
  font-size: .75rem;
}
.sa-table th {
  background: #f8fafc;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.sa-table tbody tr:hover { background: #f8fafc; }
.sa-totals { text-align: right; margin-bottom: .75rem; }
.sa-total-row {
  display: flex;
  justify-content: flex-end;
  gap: 2.5rem;
  padding: .125rem 0;
  font-size: .8125rem;
}
.sa-total-row span:first-child { font-weight: 600; }
.sa-grand {
  border-top: 2px solid #1e293b;
  font-size: .9375rem;
  font-weight: 700;
  padding-top: .375rem;
  margin-top: .25rem;
  border-top: 1px solid #e2e8f0;
}
.sa-words { font-style: italic; margin-bottom: 1rem; font-size: .8125rem; }
.sa-footer-note { text-align: center; margin-bottom: 1.25rem; font-size: .8125rem; }
.sa-footer-row {
  display: flex;
  justify-content: space-between;
  margin-top: 2.5rem;
  font-size: .8125rem;
}

@media print {
  .sa-print-area { padding: 10px; }
  .sa-table th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ══════════════════════════════════════════════════════════════
   WHOLESALE INVOICE — On-screen Preview Styles
   ══════════════════════════════════════════════════════════════ */
.ws-invoice { max-width: 820px; margin: 0 auto; font-size: .8125rem; }
.ws-inv-outer { width: 100%; border-collapse: collapse; border: 2px solid #1e293b; }
.ws-inv-outer > tbody > tr > td { border: 1px solid #cbd5e1; padding: 6px 8px; vertical-align: top; }
.ws-inv-header { text-align: center; padding: 4px !important; background: #f8fafc; }
.ws-inv-title { font-size: 1.125rem; font-weight: 700; }
.ws-inv-company { font-size: 1rem; font-weight: 700; }
.ws-inv-seller { width: 55%; }
.ws-inv-meta { width: 45%; }
.ws-inv-meta-tbl { width: 100%; }
.ws-inv-meta-tbl td { padding: 2px 4px; font-size: .8125rem; }
.ws-inv-section-label { font-weight: 600; font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin-bottom: 2px; }
.ws-inv-items, .ws-inv-gst { width: 100%; border-collapse: collapse; }
.ws-inv-items th, .ws-inv-items td,
.ws-inv-gst th, .ws-inv-gst td { border: 1px solid #cbd5e1; padding: 4px 6px; font-size: .75rem; }
.ws-inv-items th, .ws-inv-gst th { background: #f8fafc; font-weight: 600; text-align: left; }
.ws-inv-items tfoot td, .ws-inv-gst tfoot td { border-top: 2px solid #1e293b; }
.ws-inv-words { font-style: italic; font-size: .8125rem; }
.ws-inv-eoe { font-size: .75rem; }
.ws-inv-sig { width: 45%; padding-top: 10px !important; }
.ws-inv-declaration { width: 55%; }
.ws-inv-balance { padding: 4px 0 !important; }
.ws-inv-bal-tbl { width: 100%; border-collapse: collapse; }
.ws-inv-bal-tbl td { padding: 3px 8px; font-size: .75rem; }
.ws-bal-amt { font-weight: 700; }
.ws-bal-highlight { background: #fef08a; padding: 1px 4px; border-radius: 2px; }

/* ══════════════════════════════════════════════════════════════
   CUSTOMER LEDGER — Report Styles
   ══════════════════════════════════════════════════════════════ */
.cledger-container { padding: 1.5rem; }
.cledger-report { max-width: 820px; margin: 0 auto; }
.cledger-header { text-align: center; margin-bottom: .75rem; }
.cledger-tenant-name { font-size: 1.125rem; font-weight: 700; color: #0f172a; }
.cledger-tenant-addr { font-size: .75rem; color: #475569; }
.cledger-cust-header { text-align: center; margin: 1rem 0 .5rem; }
.cledger-cust-name { font-size: 1rem; font-weight: 700; color: #0f172a; }
.cledger-cust-sub { font-size: .75rem; color: #64748b; }
.cledger-period { text-align: center; margin-bottom: 1rem; font-size: .75rem; font-weight: 600; color: #475569; }
.cledger-table { width: 100%; border-collapse: collapse; }
.cledger-table thead th { border-top: 2px solid #1e293b; border-bottom: 2px solid #1e293b; padding: .375rem .5rem; font-size: .75rem; font-weight: 600; color: #475569; text-align: left; }
.cledger-table tbody td { padding: .125rem .5rem; font-size: .8125rem; vertical-align: top; color: #334155; }
.cledger-entry-main td { padding-top: .5rem; }
.cledger-sub-row td { padding-top: 0; padding-bottom: 0; color: #64748b; font-size: .75rem; }
.cledger-balance-row td { font-weight: 600; padding-top: .375rem; color: #0f172a; }
.cledger-separator td { border-bottom: 2px solid #1e293b; padding: 0; height: 4px; }
.cledger-grand-total td { border-top: 1px solid #1e293b; border-bottom: 3px double #1e293b; font-weight: 700; padding: .375rem .5rem; color: #0f172a; }
.cledger-drcr { display: inline-block; width: 20px; font-weight: 600; color: #64748b; }

/* Customer Ledger dropdown */
.cledger-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + .25rem);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
  z-index: 1050;
  overflow: hidden;
}
#custDropdown.show .cledger-dropdown-menu,
#empDropdown.show .cledger-dropdown-menu { display: block; }
.cledger-dropdown-search { display: flex; align-items: center; gap: .5rem; padding: .625rem .75rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.cledger-dropdown-search i { color: #94a3b8; font-size: .875rem; }
.cledger-dropdown-search .form-control { border: none; background: transparent; box-shadow: none; padding: .125rem 0; font-size: .8125rem; }
.cledger-dropdown-search .form-control:focus { box-shadow: none; }
.cledger-dropdown-list { max-height: 280px; overflow-y: auto; padding: .375rem; }
.cledger-cust-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: .5rem .75rem;
  border: 1px solid transparent;
  border-radius: .375rem;
  background: #fff;
  cursor: pointer;
  margin-bottom: .25rem;
  transition: all .1s;
  outline: none;
}
.cledger-cust-item:hover,
.cledger-cust-item:focus { background: var(--primary-soft); border-color: var(--primary); }
/* ══════════════════════════════════════════════════════════════
   GRN CREATE — Searchable Dropdown Styles
   ══════════════════════════════════════════════════════════════ */
.grn-dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + .25rem);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
  z-index: 1050;
  overflow: hidden;
}
#supplierDropdown.show .grn-dd-menu,
#warehouseDropdown.show .grn-dd-menu { display: block; }
.grn-dd-search { display: flex; align-items: center; gap: .5rem; padding: .625rem .75rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.grn-dd-search i { color: #94a3b8; font-size: .875rem; }
.grn-dd-list { max-height: 240px; overflow-y: auto; padding: .375rem; }
.grn-dd-item {
  display: block; width: 100%; text-align: left; padding: .5rem .75rem;
  border: 1px solid transparent; border-radius: .375rem; background: #fff;
  cursor: pointer; margin-bottom: .25rem; transition: all .1s; outline: none;
}
.grn-dd-item:hover, .grn-dd-item:focus { background: var(--primary-soft); border-color: var(--primary); }

/* ══════════════════════════════════════════════════════════════
   CHALLAN CREATE — Modern ERP Styles
   ══════════════════════════════════════════════════════════════ */
.challan-dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + .25rem);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
  z-index: 1050;
  overflow: hidden;
}
#custDropdown.show .challan-dd-menu,
#invDropdown.show .challan-dd-menu,
#supplierDropdown.show .challan-dd-menu,
.position-relative.show > .challan-dd-menu { display: block; }
.challan-dd-search { display: flex; align-items: center; gap: .5rem; padding: .625rem .75rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.challan-dd-search i { color: #94a3b8; font-size: .875rem; }
.challan-dd-list { max-height: 240px; overflow-y: auto; padding: .375rem; }
.challan-dd-item {
  display: block; width: 100%; text-align: left; padding: .5rem .75rem;
  border: 1px solid transparent; border-radius: .375rem; background: #fff;
  cursor: pointer; margin-bottom: .25rem; transition: all .1s; outline: none;
}
.challan-dd-item:hover, .challan-dd-item:focus { background: var(--primary-soft); border-color: var(--primary); }

/* ══════════════════════════════════════════════════════════════
   DELIVERY CHALLAN — Document & Print Styles
   ══════════════════════════════════════════════════════════════ */
.dc-document { max-width: 820px; margin: 0 auto; font-size: .8125rem; }
.dc-outer { width: 100%; border-collapse: collapse; border: 2px solid #1e293b; }
.dc-outer > tbody > tr > td { border: 1px solid #cbd5e1; padding: 6px 8px; vertical-align: top; }
.dc-header { text-align: center; padding: 4px !important; background: #f8fafc; }
.dc-title { font-size: 1.125rem; font-weight: 700; letter-spacing: .5px; }
.dc-company { font-size: 1rem; font-weight: 700; }
.dc-seller { width: 55%; }
.dc-meta { width: 45%; }
.dc-meta-tbl { width: 100%; }
.dc-meta-tbl td { padding: 2px 4px; font-size: .8125rem; }
.dc-section-label { font-weight: 600; font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin-bottom: 2px; }
.dc-items { width: 100%; border-collapse: collapse; }
.dc-items th, .dc-items td { border: 1px solid #cbd5e1; padding: 4px 6px; font-size: .75rem; }
.dc-items th { background: #f8fafc; font-weight: 600; text-align: left; }
.dc-items tfoot td { border-top: 2px solid #1e293b; }
.dc-declaration { width: 55%; }
.dc-sig { width: 45%; padding-top: 10px !important; }

@media print {
  .dc-screen-only { display: none !important; }
  .dc-document { max-width: 100%; }
  .dc-items th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dc-header { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ══════════════════════════════════════════════════════════════
   PAYMENT — Record Payment Styles
   ══════════════════════════════════════════════════════════════ */
.pay-direction-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.pay-direction-btn {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: .5rem;
  background: #fff;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  color: #64748b;
  text-align: left;
}
.pay-direction-btn i { font-size: 1.5rem; }
.pay-direction-btn:hover { border-color: var(--primary); color: var(--primary); }
.pay-direction-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.pay-direction-btn.active .text-muted { color: var(--primary) !important; opacity: .7; }
.pay-mode-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: .5rem;
}
.pay-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: .625rem .5rem;
  border: 2px solid #e2e8f0;
  border-radius: .5rem;
  background: #fff;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 600;
  color: #64748b;
}
.pay-mode-btn i { font-size: 1.25rem; }
.pay-mode-btn:hover { border-color: var(--primary); color: var(--primary); }
.pay-mode-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.pay-dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + .25rem);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
  z-index: 1050;
  overflow: hidden;
}
#partyDropdown.show .pay-dd-menu,
#invDropdown.show .pay-dd-menu { display: block; }
.pay-dd-search { display: flex; align-items: center; gap: .5rem; padding: .625rem .75rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.pay-dd-search i { color: #94a3b8; font-size: .875rem; }
.pay-dd-list { max-height: 260px; overflow-y: auto; padding: .375rem; }
.pay-dd-item {
  display: block; width: 100%; text-align: left; padding: .5rem .75rem;
  border: 1px solid transparent; border-radius: .375rem; background: #fff;
  cursor: pointer; margin-bottom: .25rem; transition: all .1s; outline: none;
}
.pay-dd-item:hover, .pay-dd-item:focus { background: var(--primary-soft); border-color: var(--primary); }

/* ══════════════════════════════════════════════════════════════
   POS TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════════════ */
.pos-toast-container {
  position: fixed;
  top: calc(var(--topnav-height, 52px) + .75rem);
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
  max-width: 420px;
  width: 100%;
}
@media (max-width: 767.98px) {
  .pos-toast-container {
    top: calc(var(--topbar-height, 48px) + .75rem);
    right: .5rem;
    left: .5rem;
    max-width: none;
  }
}
.pos-toast {
  display: flex;
  align-items: center;
  padding: .75rem 1rem;
  border-radius: .5rem;
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0,0,0,.15), 0 2px 6px rgba(0,0,0,.08);
  pointer-events: auto;
  animation: posToastIn .3s ease-out;
  backdrop-filter: blur(8px);
  border: 1px solid transparent;
}
.pos-toast i { font-size: 1.125rem; flex-shrink: 0; }
.pos-toast-success {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #065f46;
  border-color: #a7f3d0;
}
.pos-toast-success i { color: #059669; }
.pos-toast-danger {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #991b1b;
  border-color: #fca5a5;
}
.pos-toast-danger i { color: #dc2626; }
.pos-toast-info {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e40af;
  border-color: #93c5fd;
}
.pos-toast-info i { color: #3b82f6; }
.pos-toast-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #92400e;
  border-color: #fcd34d;
}
.pos-toast-warning i { color: #f59e0b; }
.pos-toast-out {
  animation: posToastOut .3s ease-in forwards;
}

@keyframes posToastIn {
  from { opacity: 0; transform: translateX(40px) scale(.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes posToastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(40px) scale(.95); }
}

/* ══════════════════════════════════════════════════════════════
   COLLECT PAYMENT — Customer Payment Collection
   ══════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════
   NOTIFICATION BELL & DROPDOWN
   ══════════════════════════════════════════════════════════════ */
.notif-dropdown { position: relative; }
.notif-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: .5rem;
  border: none;
  background: none;
  color: var(--sidebar-text);
  font-size: 1.15rem;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.notif-bell:hover { color: #fff; background: var(--sidebar-hover); }
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
  animation: notifPulse 2s ease-in-out infinite;
}
@keyframes notifPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.notif-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 2rem);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  box-shadow: 0 12px 36px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.06);
  z-index: 1060;
  overflow: hidden;
}
.notif-dropdown.open > .notif-dropdown-menu { display: block; }
.notif-dropdown-menu-mobile { right: -1rem; }
.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: .8125rem;
}
.notif-count-label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: .125rem .5rem;
  border-radius: 1rem;
}
.notif-list {
  max-height: 360px;
  overflow-y: auto;
}
.notif-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #cbd5e1;
}
.notif-empty i { font-size: 2rem; display: block; margin-bottom: .5rem; }
.notif-empty p { font-size: .8125rem; color: #94a3b8; margin: 0; }
.notif-item {
  display: flex;
  gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}
.notif-item:hover { background: #f8fafc; color: inherit; }
.notif-item-icon {
  width: 36px;
  height: 36px;
  border-radius: .5rem;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b45309;
  font-size: 1rem;
  flex-shrink: 0;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
  font-size: .75rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: .125rem;
}
.notif-item-msg {
  font-size: .7rem;
  color: #64748b;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-item-time {
  font-size: .6rem;
  color: #94a3b8;
  margin-top: .25rem;
}
.notif-footer {
  padding: .5rem 1rem;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  background: #f8fafc;
}
.notif-view-all {
  font-size: .75rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.notif-view-all:hover { text-decoration: underline; }

/* Mobile topbar bell styling */
.mobile-topbar .notif-bell { color: #64748b; }
.mobile-topbar .notif-bell:hover { color: var(--primary); background: var(--primary-soft); }

.cp-cust-list {
  max-height: calc(100vh - var(--topnav-height) - 220px);
  overflow-y: auto;
  min-height: 300px;
}
.cp-cust-item {
  display: block;
  padding: .75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .1s;
  outline: none;
}
.cp-cust-item:hover,
.cp-cust-item:focus { background: var(--primary-soft); }
.cp-cust-item.active {
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
}
.cp-cust-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1rem;
  flex-shrink: 0;
}
.cp-mode-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: .5rem;
}
.cp-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: .625rem .5rem;
  border: 2px solid #e2e8f0;
  border-radius: .5rem;
  background: #fff;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 600;
  color: #64748b;
}
.cp-mode-btn i { font-size: 1.25rem; }
.cp-mode-btn:hover { border-color: var(--primary); color: var(--primary); }
.cp-mode-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.cp-quick-btn { font-size: .75rem; font-weight: 600; }
.cp-btn-submit {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  border-radius: .5rem;
  padding: .75rem;
}
.cp-btn-submit:hover { background: linear-gradient(135deg, #059669 0%, #047857 100%); color: #fff; }
.cp-btn-submit:disabled { opacity: .5; pointer-events: none; }
