/* UltimatePOS V7-inspired shell — matches samples/chrome-preview.html */
:root {
  --theme-700: #004EEB;
  --theme-800: #0040C1;
  --theme-900: #00359E;
  --sidebar-bg: #ffffff;
  --sidebar-hover: color-mix(in srgb, var(--theme-700) 10%, transparent);
  --sidebar-active: color-mix(in srgb, var(--theme-700) 15%, transparent);
  --sidebar-accent: var(--theme-700);
  --header-bg: var(--theme-800);
  --content-bg: #f3f4f6;
  --sidebar-width: 240px;
  --header-h: 56px;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card: #ffffff;
  --radius: 8px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  width: 100%;
  max-width: 100%;
  background: var(--content-bg);
}

body.admin-body {
  margin: 0 !important;
  font-family: Inter, "Segoe UI", Tahoma, sans-serif !important;
  background: var(--content-bg) !important;
  color: var(--text) !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  min-height: 100vh;
  width: 100% !important;
  max-width: 100% !important;
  -webkit-font-smoothing: antialiased;
}

.wrapper {
  display: block;
  min-height: 100vh;
  width: 100% !important;
  max-width: 100% !important;
}
.wrapper.upos-shell {
  display: flex !important;
  align-items: stretch;
  min-height: 100vh;
  width: 100% !important;
  max-width: 100% !important;
  padding-top: 0;
}

/* Sidebar — white column with blue brand (Ultimate POS sample) */
.main-sidebar {
  width: var(--sidebar-width) !important;
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg) !important;
  color: #4b5563 !important;
  position: sticky !important;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  z-index: 1000;
  overflow-x: hidden;
  overflow-y: auto;
  transition: margin-left 0.25s ease, transform 0.25s ease;
  display: flex !important;
  flex-direction: column;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.main-sidebar a { text-decoration: none !important; }

.sidebar-brand {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--header-h);
  min-height: var(--header-h);
  background: var(--theme-800) !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none !important;
  flex-shrink: 0;
}
.sidebar-brand:hover { color: #fff !important; }
.sidebar-brand .header-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,.25);
}

.sidebar-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}
.sidebar-search .form-control {
  background: #f3f4f6;
  border-radius: 8px;
  height: 36px;
  font-size: 13px;
  width: 100%;
}
.sidebar-search .form-control:focus {
  background: #fff;
  border-color: var(--theme-700);
}

.sidebar-menu {
  list-style: none !important;
  margin: 0 !important;
  padding: 8px !important;
  flex: 1;
  overflow-y: auto;
}

.sidebar-menu > li {
  display: block !important;
  position: relative;
  margin-bottom: 2px;
}

.sidebar-menu > li > a {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 8px 12px !important;
  color: #4b5563 !important;
  border-left: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px !important;
  line-height: 1.4 !important;
  font-weight: 400;
}

.sidebar-menu > li > a:hover {
  background: var(--sidebar-hover) !important;
  color: var(--theme-700) !important;
}

.sidebar-menu > li.active > a,
.sidebar-menu > li.menu-open > a {
  background: var(--sidebar-active) !important;
  color: var(--theme-700) !important;
  font-weight: 600;
}

.sidebar-menu .fa {
  width: 18px;
  text-align: center;
  font-size: 14px !important;
  flex-shrink: 0;
  color: #9ca3af;
}
.sidebar-menu > li > a:hover .fa,
.sidebar-menu > li.active > a .fa,
.sidebar-menu > li.menu-open > a .fa {
  color: var(--theme-700);
}

.sidebar-menu .pull-right {
  margin-left: auto;
  transition: transform 0.2s;
  font-size: 12px !important;
  color: #9ca3af;
}

.sidebar-menu .label.pull-right,
.sidebar-menu .badge.pull-right {
  background: #dd4b39;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.bg-red { background: #dd4b39 !important; }

.sidebar-menu li.menu-open > a .pull-right { transform: rotate(-90deg); }

.treeview-menu {
  list-style: none !important;
  margin: 2px 0 8px 20px !important;
  padding: 0 0 0 12px !important;
  background: transparent !important;
  display: block !important;
  border-left: 1px solid #f3f4f6;
}

.treeview:not(.menu-open) > .treeview-menu { display: none !important; }
.treeview.menu-open > .treeview-menu { display: block !important; }

.treeview-menu li { display: block !important; }

.treeview-menu li a {
  display: block !important;
  padding: 6px 10px !important;
  color: #6b7280 !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  border-radius: 6px;
}

.treeview-menu li a:hover {
  color: var(--theme-700) !important;
  background: transparent !important;
}

.treeview-menu li.active a {
  color: var(--theme-700) !important;
  font-weight: 600;
}

.treeview-menu li a.soon {
  color: #9ca3af !important;
  cursor: not-allowed;
  pointer-events: none;
}

/* Top header — blue gradient over content column only (chrome-preview) */
.main-column {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: none !important;
  display: flex !important;
  flex-direction: column;
  background: var(--content-bg);
}
.main-header {
  position: sticky;
  top: 0;
  left: auto;
  right: auto;
  height: var(--header-h);
  background: linear-gradient(to right, var(--theme-800), var(--theme-900)) !important;
  color: #fff !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
  z-index: 1100;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
  border-bottom: none;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.header-brand { display: none; }
.header-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,.25);
}

.sidebar-toggle {
  background: color-mix(in srgb, var(--theme-700) 55%, transparent) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: #fff !important;
  font-size: 15px;
  cursor: pointer;
  padding: 0;
  border-radius: 8px;
  line-height: 1;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sidebar-toggle:hover { background: var(--theme-700) !important; }

.header-title { display: none; }

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.header-icon-btn,
.header-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff !important;
  font-size: 14px;
  font-weight: 500;
  width: auto;
  min-width: 36px;
  height: 36px;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none !important;
  background: color-mix(in srgb, var(--theme-700) 55%, transparent);
  border: 1px solid rgba(255,255,255,.12);
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.header-icon-btn:hover,
.header-tool:hover {
  background: var(--theme-700);
  color: #fff !important;
}
.header-pos-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff !important;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 8px;
  text-decoration: none !important;
  border: 1px solid rgba(255,255,255,.12);
  background: color-mix(in srgb, var(--theme-700) 55%, transparent);
}
.header-pos-btn:hover { background: var(--theme-700); color: #fff !important; }
.header-tool-text { display: none; }
.header-pnl-wrap { position: relative; }
button.header-tool,
button.header-icon-btn {
  font-family: inherit;
  cursor: pointer;
}
button.header-tool:hover,
button.header-icon-btn:hover { background: var(--theme-700); }
.header-pnl-popup {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1200;
  width: min(640px, 92vw);
  background: #fff;
  color: #334155;
  border: 1px solid #dfe3e8;
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
  padding: 12px 14px;
}
.header-pnl-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef1f4;
}
.header-pnl-head strong { font-size: 14px; color: #1f2937; }
.header-pnl-head span { font-size: 12px; color: #64748b; }
.header-pnl-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.header-pnl-cols h5 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.header-pnl-cols table { width: 100%; border-collapse: collapse; font-size: 12px; }
.header-pnl-cols td { padding: 4px 0; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.header-pnl-cols td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
.header-pnl-cols tr.tot td { border-bottom: 0; padding-top: 8px; color: #1f2937; }
.header-pnl-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eef1f4;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 13px;
}
.header-pnl-foot .ok { color: #00a65a; }
.header-pnl-foot .bad { color: #dd4b39; }
.header-pnl-foot a {
  margin-left: auto;
  color: var(--theme-700);
  font-weight: 600;
  text-decoration: none;
  font-size: 12px;
}
.header-pnl-empty { margin: 8px 0; color: #64748b; font-size: 13px; }
@media (max-width: 700px) {
  .header-pnl-cols { grid-template-columns: 1fr; }
  .header-pnl-popup { right: auto; left: 50%; transform: translateX(-50%); }
}
.header-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--theme-700) 55%, transparent);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  margin-left: 0;
  white-space: nowrap;
  font-family: ui-monospace, Consolas, monospace;
}

.header-user {
  position: relative;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #fff !important;
}
.header-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--theme-700) 55%, transparent);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff !important;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 8px;
}
.header-user-btn:hover { background: var(--theme-700); }
.header-user .dropdown-menu { right: 0; left: auto; }
.header-user-name,
.header-logout { display: none; }

@media (max-width: 1100px) {
  .header-pos-btn { padding: 7px 10px; }
  .header-pos-btn .fa + * { /* keep icon+label */ }
}
@media (max-width: 900px) {
  .header-date-pill { display: none; }
}

/* Content sits inside main-column (no sidebar margin) */
.content-wrapper {
  margin-left: 0 !important;
  margin-top: 0;
  padding: 20px 24px 40px;
  min-height: calc(100vh - var(--header-h));
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
  overflow-x: visible;
  overflow-y: visible;
}
.main-footer {
  margin-top: 24px;
  padding: 12px 0 4px;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  border-top: 1px solid var(--border);
}

.content-header { margin-bottom: 16px; }

.content-header h1 {
  margin: 0 0 2px;
  font-size: 28px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.01em;
}
.content-header h1 small {
  font-size: 15px;
  font-weight: 400;
  display: inline-block;
  padding-left: 8px;
  color: var(--muted);
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.form-narrow { max-width: 560px; }
.form-narrow-sm { max-width: 480px; }
.contact-form-full,
.form-full-width {
  width: 100%;
  max-width: none;
}
.contact-form-full .box { max-width: none; }

.form-inline-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.form-inline-filters .form-group { margin-bottom: 0; min-width: 180px; flex: 1; }

.stat-tile {
  text-align: center;
  margin-bottom: 0;
}
.stat-tile .stat-value {
  font-size: 28px;
  font-weight: 700;
  margin: 4px 0 0;
  line-height: 1.2;
}
.stat-tile .stat-value.text-blue { color: #3c8dbc; }
.stat-tile .stat-value.text-green { color: #00a65a; }
.stat-tile .stat-value.text-yellow { color: #f39c12; }
.stat-tile .stat-value.text-purple { color: #605ca8; }

.table-responsive { overflow-x: auto; width: 100%; }
/* Actions dropdown must not be clipped by table scroll */
.list-table-card,
.list-table-card .box-body,
.list-table-wrap,
.upos-list-box,
.upos-list-box .box-body,
.table-responsive.list-table-wrap {
  overflow: visible !important;
}
.list-table-card .table-responsive,
.upos-list-box .table-responsive {
  overflow-x: auto !important;
  overflow-y: visible !important;
}
.actions-dropdown {
  position: relative;
  z-index: 2;
}
.actions-dropdown.open {
  z-index: 10040;
  position: relative;
}
.actions-dropdown .dropdown-menu,
.btn-group.open > .dropdown-menu,
.list-table-card .dropdown-menu,
.upos-list-box .dropdown-menu {
  z-index: 10050;
}
/* When JS pins menu fixed, still ensure it paints above shell */
.dropdown-menu[style*="position: fixed"],
.dropdown-menu[style*="position:fixed"] {
  z-index: 10050 !important;
}
tr.warning td { background: #fcf8e3 !important; }
.text-success { color: #00a65a !important; }
.text-danger { color: #dd4b39 !important; }

.btn-block { display: block; width: 100%; }

.report-link {
  display: block;
  color: inherit !important;
  text-decoration: none !important;
}
.report-link:hover .box { border-top-color: #367fa9; }
.report-link h4 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: #444; }

.box {
  background: var(--card);
  border-radius: 4px;
  border: 1px solid #d2d6de;
  border-top: 1px solid #d2d6de;
  box-shadow: 0 1px 1px rgba(0,0,0,.05);
  margin-bottom: 18px;
}

.box-header {
  padding: 12px 16px;
  border-bottom: 1px solid #f4f4f4;
  font-weight: 600;
  color: #444;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.box-body { padding: 16px; }
.box-footer {
  padding: 12px 16px;
  border-top: 1px solid #f4f4f4;
  background: #fff;
}

.box-primary > .box-header,
.box-success > .box-header,
.box-warning > .box-header,
.box-default > .box-header { background: #fff; }
.box.box-primary,
.box.box-success,
.box.box-warning,
.box.box-default { border-top: 1px solid #d2d6de; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef1f4; vertical-align: middle; }
.table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}
/* Blue headers only where POS uses them (ledger / explicit) */
.table.table-upos-blue thead th,
.ledger-data-table thead th {
  background: #3c8dbc !important;
  color: #fff !important;
  border-color: #367fa9 !important;
  font-weight: 600;
}
/* List tables: light uppercase headers like chrome-preview */
.list-data-table thead th,
.upos-list-box .table thead th {
  background: #f9fafb !important;
  color: #6b7280 !important;
  border-bottom: 1px solid #f3f4f6 !important;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.list-data-table thead th.text-right,
.upos-list-box .table thead th.text-right { text-align: right !important; }
.table tr:hover td { background: #f8fafc; }

.form-control {
  display: block;
  width: 100%;
  height: 34px;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1.4;
  color: #1f2937;
  background: #fff;
  border: 1px solid #cfd6dd;
  border-radius: var(--radius);
  box-sizing: border-box;
}
.form-control:focus {
  outline: none;
  border-color: #3c8dbc;
  box-shadow: 0 0 0 3px rgba(60, 141, 188, 0.15);
}
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  font-size: 13px;
  color: #374151;
}
.help-block { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

.party-search-with-add {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.party-search-with-add .party-search { flex: 1; min-width: 0; }
.party-search-with-add > .btn {
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn {
  display: inline-block;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
}

.btn-primary { background: var(--theme-800); color: #fff !important; border-color: var(--theme-900); }
.btn-primary:hover { background: var(--theme-700); color: #fff !important; border-color: var(--theme-700); }
.btn-default { background: #f4f4f4; color: #444 !important; border-color: #ddd; }

.alert { padding: 12px 15px; border-radius: 3px; margin-bottom: 15px; font-size: 14px; }
.alert-success { background: #dff0d8; color: #3c763d; border: 1px solid #d6e9c6; }
.alert-warning { background: #fcf8e3; color: #8a6d3b; border: 1px solid #faebcc; }

.badge { display: inline-block; padding: 2px 8px; font-size: 11px; border-radius: 3px; }
.badge-soon { background: #f39c12; color: #fff; }

.text-right { text-align: right; }
.text-muted { color: #999; }
.mb-0 { margin-bottom: 0; }

body.sidebar-collapse .main-sidebar {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden !important;
  opacity: 0;
  pointer-events: none;
}
body.sidebar-collapse .main-header { left: auto; }
body.sidebar-collapse .content-wrapper,
body.sidebar-collapse .main-column {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 100% !important;
}

/* Grid — mobile-first (Bootstrap-like). Fixes half-width desktop bug:
   old .col-sm-6 { width:50% } was global and overrode every col-md-* . */
.row { display: flex; flex-wrap: wrap; margin: 0 -10px 15px; }
[class*="col-"] { padding: 0 10px; box-sizing: border-box; width: 100%; }
@media (min-width: 0) {
  .col-xs-6 { width: 50%; }
}

@media (min-width: 768px) {
  .col-sm-3 { width: 25%; }
  .col-sm-4 { width: 33.333%; }
  .col-sm-6 { width: 50%; }
  .col-sm-8 { width: 66.666%; }
  .col-sm-12 { width: 100%; }
}

@media (min-width: 992px) {
  /* Higher specificity so col-md-* always beats col-sm-* on desktop */
  [class*="col-"].col-md-1 { width: 8.333%; }
  [class*="col-"].col-md-2 { width: 16.666%; }
  [class*="col-"].col-md-3 { width: 25%; }
  [class*="col-"].col-md-4 { width: 33.333%; }
  [class*="col-"].col-md-5 { width: 41.666%; }
  [class*="col-"].col-md-6 { width: 50%; }
  [class*="col-"].col-md-7 { width: 58.333%; }
  [class*="col-"].col-md-8 { width: 66.666%; }
  [class*="col-"].col-md-9 { width: 75%; }
  [class*="col-"].col-md-10 { width: 83.333%; }
  [class*="col-"].col-md-11 { width: 91.666%; }
  [class*="col-"].col-md-12 { width: 100%; }
  .col-md-1 { width: 8.333%; }
  .col-md-2 { width: 16.666%; }
  .col-md-3 { width: 25%; }
  .col-md-4 { width: 33.333%; }
  .col-md-5 { width: 41.666%; }
  .col-md-6 { width: 50%; }
  .col-md-7 { width: 58.333%; }
  .col-md-8 { width: 66.666%; }
  .col-md-9 { width: 75%; }
  .col-md-10 { width: 83.333%; }
  .col-md-11 { width: 91.666%; }
  .col-md-12 { width: 100%; }
}

/* Small boxes (dashboard) */
.btn-app {
  position: relative;
  padding: 12px 8px 8px;
  margin: 0 4px 8px 0;
  min-width: 78px;
  height: 68px;
  text-align: center;
  color: #666 !important;
  border: 1px solid #ddd;
  background: #f4f4f4;
  font-size: 12px;
  display: inline-block;
  text-decoration: none !important;
  border-radius: 3px;
  vertical-align: top;
}
.btn-app > .fa {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
}
.btn-app:hover {
  background: #f9f9f9;
  color: #444 !important;
  border-color: #aaa;
}
.dash-filters .form-control { height: 30px; }

/* Home welcome strip ? calm, professional */
.dash-welcome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--card);
  color: #1f2937;
  padding: 16px 18px;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 4px solid var(--sidebar-accent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.dash-welcome-text { min-width: 220px; flex: 1; }
.dash-welcome-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
}
.dash-welcome-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 560px;
}
.dash-welcome-actions { position: relative; }
.btn-filter-date {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: #334155;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-width: 220px;
  text-align: left;
}
.btn-filter-date:hover { border-color: #3c8dbc; color: #3c8dbc; }
.btn-filter-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.btn-filter-label strong {
  font-size: 12px;
  font-weight: 700;
  color: inherit;
}
.btn-filter-label small {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.btn-filter-date .fa-chevron-down { font-size: 11px; color: #888; margin-left: auto; }
.dash-filter-wrap { position: relative; }
.dash-filter-hint {
  margin: 0 0 10px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}
.dash-filter-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  width: 300px;
  background: #fff;
  color: #444;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
  padding: 14px;
}
.dash-filter-panel .form-group { margin-bottom: 10px; }
.dash-filter-panel label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 3px;
}
.dash-filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
@media (max-width: 767px) {
  .dash-welcome { margin: 0 0 12px; padding: 14px; }
  .dash-welcome-title { font-size: 18px; }
  .btn-filter-date { width: 100%; }
  .dash-filter-panel { left: 0; right: auto; width: min(300px, 92vw); }
  .header-date-pill { display: none; }
}

.small-box {
  border-radius: var(--radius);
  position: relative;
  display: block;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  color: #fff;
  overflow: hidden;
  text-decoration: none !important;
}
.small-box .inner { padding: 14px 16px 16px; position: relative; z-index: 1; }
.small-box .inner h3 {
  font-size: clamp(16px, 2.1vw, 26px);
  font-weight: 700;
  margin: 0 0 4px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.02em;
}
.small-box .inner p { font-size: 13px; margin: 0; color: rgba(255,255,255,.92); font-weight: 500; }
.small-box .icon { position: absolute; top: 10px; right: 12px; font-size: 58px; color: rgba(0,0,0,.12); z-index: 0; }
.small-box-footer {
  display: block;
  padding: 6px 0;
  text-align: center;
  background: rgba(0,0,0,.12);
  color: #fff !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
}
.small-box-footer:hover { background: rgba(0,0,0,.18); color: #fff !important; }

/* Home period P&L */
.dash-pnl { margin-bottom: 18px; }
.dash-pnl .box-title small { font-size: 12px; font-weight: 500; margin-left: 6px; }
.dash-pnl-kpis { margin: 0 -6px; }
.dash-pnl-kpi {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0 0 8px;
  min-height: 72px;
}
.dash-pnl-kpi-net { border-left: 3px solid var(--sidebar-accent); }
.dash-pnl-kpi-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}
.dash-pnl-kpi strong { font-size: 18px; color: #1f2937; }
.dash-pnl-section {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}
.dash-pnl-section .fa { margin-right: 4px; color: #94a3b8; }
.dash-pnl-table td { padding: 7px 10px !important; font-size: 13px; }
.dash-pnl-total td { background: #f1f5f9; border-top: 1px solid #e2e8f0; }

.bg-aqua { background: #00c0ef !important; }
.bg-green { background: #00a65a !important; }
.bg-yellow { background: #f39c12 !important; }
.bg-red { background: #dd4b39 !important; }
.bg-blue { background: #0073b7 !important; }
.bg-purple { background: #605ca8 !important; }
.bg-navy { background: #001f3f !important; }

/* Buttons */
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-success { background: #00a65a; color: #fff !important; border-color: #008d4c; }
.btn-danger { background: #dd4b39; color: #fff !important; border-color: #d73925; }

/* Alerts */
.alert-danger { background: #f2dede; color: #a94442; border: 1px solid #ebccd1; }
.alert-info { background: #d9edf7; color: #31708f; border: 1px solid #bce8f1; }

/* Box variants */
.box.box-primary { border-top-color: var(--theme-700); }
.box.box-success { border-top-color: #00a65a; }
.box.box-warning { border-top-color: #f39c12; }
.box.box-info { border-top-color: #00c0ef; }
.box.box-danger { border-top-color: #dd4b39; }
.box.box-default { border-top-color: #d2d6de; }
.box-header.with-border { display: flex; justify-content: space-between; align-items: center; }
.box-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.box-footer { padding: 10px 16px; background: #fafbfc; border-top: 1px solid #eef1f4; font-size: 13px; }

/* Forms */
.form-row { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 15px; }
.form-row .form-group { flex: 1; min-width: 180px; margin-bottom: 0; }
.form-control[readonly] { background: #f9f9f9; color: #666; }
textarea.form-control { min-height: 70px; resize: vertical; }
.radio-inline, .checkbox-inline { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; font-weight: 400; font-size: 13px; }

/* Labels / filter chips — soft pills like chrome-preview */
.label { display: inline-block; padding: 3px 8px; font-size: 11px; font-weight: 600; border-radius: 999px; line-height: 1.4; }
.label-default { background: #f3f4f6; color: #4b5563; }
.label-primary { background: #dbeafe; color: #1e40af; }
.label-success { background: #dcfce7; color: #166534; }
.label-warning { background: #fef3c7; color: #92400e; }
.label-danger { background: #fee2e2; color: #991b1b; }
.label-info { background: #e0f2fe; color: #075985; }
a.label { text-decoration: none !important; cursor: pointer; }
a.label:hover { opacity: .9; }
.filter-bar { margin-bottom: 12px; }
.filter-title { font-size: 11px; font-weight: 700; color: #888; text-transform: uppercase; margin-bottom: 6px; }

/* Lists */
.list-group { list-style: none; margin: 0; padding: 0; }
.list-group-item {
  padding: 11px 15px;
  border-bottom: 1px solid #eef1f4;
  font-size: 13px;
  color: #334155;
}
.list-group-item:last-child { border-bottom: none; }
.list-group-item:hover { background: #f8fafc; }
.list-group-item a { color: #3c8dbc; text-decoration: none; }

/* Breadcrumb */
.content-header.clearfix::after { content: ''; display: table; clear: both; }
.breadcrumb {
  float: right;
  list-style: none;
  margin: 0;
  padding: 6px 0 0;
  font-size: 12px;
  background: transparent;
  color: var(--muted);
}
.breadcrumb > li { display: inline-block; }
.breadcrumb > li + li::before { content: '/\00a0'; padding: 0 5px; color: #cbd5e1; }
.breadcrumb > li > a { color: #3c8dbc; text-decoration: none; font-weight: 600; }
.breadcrumb > li.active { color: #64748b; }
.box-title { margin: 0; font-size: 15px; font-weight: 600; color: #1f2937; }
.box-title .fa { margin-right: 6px; color: #94a3b8; }

/* Tables */
.table-striped tbody tr:nth-child(even) td { background: #f9f9f9; }
.table-bordered th, .table-bordered td { border: 1px solid #f4f4f4; }

/* Shell / empty */
.shell-box { text-align: center; padding: 40px 20px; }
.shell-box .fa { font-size: 48px; color: #3c8dbc; margin-bottom: 12px; }
.shell-box h3 { margin: 0 0 8px; color: #444; font-weight: 400; }
.shell-box p { color: #999; max-width: 480px; margin: 0 auto 20px; }

/* Pricing breakdown panel */
.pricing-panel { background: #222d32; color: #fff; border-radius: 3px; padding: 15px; margin-top: 15px; }
.pricing-panel h4 { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: #b8c7ce; }
.pricing-panel table { width: 100%; font-size: 13px; }
.pricing-panel td { padding: 4px 0; border: none; }
.pricing-panel td:last-child { text-align: right; }
.pricing-panel tr.pnl-margin td { padding-top: 8px; border-top: 1px solid rgba(255,255,255,.15); }
.pricing-panel tr.pnl-margin td strong { color: #00a65a; }
.pricing-panel tr.pnl-margin td.text-danger strong { color: #f56954; }
.carton-hint { background: #d9edf7; border: 1px solid #bce8f1; color: #31708f; padding: 10px 12px; border-radius: 3px; font-size: 13px; margin-top: 10px; }

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--content-bg);
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 400px;
}
.login-logo {
  text-align: center;
  margin-bottom: 20px;
  font-size: 28px;
  font-weight: 300;
  color: #111827;
}
.login-logo b { font-weight: 700; }
.login-logo img[src=""],
.login-logo img:not([src]) { display: none; }
.login-box-body {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--theme-700);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.login-box-msg { text-align: center; margin: 0 0 16px; font-size: 14px; }

/* Utilities */
.hidden { display: none !important; }
.clearfix::after { content: ''; display: table; clear: both; }
.pull-left { float: left; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }

@media (max-width: 767px) {
  .form-row { flex-direction: column; }
}

/* Actions dropdown (UltimatePOS / Bootstrap 3 style) */
.btn-group {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}
.btn-group.open .dropdown-menu { display: block; }
.btn-group.open .dropdown-toggle { box-shadow: inset 0 3px 5px rgba(0,0,0,.125); }
.btn-info { background: #00c0ef; color: #fff !important; border-color: #00acd6; }
.btn-info:hover { background: #00acd6; color: #fff !important; }
.btn-warning { background: #f39c12; color: #fff !important; border-color: #e08e0b; }
.btn-xs { padding: 1px 5px; font-size: 12px; line-height: 1.5; border-radius: 3px; }
.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  vertical-align: middle;
  border-top: 4px solid;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1050;
  min-width: 160px;
  padding: 5px 0;
  margin: 2px 0 0;
  list-style: none;
  font-size: 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 4px;
  box-shadow: 0 6px 12px rgba(0,0,0,.175);
}
.dropdown-menu > li > a,
.dropdown-menu-btn {
  display: block;
  padding: 3px 20px;
  clear: both;
  font-weight: 400;
  color: #333 !important;
  white-space: nowrap;
  text-decoration: none !important;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.dropdown-menu > li > a .fa,
.dropdown-menu-btn .fa {
  width: 16px;
  margin-right: 6px;
  text-align: center;
  color: #777;
}
.dropdown-menu > li > a:hover,
.dropdown-menu-btn:hover {
  background: #f5f5f5;
  color: #262626 !important;
}
.dropdown-menu .divider {
  height: 1px;
  margin: 9px 0;
  overflow: hidden;
  background: #e5e5e5;
  list-style: none;
}
.dropdown-form-item form { margin: 0; }
.table td.actions-cell { width: 1%; white-space: nowrap; vertical-align: middle; }
@media (max-width: 768px) {
  .dropdown-menu { min-width: 140px; }
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1050;
}
.sidebar-overlay.active { display: block; }
@media (min-width: 769px) {
  .sidebar-overlay { display: none !important; }
}

/* Mobile ? sidebar overlays content; collapsed by default via sidebar.js */
@media (max-width: 768px) {
  .main-sidebar {
    z-index: 1100;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.25);
  }
  .main-header {
    left: 0 !important;
  }
  .content-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 12px;
  }
  .header-title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-user span {
    display: none;
  }
  .contacts-toolbar .btn-sm {
    margin-bottom: 4px;
  }
  .contacts-data-table {
    min-width: 900px !important;
  }
}

/* Shared list filters / table cards (UPOS V7) */
/* Section B: filters open by default; one-row feel; sticky totals; less h-scroll */
.list-filters-box.pf-card .pf-body,
.contacts-filters-box.pf-card .pf-body,
.list-filter-card.pf-card .pf-body,
.pf-card.pf-open .pf-body { display: block !important; }
.list-table-wrap { max-width: 100%; }
.upos-list-box .table tfoot td,
.upos-list-box .table tfoot th {
  position: sticky;
  bottom: 0;
  background: #f0fdfa;
  z-index: 1;
}
.upos-list-box td a.ds-name-1,
.contacts-table-box td:nth-child(2) a { white-space: nowrap; }

.list-filter-card,
.contacts-filters-box,
.list-filters-box,
.pf-card {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-top: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow .2s;
}
.list-filter-card:hover,
.contacts-filters-box:hover,
.list-filters-box:hover,
.pf-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}

.pf-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  text-align: left;
}
.pf-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--theme-700);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.pf-open > .pf-btn::before { transform: scaleX(1); }
.pf-open > .pf-btn { border-bottom-color: var(--border); }
.pf-btn:hover { background: #f9fafb; }
.pf-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pf-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--theme-700) 10%, transparent);
  color: var(--theme-700);
  font-size: 12px;
  flex-shrink: 0;
}
.pf-label {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}
.pf-chevron {
  color: var(--theme-700);
  transition: transform .3s;
  font-size: 12px;
}
.pf-open .pf-chevron { transform: rotate(180deg); }
.pf-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 12px;
}
.pf-tools a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}
.pf-tools a:hover { color: var(--theme-700); }

.pf-body {
  display: none;
  padding: 12px 16px 16px;
}
.pf-open > .pf-body { display: block; }

.list-table-card,
.contacts-table-box,
.products-list-box {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-top: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  margin-bottom: 16px;
  overflow: visible;
}
.list-table-card:hover,
.contacts-table-box:hover,
.products-list-box:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.list-table-card > .box-header,
.contacts-table-box > .box-header,
.products-list-box > .box-header {
  background: #fff !important;
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
}
.upos-add-btn,
.list-table-card .upos-add-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  background: linear-gradient(to right, #4f46e5, #3b82f6) !important;
  border: none !important;
  color: #fff !important;
  border-radius: 999px !important;
  font-weight: 700;
  font-size: 13px !important;
  padding: 8px 16px !important;
  box-shadow: none !important;
}
.upos-add-btn:hover {
  filter: brightness(1.05);
  color: #fff !important;
  background: linear-gradient(to right, #4f46e5, #3b82f6) !important;
}

/* Shared list filters / toolbar (UltimatePOS style) */
.list-filters-box .list-filter-form .form-group { margin-bottom: 0; }
.list-filters-box .list-filter-form .form-group label {
  font-size: 12px;
  margin-bottom: 4px;
}
.list-filters-box .box-body { padding: 12px 15px; }
.list-toolbar { align-items: center; }
.list-data-table { min-width: 720px; }
.list-pagination .pagination { margin: 0; }

/* UPOS DataTables toolbar row */
.upos-dt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 4px 0 10px;
}
.upos-dt-left,
.upos-dt-center,
.upos-dt-right { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.upos-dt-length,
.upos-dt-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #555;
  font-weight: 400;
  margin: 0;
}
.upos-dt-length select,
.upos-dt-search input {
  width: auto;
  display: inline-block;
  min-width: 70px;
  height: 30px;
}
.upos-dt-search input { min-width: 160px; }
.list-table-card .box-header,
.upos-list-box .box-header {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between;
  display: flex !important;
}
.list-table-card .box-header .box-title,
.upos-list-box .box-header .box-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  float: none;
}
.list-table-card .box-tools,
.upos-list-box .box-tools {
  float: none;
  margin: 0;
}
.upos-dt-toolbar {
  margin: 0 !important;
  padding: 0 4px;
}
.upos-list-box {
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  border-top: 1px solid var(--border) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  overflow: visible !important;
}
.list-table-card,
.contacts-table-box,
.products-list-box {
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  border-top: 1px solid var(--border) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  overflow: visible !important;
}
.list-table-card:hover,
.upos-list-box:hover,
.contacts-table-box:hover,
.products-list-box:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.upos-list-box > .box-header,
.list-table-card > .box-header {
  border-radius: 12px 12px 0 0;
}
.upos-dt-toolbar {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 4px 0 10px;
  position: relative;
  z-index: 5;
  overflow: visible !important;
}
.upos-dt-center.list-toolbar,
.upos-dt-center.dt-buttons {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  visibility: visible !important;
  opacity: 1 !important;
}
.dt-buttons .btn-group,
.list-toolbar .btn-group {
  position: relative;
  z-index: 20;
}
.dt-buttons .dropdown-menu,
.list-toolbar .dropdown-menu {
  z-index: 1300;
}
.content-header h1 small {
  font-size: 14px;
  color: #777;
  font-weight: 400;
}
.list-pagination .pagination > li > a,
.list-pagination .pagination > li > span {
  padding: 5px 12px;
  border: 1px solid #ddd;
  color: #337ab7;
}
.list-pagination .pagination > li.active > a {
  background: #337ab7;
  border-color: #337ab7;
  color: #fff;
}
@media (max-width: 768px) {
  .list-data-table { min-width: 640px; }
  .list-toolbar .btn-sm { margin-bottom: 4px; }
  .upos-dt-toolbar { flex-direction: column; align-items: flex-start; }
}

/* Contacts list (UltimatePOS style) */
.contacts-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px 16px;
  align-items: end;
}
.contacts-filter-actions { min-width: 100px; }
.contacts-toolbar { align-items: center; }
.contacts-search-bar {
  padding: 10px 15px !important;
  border-bottom: 1px solid #f4f4f4;
  background: #fafafa;
}
.contacts-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.contacts-search-input { max-width: 280px; }
.contacts-per-page { width: auto; min-width: 110px; }
.contacts-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.contacts-pager { margin: 0; }
.contacts-colvis-menu { padding: 8px 0; min-width: 200px; }
.contacts-colvis-menu .colvis-item {
  display: block;
  padding: 6px 16px;
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}
.contacts-colvis-menu .colvis-item input { margin-right: 8px; }
.contacts-toolbar .dropdown-menu.open { display: block; }
.contacts-toolbar .btn-group { position: relative; }
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { flex: 1; min-width: 0; }
.input-group-addon {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: #eee;
  border: 1px solid #d2d6de;
  color: #555;
  white-space: nowrap;
}
.input-group-addon:first-child {
  border-right: 0;
  border-radius: 3px 0 0 3px;
}
.input-group-addon:first-child + .form-control {
  border-radius: 0 3px 3px 0;
}
.input-group .form-control:first-child {
  border-radius: 3px 0 0 3px;
}
.input-group .form-control + .input-group-addon {
  border-left: 0;
  border-radius: 0 3px 3px 0;
}
.input-group-btn { display: flex; }
.input-group-btn .btn { border-radius: 0 3px 3px 0; height: 100%; }
.pagination { display: inline-flex; list-style: none; padding: 0; }
.pagination > li > a, .pagination > li > span {
  padding: 5px 10px;
  border: 1px solid #ddd;
  margin-left: -1px;
  color: #337ab7;
  text-decoration: none;
}
.pagination > li.active > a { background: #3c8dbc; color: #fff; border-color: #367fa9; }
.pagination > li.disabled > a { color: #777; pointer-events: none; }
.form-control.input-sm { height: 30px; padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 1px 5px; font-size: 12px; }

/* P&L report ? UltimatePOS two-column layout */
.pnl-columns-row { margin-bottom: 12px; }
.pnl-side-box { margin-bottom: 0; }
.pnl-side-table td { vertical-align: middle !important; }
.pnl-side-table td:last-child { width: 170px; white-space: nowrap; }
.pnl-row-highlight-purchase td { background: #fcf8e3 !important; }
.pnl-row-highlight-sales td { background: #dff0d8 !important; }
.pnl-row-total td { background: #eef5fb !important; font-weight: 600; }
.pnl-kpi-row { margin-bottom: 12px; }
.pnl-kpi-box { margin-bottom: 0; }
.pnl-kpi-value { margin: 6px 0; font-weight: 700; }
.pnl-net-banner { margin-bottom: 16px; border-top: 3px solid #3c8dbc; }
.pnl-net-banner.pnl-net-positive .box-body { background: #dff0d8; }
.pnl-net-banner.pnl-net-negative .box-body { background: #f2dede; }
.pnl-tabs-box { margin-bottom: 16px; }
.pnl-tabs-box .tab-content { padding: 12px 16px 16px; background: #fff; }

/* Nav tabs ? shared by P&L and other AdminLTE tab panels */
.nav-tabs-custom > .nav-tabs,
.pnl-tabs-box > .nav-tabs {
  margin: 0;
  padding: 0 8px;
  border-bottom: 1px solid #f4f4f4;
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.nav-tabs-custom > .nav-tabs > li,
.pnl-tabs-box > .nav-tabs > li {
  flex: 0 0 auto;
  margin-bottom: -1px;
}
.nav-tabs-custom > .nav-tabs > li > a,
.pnl-tabs-box > .nav-tabs > li > a {
  display: block;
  padding: 12px 16px;
  color: #444;
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  border-radius: 3px 3px 0 0;
  cursor: pointer;
}
.nav-tabs-custom > .nav-tabs > li > a:hover,
.pnl-tabs-box > .nav-tabs > li > a:hover {
  background: #f9f9f9;
  color: #3c8dbc;
}
.nav-tabs-custom > .nav-tabs > li.active > a,
.nav-tabs-custom > .nav-tabs > li.active > a:hover,
.nav-tabs-custom > .nav-tabs > li.active > a:focus,
.pnl-tabs-box > .nav-tabs > li.active > a,
.pnl-tabs-box > .nav-tabs > li.active > a:hover,
.pnl-tabs-box > .nav-tabs > li.active > a:focus {
  color: #444;
  background: #fff;
  border-color: #f4f4f4;
  border-top: 3px solid #3c8dbc;
  border-bottom-color: #fff;
  padding-top: 10px;
}
.nav-tabs-custom > .tab-content,
.pnl-tabs-box > .tab-content { background: #fff; }
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active { display: block; }
.pnl-summary-row { margin-bottom: 0; }
.pnl-table .pnl-indent-1 { padding-left: 28px !important; color: #555; }
.pnl-table .pnl-section-row td {
  background: #f4f4f4 !important;
  font-weight: 600;
  color: #444;
  border-top: 2px solid #ddd;
}
.pnl-table .pnl-total-row td {
  background: #eef5fb !important;
  border-top: 1px solid #c8d9e8;
}
.pnl-table .pnl-net-row td {
  font-size: 15px;
  border-top: 2px solid #3c8dbc;
}
.pnl-table .pnl-net-positive td { background: #dff0d8 !important; color: #3c763d; }
.pnl-table .pnl-net-negative td { background: #f2dede !important; color: #a94442; }
.print-only { display: none !important; }
.pnl-print-header { text-align: center; margin-bottom: 16px; }
.pnl-print-header h2 { margin: 0 0 4px; font-size: 20px; }
.pnl-print-header h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.pnl-print-header p { margin: 0; color: #666; font-size: 13px; }

/* Document entry forms (Sale Invoice / Purchase GRN) */
.doc-entry .box-header .box-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #444;
}
.doc-entry .box-header .box-title .fa { margin-right: 6px; color: #3c8dbc; }
.doc-entry .box-success .box-header .box-title .fa { color: #00a65a; }
.doc-entry .doc-header-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 0 0 12px;
}
.doc-entry .doc-header-grid > .col-md-3,
.doc-entry .doc-header-grid > .col-md-4,
.doc-entry .doc-header-grid > .col-md-6 {
  width: auto;
  padding: 0;
  max-width: none;
}
.doc-entry .doc-header-grid .form-group { margin-bottom: 0; }
.doc-entry .doc-header-grid .form-group label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-entry .doc-lines-toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  padding: 12px 15px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}
.doc-entry .doc-lines-toolbar .form-control {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
.doc-entry .doc-lines-toolbar .btn { flex: 0 0 auto; white-space: nowrap; }

/* UltimatePOS-style product search */
.doc-entry .upos-product-toolbar {
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 16px;
}
.product-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}
.product-search-field {
  position: relative;
}
.product-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
  z-index: 1;
  font-size: 16px;
}
.product-search-input {
  padding-left: 42px !important;
  height: 46px !important;
  font-size: 15px !important;
  border: 2px solid #cbd5e1 !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  background: #fff !important;
}
.product-search-input:focus {
  border-color: #3c8dbc !important;
  box-shadow: 0 0 0 3px rgba(60, 141, 188, 0.15) !important;
}
.product-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1050;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: 360px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}
.product-search-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  line-height: 1.35;
}
.product-search-item:last-child { border-bottom: 0; }
.product-search-item:hover,
.product-search-item.active {
  background: #3c8dbc;
  color: #fff;
}
.product-search-item:hover .text-muted,
.product-search-item.active .text-muted,
.product-search-item:hover .ps-stock,
.product-search-item.active .ps-stock,
.product-search-item:hover .ps-price,
.product-search-item.active .ps-price {
  color: rgba(255, 255, 255, 0.9) !important;
}
.product-search-item .ps-sku {
  font-family: Consolas, Monaco, monospace;
  font-weight: 700;
  color: #0f172a;
}
.product-search-item:hover .ps-sku,
.product-search-item.active .ps-sku {
  color: #fff;
}
.product-search-item .ps-name {
  min-width: 0;
}
.product-search-item .ps-meta {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #64748b;
}
.product-search-item .ps-stock,
.product-search-item .ps-price {
  font-variant-numeric: tabular-nums;
  color: #475569;
  white-space: nowrap;
}
.product-search-item .ps-right {
  text-align: right;
}
.product-search-empty {
  padding: 14px 16px;
  color: #94a3b8;
  font-size: 13px;
}
@media (max-width: 767px) {
  .product-search-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .product-search-item .ps-right { text-align: left; }
}

/* UltimatePOS-style party (customer/supplier) search */
.party-search {
  position: relative;
  width: 100%;
}
.party-search-field {
  position: relative;
}
.party-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
  z-index: 1;
}
.party-search-input {
  padding-left: 36px !important;
  padding-right: 32px !important;
  height: 34px;
}
.party-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.party-search-clear:hover { color: #ef4444; }
.party-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 1060;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}
.party-search-item {
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.party-search-item:last-child { border-bottom: 0; }
.party-search-item:hover,
.party-search-item.active {
  background: #3c8dbc;
  color: #fff;
}
.party-search-item .ps-meta {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #64748b;
}
.party-search-item:hover .ps-meta,
.party-search-item.active .ps-meta {
  color: rgba(255, 255, 255, 0.85);
}
.party-search-empty {
  padding: 12px;
  color: #94a3b8;
  font-size: 13px;
}


.doc-entry .doc-lines-table {
  margin: 0;
  width: 100%;
}
.doc-entry .doc-lines-table th {
  font-size: 12px;
  white-space: nowrap;
  padding: 8px;
  vertical-align: middle;
}
.doc-entry .doc-lines-table td {
  padding: 6px 8px;
  vertical-align: middle;
}
.doc-entry .doc-lines-table .form-control {
  padding: 5px 8px;
  font-size: 13px;
  height: 32px;
  min-width: 0;
  width: 100%;
}
.doc-entry .doc-lines-table select.form-control { max-width: 100%; }
.doc-entry .doc-lines-empty td {
  text-align: center;
  color: #999;
  padding: 28px 12px !important;
  background: #fcfcfc;
  font-size: 13px;
}
.doc-entry .doc-totals-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
}
.doc-entry .doc-totals-fields {
  flex: 1 1 240px;
  max-width: 380px;
}
.doc-entry .doc-totals-table {
  flex: 0 0 280px;
  width: 280px;
  margin-left: auto;
  font-size: 13px;
}
.doc-entry .doc-totals-table td {
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
}
.doc-entry .doc-totals-table tr:last-child td { border-bottom: none; }
.doc-entry .doc-totals-table .doc-grand td {
  border-top: 2px solid #333;
  padding-top: 10px;
  font-size: 14px;
}
.doc-entry .line-stock { display: block; margin-top: 3px; font-size: 11px; }
.doc-entry .box-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 1100px) {
  .doc-entry .doc-header-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .doc-entry .doc-header-grid { grid-template-columns: 1fr; }
  .doc-entry .doc-lines-toolbar { flex-wrap: wrap; }
  .doc-entry .doc-totals-wrap { flex-direction: column; }
  .doc-entry .doc-totals-fields,
  .doc-entry .doc-totals-table {
    max-width: none;
    width: 100%;
    flex: 1 1 auto;
    margin-left: 0;
  }
}

@media print {
  .main-sidebar, .main-header, .no-print, .breadcrumb { display: none !important; }
  .content-wrapper { margin: 0 !important; width: 100% !important; padding: 0 !important; }
  .content-header { display: none !important; }
  .print-only { display: block !important; }
  .small-box { box-shadow: none; page-break-inside: avoid; }
  .small-box .icon { display: none; }
  .pnl-side-box, .pnl-net-banner, .pnl-kpi-box { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  .pnl-side-table th, .pnl-side-table td { border: 1px solid #ccc !important; }
  .pnl-statement-box { box-shadow: none; border: 1px solid #ccc; }
  .pnl-table th, .pnl-table td { border: 1px solid #ccc !important; }
  @page { margin: 12mm; }
}

@media (max-width: 992px) {
  .breadcrumb { float: none; padding-top: 8px; }
}
@media (max-width: 768px) {
  .breadcrumb { display: none; }
}


/* ===== Ultimate POS V7 ? modals, actions, toolbar, purple buttons ===== */
.btn-primary { background: #605ca8; border-color: #555299; color: #fff !important; }
.btn-primary:hover { background: #555299; border-color: #4b4788; color: #fff !important; }
.btn-info { background: #00c0ef; color: #fff !important; border-color: #00acd6; border-radius: 3px; }
.actions-dropdown .btn-info.btn-xs,
.actions-btn {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  color: #374151 !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
  font-weight: 600;
}
.actions-dropdown .btn-info.btn-xs:hover,
.actions-btn:hover {
  background: #f9fafb !important;
  color: #111827 !important;
}
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
/* DataTables-style buttons (POS) - not neon export bricks */
.dt-buttons .btn-default,
.list-toolbar.dt-buttons .btn-default {
  background: #fff !important;
  border: 1px solid #ddd !important;
  color: #333 !important;
  border-radius: 3px !important;
  font-weight: 600;
  font-size: 12px !important;
  padding: 5px 10px !important;
  box-shadow: none !important;
}
.dt-buttons .btn-default:hover {
  background: #e7e7e7 !important;
  border-color: #adadad !important;
  color: #333 !important;
}
.dt-buttons .dropdown-menu { font-size: 13px; }
.dt-buttons .dropdown-menu > li > a { padding: 6px 14px; }
.list-colvis-menu { max-height: 280px; overflow-y: auto; min-width: 180px; padding: 6px 0; }
.list-colvis-menu label {
  display: block;
  font-weight: 400;
  margin: 0;
  padding: 4px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.list-colvis-menu label:hover { background: #f5f5f5; }
.list-colvis-menu input { margin-right: 6px; }
.btn-export-csv { background: #00a65a; border-color: #008d4c; color: #fff !important; }
.btn-export-excel { background: #00a65a; border-color: #008d4c; color: #fff !important; }
.btn-export-print { background: #00c0ef; border-color: #00acd6; color: #fff !important; }
.btn-export-cols { background: #605ca8; border-color: #555299; color: #fff !important; }
.btn-export-pdf { background: #f39c12; border-color: #e08e0b; color: #fff !important; }

.upos-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 2000; display: none; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.upos-modal-backdrop.open { display: flex; }
.upos-modal {
  background: #fff; border-radius: 4px; width: min(920px, 100%);
  box-shadow: 0 8px 28px rgba(0,0,0,.28); margin-bottom: 40px;
}
.upos-modal.upos-modal-sm { width: min(640px, 100%); }
.upos-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #e5e7eb;
}
.upos-modal-head h3 { margin: 0; font-size: 18px; font-weight: 600; color: #333; }
.upos-modal-close {
  background: none; border: none; font-size: 22px; line-height: 1;
  color: #999; cursor: pointer; padding: 0 4px;
}
.upos-modal-close:hover { color: #333; }
.upos-modal-body { padding: 16px 18px; }
.upos-modal-foot {
  padding: 12px 18px; border-top: 1px solid #e5e7eb;
  display: flex; justify-content: flex-end; gap: 8px; align-items: center;
}
.upos-info-grid {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px;
  margin-bottom: 14px;
}
.upos-info-box {
  background: #f4f6f9; border: 1px solid #e5e7eb; border-radius: 4px; padding: 10px 12px; font-size: 13px;
}
.upos-info-box strong { display: block; margin-bottom: 4px; }
.pay-action-btns { display: inline-flex; gap: 6px; }
.pay-action-btns .pay-act {
  width: 30px; height: 30px; border-radius: 50%; border: none; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  text-decoration: none !important; font-size: 13px;
}
.pay-act.edit { background: #00c0ef; }
.pay-act.delete { background: #dd4b39; }
.pay-act.view { background: #605ca8; }
.btn-upos-purple { background: #605ca8 !important; border-color: #555299 !important; color: #fff !important; }
.btn-upos-gray { background: #3c3c3c !important; border-color: #2a2a2a !important; color: #fff !important; }

body.sidebar-collapse .main-sidebar {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden !important;
  opacity: 0;
  pointer-events: none;
}
body.sidebar-collapse .content-wrapper,
body.sidebar-collapse .main-column {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 100% !important;
}
@media (max-width: 768px) {
  .main-sidebar {
    position: fixed !important;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    margin-left: 0;
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    z-index: 1100;
  }
  body.sidebar-collapse .main-sidebar {
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    max-width: var(--sidebar-width) !important;
    transform: translateX(-100%);
    opacity: 1;
    pointer-events: none;
  }
  .main-column { width: 100% !important; flex: 1 1 100% !important; }
}

/* Forms — POS white cards, purple primary */
.content .box > form .box-body,
.content form .box-body { background: #fff; }
.content .box .box-footer .btn-primary,
.content form .btn-primary {
  background: #605ca8;
  border-color: #555299;
}
.upos-list-box .box-header .box-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
