/* ============================================================
   CHAMAA CELL POS — v4.1 Styles
   Primary green: #3a9142 (bright like reference image)
   Font: Inter | Numbers: IBM Plex Sans | Mono: IBM Plex Mono
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  height: 100%; overflow: hidden;
  transition: background .3s, color .3s;
  -webkit-font-smoothing: antialiased;
}
body.rtl { direction: rtl; }
input, select, textarea, button { font-family: inherit; }
.num, .product-price, .stat-card-value, .profile-hero-stat-val,
.summary-row.total span, #subtotal, #tax-val, #total-val,
#lbp-subtotal, #lbp-total, #ps-today, #ps-rev,
#today-badge, td strong { font-family: 'IBM Plex Sans', sans-serif; }
#barcode-scan-input, #inv-barcode-input,
.barcode-field input, .barcode-input-wrap input {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
}

/* ── CSS VARIABLES ── */
:root {
  --sidebar-w:   192px;
  /* BRIGHT GREEN — matching reference image */
  --green-main:  #3a9142;
  --green-dark:  #2a6b30;
  --green-mid:   #4db857;
  --green-light: #5cc966;
  --green-pale:  #eef8ef;
  --green-soft:  rgba(58,145,66,.13);
  --green-mist:  rgba(58,145,66,.05);
  /* BG / Surface */
  --bg:          #f3f5f7;
  --surface:     #ffffff;
  --surface2:    #f0f2f4;
  --border:      #dde2e8;
  --border2:     #eaecf0;
  /* Text */
  --text:        #1a2433;
  --text2:       #4a5568;
  --text3:       #8c9baa;
  /* Alert */
  --danger:      #e53e3e;
  --warn:        #d97706;
  /* Misc */
  --radius:      14px;
  --radius-sm:   8px;
  --shadow-sm:   0 1px 4px rgba(0,0,0,.06);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 10px 36px rgba(0,0,0,.16);
}
body.dark {
  --bg:          #10141a;
  --surface:     #1b2130;
  --surface2:    #222b3a;
  --border:      #2d3a4e;
  --border2:     #232e3f;
  --text:        #e4eaf2;
  --text2:       #8fa5bd;
  --text3:       #526070;
  --green-pale:  rgba(58,145,66,.12);
  --green-mist:  rgba(58,145,66,.05);
  --green-soft:  rgba(58,145,66,.18);
}

/* ── APP SHELL ── */
#login-screen { display:flex; width:100%; height:100vh; overflow:hidden; }
#pos-app      { display:none; width:100%; height:100vh; overflow:hidden; }

/* ============================================================
   LOGIN — large green left (~76%), narrow white right (~24%)
   Like the reference screenshot
   ============================================================ */
.login-left {
  flex: 1;  /* takes most space */
  background: linear-gradient(145deg, #1f6127 0%, #2e7d35 30%, #3a9142 70%, #42a34b 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  padding: 40px;
}
/* big translucent circles like in the reference */
.login-decor-circle {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
}
.login-circle-tl { width: 400px; height: 400px; top: -130px; left: -130px; }
.login-circle-br { width: 500px; height: 500px; bottom: -160px; right: -160px; }

.login-center-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 0;
}
.login-logo-wrap {
  width: 90px; height: 90px; border-radius: 22px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
  border: 2px solid rgba(255,255,255,.22);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  overflow: hidden;
}
.login-logo-wrap img { width:100%; height:100%; object-fit:cover; border-radius:20px; }
.login-left h1 {
  font-size: 52px; font-weight: 900; color: #fff;
  letter-spacing: -2px; line-height: 1;
  margin-bottom: 10px;
  text-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.login-tagline {
  font-size: 13px; font-weight: 700; color: rgba(255,255,255,.6);
  letter-spacing: 3px; text-transform: uppercase;
  margin-bottom: 44px;
}
.login-stats-row {
  display: flex; gap: 16px;
}
.login-stat-box {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px; padding: 18px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  backdrop-filter: blur(8px);
}
.login-stat-num {
  font-size: 26px; font-weight: 800; color: #fff;
  letter-spacing: -0.5px; line-height: 1;
}
.login-stat-lbl {
  font-size: 9px; font-weight: 700; color: rgba(255,255,255,.55);
  letter-spacing: 1.5px; text-transform: uppercase;
}

.login-right {
  width: 320px; flex-shrink: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 50px 40px; background: var(--surface); overflow-y: auto;
}
.login-right h2 {
  font-size: 24px; font-weight: 800; color: var(--text);
  letter-spacing: -.6px; margin-bottom: 4px;
}
.login-right > p { font-size: 13px; color: var(--text3); margin-bottom: 28px; line-height: 1.5; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 10.5px; font-weight: 700; color: var(--text2);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: .6px;
}
.form-group input {
  width: 100%; padding: 12px 13px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); background: var(--surface); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus {
  border-color: var(--green-main);
  box-shadow: 0 0 0 3px rgba(58,145,66,.1);
}
.btn-login {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, #3a9142, #2a6b30);
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: all .25s; letter-spacing: -.2px; margin-top: 4px;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(42,107,48,.4); }
.btn-login:active { transform: translateY(0); }

/* ============================================================
   SIDEBAR — deep forest green matching bg
   ============================================================ */
.sidebar {
  position: fixed; top:0; left:0; bottom:0; width: var(--sidebar-w);
  background: linear-gradient(175deg, #0e2516 0%, #153d20 35%, #1c5530 65%, #246838 100%);
  display: flex; flex-direction: column; z-index: 300;
  box-shadow: 3px 0 24px rgba(0,0,0,.28);
}
body.rtl .sidebar { left: auto; right: 0; }
.sidebar-brand {
  display:flex; align-items:center; gap:10px;
  padding:18px 14px 16px; border-bottom:1px solid rgba(255,255,255,.09); flex-shrink:0;
}
.sidebar-logo {
  width:36px; height:36px; flex-shrink:0; border-radius:9px;
  background:rgba(255,255,255,.13);
  display:flex; align-items:center; justify-content:center;
  font-size:18px; overflow:hidden; border:1px solid rgba(255,255,255,.1);
}
.sidebar-brand-text h2 { font-size:14px; font-weight:800; color:#fff; letter-spacing:-.3px; line-height:1.2; }
.sidebar-brand-text span { font-size:9.5px; color:rgba(255,255,255,.33); text-transform:uppercase; letter-spacing:1px; }
.sidebar-nav { flex:1; padding:12px 8px; overflow-y:auto; }
.sb-section { font-size:9.5px; font-weight:700; color:rgba(255,255,255,.25); text-transform:uppercase; letter-spacing:1.3px; padding:10px 8px 4px; }
.sb-divider { height:1px; background:rgba(255,255,255,.07); margin:8px 0; }
.nav-item {
  display:flex; align-items:center; gap:9px; padding:10px 11px; border-radius:9px;
  color:rgba(255,255,255,.48); font-size:13px; font-weight:500;
  cursor:pointer; transition:all .18s; margin-bottom:2px;
  border:none; background:transparent; width:100%; text-align:left; letter-spacing:-.1px;
}
body.rtl .nav-item { text-align: right; }
.nav-item:hover { color:rgba(255,255,255,.88); background:rgba(255,255,255,.09); }
.nav-item.active { color:#fff; background:rgba(255,255,255,.17); font-weight:600; box-shadow:inset 0 0 0 1px rgba(255,255,255,.09); }
.nav-icon { font-size:15px; width:18px; text-align:center; flex-shrink:0; }
.nav-badge { margin-left:auto; background:var(--green-mid); color:#fff; font-size:10px; font-weight:700; padding:2px 6px; border-radius:10px; min-width:18px; text-align:center; }
body.rtl .nav-badge { margin-left:0; margin-right:auto; }
.sidebar-footer { padding:10px 8px 13px; border-top:1px solid rgba(255,255,255,.08); flex-shrink:0; }
.sidebar-user { display:flex; align-items:center; gap:9px; padding:9px 10px; border-radius:9px; background:rgba(255,255,255,.07); margin-bottom:7px; cursor:pointer; transition:background .18s; }
.sidebar-user:hover { background:rgba(255,255,255,.13); }
.user-avatar { width:32px; height:32px; border-radius:50%; background:linear-gradient(135deg,var(--green-mid),var(--green-dark)); display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; color:#fff; flex-shrink:0; overflow:hidden; }
.user-info strong { display:block; font-size:12px; font-weight:700; color:#fff; line-height:1.3; }
.user-info span { font-size:10px; color:rgba(255,255,255,.36); }
.btn-logout { width:100%; padding:8px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1); border-radius:8px; color:rgba(255,255,255,.46); font-size:12px; font-weight:500; cursor:pointer; transition:all .18s; }
.btn-logout:hover { background:rgba(229,62,62,.18); color:#ff8080; border-color:rgba(229,62,62,.28); }

/* ── MAIN CONTENT ── */
.main-content { margin-left:var(--sidebar-w); width:calc(100vw - var(--sidebar-w)); height:100vh; display:flex; flex-direction:column; overflow:hidden; }
body.rtl .main-content { margin-left:0; margin-right:var(--sidebar-w); }
.top-bar { height:52px; flex-shrink:0; background:var(--surface); border-bottom:1px solid var(--border2); display:flex; align-items:center; padding:0 20px; justify-content:space-between; box-shadow:var(--shadow-sm); z-index:100; }
.top-bar-title { font-size:15px; font-weight:700; color:var(--text); letter-spacing:-.3px; }
.today-pill { background:var(--green-pale); color:var(--green-dark); font-family:'IBM Plex Sans',sans-serif; font-size:12px; font-weight:700; padding:4px 13px; border-radius:20px; border:1px solid rgba(58,145,66,.2); }
body.dark .today-pill { color:var(--green-mid); }

/* ── VIEWS ── */
.view { display:none; flex:1; overflow:hidden; min-height:0; }
.view.active { display:flex; }
#view-inventory, #view-sales, #view-suppliers, #view-settings, #view-profile, #view-dashboard { flex-direction:column; padding:20px 22px; overflow-y:auto; }

/* ── POS VIEW ── */
#view-pos { flex-direction:column; }
#view-pos > div { display:flex; flex-direction:column; flex:1; overflow:hidden; min-height:0; }
.barcode-bar { display:flex; align-items:center; gap:10px; padding:9px 16px; flex-shrink:0; background:linear-gradient(90deg,#163f22,var(--green-main)); border-bottom:2px solid var(--green-mid); }
.barcode-bar label { color:rgba(255,255,255,.78); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:1px; white-space:nowrap; }
.barcode-input-wrap { flex:1; position:relative; }
.barcode-input-wrap input { width:100%; padding:8px 14px 8px 34px; border:2px solid rgba(255,255,255,.3); border-radius:var(--radius-sm); letter-spacing:1px; color:#1a2433; background:#fff; outline:none; transition:all .2s; }
.barcode-input-wrap input:focus { border-color:#00e676; box-shadow:0 0 0 3px rgba(0,230,118,.18); }
.barcode-input-wrap::before { content:'▌'; position:absolute; left:11px; top:50%; transform:translateY(-50%); font-size:14px; color:var(--green-main); pointer-events:none; }
.barcode-status { font-size:11px; color:rgba(255,255,255,.56); white-space:nowrap; min-width:180px; }
.barcode-status.ok  { color:#00e676; }
.barcode-status.err { color:#ff6b6b; }
.pos-body { display:flex; flex:1; overflow:hidden; min-height:0; }
.products-panel { flex:1; min-width:0; display:flex; flex-direction:column; padding:12px; overflow:hidden; background:var(--bg); }
.search-bar { position:relative; margin-bottom:9px; flex-shrink:0; }
.search-bar input { width:100%; padding:9px 14px 9px 38px; border:2px solid var(--border); border-radius:var(--radius-sm); font-size:13px; outline:none; background:var(--surface); color:var(--text); transition:border-color .2s; }
.search-bar input:focus { border-color:var(--green-main); }
.search-bar::before { content:'🔍'; position:absolute; left:12px; top:50%; transform:translateY(-50%); font-size:13px; pointer-events:none; }
.category-filter { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:9px; flex-shrink:0; }
.cat-btn { padding:4px 11px; border-radius:16px; border:1.5px solid var(--border); background:var(--surface); font-size:11.5px; font-weight:500; cursor:pointer; transition:all .18s; color:var(--text2); }
.cat-btn.active, .cat-btn:hover { background:var(--green-main); color:#fff; border-color:var(--green-main); }
.products-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:9px; overflow-y:auto; flex:1; padding-bottom:4px; align-content:start; }
.product-card { background:var(--surface); border-radius:11px; padding:13px 11px; cursor:pointer; border:1.5px solid var(--border2); transition:all .18s; position:relative; }
.product-card:hover { border-color:var(--green-main); transform:translateY(-1px); box-shadow:var(--shadow-md); }
.product-card.out-of-stock { opacity:.45; cursor:not-allowed; }
.product-badge { position:absolute; top:7px; right:7px; font-size:10px; font-weight:700; padding:2px 6px; border-radius:8px; }
.product-name { font-size:12px; font-weight:600; color:var(--text); margin-bottom:2px; line-height:1.3; }
.product-brand { font-size:10px; color:var(--text3); margin-bottom:6px; }
.product-price { font-size:15px; font-weight:700; color:var(--green-dark); }
.product-stock { font-size:10px; color:var(--text3); margin-top:2px; }

/* ── CART ── */
.cart-panel { width:312px; flex-shrink:0; display:flex; flex-direction:column; background:var(--surface); border-left:1px solid var(--border2); }
.cart-header { display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--border2); flex-shrink:0; }
.cart-title { font-size:14px; font-weight:700; color:var(--text); display:flex; align-items:center; gap:7px; }
.cart-count { background:var(--green-main); color:#fff; font-size:11px; font-weight:700; padding:2px 7px; border-radius:10px; }
.btn-clear-cart { font-size:12px; color:var(--danger); cursor:pointer; background:none; border:none; font-weight:600; padding:4px 8px; border-radius:5px; transition:background .18s; }
.btn-clear-cart:hover { background:rgba(229,62,62,.08); }
.cart-items { flex:1; overflow-y:auto; padding:8px; }
.cart-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; gap:10px; color:var(--text3); font-size:13px; text-align:center; }
.cart-empty span { font-size:38px; }
.cart-item { display:flex; align-items:center; justify-content:space-between; padding:9px 10px; border-radius:9px; background:var(--bg); margin-bottom:6px; border:1.5px solid var(--border2); }
.cart-item-info { flex:1; min-width:0; margin-right:8px; }
.cart-item-name { font-size:12px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cart-item-price { font-size:13px; font-weight:700; color:var(--green-dark); margin-top:2px; }
.qty-control { display:flex; align-items:center; gap:5px; }
.qty-btn { width:24px; height:24px; border-radius:6px; border:1.5px solid var(--border); background:var(--surface); cursor:pointer; font-size:15px; font-weight:600; display:flex; align-items:center; justify-content:center; color:var(--text2); transition:all .15s; }
.qty-btn:hover { background:var(--green-main); color:#fff; border-color:var(--green-main); }
.qty-btn.minus { color:var(--danger); }
.qty-value { font-size:13px; font-weight:700; color:var(--text); min-width:18px; text-align:center; }
.cart-summary { padding:12px 14px; border-top:1px solid var(--border2); flex-shrink:0; }
.summary-row { display:flex; justify-content:space-between; align-items:center; font-size:13px; color:var(--text2); margin-bottom:6px; }
.summary-row span:last-child { font-weight:600; }
.summary-row.total { font-size:18px; font-weight:800; color:var(--text); border-top:2px solid var(--border2); padding-top:8px; margin-top:4px; }
.discount-row { display:flex; gap:6px; margin-bottom:8px; }
.discount-row input { flex:1; padding:7px 9px; border:1.5px solid var(--border); border-radius:6px; font-size:13px; outline:none; background:var(--surface); color:var(--text); }
.discount-row input:focus { border-color:var(--green-main); }
.btn-apply { padding:7px 11px; background:var(--green-pale); border:1.5px solid var(--green-main); border-radius:6px; color:var(--green-dark); font-weight:700; font-size:12px; cursor:pointer; white-space:nowrap; transition:all .18s; }
.btn-apply:hover { background:var(--green-main); color:#fff; }
.payment-methods { display:flex; gap:6px; margin:8px 0; }
.pay-btn { flex:1; padding:8px; border:1.5px solid var(--border); border-radius:8px; background:var(--surface); cursor:pointer; font-size:12px; font-weight:600; transition:all .18s; color:var(--text2); text-align:center; }
.pay-btn.active { background:var(--green-pale); border-color:var(--green-main); color:var(--green-dark); }
.btn-checkout { width:100%; padding:13px; background:linear-gradient(135deg,var(--green-mid),var(--green-dark)); color:#fff; border:none; border-radius:var(--radius-sm); font-size:14px; font-weight:700; cursor:pointer; transition:all .25s; display:flex; align-items:center; justify-content:center; gap:8px; }
.btn-checkout:disabled { opacity:.45; cursor:not-allowed; }
.btn-checkout:not(:disabled):hover { transform:translateY(-1px); box-shadow:0 6px 20px rgba(42,107,48,.4); }

/* ── GENERIC PAGE ── */
.page-content { width:100%; }
.page-title { font-size:22px; font-weight:800; color:var(--text); margin-bottom:18px; letter-spacing:-.5px; }
.toolbar { display:flex; gap:10px; margin-bottom:14px; align-items:center; flex-wrap:wrap; }
.btn-primary { padding:9px 16px; background:var(--green-main); color:#fff; border:none; border-radius:var(--radius-sm); font-size:13px; font-weight:600; cursor:pointer; transition:background .2s; white-space:nowrap; }
.btn-primary:hover { background:var(--green-dark); }
.btn-secondary { padding:9px 16px; background:var(--surface2); color:var(--text2); border:1.5px solid var(--border); border-radius:var(--radius-sm); font-size:13px; font-weight:600; cursor:pointer; transition:all .18s; white-space:nowrap; }
.btn-secondary:hover { background:var(--border); }
.btn-danger { padding:9px 16px; background:#fff0f0; color:var(--danger); border:1.5px solid rgba(229,62,62,.25); border-radius:var(--radius-sm); font-size:13px; font-weight:600; cursor:pointer; transition:all .18s; }
.btn-danger:hover { background:var(--danger); color:#fff; }
body.dark .btn-danger { background:rgba(229,62,62,.1); border-color:rgba(229,62,62,.2); }
.data-table { width:100%; background:var(--surface); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-sm); margin-bottom:18px; border:1px solid var(--border2); }
.data-table table { width:100%; border-collapse:collapse; }
.data-table th { background:var(--green-dark); color:#fff; padding:12px 13px; text-align:left; font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; }
body.rtl .data-table th { text-align:right; }
.data-table td { padding:11px 13px; font-size:13px; border-bottom:1px solid var(--border2); color:var(--text); vertical-align:middle; }
.data-table tr:last-child td { border-bottom:none; }
.data-table tr:hover td { background:var(--green-mist); }
.badge { display:inline-block; padding:3px 8px; border-radius:10px; font-size:11px; font-weight:600; }
.badge-green  { background:var(--green-pale); color:var(--green-dark); }
.badge-yellow { background:#fff3cd; color:#856404; }
.badge-red    { background:#f8d7da; color:#842029; }
.badge-blue   { background:#dbeafe; color:#1d4ed8; }
.badge-gray   { background:var(--surface2); color:var(--text2); }
body.dark .badge-green  { background:rgba(77,184,87,.15); color:var(--green-mid); }
body.dark .badge-yellow { background:rgba(246,173,85,.15); color:#f6ad55; }
body.dark .badge-red    { background:rgba(245,101,101,.15); color:#f56565; }
body.dark .badge-blue   { background:rgba(96,165,250,.15); color:#60a5fa; }
.btn-icon { width:28px; height:28px; border-radius:6px; border:none; cursor:pointer; font-size:13px; transition:all .18s; display:inline-flex; align-items:center; justify-content:center; margin-right:2px; }
.btn-edit   { background:var(--green-pale); }
.btn-edit:hover   { background:var(--green-main); }
.btn-delete { background:rgba(229,62,62,.08); }
.btn-delete:hover { background:var(--danger); }

/* ── REPORTS / DASHBOARD ── */
.dashboard-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:18px; }
.stat-card { background:var(--surface); border-radius:var(--radius); padding:16px; box-shadow:var(--shadow-sm); border:1px solid var(--border2); border-left-width:4px; transition:all .18s; }
.stat-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); }
.stat-card-label { font-size:10.5px; color:var(--text3); text-transform:uppercase; letter-spacing:.6px; font-weight:700; margin-bottom:5px; }
.stat-card-value { font-size:22px; font-weight:700; color:var(--text); margin-bottom:3px; }
.stat-card-change { font-size:11.5px; color:var(--green-main); font-weight:500; }
body.dark .stat-card-change { color:var(--green-mid); }
.report-filter-btn { padding:5px 13px; border-radius:20px; border:1px solid var(--border2); background:var(--bg); color:var(--text3); font-size:12px; font-weight:600; cursor:pointer; transition:all .15s; }
.report-filter-btn:hover { border-color:var(--green-main); color:var(--green-main); }
.report-filter-btn.active { background:var(--green-main); color:#fff; border-color:var(--green-main); }

/* ── SETTINGS ── */
.settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:22px; }
.settings-card { background:var(--surface); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow-sm); border:1px solid var(--border2); }
.settings-card h3 { font-size:14px; font-weight:700; color:var(--text); margin-bottom:16px; padding-bottom:10px; border-bottom:2px solid var(--border2); display:flex; align-items:center; gap:8px; letter-spacing:-.2px; }
.setting-row { margin-bottom:13px; }
.setting-row label { display:block; font-size:11px; font-weight:700; color:var(--text2); margin-bottom:5px; text-transform:uppercase; letter-spacing:.5px; }
.setting-row input, .setting-row select, .setting-row textarea { width:100%; padding:9px 11px; border:2px solid var(--border); border-radius:var(--radius-sm); font-size:13px; color:var(--text); outline:none; transition:border-color .2s; background:var(--surface); }
.setting-row input:focus, .setting-row select:focus, .setting-row textarea:focus { border-color:var(--green-main); }
.setting-row textarea { resize:vertical; min-height:65px; }
.settings-save-bar { padding-top:12px; border-top:1px solid var(--border2); display:flex; gap:10px; margin-top:4px; }
.toggle-row { display:flex; align-items:center; justify-content:space-between; padding:9px 0; border-bottom:1px solid var(--border2); }
.toggle-row:last-child { border-bottom:none; padding-bottom:0; }
.toggle-row span { font-size:13px; color:var(--text); font-weight:500; }
.toggle { position:relative; width:42px; height:23px; flex-shrink:0; }
.toggle input { opacity:0; width:0; height:0; }
.toggle-slider { position:absolute; inset:0; background:var(--border); border-radius:24px; cursor:pointer; transition:.3s; }
.toggle-slider::before { content:''; position:absolute; height:17px; width:17px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.3s; }
.toggle input:checked + .toggle-slider { background:var(--green-main); }
.toggle input:checked + .toggle-slider::before { transform:translateX(19px); }
.currency-rate-box { display:grid; grid-template-columns:1fr auto 1fr; gap:8px; align-items:center; margin-bottom:13px; }
.currency-rate-box .arrow { font-size:18px; text-align:center; color:var(--text3); }
.currency-rate-box input { padding:9px 11px; border:2px solid var(--border); border-radius:var(--radius-sm); font-size:13px; color:var(--text); outline:none; background:var(--surface); }
.currency-rate-box input:focus { border-color:var(--green-main); }
.currency-label { font-size:10px; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:.5px; text-align:center; margin-bottom:4px; }
.printer-test { display:flex; gap:10px; align-items:center; margin-top:12px; }
.printer-status { font-size:12px; padding:5px 11px; border-radius:20px; background:var(--green-pale); color:var(--green-dark); font-weight:600; }
body.dark .printer-status { background:rgba(77,184,87,.15); color:var(--green-mid); }

/* ── LANGUAGE SWITCHER ── */
.lang-switcher { display:flex; gap:4px; background:var(--bg); border-radius:8px; padding:3px; border:1px solid var(--border); }
.lang-btn { padding:5px 10px; border-radius:5px; border:none; background:transparent; font-size:12px; font-weight:600; color:var(--text3); cursor:pointer; transition:all .18s; }
.lang-btn.active { background:var(--green-main); color:#fff; box-shadow:0 2px 8px rgba(58,145,66,.3); }
.lang-btn:hover:not(.active) { background:var(--surface2); color:var(--text); }

.admin-section-header { display:flex; align-items:center; gap:10px; font-size:16px; font-weight:700; color:var(--text); margin-bottom:14px; }
.admin-only-chip { font-size:10.5px; background:var(--green-soft); color:var(--green-dark); padding:3px 10px; border-radius:10px; font-weight:700; }
body.dark .admin-only-chip { color:var(--green-mid); }

/* ── ACTIVITY LOGS ── */
.log-row { display:flex; align-items:flex-start; gap:12px; padding:10px 0; border-bottom:1px solid var(--border2); font-size:13px; }
.log-row:last-child { border-bottom:none; }
.log-icon { width:32px; height:32px; border-radius:8px; background:var(--bg); display:flex; align-items:center; justify-content:center; font-size:15px; flex-shrink:0; }
.log-body { flex:1; min-width:0; }
.log-user { font-weight:600; color:var(--text); }
.log-detail { color:var(--text2); font-size:12px; margin-top:1px; }
.log-time { font-size:11px; color:var(--text3); white-space:nowrap; flex-shrink:0; font-family:'IBM Plex Mono',monospace; }
.log-filter-bar { display:flex; gap:6px; margin-bottom:14px; flex-wrap:wrap; }

/* ── PROFILE ── */
.profile-hero-card { background:linear-gradient(135deg,#0e2516,#1c5530); border-radius:var(--radius); padding:24px 28px; display:flex; align-items:center; gap:20px; margin-bottom:20px; flex-wrap:wrap; }
.profile-hero-avatar { width:80px; height:80px; border-radius:50%; background:rgba(255,255,255,.2); border:3px solid rgba(255,255,255,.38); color:#fff; font-size:32px; font-weight:700; display:flex; align-items:center; justify-content:center; overflow:hidden; transition:all .2s; flex-shrink:0; cursor:pointer; }
.profile-hero-avatar:hover { border-color:#fff; }
.profile-hero-name { font-size:22px; font-weight:800; color:#fff; letter-spacing:-.5px; line-height:1.2; }
.profile-hero-username { font-size:13px; color:rgba(255,255,255,.58); margin-top:3px; }
.profile-role-chip { background:rgba(255,255,255,.18); color:#fff; font-size:11px; font-weight:700; padding:3px 10px; border-radius:20px; border:1px solid rgba(255,255,255,.22); }
.profile-hero-stats { display:flex; gap:0; margin-left:auto; background:rgba(255,255,255,.1); border-radius:12px; overflow:hidden; flex-shrink:0; }
.profile-hero-stat { padding:14px 20px; text-align:center; border-right:1px solid rgba(255,255,255,.12); }
.profile-hero-stat:last-child { border-right:none; }
.profile-hero-stat-val { font-size:20px; font-weight:700; color:#fff; line-height:1; }
.profile-hero-stat-lbl { font-size:10px; color:rgba(255,255,255,.55); text-transform:uppercase; letter-spacing:.5px; margin-top:4px; }
.profile-tab-bar { display:flex; gap:2px; background:var(--surface); border-radius:12px; padding:4px; margin-bottom:16px; border:1px solid var(--border2); box-shadow:var(--shadow-sm); width:fit-content; }
.profile-tab { padding:8px 18px; border-radius:9px; border:none; background:transparent; font-size:13px; font-weight:600; color:var(--text3); cursor:pointer; transition:all .18s; }
.profile-tab.active { background:var(--green-main); color:#fff; box-shadow:0 2px 8px rgba(58,145,66,.3); }
.profile-tab:hover:not(.active) { background:var(--surface2); color:var(--text); }
.profile-tab-panel { display:none; animation:fadeUp .2s ease; }
.profile-tab-panel.active { display:block; }
.profile-stat { display:flex; justify-content:space-between; align-items:center; padding:9px 0; border-bottom:1px solid var(--border2); font-size:13px; }
.profile-stat:last-child { border-bottom:none; }
.profile-stat span:first-child { color:var(--text2); }
.profile-stat span:last-child { font-weight:600; color:var(--text); }

/* ── MODALS ── */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.52); backdrop-filter:blur(4px); z-index:1000; align-items:center; justify-content:center; }
.modal-overlay.active { display:flex; }
.modal { background:var(--surface); border-radius:var(--radius); padding:26px; width:100%; max-width:560px; max-height:92vh; overflow-y:auto; box-shadow:var(--shadow-lg); animation:fadeUp .25s ease; border:1px solid var(--border2); }
.modal h3 { font-size:18px; font-weight:700; margin-bottom:16px; color:var(--text); letter-spacing:-.3px; }
.modal-actions { display:flex; gap:10px; margin-top:18px; justify-content:flex-end; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.cat-add-row { display:flex; gap:8px; align-items:stretch; }
.cat-add-row select { flex:1; padding:9px 11px; border:2px solid var(--border); border-radius:var(--radius-sm); font-size:13px; color:var(--text); outline:none; background:var(--surface); transition:border-color .2s; }
.cat-add-row select:focus { border-color:var(--green-main); }
.btn-add-cat { padding:0 12px; background:var(--green-pale); border:2px solid var(--green-main); border-radius:var(--radius-sm); color:var(--green-dark); font-size:20px; font-weight:700; cursor:pointer; transition:all .2s; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.btn-add-cat:hover { background:var(--green-main); color:#fff; }
.new-cat-row { display:none; gap:7px; margin-top:7px; align-items:center; }
.new-cat-row.visible { display:flex; }
.new-cat-row input { flex:1; padding:8px 11px; border:2px solid var(--green-main); border-radius:var(--radius-sm); font-size:13px; outline:none; background:var(--surface); color:var(--text); }
.btn-save-cat { padding:8px 12px; background:var(--green-main); color:#fff; border:none; border-radius:var(--radius-sm); font-size:13px; font-weight:600; cursor:pointer; }
.btn-cancel-cat { padding:8px 10px; background:var(--surface2); color:var(--text2); border:none; border-radius:var(--radius-sm); font-size:13px; cursor:pointer; }
.barcode-field input { letter-spacing:1.5px; }
.supplier-quick { margin-top:6px; padding:10px 12px; background:var(--bg); border:1px solid var(--border2); border-radius:var(--radius-sm); display:none; }
.supplier-quick.visible { display:block; }
.supplier-quick-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.supplier-quick-header span { font-size:11px; font-weight:700; color:var(--text2); text-transform:uppercase; }
.supplier-list-mini { max-height:130px; overflow-y:auto; margin-bottom:8px; }
.supplier-mini-row { display:flex; align-items:center; justify-content:space-between; padding:5px 8px; border-radius:6px; font-size:12px; color:var(--text); }
.supplier-mini-row:hover { background:var(--surface2); }
.supplier-mini-row button { background:none; border:none; color:var(--danger); cursor:pointer; font-size:13px; padding:2px 5px; border-radius:4px; }
.supplier-mini-row button:hover { background:rgba(229,62,62,.1); }
.supplier-add-row { display:flex; gap:7px; }
.supplier-add-row input { flex:1; padding:7px 10px; border:2px solid var(--border); border-radius:6px; font-size:13px; outline:none; background:var(--surface); color:var(--text); }
.supplier-add-row input:focus { border-color:var(--green-main); }

/* ── TOAST ── */
.toast-container { position:fixed; bottom:22px; right:22px; z-index:2000; display:flex; flex-direction:column; gap:8px; }
body.rtl .toast-container { right:auto; left:22px; }
.toast { padding:11px 15px; border-radius:var(--radius-sm); background:var(--green-dark); color:#fff; font-size:13px; font-weight:500; box-shadow:var(--shadow-lg); display:flex; align-items:center; gap:10px; animation:slideInRight .3s ease; max-width:300px; }
.toast.error { background:var(--danger); }
.toast.warn  { background:var(--warn); }

/* ── ANIMATIONS ── */
@keyframes fadeUp       { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }
@keyframes slideIn      { from{opacity:0;transform:translateX(-10px)} to{opacity:1;transform:translateX(0)} }
@keyframes slideInRight { from{opacity:0;transform:translateX(40px)} to{opacity:1;transform:translateX(0)} }

::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-thumb { background:var(--border); border-radius:10px; }
::-webkit-scrollbar-thumb:hover { background:var(--text3); }

/* ============================================================
   IT HUB CREATOR CREDIT — login bottom
   ============================================================ */
.login-creator-credit {
  display: flex; align-items: center; gap: 8px;
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.login-creator-logo {
  height: 22px; width: auto;
  object-fit: contain; opacity: .75;
  filter: grayscale(20%);
}
.login-creator-text {
  font-size: 11px; color: var(--text3);
}
.login-creator-text strong {
  color: var(--text2); font-weight: 700;
}

/* ============================================================
   RTL SUPPORT — Arabic layout
   ============================================================ */
body.rtl .sidebar { left: auto; right: 0; box-shadow: -3px 0 24px rgba(0,0,0,.28); }
body.rtl .main-content { margin-left: 0; margin-right: var(--sidebar-w); }
body.rtl .sidebar-brand { flex-direction: row-reverse; }
body.rtl .sidebar-brand-text { text-align: right; }
body.rtl .nav-item { flex-direction: row-reverse; text-align: right; }
body.rtl .nav-badge { margin-left: 0; margin-right: auto; }
body.rtl .sidebar-user { flex-direction: row-reverse; }
body.rtl .user-info { text-align: right; }
body.rtl .data-table th,
body.rtl .data-table td { text-align: right; }
body.rtl .cart-header { flex-direction: row-reverse; }
body.rtl .cart-item { flex-direction: row-reverse; }
body.rtl .cart-item-info { margin-right: 0; margin-left: 8px; }
body.rtl .cart-summary .summary-row { flex-direction: row-reverse; }
body.rtl .barcode-bar { flex-direction: row-reverse; }
body.rtl .barcode-input-wrap::before { left: auto; right: 11px; }
body.rtl .barcode-input-wrap input { padding: 8px 34px 8px 14px; }
body.rtl .search-bar::before { left: auto; right: 12px; }
body.rtl .search-bar input { padding: 9px 38px 9px 14px; }
body.rtl .toolbar { flex-direction: row-reverse; }
body.rtl .top-bar { flex-direction: row-reverse; }
body.rtl .admin-section-header { flex-direction: row-reverse; }
body.rtl .settings-card h3 { flex-direction: row-reverse; }
body.rtl .toggle-row { flex-direction: row-reverse; }
body.rtl .toast-container { right: auto; left: 22px; }
body.rtl .profile-hero-card { flex-direction: row-reverse; }
body.rtl .profile-hero-stats { margin-left: 0; margin-right: auto; }
body.rtl .profile-tab-bar { flex-direction: row-reverse; }
body.rtl .profile-stat { flex-direction: row-reverse; }
body.rtl .modal-actions { flex-direction: row-reverse; }
body.rtl .settings-save-bar { flex-direction: row-reverse; }
body.rtl .discount-row { flex-direction: row-reverse; }
body.rtl .payment-methods { flex-direction: row-reverse; }
body.rtl .log-row { flex-direction: row-reverse; }
body.rtl .log-body { text-align: right; }
body.rtl .log-filter-bar { flex-direction: row-reverse; }
body.rtl .form-grid { direction: rtl; }
body.rtl input, body.rtl select, body.rtl textarea { text-align: right; direction: rtl; }
body.rtl .barcode-input-wrap input,
body.rtl #barcode-scan-input,
body.rtl #inv-barcode-input { text-align: left; direction: ltr; letter-spacing: 1px; }
body.rtl .btn-icon { margin-right: 0; margin-left: 2px; }
body.rtl .category-filter { flex-direction: row-reverse; }
body.rtl .qty-control { flex-direction: row-reverse; }

/* Language switcher improved */
.lang-switcher { display: flex; gap: 4px; background: var(--bg); border-radius: 8px; padding: 3px; border: 1.5px solid var(--border); }
.lang-btn { padding: 5px 12px; border-radius: 5px; border: none; background: transparent; font-size: 12px; font-weight: 600; color: var(--text3); cursor: pointer; transition: all .18s; white-space: nowrap; }
.lang-btn.active { background: var(--green-main); color: #fff; box-shadow: 0 2px 8px rgba(58,145,66,.3); }
.lang-btn:hover:not(.active) { background: var(--surface2); color: var(--text); }
