/* ============================================================
   Tasleeh Tactical — Brand Design System
   Colors: Red #EC2127 | Black #050505 | White #FFFFFF
   Fonts:  Montserrat (EN) | Janna LT (AR, licensed)
   ============================================================ */

.cur,
[dir="rtl"] .cur,
:lang(ar) .cur { font-family: 'UAEDirham' !important; font-style: normal; }

/* ── Arabic Font: Janna LT (licensed) ──────────────────────── */
/* Place JannaLT-Regular.ttf + JannaLT-Bold.ttf in assets/fonts/ */
@font-face {
  font-family: 'Janna LT';
  src: local('Janna LT'), local('Janna LT Regular'), local('JannaLT'),
       url('../fonts/JannaLT-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Janna LT';
  src: local('Janna LT Bold'), local('JannaLT-Bold'),
       url('../fonts/JannaLT-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --red:        #EC2127;
  --red-dark:   #C41920;
  --red-light:  #FF3A40;
  --black:      #050505;
  --gray-900:   #0f0f0f;
  --gray-800:   #141414;
  --gray-700:   #1a1a1a;
  --gray-600:   #222222;
  --gray-500:   #333333;
  --gray-400:   #555555;
  --gray-300:   #888888;
  --gray-200:   #aaaaaa;
  --gray-100:   #cccccc;
  --white:      #FFFFFF;
  --on-accent:  #FFFFFF; /* text on solid red/green buttons & badges — never flips */

  --success:    #22c55e;
  --warning:    #f59e0b;
  --danger:     #EC2127;
  --info:       #3b82f6;

  --font-en:    'Montserrat', sans-serif;
  --font-ar:    'Janna LT', 'Noto Kufi Arabic', sans-serif;

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
  --shadow:     0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 48px rgba(0,0,0,0.7);
  --shadow-red: 0 4px 24px rgba(236,33,39,0.3);

  --transition: 0.22s ease;
  --navbar-h:   70px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-en);
  background-color: var(--black);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Arabic / RTL ────────────────────────────────────────────── */
:lang(ar),
[dir="rtl"] {
  font-family: var(--font-ar);
  letter-spacing: 0;
}
[dir="rtl"] .navbar-inner   { flex-direction: row-reverse; }
[dir="rtl"] .nav-links      { flex-direction: row-reverse; }
[dir="rtl"] .nav-links a    { flex-direction: row-reverse; gap: 6px; }
[dir="rtl"] .nav-user       { flex-direction: row-reverse; }
[dir="rtl"] .user-btn       { flex-direction: row-reverse; }
[dir="rtl"] .dropdown-menu  { left: 0; right: auto; }
[dir="rtl"] .page-header    { flex-direction: row-reverse; }
[dir="rtl"] .form-group label { text-align: right; }
[dir="rtl"] .alert          { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .alert-close    { margin-left: 0; margin-right: auto; }
[dir="rtl"] .card-header    { flex-direction: row-reverse; }
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }
[dir="rtl"] .stat-card      { text-align: right; }
[dir="rtl"] .stat-card .stat-icon { right: auto; left: 20px; }
[dir="rtl"] .invoice-header { flex-direction: row-reverse; }
[dir="rtl"] .invoice-meta   { text-align: left; }
[dir="rtl"] .invoice-totals-row { flex-direction: row-reverse; }
[dir="rtl"] .btn i[data-feather] { margin-right: 0; margin-left: 6px; }
[dir="rtl"] .site-footer .footer-inner { flex-direction: row-reverse; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--white);
}
h1 { font-size: clamp(24px, 4vw, 40px); }
h2 { font-size: clamp(20px, 3vw, 32px); }
h3 { font-size: clamp(18px, 2.5vw, 24px); }
h4 { font-size: 18px; }

p { color: var(--gray-200); }

a { color: var(--red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red-light); }

strong { color: var(--white); font-weight: 700; }

/* ── Layout ──────────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.main-content {
  padding: 32px 24px 80px;
  max-width: 1280px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-600);
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 26px;
  font-weight: 800;
}

.page-header h1::before {
  content: '';
  display: block;
  width: 4px;
  height: 32px;
  background: var(--red);
  border-radius: 2px;
}

/* ── Navbar ──────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--navbar-h);
  background: var(--gray-900);
  border-bottom: 1px solid var(--gray-700);
  backdrop-filter: blur(10px);
  overflow: visible;
}
.navbar::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px; height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--red) 0%, rgba(236,33,39,0.35) 35%, transparent 70%);
}

.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  align-self: flex-start;
}
.navbar-brand img {
  height: 80px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex: 1;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--gray-200);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
}
.nav-links a svg { width: 15px; height: 15px; }
.nav-links a:hover, .nav-links a.active {
  color: var(--white);
  background: rgba(236,33,39,0.12);
}
.nav-links a.active { color: var(--red); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -1px;
  width: 5px; height: 5px;
  background: var(--red);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(236,33,39,0.8);
}

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--red);
  color: var(--on-accent);
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  margin-left: 2px;
}

.nav-user { margin-left: auto; display: flex; align-items: center; gap: 16px; }

.user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-700);
  border: 1px solid var(--gray-600);
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--white);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
}
.user-btn:hover {
  background: var(--gray-600);
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(236,33,39,0.25);
}
.user-avatar {
  width: 30px; height: 30px;
  background: var(--red);
  color: var(--on-accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color var(--transition);
}
.user-btn:hover .user-avatar { outline-color: rgba(236,33,39,0.5); }
.user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron   { width: 14px; height: 14px; opacity: 0.6; transition: transform var(--transition); }
.chevron.open { transform: rotate(180deg); }

/* Dropdown */
.user-dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
  z-index: 200;
}
.dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-header { padding: 16px 18px; }
.dh-name { font-weight: 700; font-size: 14px; color: var(--white); }
.dh-role { font-size: 11px; color: var(--red); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.dropdown-divider { height: 1px; background: var(--gray-600); }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  color: var(--gray-200);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}
.dropdown-item svg { width: 15px; height: 15px; }
.dropdown-item:hover { background: var(--gray-700); color: var(--white); }
.dropdown-item.danger:hover { background: rgba(236,33,39,0.12); color: var(--red); }

/* ── Light Theme — app-wide, toggled via the navbar sun/moon button ──
   Brand guidelines explicitly allow a white background (#FFFFFF) with
   the same red/black logo, so this keeps --red untouched and only
   flips surface/text colors. */
body.theme-light {
  /* Flip the surface/text tokens; --red/--success/--warning/--info and
     --on-accent are intentionally untouched so colored buttons/badges
     keep white text on both themes. */
  --black:      #FFFFFF;
  --gray-900:   #FFFFFF;
  --gray-800:   #FFFFFF;
  --gray-700:   #F0F0F0;
  --gray-600:   #E5E5E5;
  --gray-500:   #CCCCCC;
  --gray-400:   #999999;
  --gray-300:   #666666;
  --gray-200:   #333333;
  --gray-100:   #1A1A1A;
  --white:      #050505;
  background-color: #F7F7F7;
}
body.theme-light a:not(.btn) { color: var(--red); }

/* Logo theme swap — !important beats .navbar-brand img { display:block } */
.site-logo--light                  { display: none   !important; }
.site-logo--dark                   { display: block  !important; }
body.theme-light .site-logo--dark  { display: none   !important; }
body.theme-light .site-logo--light { display: block  !important; }

/* Shadows tuned for dark drop-shadows on a light surface — the dark-mode
   --shadow-lg/--shadow-red values are too heavy once the background is white. */
body.theme-light .dropdown-menu { box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
body.theme-light .product-card:hover { box-shadow: 0 8px 28px rgba(236,33,39,0.15); }
body.theme-light .chevron { opacity: 0.5; }

/* .qty-btn only changes background/border on hover in the base rule, so its
   text color is inherited from --white — without this it'd go dark-on-red. */
body.theme-light .qty-btn:hover { color: var(--on-accent); }

/* Navbar theme toggle (sun/moon) — same shape as .lang-toggle */
.theme-toggle-btn-nav {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--gray-700); border: 1px solid var(--gray-500);
  border-radius: 8px; color: var(--white);
  transition: all var(--transition); flex-shrink: 0;
}
.theme-toggle-btn-nav svg { width: 16px; height: 16px; }
.theme-toggle-btn-nav:hover { background: var(--red); border-color: var(--red); color: var(--on-accent); }

/* Language toggle */
.lang-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--gray-700); border: 1px solid var(--gray-500);
  border-radius: 8px; color: var(--white);
  font-size: 13px; font-weight: 700; text-decoration: none;
  transition: all var(--transition); flex-shrink: 0;
  font-family: var(--font-en);
}
.lang-toggle:hover { background: var(--red); border-color: var(--red); color: var(--on-accent); }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; justify-content: space-between;
  width: 28px; height: 20px;
  background: none; border: none; cursor: pointer; padding: 0;
}
.hamburger span {
  display: block; height: 2px; background: var(--white);
  border-radius: 2px; transition: all var(--transition);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--red);
  color: var(--on-accent);
}
.btn-primary:hover {
  background: var(--red-light);
  color: var(--on-accent);
  box-shadow: var(--shadow-red);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--gray-600);
  color: var(--white);
  border: 1px solid var(--gray-500);
}
.btn-secondary:hover {
  background: var(--gray-500);
  color: var(--white);
  border-color: var(--gray-400);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--gray-500);
}
.btn-outline:hover {
  background: var(--gray-700);
  border-color: var(--white);
  color: var(--white);
}

.btn-outline-red {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}
.btn-outline-red:hover {
  background: var(--red);
  color: var(--on-accent);
  box-shadow: var(--shadow-red);
}

.btn-success {
  background: var(--success);
  color: var(--on-accent);
}
.btn-success:hover { background: #16a34a; color: var(--on-accent); }

.btn-danger {
  background: var(--red);
  color: var(--on-accent);
}
.btn-danger:hover { background: var(--red-dark); color: var(--on-accent); }

.btn-sm   { padding: 7px 14px; font-size: 12px; }
.btn-lg   { padding: 14px 32px; font-size: 15px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--gray-500); }
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}
.card-header::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 18px;
  background: var(--red);
  transform: translateY(-50%);
}
.card-header h3 {
  font-size: 16px;
  font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  padding-left: 12px;
}
[dir="rtl"] .card-header::before { left: auto; right: 0; }
[dir="rtl"] .card-header h3 { padding-left: 0; padding-right: 12px; }
.card-body    { padding: 24px; }
.card-footer  { padding: 16px 24px; border-top: 1px solid var(--gray-600); background: var(--gray-900); }

/* Stat Cards */
.stat-card {
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(236,33,39,0.4);
  box-shadow: var(--shadow-red);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 0 100%);
}
.stat-card .stat-label  { font-size: 11px; font-weight: 700; color: var(--gray-300); text-transform: uppercase; letter-spacing: 1px; }
.stat-card .stat-value  { font-size: 36px; font-weight: 900; color: var(--white); margin: 8px 0 4px; line-height: 1; }
.stat-card .stat-change { font-size: 12px; color: var(--gray-300); }
.stat-card .stat-icon   { position: absolute; top: 20px; right: 20px; opacity: 0.5; color: var(--red); transition: opacity var(--transition); }
.stat-card .stat-icon svg { width: 48px; height: 48px; }
.stat-card:hover .stat-icon { opacity: 0.85; }

/* ── Product Grid ────────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  border-color: var(--red);
  transform: translateY(-4px);
  box-shadow: var(--shadow-red);
}
.product-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--gray-700);
}
.product-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-img-placeholder svg { width: 48px; height: 48px; opacity: 0.2; }
.product-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-category {
  font-size: 10px; font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}
.product-name {
  font-size: 15px; font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
  line-height: 1.3;
}
.product-desc {
  font-size: 12px; color: var(--gray-300);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
}
.product-price { font-size: 20px; font-weight: 900; color: var(--red); }
.product-stock { font-size: 11px; color: var(--gray-300); }
.product-stock.low { color: var(--warning); }
.product-stock.out { color: var(--danger); }

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-btn {
  width: 28px; height: 28px;
  background: var(--gray-600);
  border: 1px solid var(--gray-500);
  border-radius: 6px;
  color: var(--white);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.qty-btn:hover { background: var(--red); border-color: var(--red); }
.qty-input {
  width: 40px; text-align: center;
  background: var(--gray-700);
  border: 1px solid var(--gray-500);
  border-radius: 6px;
  color: var(--white);
  font-size: 13px; font-weight: 700;
  padding: 4px;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 12px; font-weight: 700;
  color: var(--gray-200);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.form-control {
  display: block; width: 100%;
  padding: 12px 16px;
  background: var(--gray-700);
  border: 1px solid var(--gray-500);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-en); font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control::placeholder { color: var(--gray-400); }
.form-control:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(236,33,39,0.15);
  background: var(--gray-600);
}
.form-control.error { border-color: var(--danger); }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }

select.form-control {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.form-hint { font-size: 12px; color: var(--gray-300); margin-top: 5px; }

/* File Upload */
.file-upload {
  position: relative;
  border: 2px dashed var(--gray-500);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--gray-700);
}
.file-upload:hover, .file-upload.dragover {
  border-color: var(--red);
  background: rgba(236,33,39,0.05);
}
.file-upload input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.file-upload-icon { margin: 0 auto 12px; opacity: 0.4; }
.file-upload-icon svg { width: 36px; height: 36px; }
.file-upload-text { font-size: 13px; color: var(--gray-300); }
.file-upload-text strong { color: var(--red); }
.file-upload-hint { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
.file-preview { margin-top: 12px; font-size: 13px; color: var(--success); }

/* OTP Input */
.otp-input-group {
  display: flex; gap: 10px; justify-content: center;
}
.otp-digit {
  width: 52px; height: 62px;
  text-align: center;
  font-size: 26px; font-weight: 800;
  background: var(--gray-700);
  border: 2px solid var(--gray-500);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-en);
  outline: none;
  transition: all var(--transition);
}
.otp-digit:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(236,33,39,0.15);
}

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--gray-600); }
table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
thead th {
  padding: 14px 18px;
  background: var(--gray-700);
  color: var(--gray-200);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  text-align: left;
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--gray-700);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-700); }
tbody td {
  padding: 14px 18px;
  color: var(--gray-100);
  vertical-align: middle;
}
.td-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  border-radius: 100px;
  text-transform: uppercase; white-space: nowrap;
}
.badge-warning   { background: rgba(245,158,11,0.15);  color: var(--warning); }
.badge-info      { background: rgba(59,130,246,0.15);  color: var(--info);    }
.badge-danger    { background: rgba(236,33,39,0.15);   color: var(--red);     }
.badge-success   { background: rgba(34,197,94,0.15);   color: var(--success); }
.badge-secondary { background: rgba(136,136,136,0.15); color: var(--gray-300);}
.badge-primary   { background: rgba(59,130,246,0.15);  color: var(--info);    }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  position: relative;
  max-width: 1280px; margin: 12px auto;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert-close {
  margin-left: auto; background: none; border: none;
  color: inherit; font-size: 18px; cursor: pointer; opacity: 0.7; padding: 0 4px;
}
.alert-close:hover { opacity: 1; }
.alert-success {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--success);
}
.alert-danger {
  background: rgba(236,33,39,0.12);
  border: 1px solid rgba(236,33,39,0.3);
  color: var(--red);
}
.alert-info {
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.3);
  color: var(--info);
}
.alert-warning {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  color: var(--warning);
}
.alert-dismissible { padding-right: 40px; }

/* ── Modals ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
  overflow: hidden;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--gray-600);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 18px; font-weight: 800; }
.modal-close {
  width: 32px; height: 32px;
  background: var(--gray-700);
  border: 1px solid var(--gray-600);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--gray-300);
  font-size: 18px; line-height: 1;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--red); border-color: var(--red); color: var(--on-accent); }
.modal-body    { padding: 28px; }
.modal-footer  { padding: 16px 28px; border-top: 1px solid var(--gray-600); display: flex; gap: 12px; justify-content: flex-end; }

/* OTP Modal specific */
.otp-modal-icon {
  width: 64px; height: 64px;
  background: rgba(236,33,39,0.1);
  border: 2px solid var(--red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.otp-modal-icon svg { width: 28px; height: 28px; color: var(--red); }
.otp-modal-title { text-align: center; font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.otp-modal-desc  { text-align: center; font-size: 13px; color: var(--gray-300); margin-bottom: 24px; }
.otp-countdown {
  text-align: center; font-size: 12px; color: var(--gray-300);
  margin-top: 12px;
}
.otp-countdown #otp-timer { color: var(--red); font-weight: 700; font-size: 14px; }

/* ── Cart ────────────────────────────────────────────────────── */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-item {
  display: flex; gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--gray-700);
  align-items: flex-start;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
  width: 72px; height: 72px;
  object-fit: cover; border-radius: var(--radius-sm);
  background: var(--gray-700);
  flex-shrink: 0;
}
.cart-item-info { flex: 1; }
.cart-item-name  { font-weight: 700; font-size: 14px; color: var(--white); margin-bottom: 4px; }
.cart-item-price { font-size: 13px; color: var(--gray-300); }
.cart-item-total { font-size: 16px; font-weight: 700; color: var(--red); }
.cart-item-controls { display: flex; align-items: center; gap: 10px; margin-top: 10px; }

.cart-summary {
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: calc(var(--navbar-h) + 20px);
}
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-700);
  font-size: 14px;
}
.summary-row:last-child { border-bottom: none; }
.summary-row.total {
  font-size: 18px; font-weight: 800;
  padding-top: 16px;
}
.summary-row .label { color: var(--gray-300); }
.summary-row .value { color: var(--white); font-weight: 600; }
.summary-row.total .value { color: var(--red); font-size: 22px; }

/* ── Order Detail ────────────────────────────────────────────── */
.order-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
@media (max-width: 640px) { .order-info-grid { grid-template-columns: 1fr; } }

.info-item .info-label { font-size: 11px; color: var(--gray-300); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
.info-item .info-value { font-size: 15px; font-weight: 600; color: var(--white); }

.emirates-id-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 16px;
}
.emirates-id-img {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--gray-600);
  background: var(--gray-700);
  aspect-ratio: 16/9; object-fit: cover;
}
.emirates-id-label { font-size: 11px; color: var(--gray-300); margin-bottom: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; }

/* ── Discount Calculator ─────────────────────────────────────── */
.discount-layout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
@media (max-width: 1000px) { .discount-layout { grid-template-columns: 1fr; } }

.discount-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--gray-700);
}
.discount-row:last-child { border-bottom: none; }
.discount-item-name { flex: 1; font-weight: 600; font-size: 14px; }
.discount-item-price { min-width: 90px; text-align: right; font-size: 14px; color: var(--gray-200); }
.discount-input {
  width: 90px; padding: 8px 10px;
  background: var(--gray-700); border: 1px solid var(--gray-500);
  border-radius: var(--radius-sm); color: var(--white);
  font-size: 13px; font-weight: 700; text-align: center;
  outline: none; transition: border-color var(--transition);
}
.discount-input:focus { border-color: var(--red); }
.discount-input-addon {
  font-size: 12px; color: var(--gray-300); font-weight: 600;
}
.otp-required-tag {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  background: rgba(236,33,39,0.15); color: var(--red);
  border-radius: 100px; text-transform: uppercase; letter-spacing: 0.5px;
}
.mode-select {
  flex-shrink: 0; width: 58px; padding: 8px 6px;
  background: var(--gray-700); border: 1px solid var(--gray-500);
  border-radius: var(--radius-sm); color: var(--white);
  font-size: 12px; font-weight: 700; text-align: center;
  outline: none; cursor: pointer; transition: border-color var(--transition);
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.mode-select:focus { border-color: var(--red); }

/* Totals panel in discount page */
.totals-panel {
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: calc(var(--navbar-h) + 20px);
}
.totals-panel h4 { margin-bottom: 18px; font-size: 16px; }
.totals-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--gray-700);
}
.totals-row:last-child { border-bottom: none; padding-top: 14px; font-size: 18px; font-weight: 800; }
.totals-row .t-label { color: var(--gray-300); }
.totals-row .t-value { color: var(--white); font-weight: 600; }
.totals-row.final .t-value { color: var(--red); }
.totals-row.discount .t-value { color: var(--success); }

/* ── Invoice / POS Document ─────────────────────────────────────
   Dark-themed for screen. Print-safe overrides at the bottom.   */
.invoice-page { background: #111; color: #e0e0e0; }
.invoice-container {
  max-width: 860px; margin: 0 auto; padding: 28px;
  font-family: var(--font-en);
}

/* header — black card */
.invoice-header {
  background: #0d0d0d;
  border-radius: 14px;
  border: 1px solid #1e1e1e;
  padding: 22px 28px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.invoice-header img { filter: brightness(0) invert(1); }

.invoice-meta { text-align: right; }
.invoice-number { font-size: 26px; font-weight: 900; color: #EC2127; letter-spacing: 0.5px; }
.invoice-date   { font-size: 12px; color: #666; margin-top: 6px; line-height: 1.8; }

/* dark card wrapper for each section */
.invoice-card {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 14px;
  border: 1px solid #222;
}

.invoice-section-title {
  font-size: 10px; font-weight: 700; color: #EC2127;
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.invoice-table { width: 100%; border-collapse: collapse; margin: 0; }
.invoice-table th {
  background: transparent; color: #555;
  padding: 0 16px 10px; text-align: left;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  border-bottom: 1px solid #252525;
}
.invoice-table th:first-child { padding-left: 0; }
.invoice-table th:last-child  { text-align: right; padding-right: 0; }
.invoice-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #1e1e1e;
  font-size: 13px; color: #ccc;
}
.invoice-table td:first-child { padding-left: 0; }
.invoice-table td:last-child  { text-align: right; font-weight: 700; color: #fff; padding-right: 0; }
.invoice-table tr:last-child td { border-bottom: none; }

.invoice-totals { margin: 0; }
.invoice-totals-row {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  font-size: 14px; color: #777;
  border-bottom: 1px solid #1e1e1e;
}
.invoice-totals-row:last-child { border-bottom: none; }
.invoice-totals-row .t-amount { color: #ddd; font-weight: 600; }
.invoice-totals-row.discount-row .t-amount { color: #22c55e; }
.invoice-totals-row.final {
  font-size: 22px; font-weight: 900; color: #fff;
  padding: 16px 0 0;
  border-bottom: none; border-top: 1px solid #333;
  margin-top: 6px;
}
.invoice-totals-row.final .t-amount { color: #EC2127; }

.invoice-footer {
  background: #1a1a1a;
  border-radius: 12px;
  border: 1px solid #222;
  margin-top: 14px; padding: 14px 24px;
  display: flex; justify-content: space-between;
  font-size: 12px; color: #444;
  align-items: center;
}

@media print {
  .no-print { display: none !important; }
  .invoice-page { background: #fff !important; color: #050505 !important; }
  .invoice-header {
    background: #050505 !important;
    border-radius: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .invoice-card {
    background: #fff !important;
    border: 1px solid #eee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .invoice-table th { color: #888 !important; border-bottom-color: #eee !important; }
  .invoice-table td { color: #333 !important; border-bottom-color: #f0f0f0 !important; }
  .invoice-table td:last-child { color: #050505 !important; }
  .invoice-totals-row { color: #555 !important; border-bottom-color: #eee !important; }
  .invoice-totals-row .t-amount { color: #050505 !important; }
  .invoice-totals-row.final { border-top-color: #050505 !important; }
  .invoice-totals-row.final .t-amount { color: #EC2127 !important; }
  .invoice-footer { background: #f5f5f5 !important; border-color: #eee !important; color: #888 !important; }
  .invoice-container { padding: 20px !important; }
  body { background: white !important; }
}

/* ── Auth Pages ──────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--black);
  position: relative;
}
.auth-page::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 20% 50%, rgba(236,33,39,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 400px 600px at 80% 30%, rgba(236,33,39,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  width: 100%; max-width: 480px;
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.auth-header {
  background: var(--gray-900);
  padding: 36px 40px 28px;
  border-bottom: 1px solid var(--gray-700);
  text-align: center;
}
.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.auth-logo img {
  height: 96px;
  width: auto;
}
.auth-title {
  margin-top: 20px;
  font-size: 24px; font-weight: 800;
}
.auth-desc { font-size: 13px; color: var(--gray-300); margin-top: 6px; }
.auth-body { padding: 36px 40px; }
.auth-footer {
  text-align: center; padding-bottom: 28px;
  font-size: 13px; color: var(--gray-300);
}
.auth-footer a { color: var(--red); font-weight: 600; }

/* ── Dashboard Grids ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ── Search Bar ──────────────────────────────────────────────── */
.search-form {
  display: flex; gap: 10px;
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: var(--radius);
  padding: 6px 6px 6px 18px;
  transition: border-color var(--transition);
}
.search-form:focus-within { border-color: var(--red); }
.search-input {
  flex: 1; background: none; border: none;
  color: var(--white); font-family: var(--font-en); font-size: 14px;
  outline: none;
}
.search-input::placeholder { color: var(--gray-400); }

/* ── Filters Bar ─────────────────────────────────────────────── */
.filters-bar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: nowrap; overflow-x: auto;
  margin-bottom: 24px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.filters-bar::-webkit-scrollbar { display: none; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: 32px; flex-wrap: wrap;
}
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 10px;
  background: var(--gray-800); border: 1px solid var(--gray-600);
  border-radius: 8px; color: var(--gray-200);
  font-size: 14px; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: all var(--transition);
}
.page-btn svg { width: 16px; height: 16px; }
.page-btn:hover { background: rgba(236,33,39,0.1); border-color: var(--red); color: var(--red); }
.page-btn.active { background: var(--red); border-color: var(--red); color: #fff; pointer-events: none; }
.page-btn.disabled { opacity: 0.35; pointer-events: none; cursor: default; }
.page-dots { color: var(--gray-400); font-size: 14px; padding: 0 4px; line-height: 38px; }
.filter-btn {
  padding: 7px 16px;
  background: var(--gray-800);
  border: 1px solid var(--gray-600);
  border-radius: 100px;
  color: var(--gray-200); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  background: rgba(236,33,39,0.1);
  border-color: var(--red);
  color: var(--red);
}

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 80px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.empty-state-icon { opacity: 0.15; }
.empty-state-icon svg { width: 64px; height: 64px; }
.empty-state h3 { font-size: 18px; color: var(--gray-300); }
.empty-state p  { font-size: 13px; color: var(--gray-400); max-width: 300px; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--gray-900);
  border-top: 1px solid var(--gray-700);
  padding: 20px 24px;
  margin-top: 60px;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
}
.footer-brand { font-size: 12px; font-weight: 700; color: var(--gray-300); letter-spacing: 1.5px; }
.footer-brand em { color: var(--red); font-style: normal; }
.footer-copy  { font-size: 11px; color: var(--gray-400); }

/* ── Utility Classes ─────────────────────────────────────────── */
.text-red     { color: var(--red) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--gray-300) !important; }
.text-white   { color: var(--white) !important; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-bold    { font-weight: 700; }
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.gap-16  { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --navbar-h: 64px; }
  .main-content { padding: 20px 16px 60px; }
  .nav-links { display: none; position: fixed; top: var(--navbar-h); left: 0; right: 0; bottom: 0; background: var(--gray-900); flex-direction: column; align-items: stretch; padding: 20px; gap: 4px; z-index: 999; overflow-y: auto; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 18px; font-size: 15px; }
  .hamburger { display: flex; }
  .user-name { display: none; }
  .page-header { margin-bottom: 20px; }
  .form-row  { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
  .discount-layout { grid-template-columns: 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
  .order-info-grid { grid-template-columns: 1fr; }
  .emirates-id-grid { grid-template-columns: 1fr; }
  .auth-body, .auth-header { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .otp-input-group { gap: 6px; }
  .otp-digit { width: 44px; height: 54px; font-size: 22px; }
}

/* ── PWA Standalone (iOS Add to Home Screen) ─────────────────── */
@media all and (display-mode: standalone) {
  .main-content {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
}
