/* ============================================================
   NEO BRUTALISM — POS KONTER
   Elegant, Professional, Mobile-First
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* ── DESIGN TOKENS ───────────────────────────────────────── */
:root {
  --gold:        #F5C400;
  --gold-dark:   #C9A000;
  --gold-light:  #FFF8D0;
  --gold-subtle: #FFFBEA;
  --black:       #111111;
  --gray-dark:   #333333;
  --gray-mid:    #888888;
  --gray-light:  #E8E8E8;
  --white:       #FFFFFF;
  --bg:          #FAFAF7;
  --card-bg:     #FFFFFF;
  --border:      2px solid var(--black);
  --border-light:1px solid #E0E0E0;
  --shadow:      4px 4px 0 var(--black);
  --shadow-sm:   2px 2px 0 var(--black);
  --shadow-lg:   6px 6px 0 var(--black);
  --shadow-gold: 4px 4px 0 var(--gold-dark);
  --red:         #D63031;
  --red-bg:      #FFF0F0;
  --green:       #1D6A3E;
  --green-bg:    #EAFAF1;
  --blue:        #1565C0;
  --blue-bg:     #EEF4FF;
  --orange:      #B84500;
  --orange-bg:   #FFF3E9;
  --sidebar-w:   248px;
  --header-h:    60px;
  --radius:      0px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--black);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-light); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-mid); }

/* ── LAYOUT ──────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--black);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 300;
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 32px rgba(0,0,0,.4); }
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 299;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

.sidebar-logo {
  /* Exactly match topbar height so the border-bottom aligns perfectly */
  height: var(--header-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 20px;
  background: var(--gold);
  color: var(--black);
  border-bottom: var(--border);
  flex-shrink: 0;
  box-sizing: border-box;
}
.sidebar-logo h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.sidebar-logo p {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.6;
  margin-top: 3px;
  line-height: 1;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0 20px; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #444; }

.nav-section-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #555;
  padding: 16px 20px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px;
  color: #B0B0B0;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  position: relative;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active {
  color: var(--gold);
  background: rgba(245,196,0,.1);
  border-left-color: var(--gold);
  font-weight: 700;
}
.nav-item .icon { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #2a2a2a;
  flex-shrink: 0;
}
.sidebar-user-name { font-weight: 700; font-size: 13px; color: #eee; }
.sidebar-user-role { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── MAIN CONTENT ────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}
@media (max-width: 768px) { .main-content { margin-left: 0; } }

/* ── TOPBAR ──────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);          /* must equal sidebar-logo height */
  min-height: var(--header-h);
  background: var(--gold);
  border-bottom: var(--border);     /* same as sidebar-logo border-bottom */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-sizing: border-box;
}
.topbar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }

.btn-hamburger {
  display: none;
  background: var(--black);
  color: var(--white);
  border: 2px solid var(--black);
  width: 36px; height: 36px;
  cursor: pointer;
  font-size: 14px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .1s;
}
.btn-hamburger:active { transform: scale(.95); }
@media (max-width: 768px) {
  .btn-hamburger { display: flex; }
  .topbar-date-full { display: none; }
  .topbar { padding: 0 12px; }
}

.page-content { padding: 20px; flex: 1; overflow-x: hidden; }
@media (max-width: 768px) { .page-content { padding: 12px; } }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-header-left h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.page-header-left p {
  font-size: 13px;
  color: var(--gray-mid);
  margin-top: 2px;
}
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  position: relative;
}
.card + .card { margin-top: 16px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--black);
  gap: 10px;
  flex-wrap: wrap;
}
.card-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-subtitle { font-size: 12px; color: var(--gray-mid); margin-top: 2px; }

/* card accent stripe */
.card-accent { border-top: 4px solid var(--gold); }
.card-accent-green  { border-top: 4px solid var(--green); }
.card-accent-red    { border-top: 4px solid var(--red); }
.card-accent-blue   { border-top: 4px solid var(--blue); }

@media (max-width: 480px) {
  .card { padding: 14px; }
  .card-header { margin-bottom: 12px; padding-bottom: 10px; }
}

/* ── STAT CARDS ──────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 480px) { .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; } }

.stat-card {
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 18px 16px;
  background: var(--white);
  position: relative;
  overflow: hidden;
  transition: box-shadow .15s, transform .15s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
}
.stat-card:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow); }
.stat-card-icon {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 24px;
  color: var(--gold);
  opacity: .7;
}
.stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gray-mid);
}
.stat-value {
  font-size: 24px;
  font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -1px;
  margin: 6px 0 2px;
  line-height: 1;
}
.stat-sub { font-size: 11px; color: var(--gray-mid); }

@media (max-width: 480px) {
  .stat-value { font-size: 18px; }
  .stat-card  { padding: 12px; }
  .stat-card-icon { font-size: 18px; }
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  border: var(--border);
  cursor: pointer;
  transition: transform .1s, box-shadow .1s, background .1s;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  background: var(--white);
  color: var(--black);
  min-height: 40px;
  letter-spacing: -0.1px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover  { transform: translate(-2px,-2px); box-shadow: var(--shadow); }
.btn:active { transform: translate(1px,1px);   box-shadow: none; }

.btn-primary { background: var(--gold); color: var(--black); }
.btn-primary:hover { background: var(--gold-dark); color: var(--black); }

.btn-dark  { background: var(--black); color: var(--white); }
.btn-dark:hover { background: var(--gray-dark); }

.btn-danger { background: var(--red); color: var(--white); border-color: var(--red); box-shadow: 2px 2px 0 #8b0000; }
.btn-danger:hover { background: #c0392b; box-shadow: var(--shadow); border-color: var(--black); }

.btn-success { background: var(--green); color: var(--white); border-color: var(--green); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--gold-subtle); box-shadow: var(--shadow-sm); }

.btn-sm { padding: 5px 10px; font-size: 12px; min-height: 32px; gap: 5px; }
.btn-lg { padding: 11px 22px; font-size: 14px; min-height: 46px; }
.btn-icon { padding: 7px 10px; min-width: 36px; }

.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: var(--shadow-sm) !important; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  color: var(--gray-dark);
}
.form-hint { font-size: 11px; color: var(--gray-mid); margin-top: 4px; }

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: var(--border);
  background: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--black);
  outline: none;
  transition: box-shadow .15s, border-color .15s;
  min-height: 42px;
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  box-shadow: 3px 3px 0 var(--gold);
  border-color: var(--black);
}
.form-control::placeholder { color: #aaa; }

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23111'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
textarea.form-control { resize: vertical; min-height: 88px; line-height: 1.5; }

.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-row, .form-row-3 { grid-template-columns: 1fr; gap: 0; } }

.input-group { display: flex; gap: 0; }
.input-group .form-control { flex: 1; }
.input-group .btn { border-left: none; box-shadow: var(--shadow-sm); }

/* ── SEARCH BAR ──────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-bar .form-control { flex: 1; min-width: 180px; }
@media (max-width: 480px) { .search-bar .btn { flex: 1; } }

/* ── TABLES ──────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: var(--border);
  box-shadow: var(--shadow-sm);
  margin: -1px; /* collapse with card border */
}
.card .table-wrapper { margin: 0; border: none; box-shadow: none; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 500px;
}
thead tr {
  background: var(--black);
  color: var(--white);
}
thead th {
  padding: 11px 14px;
  text-align: left;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
}
thead th:first-child { border-left: 3px solid var(--gold); }

tbody tr {
  border-bottom: 1px solid #F0F0F0;
  transition: background .1s;
}
tbody tr:nth-child(even) { background: #FAFAFA; }
tbody tr:hover { background: var(--gold-light) !important; }
tbody tr:active { background: var(--gold-light) !important; }
tbody td {
  padding: 11px 14px;
  vertical-align: middle;
  color: var(--black);
}
tbody td:first-child { font-weight: 600; }

.table-actions { display: flex; gap: 5px; flex-wrap: nowrap; align-items: center; }

/* Table info bar */
.table-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 12px;
  color: var(--gray-mid);
  border-top: 1px solid var(--gray-light);
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── PAGINATION ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 14px 0 4px;
}
.pagination-info {
  flex: 1;
  font-size: 12px;
  color: var(--gray-mid);
  white-space: nowrap;
}
.pagination-pages { display: flex; gap: 4px; flex-wrap: wrap; }

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border: var(--border);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: var(--white);
  transition: all .1s;
  font-family: 'Space Grotesk', sans-serif;
}
.page-btn:hover   { background: var(--gold-light); transform: translate(-1px,-1px); box-shadow: var(--shadow-sm); }
.page-btn.active  { background: var(--black); color: var(--white); box-shadow: var(--shadow-sm); }
.page-btn:disabled{ opacity: .4; cursor: default; transform: none !important; box-shadow: none !important; }
.page-btn-prev, .page-btn-next { width: auto; padding: 0 12px; gap: 5px; font-size: 12px; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  border: 1.5px solid var(--black);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.badge-gold    { background: var(--gold);     color: var(--black); border-color: var(--gold-dark); }
.badge-green   { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.badge-red     { background: var(--red-bg);   color: var(--red);   border-color: var(--red); }
.badge-blue    { background: var(--blue-bg);  color: var(--blue);  border-color: var(--blue); }
.badge-orange  { background: var(--orange-bg);color: var(--orange);border-color: var(--orange); }
.badge-dark    { background: var(--black);    color: var(--white); border-color: var(--black); }
.badge-gray    { background: var(--gray-light);color: var(--gray-dark); border-color: #ccc; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  animation: modalIn .18s cubic-bezier(.4,0,.2,1);
  -webkit-overflow-scrolling: touch;
}
@keyframes modalIn {
  from { transform: translateY(10px) scale(.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@media (max-width: 600px) {
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { max-width: 100%; max-height: 95vh; animation: modalUp .22s ease; }
  @keyframes modalUp {
    from { transform: translateY(100%); }
    to   { transform: none; }
  }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: var(--border);
  background: var(--gold);
  position: sticky; top: 0; z-index: 1;
}
.modal-header h2 { font-size: 15px; letter-spacing: -0.3px; }
.modal-body    { padding: 18px; }
.modal-footer  {
  padding: 14px 18px;
  border-top: var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  position: sticky; bottom: 0;
  background: var(--bg);
}
@media (max-width: 480px) {
  .modal-footer { justify-content: stretch; }
  .modal-footer .btn { flex: 1; }
}

/* ── ALERTS ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border: var(--border);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}
.alert-success { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.alert-danger  { background: var(--red-bg);   border-color: var(--red);   color: var(--red); }
.alert-warning { background: var(--orange-bg);border-color: var(--orange);color: var(--orange); }
.alert-info    { background: var(--blue-bg);  border-color: var(--blue);  color: var(--blue); }

/* ── TOAST ───────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(340px, calc(100vw - 32px));
}
@media (max-width: 480px) { #toast-container { right: 8px; bottom: 8px; left: 8px; max-width: none; } }

.toast {
  padding: 12px 18px;
  border: var(--border);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  animation: toastIn .2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
@keyframes toastIn { from { transform: translateX(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast-success { background: var(--gold);  color: var(--black); }
.toast-error   { background: var(--red);   color: var(--white); border-color: #8b0000; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-mid);
}
.empty-state .es-icon {
  font-size: 40px;
  color: var(--gray-light);
  margin-bottom: 14px;
  display: block;
}
.empty-state h4 { font-size: 15px; color: var(--gray-dark); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

/* ── LOADING ─────────────────────────────────────────────── */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  flex-direction: column;
  gap: 14px;
  color: var(--gray-mid);
  font-size: 13px;
}
.spinner {
  display: inline-block;
  width: 28px; height: 28px;
  border: 3px solid var(--gray-light);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── LOGIN PAGE ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-box {
  width: 100%;
  max-width: 400px;
  border: var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--white);
}
.login-header {
  background: var(--gold);
  border-bottom: var(--border);
  padding: 28px 24px;
  text-align: center;
}
.login-header h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.login-header p  { font-size: 12px; opacity: .7; margin-top: 4px; }
.login-body { padding: 24px; }

/* ── POS LAYOUT ──────────────────────────────────────────── */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 12px;
  height: calc(100vh - var(--header-h) - 24px);
}
.pos-products { overflow-y: auto; min-width: 0; }
.pos-cart { display: flex; flex-direction: column; min-width: 0; }

@media (max-width: 900px) {
  .pos-layout { grid-template-columns: 1fr; height: auto; }
  .pos-cart {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 52vh;
    border-top: var(--border);
    box-shadow: 0 -4px 0 var(--black);
    z-index: 100;
    background: var(--white);
    transform: translateY(calc(100% - 54px));
    transition: transform .3s ease;
  }
  .pos-cart.cart-open { transform: translateY(0); }
  .pos-products { padding-bottom: 70px; }
  .cart-tab-handle { display: flex !important; }
}
.cart-tab-handle {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--gold);
  border-bottom: var(--border);
  cursor: pointer;
  font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  flex-shrink: 0;
  user-select: none;
}

/* ── PRODUCT GRID ────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 8px;
}
@media (max-width: 480px) { .product-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 6px; } }

.product-card {
  border: var(--border);
  padding: 12px 10px;
  cursor: pointer;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: all .12s;
  -webkit-tap-highlight-color: transparent;
}
.product-card:active { transform: translate(1px,1px); box-shadow: none; background: var(--gold-light); }
@media (hover: hover) { .product-card:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow); background: var(--gold-light); } }
.product-card.out-of-stock { opacity: .4; cursor: not-allowed; }
.product-card-name  { font-size: 11px; font-weight: 700; line-height: 1.3; }
.product-card-price { font-size: 13px; font-weight: 800; font-family: 'Space Grotesk', sans-serif; margin-top: 4px; letter-spacing: -0.3px; }
.product-card-stock { font-size: 10px; color: var(--gray-mid); margin-top: 2px; }

/* ── CART ────────────────────────────────────────────────── */
.cart-items { flex: 1; overflow-y: auto; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-light);
  font-size: 12px;
  transition: background .1s;
}
.cart-item:hover { background: var(--gold-subtle); }
.cart-item-name  { flex: 1; font-weight: 600; line-height: 1.3; }
.cart-item-qty   { display: flex; align-items: center; gap: 4px; }
.qty-btn {
  width: 26px; height: 26px;
  border: var(--border);
  background: var(--white);
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all .1s;
  font-family: 'Space Grotesk', sans-serif;
}
.qty-btn:hover  { background: var(--gold); }
.qty-btn:active { transform: scale(.9); }
.cart-item-price { font-weight: 800; font-family: 'Space Grotesk', sans-serif; white-space: nowrap; font-size: 13px; }

.cart-footer { border-top: var(--border); padding: 12px; background: var(--white); flex-shrink: 0; }
.cart-total  { display: flex; justify-content: space-between; font-size: 20px; font-weight: 800; font-family: 'Space Grotesk', sans-serif; padding: 8px 0 10px; letter-spacing: -0.5px; }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--gray-mid); margin-bottom: 4px; }

/* Pay method buttons */
.pay-methods { display: flex; gap: 6px; margin-bottom: 8px; }
.pay-method { flex: 1; font-size: 11px !important; padding: 6px 4px !important; min-height: 34px !important; }
.pay-method.active-pay { background: var(--black) !important; color: var(--white) !important; }

/* ── FINANCIAL TABLES ────────────────────────────────────── */
.report-table thead tr { background: var(--gold); color: var(--black); }
.report-table thead th:first-child { border-left-color: var(--black); }
.report-section-header td {
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #F5F5F5;
  padding: 7px 14px;
  border-bottom: 1px solid #E0E0E0;
}
.report-subtotal td {
  font-weight: 700;
  border-top: 2px solid var(--black);
  background: #F9F9F9;
}
.report-total td {
  font-weight: 800;
  background: var(--black);
  color: var(--white);
  font-size: 14px;
  letter-spacing: -0.3px;
}

/* ── TABS ────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-bar .btn {
  border-bottom: none;
  border-radius: 0;
  flex-shrink: 0;
  font-size: 12px;
  padding: 8px 14px;
  box-shadow: none;
  min-height: 38px;
}
.tab-bar .btn:hover { transform: none; background: var(--gold-light); }
.tab-bar .btn-dark { position: relative; }
.tab-bar .btn-dark::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
}

/* ── DASHBOARD GRID ──────────────────────────────────────── */
.dash-grid-2 { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
@media (max-width: 900px) { .dash-grid-2 { grid-template-columns: 1fr; } }

.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 480px) { .quick-actions .btn { flex: 1 1 calc(50% - 4px); } }

/* ── REPORT GRID ─────────────────────────────────────────── */
.report-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 700px) { .report-grid-2 { grid-template-columns: 1fr; } }

/* ── ACCOUNTING TRANSACTION GRID ─────────────────────────── */
.acc-tx-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) {
  .acc-tx-grid { grid-template-columns: 1fr; }
  .acc-form-sticky { position: static !important; }
}

/* ── QUICK TX BUTTONS ────────────────────────────────────── */
.tx-btn-group { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.tx-btn-group-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray-mid);
  margin-bottom: 5px;
  margin-top: 10px;
  display: block;
}
.tx-btn-group-label:first-child { margin-top: 0; }
.btn-tx-in  { font-size: 11px !important; background: var(--green-bg) !important; border-color: var(--green) !important; color: var(--green) !important; min-height: 30px !important; padding: 3px 8px !important; }
.btn-tx-out { font-size: 11px !important; background: var(--red-bg) !important;   border-color: var(--red) !important;   color: var(--red) !important;   min-height: 30px !important; padding: 3px 8px !important; }
.btn-tx-other { font-size: 11px !important; min-height: 30px !important; padding: 3px 8px !important; border-color: #ccc !important; }

/* ── REPORT TABLE ─────────────────────────────────────────── */
.rep-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rep-table tr.section-head td {
  background: #F0F0F0;
  padding: 7px 14px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-dark);
  border-top: var(--border);
}
.rep-table tr.row-item td { padding: 7px 14px 7px 26px; border-bottom: 1px solid #F5F5F5; }
.rep-table tr.row-item td:last-child { text-align: right; font-weight: 600; }
.rep-table tr.row-subtotal td { padding: 9px 14px; font-weight: 800; background: #FAFAFA; border-top: 2px solid var(--black); }
.rep-table tr.row-subtotal td:last-child { text-align: right; }
.rep-table tr.row-total td { padding: 12px 14px; font-weight: 800; background: var(--black); color: var(--white); font-size: 14px; }
.rep-table tr.row-total td:last-child { text-align: right; font-size: 16px; letter-spacing: -0.5px; }
.rep-table tr.row-profit-pos td { padding: 14px 16px; font-weight: 800; background: var(--green); color: white; font-size: 14px; }
.rep-table tr.row-profit-neg td { padding: 14px 16px; font-weight: 800; background: var(--red); color: white; font-size: 14px; }
.rep-table tr.row-profit-pos td:last-child, .rep-table tr.row-profit-neg td:last-child { text-align: right; font-size: 18px; letter-spacing: -0.5px; }

/* Report header box */
.rep-header {
  text-align: center;
  padding: 16px 0 20px;
  border-bottom: 2px solid var(--black);
  margin-bottom: 16px;
}
.rep-header h3 { font-size: 16px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; }
.rep-header p  { font-size: 12px; color: var(--gray-mid); margin-top: 4px; }

/* Cashflow category header */
.cf-cat-header { background: var(--gold-subtle); font-weight: 800; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; }
.cf-cat-total td { font-weight: 700; font-size: 13px; border-top: 1px solid var(--gray-light); }

/* ── IMEI CHIP ───────────────────────────────────────────── */
.imei-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  padding: 2px 8px;
  border: 1.5px solid var(--black);
  background: var(--gold-light);
  letter-spacing: 0.3px;
  word-break: break-all;
}

/* ── FONT AWESOME ────────────────────────────────────────── */
.fas, .far, .fab { font-size: inherit; line-height: inherit; pointer-events: none; }
.nav-item .icon .fas { width: 16px; text-align: center; }

/* ── PRINT ───────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin-left: 0; }
  body { background: white; }
  .receipt { max-width: 300px; margin: 0 auto; font-size: 12px; }
}

/* ── UTILITY ─────────────────────────────────────────────── */
.d-flex          { display: flex; }
.align-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8           { gap: 8px; }
.gap-12          { gap: 12px; }
.gap-16          { gap: 16px; }
.mb-8            { margin-bottom: 8px; }
.mb-12           { margin-bottom: 12px; }
.mb-16           { margin-bottom: 16px; }
.mb-20           { margin-bottom: 20px; }
.mt-8            { margin-top: 8px; }
.mt-16           { margin-top: 16px; }
.text-right      { text-align: right; }
.text-center     { text-align: center; }
.text-muted      { color: var(--gray-mid); }
.text-gold       { color: var(--gold-dark); }
.text-red        { color: var(--red); }
.text-green      { color: var(--green); }
.fw-bold         { font-weight: 700; }
.fw-800          { font-weight: 800; font-family: 'Space Grotesk', sans-serif; }
.font-mono       { font-family: 'Courier New', monospace; font-size: 12px; }
.w-100           { width: 100%; }
.hidden          { display: none !important; }
.no-wrap         { white-space: nowrap; }
.divider         { border: none; border-top: 1px solid var(--gray-light); margin: 16px 0; }
