/* ═══════════════════════════════════════════════════
   Yellow Market — GotPOS RTL Clone (Exact Match)
   Primary: #ff762d | Font: IBM Plex Sans + Tajawal
   ═══════════════════════════════════════════════════ */

:root {
  --primary:        #ff762d;
  --primary-light:  #fff1eb;
  --primary-dark:   #e5641a;
  --success:        #40c360;
  --success-light:  #edfaf1;
  --warning:        #f5c400;
  --warning-light:  #fffce0;
  --danger:         #f93434;
  --danger-light:   #fff0f0;
  --info:           #4597fb;
  --info-light:     #edf4ff;
  --indigo:         #484ee5;
  --indigo-light:   #eeeffe;

  /* Sidebar - white/light */
  --sidebar-bg:            #ffffff;
  --sidebar-hover-bg:      rgba(255,118,45,0.07);
  --sidebar-active-bg:     rgba(255,118,45,0.10);
  --sidebar-active-border: #ff762d;
  --sidebar-text:          #868688;
  --sidebar-text-hover:    #18181a;
  --sidebar-text-active:   #ff762d;
  --sidebar-width:         260px;
  --sidebar-mini:          68px;
  --sidebar-section:       #b0b0b0;

  /* Topbar */
  --topbar-h:     68px;
  --topbar-bg:    #ffffff;
  --topbar-border:#e9e9e9;

  /* Layout */
  --body-bg:      #f7f7f7;
  --card-bg:      #ffffff;
  --card-radius:  6px;
  --card-border:  1px solid #e9e9e9;
  --card-shadow:  none;
  --border-color: #e9e9e9;
  --text-main:    #18181a;
  --text-muted:   #868688;
  --input-bg:     #f3f4f6;
  --input-border: #e9e9e9;
}

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', 'IBM Plex Sans', sans-serif;
  background: var(--body-bg);
  color: var(--text-main);
  direction: rtl;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  margin: 0;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { font-family: inherit; }

/* ── Sidebar ──────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: width .22s ease, transform .22s ease;
  overflow: hidden;
  border-left: 1px solid #e9e9e9;
}

#sidebar.collapsed { width: var(--sidebar-mini); }

/* Logo area */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none;
}

.sidebar-brand .brand-icon {
  width: 34px; height: 34px;
  background: var(--primary-light);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 16px;
}

.sidebar-brand .brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #18181a;
  transition: opacity .2s;
  white-space: nowrap;
}

#sidebar.collapsed .brand-name { opacity: 0; width: 0; }

/* Scroll area */
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 16px;
}

.sidebar-scroll::-webkit-scrollbar { width: 3px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

/* Section labels */
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #a0a0a0;
  padding: 16px 18px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .2s;
}

#sidebar.collapsed .nav-section-label { opacity: 0; }

/* Nav items wrapper */
.nav-item { padding: 1px 8px; }

/* Nav link */
.nav-link-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--sidebar-text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: background .15s, color .15s;
  position: relative;
  user-select: none;
  text-decoration: none;
}

.nav-link-wrap:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text-hover);
}

.nav-link-wrap.active,
.nav-link-wrap.parent-active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
}

.nav-link-wrap.active::after {
  content: '';
  position: absolute;
  right: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  font-size: 17px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: #c0c0c0;
  transition: color .15s;
  line-height: 1;
}

.nav-link-wrap:hover .nav-icon,
.nav-link-wrap.active .nav-icon,
.nav-link-wrap.parent-active .nav-icon {
  color: var(--primary);
}

.nav-label {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  transition: opacity .2s;
}

.nav-arrow {
  font-size: 11px;
  color: rgba(255,255,255,.2);
  transition: transform .2s, opacity .2s;
  flex-shrink: 0;
}

.nav-link-wrap[aria-expanded="true"] .nav-arrow {
  transform: rotate(90deg);
  color: rgba(255,255,255,.5);
}

#sidebar.collapsed .nav-label,
#sidebar.collapsed .nav-arrow { opacity: 0; width: 0; }

/* Submenu */
.nav-sub {
  padding: 2px 0 2px 0;
  padding-right: 36px;
}

.nav-sub a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--sidebar-text);
  font-size: 12.5px;
  transition: background .12s, color .12s;
  white-space: nowrap;
}

.nav-sub a::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  flex-shrink: 0;
}

.nav-sub a:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-text-hover); }
.nav-sub a:hover::before, .nav-sub a.active::before { background: var(--primary); }
.nav-sub a.active { color: var(--primary); font-weight: 600; }

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid #e9e9e9;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-footer .user-av {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

.sidebar-footer .user-info { flex: 1; min-width: 0; transition: opacity .2s; }
.sidebar-footer .user-name { font-size: 12px; font-weight: 600; color: #18181a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .user-role { font-size: 11px; color: var(--sidebar-section); }

#sidebar.collapsed .sidebar-footer .user-info { opacity: 0; }

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1049;
}
.sidebar-overlay.show { display: block; }

/* ── Topbar ──────────────────────────────────────── */
#topbar {
  position: fixed;
  top: 0;
  right: var(--sidebar-width);
  left: 0;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: var(--card-border);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 6px;
  z-index: 1040;
  transition: right .22s ease;
}

body.sidebar-collapsed #topbar { right: var(--sidebar-mini); }

/* Sidebar toggle */
.topbar-toggle {
  background: none;
  border: none;
  width: 36px; height: 36px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .12s, color .12s;
  flex-shrink: 0;
  padding: 0;
}
.topbar-toggle:hover { background: var(--input-bg); color: var(--text-main); }
.topbar-toggle i { font-size: 20px; }

/* Topbar quick buttons */
.topbar-btn-icon {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: var(--input-bg);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .12s, color .12s;
  flex-shrink: 0;
  text-decoration: none;
}
.topbar-btn-icon:hover { background: var(--border-color); color: var(--text-main); }
.topbar-btn-icon i { font-size: 17px; }

/* POS button */
.topbar-pos-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0 14px;
  height: 36px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s;
  text-decoration: none;
  font-family: inherit;
}
.topbar-pos-btn:hover { background: var(--primary-dark); color: #fff; }
.topbar-pos-btn i { font-size: 15px; }

/* Add New button */
.topbar-addnew-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  color: var(--text-main);
  border: var(--card-border);
  border-radius: 6px;
  padding: 0 12px;
  height: 36px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s;
  font-family: inherit;
}
.topbar-addnew-btn:hover { background: var(--input-bg); }
.topbar-addnew-btn i { font-size: 16px; color: var(--primary); }

/* Branch selector */
.topbar-branch {
  display: flex;
  align-items: center;
  gap: 6px;
  border: var(--card-border);
  border-radius: 6px;
  padding: 0 10px;
  height: 36px;
  background: var(--topbar-bg);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
  font-family: inherit;
  white-space: nowrap;
  transition: border-color .12s;
}
.topbar-branch:focus { outline: none; border-color: var(--primary); }
.topbar-branch:hover { border-color: #ccc; }

/* Topbar search */
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--input-bg);
  border: var(--card-border);
  border-radius: 6px;
  padding: 0 12px;
  height: 36px;
  flex: 1;
  max-width: 260px;
  transition: border-color .12s, box-shadow .12s;
}
.topbar-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,118,45,.1);
  background: #fff;
}
.topbar-search i { color: var(--text-muted); font-size: 15px; flex-shrink: 0; }
.topbar-search input {
  background: none; border: none; outline: none;
  font-size: 13px; color: var(--text-main);
  width: 100%; font-family: inherit;
}
.topbar-search input::placeholder { color: var(--text-muted); }

/* Spacer */
.topbar-spacer { flex: 1; }

/* Topbar divider */
.topbar-sep {
  width: 1px; height: 22px;
  background: var(--border-color);
  flex-shrink: 0;
}

/* Topbar icon buttons (notifications, etc.) */
.topbar-icon-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 6px;
  background: none;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .12s, color .12s;
  flex-shrink: 0;
  padding: 0;
}
.topbar-icon-btn:hover { background: var(--input-bg); color: var(--text-main); }
.topbar-icon-btn i { font-size: 19px; }

.topbar-badge {
  position: absolute;
  top: 3px; left: 4px;
  min-width: 16px; height: 16px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  line-height: 1;
  border: 1.5px solid #fff;
}

/* User button */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
  text-decoration: none;
}
.topbar-user:hover { background: var(--input-bg); }

.user-av {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.user-av img { width: 100%; height: 100%; object-fit: cover; }

.user-details .user-name { font-size: 12.5px; font-weight: 600; color: var(--text-main); line-height: 1.3; }
.user-details .user-role { font-size: 11px; color: var(--text-muted); line-height: 1.2; }

/* Topbar dropdowns */
.topbar-dd {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 2000;
  overflow: hidden;
  display: none;
  animation: ddFadeIn .15s ease;
}
.topbar-dd.show { display: block; }
.topbar-dd.dd-right { left: auto; right: 0; }

@keyframes ddFadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }

.dd-header {
  padding: 12px 16px 10px;
  border-bottom: var(--card-border);
  font-size: 12.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--text-main);
}
.dd-header a { font-size: 12px; color: var(--primary); font-weight: 500; }

.dd-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background .1s;
  text-decoration: none;
  color: var(--text-main);
}
.dd-item:hover { background: var(--body-bg); }

.dd-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.dd-title { font-size: 13px; font-weight: 500; }
.dd-sub   { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.dd-time  { font-size: 11px; color: var(--text-muted); white-space: nowrap; margin-top: 2px; }

.dd-footer {
  padding: 10px 16px;
  border-top: var(--card-border);
  text-align: center;
}
.dd-footer a { font-size: 12.5px; color: var(--primary); font-weight: 500; }

/* Quick add menu */
.dd-qa { min-width: 210px; }
.dd-qa a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  font-size: 13px; color: var(--text-main);
  transition: background .1s;
}
.dd-qa a:hover { background: var(--body-bg); }
.dd-qa .qa-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}

/* ── Main content ─────────────────────────────────── */
#main-content {
  margin-right: var(--sidebar-width);
  margin-top: var(--topbar-h);
  padding: 20px 22px;
  min-height: calc(100vh - var(--topbar-h));
  transition: margin-right .22s ease;
}

body.sidebar-collapsed #main-content { margin-right: var(--sidebar-mini); }

/* ── Page header ──────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { font-size: 19px; font-weight: 700; margin: 0; color: var(--text-main); }
.page-subtitle { font-size: 12.5px; color: var(--text-muted); margin: 3px 0 0; }

.breadcrumb { display: flex; align-items: center; gap: 0; padding: 0; margin: 0; list-style: none; background: none; }
.breadcrumb-item { font-size: 12px; color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { content: '/'; padding: 0 6px; color: var(--border-color); }
.breadcrumb-item a { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-muted); }

/* ── Cards ────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.card-header {
  padding: 14px 18px;
  border-bottom: var(--card-border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: none;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
}
.card-title { font-size: 14px; font-weight: 600; margin: 0; color: var(--text-main); }
.card-body  { padding: 18px; }
.card-footer { padding: 12px 18px; border-top: var(--card-border); background: none; }

/* ── Stat cards ───────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.07); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
}

.stat-info { flex: 1; min-width: 0; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 3px; }
.stat-value { font-size: 20px; font-weight: 700; color: var(--text-main); line-height: 1.1; }
.stat-change { font-size: 12px; margin-top: 3px; display: flex; align-items: center; gap: 2px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Tables ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0; }
.table thead th {
  background: var(--body-bg);
  color: var(--text-muted);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  padding: 11px 16px;
  border-bottom: var(--card-border);
  white-space: nowrap;
}
.table tbody td {
  padding: 12px 16px;
  border-bottom: var(--card-border);
  vertical-align: middle;
  color: var(--text-main);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(255,118,45,.02); }

/* ── Badges ───────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.bg-primary   { background: var(--primary-light) !important; color: var(--primary) !important; }
.bg-success   { background: var(--success-light) !important; color: var(--success) !important; }
.bg-warning   { background: var(--warning-light) !important; color: #b38600 !important; }
.bg-danger    { background: var(--danger-light)  !important; color: var(--danger)  !important; }
.bg-info      { background: var(--info-light)    !important; color: var(--info)    !important; }
.bg-secondary { background: #f3f4f6 !important; color: #4b5563 !important; }
.bg-indigo    { background: var(--indigo-light) !important; color: var(--indigo) !important; }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13.5px; font-weight: 600;
  border: none; cursor: pointer;
  transition: all .12s;
  font-family: inherit;
  white-space: nowrap;
  line-height: 1.4;
}
.btn-sm   { padding: 5px 11px; font-size: 12px; gap: 4px; }
.btn-lg   { padding: 10px 22px; font-size: 15px; }
.btn-icon { padding: 7px; width: 34px; height: 34px; justify-content: center; }
.btn-icon.btn-sm { width: 28px; height: 28px; padding: 3px; }

.btn-primary         { background: var(--primary); color: #fff; }
.btn-primary:hover   { background: var(--primary-dark); }
.btn-success         { background: var(--success); color: #fff; }
.btn-danger          { background: var(--danger); color: #fff; }
.btn-outline-primary { background: none; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary-light); }
.btn-outline-secondary { background: none; border: var(--card-border); color: var(--text-muted); }
.btn-outline-secondary:hover { background: var(--input-bg); color: var(--text-main); }
.btn-light { background: var(--body-bg); border: var(--card-border); color: var(--text-main); }
.btn-light:hover { background: var(--input-bg); }

/* ── Forms ────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 5px; }
.form-label .req { color: var(--danger); margin-right: 2px; }

.form-control, .form-select {
  display: block; width: 100%;
  height: 40px; padding: 0 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  font-size: 13.5px; color: var(--text-main);
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
  direction: rtl;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,118,45,.1);
  background: #fff;
}
textarea.form-control { height: auto; padding: 10px 12px; resize: vertical; }
.form-control::placeholder { color: var(--text-muted); }

.input-group { display: flex; }
.input-group .form-control { border-radius: 6px 0 0 6px; }
.input-group .input-group-text {
  background: var(--input-bg); border: 1px solid var(--input-border); border-right: none;
  padding: 0 10px; font-size: 13px; color: var(--text-muted);
  border-radius: 0 6px 6px 0;
  display: flex; align-items: center;
}

/* ── Alerts ───────────────────────────────────────── */
.alert {
  padding: 11px 14px; border-radius: 6px; font-size: 13px;
  display: flex; align-items: flex-start; gap: 9px; margin-bottom: 14px;
}
.alert i { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-light); color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: var(--danger-light);  color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: #854d0e; border: 1px solid #fde68a; }
.alert-info    { background: var(--info-light);    color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Pagination ───────────────────────────────────── */
.pagination { display: flex; gap: 3px; align-items: center; }
.page-item .page-link {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 13px; font-weight: 500;
  color: var(--text-main); border: var(--card-border);
  transition: all .12s; cursor: pointer; text-decoration: none;
}
.page-item .page-link:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.page-item.active .page-link { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-item.disabled .page-link { opacity: .4; cursor: not-allowed; }

/* ── Product image ────────────────────────────────── */
.product-thumb {
  width: 38px; height: 38px;
  border-radius: 6px; object-fit: cover;
  background: var(--body-bg); border: var(--card-border);
}

/* ── Login page ───────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: #18181a;
  padding: 20px;
}
.login-card {
  background: #fff; border-radius: 10px;
  padding: 36px 32px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo .logo-box {
  width: 56px; height: 56px;
  background: var(--primary); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; font-size: 24px; color: #fff;
}
.login-logo h4 { font-size: 20px; font-weight: 700; margin: 0; }
.login-logo p { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }

/* ── POS ─────────────────────────────────────────── */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  height: calc(100vh - var(--topbar-h) - 44px);
}
.pos-products { overflow-y: auto; padding-left: 4px; }

.pos-cat-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 14px; }
.pos-cat-bar::-webkit-scrollbar { height: 3px; }

.pos-cat-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 14px; min-width: 76px;
  background: var(--card-bg); border: var(--card-border); border-radius: 6px;
  cursor: pointer; white-space: nowrap; font-size: 12px; font-weight: 500;
  color: var(--text-muted); transition: all .12s; font-family: inherit;
}
.pos-cat-btn:hover { border-color: var(--primary); color: var(--primary); }
.pos-cat-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pos-cat-btn i { font-size: 18px; }
.pos-cat-btn img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 10px; }

.pos-product-card {
  background: var(--card-bg); border: var(--card-border); border-radius: 6px;
  padding: 12px 10px; cursor: pointer; text-align: center;
  transition: border-color .12s, transform .12s;
}
.pos-product-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.pos-product-card img {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  margin-bottom: 7px;
  flex-shrink: 0;
  display: block;
  max-width: 60px;
  max-height: 60px;
}
.pos-product-card .p-name  { font-size: 12.5px; font-weight: 500; margin-bottom: 3px; }
.pos-product-card .p-price { font-size: 13px; font-weight: 700; color: var(--primary); }
.pos-product-card .p-stock { font-size: 11px; color: var(--text-muted); }

.pos-cart {
  background: var(--card-bg); border: var(--card-border); border-radius: var(--card-radius);
  display: flex; flex-direction: column; overflow: hidden;
}
.cart-header { padding: 12px 14px; border-bottom: var(--card-border); display: flex; align-items: center; justify-content: space-between; }
.cart-header h6 { font-size: 13.5px; font-weight: 600; margin: 0; }
.cart-items { flex: 1; overflow-y: auto; }
.cart-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: var(--card-border); }
.cart-item:last-child { border-bottom: none; }
.cart-item img { width: 36px; height: 36px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name  { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 11.5px; color: var(--text-muted); }
.cart-qty { display: flex; align-items: center; gap: 4px; }
.qty-btn {
  width: 22px; height: 22px; border-radius: 5px;
  background: var(--body-bg); border: var(--card-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; font-weight: 700; color: var(--text-muted); padding: 0; line-height: 1;
  transition: all .1s;
}
.qty-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.qty-num { font-size: 12.5px; font-weight: 600; min-width: 18px; text-align: center; }
.cart-item-total { font-size: 12.5px; font-weight: 700; min-width: 52px; text-align: left; }
.cart-item-del { background: none; border: none; padding: 3px; color: var(--text-muted); cursor: pointer; border-radius: 4px; }
.cart-item-del:hover { color: var(--danger); }

.cart-footer { padding: 12px 14px; border-top: var(--card-border); }
.cart-total-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 2px 0; }
.cart-total-row.grand { font-size: 15px; font-weight: 700; color: var(--primary); border-top: var(--card-border); margin-top: 6px; padding-top: 7px; }
.btn-checkout {
  display: block; width: 100%; padding: 11px;
  background: var(--primary); color: #fff; border: none; border-radius: 6px;
  font-size: 14px; font-weight: 700; margin-top: 12px; cursor: pointer;
  font-family: inherit; transition: background .12s;
}
.btn-checkout:hover { background: var(--primary-dark); }

/* ── Utils ────────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--text-muted) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state i { font-size: 44px; display: block; margin-bottom: 10px; opacity: .25; }
.empty-state p { font-size: 13.5px; margin: 0; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 1024px) {
  #sidebar { transform: translateX(100%); width: var(--sidebar-width) !important; }
  #sidebar.mobile-open { transform: translateX(0); }
  #topbar { right: 0 !important; }
  #main-content { margin-right: 0 !important; }
}

@media (max-width: 768px) {
  #main-content { padding: 14px; }
  .pos-layout { grid-template-columns: 1fr; }
  .topbar-search { display: none !important; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

.fade-in { animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(-3px); } to { opacity:1; transform:none; } }

/* Extra color fills for stat cards */
.stat-icon { background: var(--primary-light); color: var(--primary); }
:root {
  --secondary-light: #f3f4f6;
  --secondary: #6b7280;
}
.bg-secondary-soft { background: #f3f4f6 !important; color: #4b5563 !important; }
