/* ================================================================
   פורטל ויסמן — CSS ראשי  v2026
   Primary: #5B7A2E (ירוק זית), RTL Hebrew, Rubik font
   ================================================================ */

/* ── Service-call custom modal ────────────────────────────────── */
.sc-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s, visibility .15s;
    pointer-events: none;
}
.sc-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.sc-dialog {
    max-width: 480px;
    width: 90%;
}
.sc-dialog-content {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.05);
}
.sc-dialog-header {
    display: flex;
    align-items: flex-start;
    padding: 1.2rem 1.4rem .5rem;
}
.sc-dialog-body {
    padding: 1rem 1.4rem 1.4rem;
}

/* ── Reset / Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  font-family: 'Rubik', 'Segoe UI', sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  direction: rtl;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── CSS Variables ───────────────────────────────────────────── */
:root {
  /* Primary palette */
  --primary:            #5B7A2E;
  --primary-dark:       #4A6526;
  --primary-light:      #EEF3E6;
  --primary-soft:       rgba(91,122,46,0.07);
  --primary-mid:        rgba(91,122,46,0.15);

  /* Aliases (תאימות לאחור) */
  --portal-green:       #5B7A2E;
  --portal-green-hover: #4A6526;
  --portal-green-light: #EEF3E6;

  /* Layout */
  --bg:                 #F5F7FA;
  --white:              #FFFFFF;
  --border:             #E4E9F0;
  --border-strong:      #C8D3E0;
  --portal-border:      #E4E9F0;

  /* Text */
  --text:               #1A2332;
  --text-secondary:     #4A5568;
  --muted:              #6B7A8D;

  /* Shadows — multi-layer, refined */
  --shadow:             0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-hover:       0 4px 8px rgba(0,0,0,0.06), 0 12px 28px rgba(0,0,0,0.10);
  --card-shadow:        0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);

  /* Radii */
  --radius:             12px;
  --radius-sm:          8px;
  --radius-lg:          16px;
  --radius-xl:          20px;

  /* Transitions */
  --ease:               cubic-bezier(0.4, 0, 0.2, 1);
  --trans-fast:         140ms var(--ease);
  --trans:              200ms var(--ease);
  --trans-slow:         300ms var(--ease);
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes countPop {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

.portal-content {
  padding: 1.5rem;
  animation: fadeSlideUp 0.25s var(--ease) both;
}

/* ── Navbar ──────────────────────────────────────────────────── */
.portal-navbar {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: box-shadow var(--trans);
}
.portal-navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.07);
}
.portal-navbar .navbar-brand {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.portal-navbar .nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem;
  transition: background var(--trans-fast), color var(--trans-fast);
}
.portal-navbar .nav-link.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}
.portal-navbar .nav-link:hover:not(.active) {
  color: var(--primary);
  background: var(--primary-soft);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-portal {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  transition: all var(--trans);
  box-shadow: 0 1px 3px rgba(91,122,46,0.25), 0 2px 8px rgba(91,122,46,0.12);
}
.btn-portal:hover, .btn-portal:focus {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  box-shadow: 0 2px 8px rgba(91,122,46,0.3), 0 4px 16px rgba(91,122,46,0.18);
  transform: translateY(-1px);
}
.btn-portal:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(91,122,46,0.2);
}
.btn-portal-outline {
  border: 1.5px solid var(--border-strong);
  color: var(--text-secondary);
  background: var(--white);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  transition: all var(--trans);
}
.btn-portal-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.bg-portal { background: var(--primary) !important; }

/* ── Cards ───────────────────────────────────────────────────── */
.portal-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
}

/* ── Dashboard stat cards ────────────────────────────────────── */
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.1rem;
  transition: box-shadow var(--trans), transform var(--trans);
  position: relative;
  overflow: hidden;
  cursor: default;
}
/* Accent bar on the right (RTL) */
.stat-card::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--stat-color, var(--primary));
  border-radius: 0 var(--radius) var(--radius) 0;
}
.stat-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.stat-num {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  animation: countPop 0.35s var(--ease) both;
}
.stat-lbl {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.2rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── Section card (s-card) ───────────────────────────────────── */
.s-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.s-card-header {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  background: linear-gradient(180deg, #FAFBFD 0%, var(--white) 100%);
  letter-spacing: 0.01em;
}

/* ── Service call item cards ─────────────────────────────────── */
.sc-item-open {
  background: #FFFBF0;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.sc-item-closed {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.sc-item-default {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

/* ── Catalog sidebar ─────────────────────────────────────────── */
.catalog-sidebar {
  width: 215px;
  min-width: 215px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  padding: 0.75rem 0.5rem;
  height: fit-content;
  position: sticky;
  top: 68px;
}

.cat-item,
.catalog-sidebar .group-btn {
  padding: 0.48rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.86rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--trans-fast), color var(--trans-fast);
  border: none;
  background: transparent;
  width: 100%;
  text-align: right;
  color: var(--text-secondary);
  margin: 1px 0;
  font-weight: 500;
}
.cat-item:hover,
.catalog-sidebar .group-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.cat-item.active,
.catalog-sidebar .group-btn.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(91,122,46,0.22);
}

/* ── Product card ────────────────────────────────────────────── */
.prod-card,
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border: 1.5px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
  display: flex;
  flex-direction: column;
}
.prod-card:hover,
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}
.prod-card img,
.product-card .card-img-top {
  height: 175px;
  object-fit: cover;
  background: var(--bg);
  width: 100%;
  transition: transform var(--trans-slow);
}
.prod-card:hover img,
.product-card:hover .card-img-top {
  transform: scale(1.04);
}
.prod-card .card-body,
.product-card .card-body {
  padding: 0.85rem 1rem;
  flex: 1;
}
.prod-card .card-title,
.product-card .card-title {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
  line-height: 1.35;
  color: var(--text);
}
.prod-card .card-group,
.product-card .card-group {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── Stock badges ────────────────────────────────────────────── */
.stk-hi {
  background: #D1FAE5;
  color: #065F46;
  border-radius: 20px;
  padding: 0.18rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}
.stk-lo {
  background: #FEF3C7;
  color: #92400E;
  border-radius: 20px;
  padding: 0.18rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}
.stk-no {
  background: #F1F5F9;
  color: #64748B;
  border-radius: 20px;
  padding: 0.18rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}

/* Legacy */
.stock-in  { color: var(--primary); font-weight: 600; }
.stock-out { color: #DC2626; }
.stock-low { color: #D97706; }

/* ── SKU Matrix (Product page) ───────────────────────────────── */
.sku-table th {
  background: var(--primary-light);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.qty-ctrl { display: flex; align-items: center; gap: 6px; }
.qty-ctrl button {
  width: 30px; height: 30px;
  border: 1.5px solid var(--border);
  background: var(--white);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--trans-fast);
  color: var(--text-secondary);
}
.qty-ctrl button:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}
.qty-ctrl input {
  width: 52px; text-align: center;
  border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  height: 30px; font-size: 0.9rem; font-weight: 600;
}

/* ── Order form ──────────────────────────────────────────────── */
.meta-bar {
  background: linear-gradient(135deg, var(--primary-light) 0%, #F3F7EC 100%);
  border: 1px solid #C8D9A8;
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  margin-bottom: 1.4rem;
}
.meta-bar .meta-row { display: flex; flex-wrap: wrap; gap: .5rem 2rem; }
.meta-bar .meta-item label {
  font-size: 0.7rem;
  color: var(--muted);
  display: block;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.meta-bar .meta-item span {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary-dark);
}

.form-sec-title,
.order-section-title {
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.45rem;
  margin-bottom: 1.1rem;
  margin-top: 1.5rem;
}

.order-cart-table th {
  background: var(--primary-light);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Order Confirmation ──────────────────────────────────────── */
.confirm-wrap {
  display: flex;
  justify-content: center;
  padding: 3rem 1rem;
}
.confirm-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  text-align: center;
  max-width: 580px;
  width: 100%;
  animation: fadeSlideUp 0.3s var(--ease) both;
}
.confirm-icon-circle {
  width: 80px; height: 80px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: var(--primary);
}
.confirm-meta {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  text-align: right;
}
.confirm-meta .cm-row {
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
  padding: .28rem 0;
  border-bottom: 1px solid #C8D9A8;
}
.confirm-meta .cm-row:last-child { border-bottom: none; }
.confirm-meta .cm-label { color: var(--muted); }
.confirm-meta .cm-value { font-weight: 600; }

/* ── Login ───────────────────────────────────────────────────── */
.login-body { background: #f0f0f0; margin: 0; }
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.login-hero {
  flex: 1;
  background:
    linear-gradient(145deg, rgba(46,74,16,.85) 0%, rgba(91,122,46,.78) 55%, rgba(127,168,64,.72) 100%),
    url('/img/placeholder-hero.jpg') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 2rem;
  color: #fff;
  min-height: 100vh;
  text-align: center;
}
.login-panel {
  width: 420px;
  min-width: 360px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 2.5rem;
  box-shadow: -8px 0 40px rgba(0,0,0,0.08);
}
@media (max-width: 768px) {
  .login-hero { display: none; }
  .login-panel { width: 100%; min-width: unset; padding: 2rem 1.5rem; }
}

/* ── Utilities ───────────────────────────────────────────────── */
.text-portal { color: var(--primary); }
.text-muted  { color: var(--muted) !important; }
.border-portal { border-color: var(--primary) !important; }
.bg-green-light { background: var(--primary-light); }

/* ── DataTables RTL fix ──────────────────────────────────────── */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { text-align: start; }
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { text-align: start; }

/* ── Table improvements ──────────────────────────────────────── */
.table > thead > tr > th {
  font-size: 0.77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  padding: 0.65rem 0.75rem;
  white-space: nowrap;
}
.table > tbody > tr > td {
  font-size: 0.86rem;
  padding: 0.62rem 0.75rem;
  vertical-align: middle;
  border-color: var(--border);
}
.table-hover > tbody > tr {
  transition: background-color var(--trans-fast);
}
.table-hover > tbody > tr:hover > * {
  background-color: var(--primary-soft);
}

/* ── Focus ring ──────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,122,46,0.12);
}

/* ── Form controls ───────────────────────────────────────────── */
.form-control, .form-select {
  border-color: var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
  background-color: #FAFBFC;
}
.form-control:not(:focus) { background-color: #FAFBFC; }
.form-control::placeholder { color: var(--muted); opacity: 0.7; }

/* ── Quick action tiles ──────────────────────────────────────── */
.quick-tile {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.1rem 0.5rem;
  text-align: center;
  color: var(--text-secondary);
  transition: all var(--trans);
  min-height: 90px;
  text-decoration: none;
}
.quick-tile:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(91,122,46,0.12);
}

/* ── Product detail page ─────────────────────────────────────── */
.prod-img-main {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: zoom-in;
  max-height: 340px;
  object-fit: cover;
  display: block;
  transition: transform var(--trans);
}
.prod-img-main:hover { transform: scale(1.01); }

/* sku-tbl */
.sku-tbl { font-size: 0.85rem; width: 100%; border-collapse: collapse; }
.sku-tbl thead th {
  background: linear-gradient(180deg, var(--primary-light) 0%, #EBF2E0 100%);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.76rem;
  padding: 0.65rem 0.8rem;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sku-tbl tbody td {
  padding: 0.65rem 0.8rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.sku-tbl tbody tr:last-child td { border-bottom: none; }
.sku-tbl tbody tr {
  transition: background var(--trans-fast);
}
.sku-tbl tbody tr:hover { background: var(--primary-soft); }

/* qty-wrap / qty-btn / qty-in */
.qty-wrap { display: flex; align-items: center; gap: .4rem; }
.qty-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--trans-fast);
  padding: 0;
  line-height: 1;
  color: var(--text-secondary);
}
.qty-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.qty-in {
  width: 50px; text-align: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.18rem;
  font-size: 0.86rem;
  height: 30px;
  font-weight: 600;
}
.qty-in:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,122,46,0.12); }

/* legacy aliases */
.qty-ctrl { display: flex; align-items: center; gap: .4rem; }
.qty-ctrl button {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--white);
  cursor: pointer; font-size: 1rem; padding: 0; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--trans-fast); color: var(--text-secondary);
}
.qty-ctrl button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.qty-ctrl input {
  width: 50px; text-align: center;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: .18rem; font-size: .86rem; height: 30px; font-weight: 600;
}

/* ── Login hero — text clip effect ──────────────────────────── */
.hero-clip-title {
  font-size: clamp(3rem, 7.5vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -2px;
  text-align: center;
  background-image: linear-gradient(
    160deg,
    #FFFFFF   0%,
    #F0FFD0  30%,
    #FFE87C  60%,
    #C8DDA0 100%
  );
  background-size: cover;
  background-position: center;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

/* ── Badge / pill helpers ────────────────────────────────────── */
.badge {
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.badge.bg-warning { color: #7c4f00 !important; }

/* ── Status badges (DataTable) ───────────────────────────────── */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Login promo (picmarketing) ──────────────────────────────── */
.login-panel.has-promo {
  justify-content: flex-start;
  padding-top: 2.2rem;
}
.login-promo {
  margin-top: 1.5rem;
  margin-left:   -2.5rem;
  margin-right:  -2.5rem;
  margin-bottom: -3rem;
  flex: 1;
  min-height: 170px;
  overflow: hidden;
  border-top: 1px solid var(--border);
}
.login-promo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Pagination ──────────────────────────────────────────────── */
.page-link {
  color: var(--text-secondary);
  border-color: var(--border);
  border-radius: var(--radius-sm) !important;
  font-size: 0.85rem;
  transition: all var(--trans-fast);
}
.page-link:hover { color: var(--primary); background: var(--primary-soft); border-color: var(--primary); }
.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(91,122,46,0.25);
}

/* ── Product card — 2026 redesign ───────────────────────────── */
.product-card-img-wrap {
  position: relative;
  overflow: hidden;
  background: #F8F9FA;
  height: 185px;
}
.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: transform var(--trans-slow);
}
.product-card:hover .product-card-img {
  transform: scale(1.06);
}

/* ── Rank badge (medal style) on product card ────────────────── */
.rank-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  backdrop-filter: blur(4px);
}
.rank-badge i { font-size: 0.68rem; }

/* Gold — #1 */
.rank-badge.rank-1 {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  box-shadow: 0 2px 10px rgba(245,158,11,0.45);
}
/* Silver — #2 */
.rank-badge.rank-2 {
  background: linear-gradient(135deg, #94A3B8, #64748B);
  box-shadow: 0 2px 10px rgba(100,116,139,0.4);
}
/* Bronze — #3 */
.rank-badge.rank-3 {
  background: linear-gradient(135deg, #CD7F32, #A0622E);
  box-shadow: 0 2px 10px rgba(205,127,50,0.4);
}
/* 4-10: olive green */
.rank-badge.rank-top10 {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 2px 8px rgba(91,122,46,0.35);
}
/* 11+: subtle gray */
.rank-badge.rank-rest {
  background: rgba(71,85,105,0.75);
  backdrop-filter: blur(6px);
  font-size: 0.68rem;
  padding: 2px 8px;
}

/* ── Usage overlay on product image (purchased indicator) ─────── */
.usage-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.0) 100%);
  color: #fff;
  z-index: 1;
}
.usage-overlay i {
  font-size: 0.7rem;
  opacity: 0.9;
}
.usage-overlay-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  overflow: hidden;
}
.usage-overlay-fill {
  height: 100%;
  background: linear-gradient(90deg, #7FA33A, #A8D45A);
  border-radius: 2px;
  transition: width 0.6s var(--ease);
  min-width: 3px;
}
.usage-overlay-label {
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ── Special group buttons ───────────────────────────────────── */
.catalog-sidebar .group-btn-special {
  font-weight: 600;
  font-size: 0.83rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3px;
  padding-bottom: 7px;
}
.catalog-sidebar .group-btn-special:hover {
  background: transparent;
  opacity: 0.8;
}
.catalog-sidebar .group-btn-special.active {
  background: var(--primary);
  color: #fff !important;
}

/* ── Service call card hover ─────────────────────────────────── */
.sc-card-clickable {
  cursor: pointer;
  transition: box-shadow var(--trans-fast), transform var(--trans-fast);
  border: 1px solid transparent;
}
.sc-card-clickable:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.10);
  border-color: var(--border);
  transform: translateX(-2px);
}

/* ── Mobile catalog ──────────────────────────────────────────── */
@media (max-width: 767px) {
  /* Group dropdown */
  #group-select {
    font-size: 0.9rem;
    border-color: var(--border);
  }

  /* Full-width cards on mobile */
  #product-grid .col-12 {
    padding-left: 4px;
    padding-right: 4px;
  }
  .product-card-img-wrap { height: 200px; }

  /* Catalog area takes full width */
  .portal-content { padding: 1rem 0.75rem; }
}

/* ── Orders List page ────────────────────────────────────────── */

/* Stats strip cards */
.orders-stat-card {
  background: var(--accent-bg, #F8FAFC);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  border-right: 4px solid var(--accent, var(--primary));
  transition: box-shadow var(--trans);
}
.orders-stat-card:hover {
  box-shadow: var(--shadow-hover);
}
.orders-stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent, var(--primary));
  letter-spacing: -0.04em;
}
.orders-stat-lbl {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.orders-stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Portal order number cell */
.portal-order-num {
  font-family: 'Courier New', monospace;
  font-size: .83rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
}
.portal-order-num:hover { text-decoration: underline; }

/* SAP doc number cell */
.sap-doc-num {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: .83rem;
  color: #166534;
}

/* Items pill */
.items-pill {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.items-qty {
  font-size: .72rem;
  color: var(--muted);
}

/* ── Order detail modal ──────────────────────────────────────── */

/* Modal header */
.order-modal-header {
  padding: 1.1rem 1.25rem 0.9rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background var(--trans);
}
.order-modal-kicker {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 3px;
}
.order-modal-title-text {
  font-size: 1rem;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.order-sap-badge {
  font-size: .72rem;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}

/* SAP result banners */
.order-modal-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.55rem 1.25rem;
  font-size: .83rem;
  font-weight: 500;
}
.order-modal-banner--success {
  background: #F0FDF4;
  color: #166534;
  border-bottom: 1px solid #BBF7D0;
}
.order-modal-banner--error {
  background: #FEF2F2;
  color: #DC2626;
  border-bottom: 1px solid #FECACA;
}

/* Modal body */
.order-modal-body {
  padding: 1rem 1.25rem 0.5rem;
  max-height: 72vh;
  overflow-y: auto;
}

/* Section title */
.order-modal-section-title {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
  margin-bottom: 0.65rem;
  margin-top: 0.1rem;
}

/* Details grid */
.order-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 1.2rem;
}
.order-detail-item {}
.order-detail-item--full {
  grid-column: 1 / -1;
}
.order-detail-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 2px;
  font-weight: 500;
}
.order-detail-value {
  font-size: .87rem;
  color: var(--text);
  word-break: break-word;
}

/* Notes box */
.order-notes-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: .84rem;
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Lines table */
.order-lines-table {
  font-size: .82rem;
  margin-bottom: 0;
}
.order-lines-table thead th {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: .71rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  border-bottom: none;
}
.order-lines-table tbody td {
  padding: 0.52rem 0.75rem;
  vertical-align: middle;
  border-color: var(--border);
}

/* Modal footer */
.order-modal-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #FAFBFD;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0 0 14px 14px;
}

/* Responsive: on mobile stack stats */
@media (max-width: 576px) {
  .orders-stat-card {
    padding: 0.7rem 0.85rem;
  }
  .orders-stat-num { font-size: 1.4rem; }
  .order-detail-grid { grid-template-columns: 1fr; }
  .order-detail-item--full { grid-column: 1; }
  .sc-dialog { width: 97% !important; }
}

/* ═══════════════════════════════════════════════════════════════
   HAMBURGER BUTTON
   ═══════════════════════════════════════════════════════════════ */
.hamburger {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-sm);
  transition: background var(--trans-fast);
}
.hamburger:hover { background: var(--primary-soft); }
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transform-origin: center;
  transition: transform 250ms var(--ease), opacity 200ms var(--ease), width 200ms var(--ease);
}
/* X animation */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════════════════════════════
   MOBILE DRAWER (RTL — slides from right)
   ═══════════════════════════════════════════════════════════════ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms var(--ease), visibility 250ms var(--ease);
}
.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;       /* RTL: opens from right */
  bottom: 0;
  width: min(300px, 85vw);
  background: #fff;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.15);
  transform: translateX(100%);  /* hidden off-right */
  transition: transform 280ms var(--ease);
  overflow-y: auto;
}
.mobile-drawer.open {
  transform: translateX(0);
}

/* Drawer header */
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--primary-soft);
  position: sticky;
  top: 0;
  z-index: 1;
}
.drawer-close {
  width: 32px;
  height: 32px;
  padding: 0;
  opacity: .6;
}
.drawer-close:hover { opacity: 1; }

/* User info strip */
.mobile-drawer-user {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

/* Nav links */
.mobile-drawer-nav {
  flex: 1;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mobile-drawer-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.78rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background var(--trans-fast), color var(--trans-fast);
}
.mobile-drawer-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  color: var(--muted);
  transition: color var(--trans-fast);
}
.mobile-drawer-link:hover,
.mobile-drawer-link.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.mobile-drawer-link:hover i,
.mobile-drawer-link.active i {
  color: var(--primary);
}
.mobile-drawer-link.active {
  font-weight: 600;
}

/* Drawer footer */
.mobile-drawer-footer {
  padding: 0.75rem 0.5rem;
  border-top: 1px solid var(--border);
}
.mobile-drawer-logout {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.78rem 0.9rem;
  border-radius: var(--radius-sm);
  color: #DC2626;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background var(--trans-fast);
}
.mobile-drawer-logout:hover { background: #FEF2F2; color: #DC2626; }
.mobile-drawer-logout i { width: 20px; text-align: center; }

/* Circular logout icon in user strip */
.drawer-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FEE2E2;
  color: #DC2626;
  font-size: .9rem;
  text-decoration: none;
  transition: background var(--trans-fast), transform var(--trans-fast);
  flex-shrink: 0;
}
.drawer-logout-btn:hover { background: #FECACA; transform: scale(1.08); color: #DC2626; }

/* ═══════════════════════════════════════════════════════════════
   ORDERS — MOBILE CARD VIEW
   (מחליף את הטבלה עד 768px)
   ═══════════════════════════════════════════════════════════════ */
.order-card-mobile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 0.65rem;
  cursor: pointer;
  transition: box-shadow var(--trans), border-color var(--trans);
  position: relative;
  overflow: hidden;
}
.order-card-mobile::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px;
  height: 100%;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--primary);
}
.order-card-mobile:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}
/* Status color stripe */
.order-card-mobile[data-status="Created"]::before { background: #16A34A; }
.order-card-mobile[data-status="Failed"]::before  { background: #DC2626; }
.order-card-mobile[data-status="Pending"]::before { background: #D97706; }

.order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}
.order-card-num {
  font-family: monospace;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  letter-spacing: .02em;
}
.order-card-sap {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 2px;
}
.order-card-sap strong { color: var(--text); font-size: .82rem; }
.order-card-customer {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
  margin-bottom: 2px;
}
.order-card-meta {
  font-size: .78rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-bottom: 0.55rem;
}
.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.order-card-items {
  font-size: .75rem;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 20px;
}

/* Hide table on mobile, show cards; reverse on desktop */
@media (max-width: 767px) {
  /* Orders List page */
  #orders-table-wrap { display: none !important; }
  #orders-cards-mobile { display: block !important; }
  /* Dashboard page */
  #tbl-orders-wrap { display: none !important; }
  #orders-cards-dash:empty { display: none; }
  .orders-stat-card { padding: 0.65rem 0.8rem; }
  .portal-content { padding: 1rem 0.75rem; }
}
@media (min-width: 768px) {
  #orders-cards-mobile { display: none !important; }
  #orders-cards-dash { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   SKU MATRIX — MOBILE CARD VIEW  (#sku-cards-mobile)
   ═══════════════════════════════════════════════════════════════ */
.sku-card-mobile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  margin-bottom: .6rem;
}
.sku-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .4rem;
}
.sku-card-code {
  background: #F0F4FF;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .82rem;
  color: #1D4ED8;
}
.sku-card-desc {
  font-size: .85rem;
  color: var(--text);
  margin-bottom: .45rem;
  line-height: 1.4;
}
.sku-card-attrs {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .65rem;
}
.sku-attr-badge {
  background: #F5F5F5;
  color: var(--text);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .78rem;
}
.sku-attr-future {
  background: #EFF6FF;
  color: #1565C0;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.sku-card-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: .55rem;
}

@media (max-width: 767px) {
  #sku-tbl-wrap { display: none !important; }
  #sku-cards-mobile { display: block !important; }
}
@media (min-width: 768px) {
  #sku-cards-mobile { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD — MOBILE ORDER CARDS  (#orders-cards-dash)
   ═══════════════════════════════════════════════════════════════ */
.dash-order-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem .85rem 1.1rem;
  margin-bottom: .55rem;
  position: relative;
  overflow: hidden;
}
.dash-order-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px;
  height: 100%;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--primary);
}
/* Status stripe — default primary; override per status badge inline */

.dash-order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: .45rem;
}
.dash-order-card-num {
  font-family: monospace;
  font-weight: 700;
  font-size: .95rem;
  color: var(--primary);
}
.dash-order-card-meta {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: .4rem;
}
.dash-order-card-row {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.dash-order-card-remarks {
  font-size: .75rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: .35rem;
  margin-top: .35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════════
   SKU Card Grid — Option A
   ═══════════════════════════════════════════════════════════════ */
.sku-card-a {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow .2s, border-color .2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.sku-card-a:hover { box-shadow: 0 6px 20px rgba(91,122,46,.18); border-color: #8fba3c; }
.sku-card-a.in-cart { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,122,46,.14); }

.sku-card-img-wrap {
  height: 130px;
  background: #f8faf4;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.sku-card-img {
  max-height: 115px;
  max-width: 100%;
  object-fit: contain;
}

.sku-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}
.sku-card-code {
  font-size: 13px;
  color: #111;
  font-family: monospace;
}
.sku-card-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  line-height: 1.35;
  flex: 1;
}
.sku-card-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.sku-badge-color {
  font-size: 10px; padding: 1px 8px; border-radius: 99px;
  background: #f0f4e8; color: #4a6b22; font-weight: 600;
}
.sku-badge-size {
  font-size: 10px; padding: 1px 8px; border-radius: 99px;
  background: #e8f0fe; color: #1a56db; font-weight: 600;
}
.sku-card-stock { font-size: 11px; display: flex; align-items: center; margin-top: 2px; }
.sku-card-future { font-size: 10px; color: #1565C0; margin-top: 1px; }

.sku-qty-row {
  display: flex; align-items: center; gap: 5px; margin-top: 6px;
}
.sku-qty-btn {
  width: 28px; height: 28px;
  border: 1.5px solid #d1d5db; border-radius: 7px;
  background: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.sku-qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.sku-qty-in {
  flex: 1; text-align: center;
  border: 1.5px solid #d1d5db; border-radius: 7px;
  padding: 2px 4px; font-weight: 700; font-size: 14px;
  min-width: 0;
}
.sku-add-btn {
  width: 100%; margin-top: 6px;
  background: var(--primary); color: #fff; border: none;
  border-radius: 8px; padding: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.sku-add-btn:hover { background: #4a6022; }
.sku-add-btn.in-cart { background: #16a34a; }

/* Mobile — 2 per row, slightly smaller image */
@media (max-width: 575px) {
  .sku-card-img-wrap { height: 100px; }
  .sku-card-body { padding: 8px 10px 10px; }
  .sku-card-name { font-size: 11.5px; }
}
