:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-alt: #f1f5f9;
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eff6ff;
  --success: #059669;
  --success-strong: #047857;
  --success-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.employee-overlay-open {
  overflow: hidden;
}

.app-shell {
  width: min(1200px, calc(100% - 32px));
  max-width: 100%;
  box-sizing: border-box;
  margin: 24px auto 48px;
}

.hero {
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(135deg, #16324f, #0f6cbd);
  color: #fff;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 18px;
}

.settings-grid,
.audit-toolbar,
.audit-actions,
.totals-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.search-bar input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  border-radius: 10px;
}

.search-bar button {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  white-space: nowrap;
}

.settings-grid {
  margin-top: 18px;
}

.settings-grid .field {
  flex: 1 1 280px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

input,
select,
textarea,
button {
  font: inherit;
}

input[type="text"],
input[type="month"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #c5d3e0;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 84px;
  resize: vertical;
}

button,
.button-like {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

button:hover,
.button-like:hover {
  transform: translateY(-1px);
}

button.primary {
  background: var(--accent);
  color: #fff;
}

button.primary:hover {
  background: var(--accent-strong);
}

button.secondary {
  background: #dde9f7;
  color: var(--ink);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

button.warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-weight: 600;
}

button.warn:hover {
  background: #fde68a;
  color: #78350f;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.mode-switch {
  display: flex;
  width: 100%;
  max-width: 440px;
  margin: 12px auto 16px;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 12px;
  gap: 3px;
  box-sizing: border-box;
}

.mode-switch button {
  flex: 1;
  padding: 9px 16px;
  border: none !important;
  background: transparent !important;
  color: #64748b !important;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 9px;
  cursor: pointer;
  box-shadow: none !important;
  transform: none !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-switch button:hover {
  color: #0f172a !important;
}

.mode-switch button.active {
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1), 0 1px 2px rgba(15, 23, 42, 0.06) !important;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.status-line {
  margin-top: 12px;
  min-height: 24px;
  font-size: 0.95rem;
  color: var(--muted);
}

.status-line.error {
  color: var(--danger);
}

.status-line.success {
  color: var(--success);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.audit-grid {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

/* ==========================================================================
   Compact Employee Audit Screen & Workflow
   ========================================================================== */

.audit-layout-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

/* 1. Sleek Auditor Header Bar */
.audit-compact-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.audit-auditor-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
  flex: 1;
}

.auditor-chip-icon,
.auditor-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex: 0 0 auto;
}

.auditor-chip-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.auditor-chip-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  line-height: 1;
}

.auditor-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}

.auditor-chip-name {
  font-family: 'Cairo', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.audit-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2.5px rgba(16, 185, 129, 0.25);
  flex: 0 0 auto;
  transition: background 0.2s, box-shadow 0.2s;
}

.audit-live-dot.warning {
  background: #f59e0b;
  box-shadow: 0 0 0 2.5px rgba(245, 158, 11, 0.25);
}

.audit-live-dot.locked {
  background: #94a3b8;
  box-shadow: 0 0 0 2.5px rgba(148, 163, 184, 0.25);
}

.audit-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ecfdf5 !important;
  color: #059669 !important;
  border: 1px solid rgba(5, 150, 105, 0.25) !important;
  border-radius: 9999px !important;
  padding: 3px 10px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  margin-left: auto;
  flex: 0 0 auto;
}

.audit-top-facts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
}

.audit-top-facts .stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
}

.audit-top-facts .stat-done {
  background: #ecfdf5;
  color: #059669;
}

.audit-top-facts .stat-diffs {
  background: #fffbeb;
  color: #d97706;
}

.btn-switch-auditor {
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  padding: 4px 11px !important;
  min-height: 28px !important;
  border-radius: 9999px !important;
  color: var(--muted) !important;
  background: #f1f5f9 !important;
  border: 1px solid var(--line) !important;
  flex: 0 0 auto;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-switch-auditor:hover {
  background: #e2e8f0 !important;
  color: var(--ink) !important;
}

/* 2. Unified Search & Scanner Capsule */
.audit-scanner-dock {
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 6px 8px 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.audit-scanner-dock:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), var(--shadow-sm);
}

.audit-scan-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audit-scan-input-wrap .scan-input-icon {
  font-size: 1.15rem;
  color: var(--muted);
  flex: 0 0 auto;
}

.audit-scan-input-wrap input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 6px 0 !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.audit-scan-input-wrap input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.audit-scan-input-wrap input:focus {
  outline: none !important;
}

.btn-scan-open {
  padding: 6px 16px !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  min-height: 34px !important;
  border-radius: var(--radius-sm) !important;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
  cursor: pointer;
  flex: 0 0 auto !important;
  transition: all 0.15s ease;
}

.btn-scan-open:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35) !important;
}

.btn-scan-open:active {
  transform: translateY(0);
}

/* 3. Hero Product Editor Card */
.audit-editor-panel {
  padding: 16px 18px !important;
  border-radius: var(--radius-xl) !important;
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow) !important;
  position: relative;
}

.audit-editor-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
}

.empty-audit-icon {
  font-size: 1.6rem;
  margin-bottom: 0;
  flex: 0 0 auto;
  line-height: 1;
}

.empty-audit-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.empty-audit-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.empty-audit-text {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.3;
}

/* Product Card Header */
.audit-product-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.audit-product-title-col {
  flex: 1;
  min-width: 0;
}

.audit-product-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.audit-product-name-en {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.audit-product-name-ar {
  font-family: 'Cairo', system-ui, sans-serif;
  font-size: 0.94rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.3;
  margin-top: 1px;
  word-break: break-word;
  text-align: left;
}

.audit-product-meta-sub {
  font-size: 0.74rem;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.audit-barcode-pill,
#auditBarcodeText {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  background: var(--panel-alt);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.audit-product-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.btn-cancel-product {
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  border: 1px solid var(--line) !important;
  background: #f8fafc !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
  line-height: 1 !important;
}

.btn-cancel-product:hover {
  color: var(--danger) !important;
  border-color: #fca5a5 !important;
  background: var(--danger-soft) !important;
  transform: rotate(90deg);
}

/* Sleek Segmented Metrics Strip */
.audit-metrics-inline {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin: 10px 0 !important;
  padding: 8px 14px !important;
  background: #f8fafc !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-md) !important;
  flex-wrap: nowrap !important;
}

.audit-metrics-inline .metric-chip {
  flex: 1 1 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.audit-metrics-inline .metric-lbl {
  color: var(--muted);
  font-size: 0.62rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
}

.audit-metrics-inline .metric-val {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.audit-metrics-inline .metric-val strong {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.audit-metrics-inline .metric-counted strong {
  color: var(--accent) !important;
}

.audit-metrics-inline .metric-progress {
  background: var(--warn-soft) !important;
  border: 1px solid rgba(217, 119, 6, 0.25) !important;
  color: var(--warn) !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
  padding: 4px 10px !important;
  border-radius: 9999px !important;
  white-space: nowrap !important;
  text-align: center;
  transition: all 0.2s ease;
}

.audit-metrics-inline .metric-progress.all-confirmed {
  background: var(--success-soft) !important;
  border-color: rgba(5, 150, 105, 0.3) !important;
  color: var(--success) !important;
}

/* Compact Modern Packaging Definition Banner (RTL) */
.audit-packaging-banner {
  margin: 6px 0 10px !important;
  padding: 8px 12px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
}

.pkg-banner-inner {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

@media (min-width: 580px) {
  .pkg-banner-inner {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }
}

.pkg-item {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 0.82rem !important;
  min-width: 0 !important;
}

.pkg-badge {
  flex: 0 0 auto !important;
  font-size: 0.70rem !important;
  font-weight: 800 !important;
  color: #0369a1 !important;
  background: #e0f2fe !important;
  border: 1px solid #bae6fd !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  line-height: 1.2 !important;
}

.pkg-badge-strip {
  color: #047857 !important;
  background: #d1fae5 !important;
  border-color: #a7f3d0 !important;
}

.pkg-text {
  font-weight: 700 !important;
  color: #1e293b !important;
  font-size: 0.82rem !important;
  word-break: break-word !important;
  line-height: 1.3 !important;
}

/* Semantic BiDi Stock Breakdown Formatter */
.stock-bidi-wrap {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  direction: ltr !important;
  unicode-bidi: isolate;
}

.bidi-part {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  direction: rtl !important;
  unicode-bidi: isolate;
}

.bidi-num {
  font-weight: 800;
  font-size: 0.95rem;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
  direction: ltr !important;
  unicode-bidi: isolate;
}

.bidi-unit {
  font-weight: 700;
  font-size: 0.74rem;
  color: #475569;
  white-space: nowrap;
}

.bidi-sep {
  font-size: 0.85rem;
  font-weight: 800;
  color: #94a3b8;
  margin: 0 1px;
  direction: ltr !important;
  unicode-bidi: isolate;
}

.compact-metric-breakdown {
  min-width: 90px;
  text-align: center;
}

.stock-breakdown-val {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
}

.stock-breakdown-sub {
  font-size: 0.70rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1;
}

/* 4. Interactive Expiry Verification Card (2-Tier Architecture) */
.employee-audit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.employee-audit-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Base Card Style */
.employee-row-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 12px 14px !important;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 14px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  box-sizing: border-box !important;
}

.employee-row-card:hover {
  border-color: #94a3b8 !important;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.07) !important;
}

.employee-row-card:active {
  transform: scale(0.99);
}

/* Tier 1: Row Header (Expiry, POS Stock, Verify Status) */
.employee-row-card .row-meta-tier {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
}

.employee-row-card .expiry-cell {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
}

.employee-row-card .expiry-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 5px 10px !important;
  font-size: 0.94rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1 !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -0.01em !important;
}

.employee-row-card .expiry-editor {
  display: inline-flex !important;
  align-items: center !important;
  position: relative !important;
}

.employee-row-card .expiry-cell input[type="text"] {
  height: 36px !important;
  min-height: 36px !important;
  width: 95px !important;
  padding: 4px 8px !important;
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  text-align: center !important;
  border-radius: 8px !important;
  border: 1.5px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-variant-numeric: tabular-nums !important;
  cursor: pointer !important;
}

.employee-row-card .expiry-picker-native {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.employee-row-card .expected-cell {
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
}

.employee-row-card .compact-metric {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 4px 8px !important;
  max-width: 100% !important;
  white-space: nowrap !important;
}

.employee-row-card .compact-metric .metric-hdr {
  font-size: 0.64rem !important;
  font-weight: 800 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  line-height: 1 !important;
}

.employee-row-card .verify-cell {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.row-verify-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 6px 12px !important;
  border-radius: 9999px !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  cursor: pointer !important;
}

.row-verify-pill .verify-icon {
  font-size: 0.88rem !important;
  line-height: 1 !important;
}

.row-verify-pill.verify-unconfirmed {
  background: #eff6ff !important;
  color: #0284c7 !important;
  border: 1.5px solid #93c5fd !important;
}

.row-verify-pill.verify-matched {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border: 1.5px solid #6ee7b7 !important;
}

.row-verify-pill.verify-diff {
  background: #fffbeb !important;
  color: #d97706 !important;
  border: 1.5px solid #fcd34d !important;
}

.btn-row-delete {
  background: transparent !important;
  border: none !important;
  color: #94a3b8 !important;
  font-size: 1.3rem !important;
  cursor: pointer !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
}

.btn-row-delete:hover {
  color: #ef4444 !important;
  background: #fee2e2 !important;
}

/* Tier 2: Stepper Action Tier (Full Width, Large Touch Targets) */
.employee-row-card .counted-cell {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
}

.box-strip-stepper {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  user-select: none !important;
}

.stepper-unit {
  flex: 1 1 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 3px 4px !important;
  gap: 4px !important;
  transition: all 0.15s ease !important;
  min-width: 0 !important;
}

.stepper-unit:hover {
  border-color: #94a3b8 !important;
}

.btn-step {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-size: 1.3rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.12s ease !important;
  padding: 0 !important;
  touch-action: manipulation !important;
}

.btn-step:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}

.btn-step:active {
  transform: scale(0.92) !important;
  background: #e2e8f0 !important;
}

.step-display {
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: baseline !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 2px 4px !important;
  cursor: pointer !important;
  border-radius: 6px !important;
  min-width: 0 !important;
  transition: background 0.12s ease !important;
}

.step-display:hover {
  background: rgba(37, 99, 235, 0.08) !important;
}

.step-num {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1 !important;
  font-variant-numeric: tabular-nums !important;
}

.step-lbl {
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  line-height: 1 !important;
  direction: rtl !important;
  unicode-bidi: isolate !important;
}

/* Confirmed Row Highlights */
.employee-row-card.row-marked-match {
  border-color: rgba(5, 150, 105, 0.5) !important;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%) !important;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.08) !important;
}

.employee-row-card.row-marked-match .expiry-pill {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #047857 !important;
}

.employee-row-card.row-marked-mismatch {
  border-color: rgba(217, 119, 6, 0.5) !important;
  background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%) !important;
}

.employee-row-card.row-marked-mismatch .expiry-pill {
  background: #fffbeb !important;
  border-color: #fde68a !important;
  color: #b45309 !important;
}

.employee-row-card.added-row {
  border-inline-start: 4px solid #0284c7 !important;
}

/* Extra Small Phones (max-width: 360px) */
@media (max-width: 360px) {
  .employee-row-card {
    padding: 10px 10px !important;
    gap: 8px !important;
  }

  .box-strip-stepper {
    gap: 4px !important;
  }

  .btn-step {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    font-size: 1.15rem !important;
  }

  .step-num {
    font-size: 1rem !important;
  }

  .step-lbl {
    font-size: 0.70rem !important;
  }

  .row-verify-pill {
    padding: 5px 10px !important;
    font-size: 0.74rem !important;
  }
}

/* Micro Actions */
.audit-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 2px;
}

.btn-sub-action {
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  padding: 5px 12px !important;
  min-height: 28px !important;
  border-radius: 9999px !important;
  color: var(--muted) !important;
  background: #f8fafc !important;
  border: 1px solid var(--line) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sub-action:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: var(--ink) !important;
}

/* Collapsible Notes */
.audit-notes-collapsible {
  margin: 6px 0 8px !important;
}

.audit-notes-collapsible textarea {
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: #f8fafc;
  color: var(--ink);
  resize: vertical;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.audit-notes-collapsible textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* 5. World-Class Action Buttons */
.employee-action-bar {
  display: flex !important;
  gap: 8px !important;
  margin-top: 10px !important;
}

.btn-save-draft {
  flex: 1 !important;
  min-height: 48px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  border-radius: var(--radius-md) !important;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: var(--ink-secondary) !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-save-draft:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: var(--ink) !important;
}

.btn-finish-product {
  flex: 2.2 !important;
  min-height: 48px !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  border-radius: var(--radius-md) !important;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 0.15s ease !important;
  cursor: pointer !important;
  letter-spacing: 0.01em;
}

.btn-finish-product:hover {
  background: linear-gradient(135deg, #13914d 0%, #047857 100%) !important;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45) !important;
  transform: translateY(-1px);
}

.btn-finish-product:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25) !important;
}

.btn-finish-product .finish-check {
  font-size: 1.15rem;
  font-weight: 900;
}

/* 5. Today's History Panel */
.audit-history-panel {
  padding: 12px 14px !important;
  border-radius: 16px !important;
}

.audit-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.audit-history-head h3 {
  margin: 0;
  font-size: 0.96rem;
  color: #1e293b;
}

.search-bar input {
  flex: 1 1 280px;
}

.autocomplete {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  max-height: 280px;
  overflow-y: auto;
  display: none;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 35, 60, 0.08);
}

.autocomplete.show {
  display: block;
}

.autocomplete li {
  padding: 12px 14px;
  border-bottom: 1px solid #edf2f7;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.autocomplete li:last-child {
  border-bottom: 0;
}

.autocomplete li:hover,
.autocomplete li.active {
  background: #eef5ff;
  color: var(--accent);
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  box-sizing: border-box;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

#stockResultsPanel {
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.result-table,
.audit-table {
  width: 100%;
  border-collapse: collapse;
}

.result-table {
  width: 100%;
  table-layout: auto;
}

.result-table th.col-name {
  text-align: left;
}

.result-table th.col-stock,
.result-table .stock-num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result-table th.col-exp,
.result-table .stock-exp-cell {
  text-align: center;
  white-space: nowrap;
}

.result-table th.col-price,
.result-table .stock-price-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result-table th.col-unit,
.result-table .stock-unit-cell {
  text-align: center;
  white-space: nowrap;
}

.stock-name-cell {
  text-align: left;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.stock-name-cell strong {
  display: block;
  line-height: 1.25;
  color: var(--ink);
}

.stock-arabic-sub {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.2;
}

.stock-table-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  margin-bottom: 8px;
  background: #f0f7ff;
  border: 1px solid #d0e4ff;
  border-radius: 8px;
  font-size: 0.78rem;
  color: #0f6cbd;
  text-align: center;
}

tr.stock-row-clickable {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(15, 108, 189, 0.12);
  user-select: none;
  transition: background-color 0.12s ease;
}

tr.stock-row-clickable:hover {
  background: #f1f6fd;
}

tr.stock-row-clickable:active {
  background: #e0edfe !important;
}

tr.total-row.stock-row-clickable:hover {
  background: #bbddff;
}

tr.total-row.stock-row-clickable:active {
  background: #a8d2fc !important;
}

.result-table th,
.result-table td,
.audit-table th,
.audit-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e7eef6;
  text-align: center;
}

.result-table th,
.audit-table th {
  background: #e9f2fd;
  color: var(--ink);
}

.result-table tr.total-row {
  background: #cfe7ff;
  font-weight: 700;
}

.audit-table tr.negative-row {
  background: var(--danger-soft);
}

.audit-table tr.added-row {
  background: #f7fbff;
}

.audit-table input[type="number"] {
  min-width: 96px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge.matched,
.badge.audited,
.badge.active {
  background: #e8f7ee;
  color: var(--success);
}

.badge.pending,
.badge.in_progress {
  background: #edf4ff;
  color: var(--accent);
}

.badge.quantity_variance,
.badge.expiry_mismatch,
.badge.needs_review,
.badge.unexpected_expiry,
.badge.anomaly {
  background: #fff3e0;
  color: var(--warn);
}

.badge.not_found,
.badge.variance {
  background: #fde7e7;
  color: var(--danger);
}

.session-meta,
.item-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.item-summary-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow: auto;
  padding-right: 4px;
}

.item-summary-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fbfdff;
  cursor: pointer;
}

.item-summary-card.active {
  border-color: var(--accent);
  background: #eef6ff;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.totals-strip {
  margin: 14px 0;
}

.totals-strip .panel-alt {
  flex: 1 1 160px;
  border-radius: 16px;
  padding: 14px;
  background: var(--panel-alt);
  border: 1px solid #d7e7fb;
}

.panel-alt strong {
  display: block;
  font-size: 1.3rem;
  margin-top: 6px;
}

.hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.audit-rows-progress {
  margin: 4px 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.divider {
  border: 0;
  border-top: 1px solid #e5edf7;
  margin: 18px 0;
}

.counted-disabled {
  opacity: 0.72;
  background: #f7fafc;
}

.compact-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.compact-metric span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.compact-metric strong {
  font-size: 1rem;
  color: var(--ink);
}

.expiry-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #c8d7e6;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.expiry-editor {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.expiry-picker-native {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  min-width: 1px;
  min-height: 1px;
  border: 0;
  padding: 0;
}

.row-marked-match {
  background: #ddf6e8;
}

.row-marked-mismatch {
  background: #ffe7c2;
}

.row-unconfirmed {
  background: #eef4ff;
}

.employee-page .employee-audit-table tr.added-row {
  border-left: 4px solid #6ea8de;
  background: linear-gradient(90deg, rgba(110, 168, 222, 0.12), rgba(110, 168, 222, 0.04));
}

.audit-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.audit-fact {
  border: 1px solid #d7e7fb;
  background: #f6faff;
  border-radius: 12px;
  padding: 10px 12px;
}

.audit-fact span {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.audit-fact strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

.audit-summary-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #edf4ff;
  color: var(--accent);
}

.audit-summary-chip.matched {
  background: #e8f7ee;
  color: var(--success);
}

.audit-summary-chip.quantity_variance,
.audit-summary-chip.expiry_mismatch {
  background: #fff3e0;
  color: var(--warn);
}

/* (Legacy employee audit styles removed in favor of modern audit layout) */

.employee-alert,
.employee-success-flash {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.employee-alert {
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 50, 71, 0.34);
}

.employee-alert-card {
  width: min(420px, 100%);
  border-radius: 20px;
  padding: 18px;
  background: #fff;
  border: 1px solid #f2c3c3;
  box-shadow: 0 24px 50px rgba(16, 42, 67, 0.22);
}

.employee-alert-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--danger);
}

.employee-alert-message {
  margin: 10px 0 14px;
  line-height: 1.45;
  color: var(--ink);
}

.employee-alert-card button {
  width: 100%;
}

.employee-success-flash {
  display: grid;
  place-items: center;
  background: rgba(24, 121, 78, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.employee-success-flash.show {
  opacity: 1;
}

.employee-success-check {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(24, 121, 78, 0.92);
  color: #fff;
  font-size: 2.8rem;
  font-weight: 800;
  box-shadow: 0 18px 40px rgba(24, 121, 78, 0.28);
}

.row-flash-add {
  animation: rowPulseAdd 0.85s ease;
}

.row-flash-merge {
  animation: rowPulseMerge 0.85s ease;
}

.panel-flash-open {
  animation: panelPulseOpen 0.52s ease;
}

@keyframes rowPulseAdd {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 108, 189, 0.35);
    transform: scale(0.995);
  }
  35% {
    box-shadow: 0 0 0 6px rgba(15, 108, 189, 0.18);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(15, 108, 189, 0);
    transform: scale(1);
  }
}

@keyframes rowPulseMerge {
  0% {
    box-shadow: 0 0 0 0 rgba(24, 121, 78, 0.36);
    transform: scale(0.995);
  }
  35% {
    box-shadow: 0 0 0 6px rgba(24, 121, 78, 0.18);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(24, 121, 78, 0);
    transform: scale(1);
  }
}

@keyframes panelPulseOpen {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 108, 189, 0);
  }
  35% {
    box-shadow: 0 0 0 6px rgba(15, 108, 189, 0.12);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(15, 108, 189, 0);
  }
}

.manager-detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.manager-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.manager-actions-inline .audit-actions {
  gap: 8px;
}

.manager-actions-inline button {
  padding: 10px 14px;
}

.manager-spotlight {
  margin-top: 12px;
  border: 1px solid #d9e3ef;
  border-radius: 14px;
  padding: 12px;
  background: #fbfdff;
}

.manager-spotlight-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  flex-wrap: wrap;
}

.manager-spotlight-head strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.manager-audit-table th {
  background: #dcecff;
}

.manager-highlight-row {
  box-shadow: inset 4px 0 0 var(--warn);
}

.manager-page .app-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 18px auto 36px;
}

.manager-page .panel {
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(16, 42, 67, 0.08);
}

.manager-page .panel + .panel {
  margin-top: 12px;
}

.manager-page .settings-grid,
.manager-page .mode-switch,
.manager-page .audit-actions {
  gap: 8px;
}

.manager-page .settings-grid {
  margin-top: 10px;
}

.manager-page .settings-grid .field {
  flex: 1 1 180px;
}

.manager-page label {
  font-size: 0.8rem;
}

.manager-page input[type="text"],
.manager-page select,
.manager-page textarea {
  padding: 10px 12px;
  border-radius: 10px;
}

.manager-page .mode-switch {
  margin: 8px 0 10px;
}

.manager-page .mode-switch button {
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
}

.coverage-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.coverage-stat {
  border: 1px solid #d7e7fb;
  background: #f6faff;
  border-radius: 12px;
  padding: 10px 12px;
}

.coverage-stat span {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.coverage-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}

.manager-page .grid.audit-grid {
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  align-items: start;
}

.manager-page h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.manager-page .item-summary-list {
  max-height: 65vh;
  gap: 8px;
}

.manager-page .item-summary-card {
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.manager-page .item-summary-card strong {
  font-size: 0.98rem;
}

.manager-page .item-meta {
  font-size: 0.84rem;
}

.manager-page .badge {
  padding: 3px 8px;
  font-size: 0.74rem;
}

.manager-page .status-line {
  margin-top: 8px;
  min-height: 18px;
  font-size: 0.84rem;
}

.manager-page .audit-table th,
.manager-page .audit-table td {
  padding: 9px 8px;
  font-size: 0.9rem;
}

@media (max-width: 920px) {
  .grid.audit-grid {
    grid-template-columns: 1fr;
  }

  .manager-detail-top {
    grid-template-columns: 1fr;
  }

  .audit-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .coverage-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .manager-page .grid.audit-grid {
    grid-template-columns: 1fr;
  }

  .manager-page .item-summary-list {
    max-height: 380px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-shell {
    width: min(100% - 20px, 1200px);
  }

  .hero,
  .panel {
    padding: 16px;
  }

  .employee-page .hero {
    padding: 16px 18px;
    border-radius: 18px;
  }

  .employee-page .hero h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  .employee-page .app-shell {
    width: min(100% - 16px, 980px);
    margin: 12px auto 28px;
  }

  .employee-page .panel {
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(16, 42, 67, 0.08);
  }

  .employee-page .mode-switch {
    position: sticky;
    top: 8px;
    z-index: 10;
    background: rgba(244, 247, 251, 0.9);
    backdrop-filter: blur(8px);
    padding: 6px 0;
    margin: 10px 0 12px;
  }

  .employee-page .mode-switch button {
    flex: 1 1 0;
    min-height: 44px;
  }

  .employee-page .audit-layout-shell {
    max-width: 100%;
  }

  /* ========================================================
     Mobile Audit Experience: High-Aesthetic & Single-Screen
     ======================================================== */
  .employee-page.audit-editing .mode-switch {
    display: none !important;
  }

  /* Keep Navigation Visible on Mobile */
  .employee-page.audit-editing .app-nav-switcher {
    display: inline-flex !important;
  }

  .employee-page.audit-editing .audit-layout-shell {
    gap: 10px !important;
  }

  /* Auditor Top Bar: Sleek and Complete */
  .employee-page.audit-editing .audit-compact-topbar {
    padding: 8px 12px !important;
    min-height: 42px !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  }

  .employee-page.audit-editing .audit-top-facts {
    display: inline-flex !important;
    gap: 6px !important;
  }

  .employee-page.audit-editing .audit-top-facts .stat-pill {
    padding: 3px 8px !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
  }

  .employee-page.audit-editing .btn-switch-auditor {
    display: inline-flex !important;
    min-height: 26px !important;
    padding: 3px 10px !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    border-radius: 999px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
  }

  .employee-page.audit-editing .audit-auditor-chip {
    padding: 0 !important;
    gap: 8px !important;
  }

  .employee-page.audit-editing .auditor-chip-icon {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.88rem !important;
    background: #eff6ff !important;
    color: #0284c7 !important;
    border-radius: 50% !important;
  }

  .employee-page.audit-editing .auditor-chip-name {
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
  }

  /* Scanner Capsule: Compact & Clean */
  .employee-page.audit-editing .audit-scanner-dock {
    padding: 4px 6px 4px 10px !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
    gap: 0 !important;
  }

  .employee-page.audit-editing .audit-manual-search-row,
  .employee-page.audit-editing #auditSessionStatus,
  .employee-page.audit-editing #manualSuggestions {
    display: none !important;
  }

  .employee-page.audit-editing .audit-scan-input-wrap {
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .employee-page.audit-editing .audit-scan-input-wrap .scan-input-icon {
    font-size: 0.95rem !important;
    color: #94a3b8 !important;
  }

  .employee-page.audit-editing .audit-scan-input-wrap input {
    font-size: 0.86rem !important;
    font-weight: 600 !important;
    padding: 5px 0 !important;
    color: #1e293b !important;
  }

  .employee-page.audit-editing .btn-scan-open {
    min-height: 30px !important;
    padding: 4px 12px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    background: #0f6cbd !important;
  }

  /* Active Product Card: Elevated, Clean, World-Class */
  .employee-page.audit-editing .audit-editor-panel {
    padding: 14px 14px 16px !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03) !important;
  }

  .employee-page.audit-editing #auditEditor {
    gap: 10px !important;
  }

  .employee-page.audit-editing .audit-product-card-head {
    padding-bottom: 8px !important;
    gap: 8px !important;
    border-bottom: 1px solid #f1f5f9 !important;
  }

  .employee-page.audit-editing .audit-product-name {
    margin: 0 !important;
  }

  .employee-page.audit-editing .audit-product-name-en {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em !important;
    line-height: 1.25 !important;
    text-transform: capitalize !important;
  }

  .employee-page.audit-editing .audit-product-name-ar {
    font-family: 'Cairo', system-ui, sans-serif !important;
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    color: #475569 !important;
    margin-top: 2px !important;
  }

  .employee-page.audit-editing .audit-product-meta-sub {
    font-size: 0.74rem !important;
    margin-top: 4px !important;
    gap: 6px !important;
  }

  .employee-page.audit-editing #auditBarcodeText {
    font-family: ui-monospace, SFMono-Regular, monospace !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    color: #475569 !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 2px 7px !important;
  }

  .employee-page.audit-editing .audit-updated-sub {
    display: none !important;
  }

  /* Status badge & Close button */
  .employee-page.audit-editing #auditProductStatusBadge {
    padding: 4px 9px !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
  }

  .employee-page.audit-editing .btn-cancel-product {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.85rem !important;
    border-radius: 50% !important;
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    color: #94a3b8 !important;
  }

  /* 3-Column Metrics Grid: Stat Tiles */
  .employee-page.audit-editing .audit-metrics-inline {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 8px !important;
    margin: 8px 0 10px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    align-items: stretch !important;
  }

  .employee-page.audit-editing .audit-metrics-inline .metric-chip {
    padding: 8px 6px !important;
    border-radius: 12px !important;
    min-height: 58px !important;
    height: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    text-align: center !important;
  }

  .employee-page.audit-editing .audit-metrics-inline .metric-chip .metric-lbl {
    font-size: 0.60rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #64748b !important;
    line-height: 1 !important;
  }

  .employee-page.audit-editing .audit-metrics-inline .metric-chip .metric-val {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1px !important;
  }

  .employee-page.audit-editing .audit-metrics-inline .metric-chip .metric-val strong {
    font-size: 1.12rem !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    line-height: 1.2 !important;
  }

  .employee-page.audit-editing .audit-metrics-inline .metric-chip #expectedUnitValue {
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
    line-height: 1 !important;
    max-width: 90px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .employee-page.audit-editing .audit-metrics-inline .metric-chip.metric-counted {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
  }

  .employee-page.audit-editing .audit-metrics-inline .metric-chip.metric-counted .metric-lbl {
    color: #0284c7 !important;
  }

  .employee-page.audit-editing .audit-metrics-inline .metric-chip.metric-counted .metric-val strong {
    color: #0f6cbd !important;
  }

  .employee-page.audit-editing .audit-metrics-inline .metric-progress {
    background: #fffbeb !important;
    border-color: #fde68a !important;
    color: #b45309 !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
  }

  .employee-page.audit-editing .audit-metrics-inline .metric-progress.all-confirmed {
    background: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
    color: #047857 !important;
  }

  /* Expiry Row Cards: Unified 2-Tier Architecture */

  /* Sub-Actions (+ Add Expiry & Note) */
  .employee-page.audit-editing .audit-sub-row {
    margin: 6px 0 !important;
    display: flex !important;
    gap: 8px !important;
  }

  .employee-page.audit-editing .btn-sub-action {
    flex: 1 !important;
    justify-content: center !important;
    min-height: 32px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
  }

  /* Action Buttons: Save Draft & Finish Product */
  .employee-page.audit-editing .employee-action-bar {
    position: static !important;
    margin-top: 8px !important;
    padding-top: 0 !important;
    background: none !important;
    display: flex !important;
    gap: 8px !important;
  }

  .employee-page.audit-editing #saveDraftButton {
    flex: 1 !important;
    width: auto !important;
    min-height: 46px !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #334155 !important;
  }

  .employee-page.audit-editing #finishProductButton {
    flex: 2 !important;
    width: auto !important;
    min-height: 46px !important;
    font-size: 0.98rem !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
  }

  .employee-page.audit-editing #auditItemStatus:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .employee-page.audit-editing #auditItemStatus {
    margin-top: 4px !important;
    font-size: 0.76rem !important;
    padding: 4px 8px !important;
    border-radius: 8px !important;
  }

  /* Keep Today's History Panel Gracefully Visible */
  .employee-page.audit-editing #auditHistoryPanel {
    display: block !important;
    margin-top: 8px !important;
    padding: 12px 14px !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  }

  .employee-page.audit-editing #auditHistoryPanel .item-summary-list {
    max-height: 240px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 6px !important;
  }

  .employee-page .audit-toolbar,
  .employee-page .audit-actions {
    display: flex;
    gap: 8px;
    align-items: stretch;
  }

  .employee-page #scanButton {
    grid-column: 1 / -1;
  }

  .employee-page #saveDraftButton,
  .employee-page #finishProductButton,
  .employee-page #openSessionButton,
  .employee-page #completeSessionButton {
    width: 100%;
  }

  .employee-page .item-summary-list {
    max-height: none;
  }

  .employee-page .item-summary-card {
    padding: 10px 12px;
    border-radius: 12px;
  }

  .employee-page .totals-strip {
    gap: 8px;
  }

  .employee-page .totals-strip .panel-alt {
    flex: 1 1 calc(50% - 8px);
    border-radius: 12px;
    padding: 10px 12px;
  }

  .employee-page .panel-alt strong {
    font-size: 1.05rem;
  }

  .employee-page .employee-action-bar {
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.95) 22%);
    padding-top: 10px;
    margin-top: 12px;
  }

  .employee-page .employee-audit-head {
    display: none;
  }

  .employee-page .employee-audit-body {
    gap: 8px;
  }
}

/* ========================================================
   Staff Directory Modal & Badges (Modern Polished UI)
   ======================================================== */
@keyframes staffModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes staffModalScaleIn {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.staff-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: staffModalFadeIn 0.18s ease-out;
}

.staff-modal-backdrop.hidden {
  display: none !important;
}

.staff-modal-card {
  width: min(680px, 100%);
  max-height: 86vh;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #d9e3ef;
  box-shadow: 0 24px 60px rgba(15, 35, 60, 0.22), 0 4px 14px rgba(15, 35, 60, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: staffModalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.staff-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #eef2f6;
  background: #ffffff;
  flex: 0 0 auto;
}

.staff-modal-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.staff-modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.staff-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #183247;
  letter-spacing: -0.01em;
}

.staff-count-badge {
  background: #eef5ff;
  color: #0f6cbd;
  border: 1px solid #cfe0f6;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.staff-modal-subtitle {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: #64748b;
  line-height: 1.35;
}

.staff-modal-close-btn {
  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  border-radius: 50% !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  padding: 0 !important;
  line-height: 1 !important;
  flex: 0 0 auto !important;
}

.staff-modal-close-btn:hover {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
  transform: scale(1.06);
}

.staff-add-bar {
  display: flex;
  gap: 10px;
  padding: 14px 24px;
  background: #f8fbff;
  border-bottom: 1px solid #eef2f6;
  align-items: center;
  flex: 0 0 auto;
}

.staff-input-wrapper {
  flex: 1;
  min-width: 0;
}

.staff-input-wrapper input {
  width: 100% !important;
  min-width: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 14px !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  font-size: 0.92rem !important;
  background: #ffffff !important;
  color: #183247 !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.staff-input-wrapper input:focus {
  border-color: #0f6cbd !important;
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.12) !important;
  outline: none !important;
}

.staff-add-btn {
  width: auto !important;
  min-width: auto !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 18px !important;
  background: #0f6cbd !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  border-radius: 10px !important;
  border: none !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  transition: background 0.15s, transform 0.1s !important;
}

.staff-add-btn:hover {
  background: #0a4f8a !important;
}

.staff-add-btn:active {
  transform: scale(0.98);
}

.staff-filter-bar {
  padding: 10px 24px 4px;
  background: #ffffff;
  flex: 0 0 auto;
}

.staff-search-input {
  width: 100% !important;
  min-width: 0 !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 12px 0 32px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 0.84rem !important;
  background: #f8fafc url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%2394a3b8" stroke-width="2.5" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>') no-repeat 10px center !important;
  color: #1e293b !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s, background-color 0.15s;
}

.staff-search-input:focus {
  background-color: #ffffff !important;
  border-color: #0f6cbd !important;
  outline: none !important;
}

.staff-status-bar {
  min-height: 20px;
  padding: 2px 24px;
  font-size: 0.82rem;
  font-weight: 500;
  flex: 0 0 auto;
}

.staff-status-bar.error {
  color: #b42318;
}

.staff-status-bar.success {
  color: #15803d;
}

.staff-table-wrap {
  flex: 1;
  overflow-y: auto;
  max-height: 390px;
  padding: 4px 24px 20px;
}

.staff-table-wrap::-webkit-scrollbar {
  width: 6px;
}

.staff-table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

.staff-table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.staff-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.staff-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.staff-table thead th {
  position: sticky;
  top: 0;
  background: #ffffff;
  padding: 10px 12px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 2px solid #eef2f6;
  z-index: 2;
}

.staff-table tbody tr {
  transition: background 0.12s ease;
}

.staff-table tbody tr:hover {
  background: #f8fafc;
}

.staff-table tbody tr + tr td {
  border-top: 1px solid #f1f5f9;
}

.staff-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

.staff-name-cell {
  font-weight: 600;
  font-size: 0.94rem;
  color: #0f172a;
}

.staff-name-cell span {
  display: inline-block;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Tahoma, sans-serif;
  letter-spacing: -0.01em;
}

.staff-empty-cell {
  text-align: center;
  padding: 24px 12px !important;
  color: #94a3b8;
  font-size: 0.88rem;
}

.staff-badge-pos {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  white-space: nowrap;
}

.staff-badge-manual {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  white-space: nowrap;
}

.staff-badge-active {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.staff-badge-active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.staff-badge-inactive {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.staff-badge-inactive::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
}

.btn-staff-action {
  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  border-radius: 7px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

.btn-staff-action.deactivate {
  background: #ffffff !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5 !important;
}

.btn-staff-action.deactivate:hover {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
}

.btn-staff-action.activate {
  background: #0f6cbd !important;
  color: #ffffff !important;
  border: 1px solid #0f6cbd !important;
}

.btn-staff-action.activate:hover {
  background: #0a4f8a !important;
  border-color: #0a4f8a !important;
}

/* ========================================================
   Modern Top Navbar & Application Brand
   ======================================================== */
.app-top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(15, 23, 42, 0.03);
  width: 100%;
}

.app-top-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.app-brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0f6cbd, #0284c7);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 2px 8px rgba(15, 108, 189, 0.28);
}

.app-brand-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.app-brand-name {
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.app-brand-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.app-nav-switcher {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}

.app-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 9px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  transition: all 0.15s ease;
  white-space: nowrap;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
}

.app-nav-tab:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

.app-nav-tab.active {
  color: #0f6cbd;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  font-weight: 700;
}

.app-nav-tab .nav-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-header-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  border-radius: 9px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap;
}

.btn-header-action:hover {
  background: #eef5ff !important;
  color: #0f6cbd !important;
  border-color: #93c5fd !important;
}

.btn-header-settings {
  width: 36px;
  height: 36px;
  padding: 0 !important;
  border-radius: 9px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 1.05rem !important;
  transition: all 0.15s ease !important;
}

.btn-header-settings:hover {
  background: #eef5ff !important;
  color: #0f6cbd !important;
  border-color: #93c5fd !important;
  transform: rotate(30deg);
}

/* ========================================================
   Clean Metrics & Toolbar Panels (Manager Page)
   ======================================================== */
.metrics-panel {
  padding: 10px 14px !important;
  margin-bottom: 12px;
  border-radius: 16px !important;
  background: #ffffff;
  border: 1px solid var(--line);
}

.coverage-toolbar-panel {
  padding: 12px 16px !important;
  margin-bottom: 16px;
  border-radius: 16px !important;
  background: #ffffff;
  border: 1px solid var(--line);
}

.coverage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.coverage-search-box {
  position: relative;
  flex: 1 1 auto;
  min-width: 260px;
  display: flex;
  align-items: center;
}

.coverage-search-box .search-icon {
  position: absolute;
  left: 14px;
  font-size: 0.95rem;
  color: var(--muted);
  pointer-events: none;
}

.coverage-search-box input {
  width: 100%;
  padding: 9px 14px 9px 38px !important;
  border-radius: 10px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #f8fafc !important;
  font-size: 0.9rem !important;
  transition: all 0.15s ease !important;
}

.coverage-search-box input:focus {
  background: #ffffff !important;
  border-color: #0f6cbd !important;
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.12) !important;
}

.coverage-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.control-group label {
  white-space: nowrap;
  font-size: 0.8rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.control-group select {
  padding: 8px 12px !important;
  border-radius: 10px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #f8fafc !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  cursor: pointer;
}

.btn-toolbar-refresh {
  padding: 8px 16px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  cursor: pointer;
  white-space: nowrap;
}

.coverage-auditor-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  vertical-align: middle;
}

.coverage-auditor-tag.manager {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.coverage-auditor-tag.staff {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}

/* ========================================================
   Interactive Coverage Metric Tabs
   ======================================================== */
.coverage-metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.metric-tab {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}

.metric-tab:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.metric-tab.active {
  background: #ffffff;
  border-color: #0f6cbd;
  box-shadow: 0 6px 18px rgba(15, 108, 189, 0.12), 0 0 0 2px rgba(15, 108, 189, 0.1);
}

.metric-tab-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.metric-dot.attention { background: #f59e0b; }
.metric-dot.never { background: #ef4444; }
.metric-dot.stale { background: #f97316; }
.metric-dot.covered { background: #10b981; }
.metric-dot.missing { background: #dc2626; }
.metric-dot.review { background: #8b5cf6; }
.metric-dot.all { background: #64748b; }

.metric-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-tab.active .metric-label {
  color: #0f6cbd;
}

.metric-count {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.metric-tab.active .metric-count {
  color: #0f6cbd;
}

/* Coverage Card & Header Elements */
.panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.panel-head-row h2 {
  margin: 0;
}

.btn-back-to-list {
  display: none;
}

.coverage-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.coverage-card-title-col {
  flex: 1;
  min-width: 0;
}

.coverage-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.coverage-card-ar {
  font-family: 'Cairo', system-ui, sans-serif;
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.25;
}

.coverage-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.78rem;
  color: #64748b;
}

.coverage-stock-pill {
  font-weight: 700;
  color: #1e293b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.coverage-check-time {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
}

/* Mobile Filter Trigger Bar (Hidden on Desktop) */
.mobile-filter-trigger {
  display: none;
}

/* Coverage Filter Modal Popup */
.filter-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: staffModalFadeIn 0.18s ease-out;
}

@media (min-width: 600px) {
  .filter-modal-backdrop {
    align-items: center;
    padding: 20px;
  }
}

.filter-modal-backdrop.hidden {
  display: none !important;
}

.filter-modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  border: 1px solid #e2e8f0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: staffModalScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 600px) {
  .filter-modal-card {
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  }
}

.filter-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
}

.filter-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.filter-modal-sub {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: #64748b;
}

.filter-modal-list {
  padding: 12px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: calc(85vh - 70px);
}

.filter-modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.filter-modal-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.filter-modal-item.active {
  background: #eff6ff;
  border-color: #0f6cbd;
  box-shadow: 0 2px 6px rgba(15, 108, 189, 0.1);
}

.filter-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.filter-item-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
}

.filter-modal-item.active .filter-item-label {
  color: #0f6cbd;
}

.filter-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.filter-item-count {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  background: #ffffff;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.filter-modal-item.active .filter-item-count {
  background: #0f6cbd;
  color: #ffffff;
  border-color: #0f6cbd;
}

.filter-item-check {
  font-size: 0.95rem;
  font-weight: 900;
  color: #0f6cbd;
  opacity: 0;
  width: 16px;
  text-align: center;
  transition: opacity 0.15s;
}

.filter-modal-item.active .filter-item-check {
  opacity: 1;
}

/* ========================================================
   Mobile Layout Refinements (Phones & Small Tablets)
   ======================================================== */
@media (max-width: 768px) {
  .app-top-header-inner {
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .app-nav-switcher {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .app-nav-tab {
    flex: 1;
    justify-content: center;
    padding: 7px 8px;
    font-size: 0.8rem;
  }

  /* Metrics Panel: Pop-up Trigger on Mobile */
  .metrics-panel {
    padding: 6px 10px !important;
    margin-bottom: 10px;
    border-radius: 14px !important;
  }
  .coverage-metrics-strip {
    display: none !important;
  }

  .mobile-filter-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }

  .mobile-filter-trigger:hover,
  .mobile-filter-trigger:active {
    border-color: #0f6cbd;
    background: #f8fafc;
  }

  .mobile-filter-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .mobile-filter-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
  }

  .mobile-filter-sub {
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .mobile-filter-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-filter-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .mobile-filter-count-badge {
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f6cbd;
    background: #eff6ff;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    letter-spacing: 0.01em;
  }

  .mobile-filter-arrow {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: bold;
  }

  /* Coverage Search & Filter Panel: Eliminate Dead Space & Squeezing */
  .coverage-toolbar-panel {
    padding: 12px 14px !important;
    margin-bottom: 12px;
    border-radius: 14px !important;
  }
  .coverage-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .coverage-search-box {
    flex: none;
    width: 100%;
    min-width: 0;
  }
  .coverage-search-box input {
    height: 42px;
    font-size: 0.88rem !important;
    padding: 8px 14px 8px 36px !important;
  }
  .coverage-toolbar-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 8px;
    width: 100%;
    align-items: end;
  }
  .control-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    min-width: 0;
  }
  .control-group label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .control-group select {
    width: 100%;
    height: 38px;
    padding: 6px 8px !important;
    font-size: 0.82rem !important;
    border-radius: 8px !important;
    border: 1.5px solid #e2e8f0 !important;
    background: #f8fafc !important;
    color: #1e293b !important;
    box-sizing: border-box;
    text-overflow: ellipsis;
  }
  .btn-toolbar-refresh {
    height: 38px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    padding: 0 10px !important;
    border-radius: 8px !important;
    box-sizing: border-box;
  }

  /* Back to list button on mobile */
  .btn-back-to-list {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    padding: 5px 12px !important;
    border-radius: 8px !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f6cbd !important;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .btn-back-to-list:hover {
    background: #e0f2fe !important;
    border-color: #93c5fd !important;
  }

  /* Manager Detail Action Buttons */
  .manager-detail-top {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .manager-actions-inline .audit-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }
  .manager-actions-inline .audit-actions button {
    height: 42px;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ========================================================
   Manual Expiry Row Delete Button
   ======================================================== */
.btn-row-delete {
  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  margin-left: 6px !important;
  border-radius: 10px !important;
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  color: #dc2626 !important;
  font-size: 1rem !important;
  font-weight: bold !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  flex: 0 0 auto !important;
}

.btn-row-delete:hover {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
  transform: scale(1.06);
}

/* ========================================================
   Stock Table Action Cell & Bilingual Names
   ======================================================== */
.stock-name-cell {
  text-align: left !important;
}

.stock-arabic-sub {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 2px;
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

.stock-action-cell {
  text-align: center !important;
  white-space: nowrap;
}

.btn-table-audit {
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  background: #eef5ff !important;
  color: #0f6cbd !important;
  border: 1px solid #cfe0f6 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.btn-table-audit:hover {
  background: #0f6cbd !important;
  color: #ffffff !important;
  border-color: #0f6cbd !important;
}

/* Product Action Modal & Buttons */
.product-action-card {
  width: min(440px, 100%);
}

.product-action-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}

.badge.neutral {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.product-action-body {
  padding: 14px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-action-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 2px;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-action-divider::before,
.product-action-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.product-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.product-action-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.product-action-btn:active {
  background: #e2e8f0;
  transform: translateY(0);
}

.product-action-btn.primary-action {
  background: linear-gradient(135deg, #0f6cbd 0%, #095292 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(15, 108, 189, 0.25);
}

.product-action-btn.primary-action:hover {
  background: linear-gradient(135deg, #1279d4 0%, #0b5aa3 100%);
  box-shadow: 0 6px 18px rgba(15, 108, 189, 0.35);
}

.product-action-btn.primary-action:active {
  background: #095292;
}

.product-action-btn .action-icon {
  font-size: 1.35rem;
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-action-btn .action-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.product-action-btn .action-text strong {
  font-size: 0.92rem;
  line-height: 1.25;
}

.product-action-btn .action-text span {
  font-size: 0.78rem;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-action-btn.primary-action .action-text span {
  color: rgba(255, 255, 255, 0.88);
}

.suggestion-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.suggestion-english {
  font-weight: 600;
  color: #1e293b;
}

.suggestion-arabic {
  font-size: 0.84rem;
  color: #64748b;
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

/* ========================================================
   Toast Notification System
   ======================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  pointer-events: none;
}

.app-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.14), 0 8px 10px -6px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.app-toast.toast-showing {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-toast.toast-hiding {
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: all 0.18s ease-in;
}

.app-toast.toast-success {
  border-left: 4px solid #10b981;
}

.app-toast.toast-error {
  border-left: 4px solid #ef4444;
}

.app-toast.toast-info {
  border-left: 4px solid #0f6cbd;
}

.toast-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.35;
}

.toast-close {
  background: transparent !important;
  border: none !important;
  color: #94a3b8 !important;
  font-size: 1.2rem !important;
  line-height: 1 !important;
  padding: 0 4px !important;
  cursor: pointer !important;
  margin-left: 4px !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  transform: none !important;
}

.toast-close:hover {
  color: #334155 !important;
  background: #f1f5f9 !important;
}

@media (max-width: 600px) {
  .app-shell {
    width: calc(100% - 16px);
    margin: 12px auto 32px;
  }
  .panel {
    padding: 14px 12px;
    border-radius: 16px;
  }
  #stockResultsPanel {
    padding: 10px 8px;
    border-radius: 14px;
  }
  .result-table th,
  .result-table td {
    padding: 7px 4px;
    font-size: 0.78rem;
  }
  .stock-name-cell {
    min-width: 0;
    max-width: none;
    font-size: 0.78rem;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .stock-arabic-sub {
    font-size: 0.7rem;
  }
  .stock-table-hint {
    font-size: 0.74rem;
    padding: 5px 8px;
  }
  .product-action-body {
    padding: 12px 16px 16px;
    gap: 8px;
  }
  .product-action-btn {
    padding: 9px 12px;
  }
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}
