/* ==========================================================================
   CENTRAL SHOP MANAGEMENT SYSTEM - EYE-COMFORT ULTRA-MODERN ARABIC RTL DESIGN
   Pure CSS3 | Calm & Modern Color Schemes | Highly Organized Modular Layout
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Tajawal:wght@400;500;700;800;900&display=swap');

:root,
[data-theme="comfort"],
[data-theme="light"] {
  /* Eye-Comfort Modern Slate & Indigo Palette */
  --bg-main: #f1f5f9;
  --bg-mesh:
    radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(13, 148, 136, 0.08) 0px, transparent 50%),
    #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-elevated: #f8fafc;
  --bg-input: #ffffff;

  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-active-bg: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);

  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: rgba(79, 70, 229, 0.08);

  --emerald: #059669;
  --emerald-hover: #047857;
  --emerald-soft: rgba(5, 150, 105, 0.08);

  --accent-teal: #0d9488;
  --accent-blue: #0284c7;
  --accent-blue-soft: rgba(2, 132, 199, 0.08);

  --accent-purple: #7c3aed;
  --accent-purple-soft: rgba(124, 58, 237, 0.08);

  --accent-amber: #d97706;
  --accent-amber-soft: rgba(217, 119, 6, 0.08);

  --accent-rose: #e11d48;
  --accent-rose-soft: rgba(225, 29, 72, 0.08);

  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 25px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px -8px rgba(15, 23, 42, 0.12);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --sidebar-width: 275px;
}

/* Theme 2: Emerald Fresh (مظهر أخضر منعش ومريح) */
[data-theme="emerald"] {
  --bg-main: #f0fdf4;
  --bg-mesh:
    radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.09) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(14, 165, 233, 0.08) 0px, transparent 50%),
    #f0fdf4;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f7fee7;
  --bg-elevated: #f4fbf7;
  --bg-input: #ffffff;
  --sidebar-bg: #064e3b;
  --sidebar-text: #a7f3d0;
  --sidebar-active-bg: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --primary: #059669;
  --primary-hover: #047857;
  --primary-soft: rgba(5, 150, 105, 0.1);
  --border-color: #d1fae5;
  --border-strong: #a7f3d0;
}

/* Theme 3: Midnight Dark (وضع ليلي هادئ وفاخر) */
[data-theme="dark"] {
  --bg-main: #0b1120;
  --bg-mesh:
    radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%),
    #0b1120;
  --bg-secondary: #111827;
  --bg-card: #172033;
  --bg-card-hover: #1e293b;
  --bg-elevated: #1e293b;
  --bg-input: #0f172a;
  --sidebar-bg: #090e1a;
  --sidebar-text: #94a3b8;
  --sidebar-active-bg: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --border-color: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.25);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-soft: rgba(99, 102, 241, 0.18);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  direction: rtl;
  text-align: right;
  font-family: 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
  background: var(--bg-mesh);
  background-attachment: fixed;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.num-val {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   APP SHELL & SIDEBAR NAVIGATION
   ========================================================================= */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-header img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
}

.sidebar-brand-title {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
}

.sidebar-brand-sub {
  font-size: 0.75rem;
  color: #38bdf8;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
  padding: 14px 12px 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: right;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(-3px);
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.nav-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--sidebar-active-bg);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-meta-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta-role {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-right: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 72px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-xs);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 1.15rem;
  cursor: pointer;
}

.page-title-heading {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.global-search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 8px 18px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 280px;
  transition: all 0.2s;
}

.global-search-trigger:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.global-search-kbd {
  margin-right: auto;
  font-size: 0.7rem;
  background: var(--bg-card);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-switcher-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
}

.theme-dot-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.18s;
}

.theme-dot-btn:hover {
  transform: scale(1.18);
}

.icon-btn {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.18s;
}

.icon-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

.notif-count-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  background: var(--accent-rose);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.content-container {
  padding: 24px;
  max-width: 1520px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   ORGANIZED SECTION HEADERS & SECTION TABS (تنظيم الأقسام واستقلاليتها)
   ========================================================================== */

.section-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-header-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: var(--shadow-xs);
}

.section-header-info h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header-info p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.section-tabs-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 8px;
}

.section-tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-xs);
}

.section-tab-btn:hover {
  background: var(--bg-elevated);
  color: var(--primary);
  border-color: var(--border-color);
}

.section-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* ==========================================================================
   CARDS, PANELS & KPI METRICS
   ========================================================================== */

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.18s;
}

.panel-card:hover {
  border-color: var(--border-strong);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.kpi-icon.emerald { background: var(--emerald-soft); color: var(--emerald); }
.kpi-icon.blue { background: var(--accent-blue-soft); color: var(--accent-blue); }
.kpi-icon.purple { background: var(--accent-purple-soft); color: var(--accent-purple); }
.kpi-icon.amber { background: var(--accent-amber-soft); color: var(--accent-amber); }
.kpi-icon.rose { background: var(--accent-rose-soft); color: var(--accent-rose); }

.kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* ==========================================================================
   PROFIT CALCULATION CARDS & LIVE SUMMARY (حساب الأرباح التلقائي)
   ========================================================================== */

.profit-live-card {
  background: var(--emerald-soft);
  border: 1.5px solid var(--emerald);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profit-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
}

.profit-highlight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1.5px dashed rgba(5, 150, 105, 0.3);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--emerald);
}

.profit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

/* ==========================================================================
   CASH CALCULATOR & WALLETS (معايا كام - المبلغ - عمولة الكاش - أضيف عليه كام)
   ========================================================================== */

.cash-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.calc-box {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.calc-box:focus-within {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.calc-box.highlight-emerald {
  border-color: rgba(5, 150, 105, 0.35);
  background: var(--emerald-soft);
}

.calc-box.highlight-amber {
  border-color: rgba(217, 119, 6, 0.35);
  background: var(--accent-amber-soft);
}

.calc-box.highlight-rose {
  border-color: rgba(225, 29, 72, 0.35);
  background: var(--accent-rose-soft);
}

.calc-box-label {
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
}

.calc-box-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.auto-badge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
}

/* ==========================================================================
   FORMS, CONTROLS, BUTTONS & TABLES
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.94rem;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-control.large-amount {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  letter-spacing: 0.01em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-emerald {
  background: var(--emerald);
  color: #ffffff;
}
.btn-emerald:hover:not(:disabled) {
  background: var(--emerald-hover);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-danger {
  background: var(--accent-rose-soft);
  color: var(--accent-rose);
  border-color: rgba(225, 29, 72, 0.25);
}
.btn-danger:hover:not(:disabled) {
  background: var(--accent-rose);
  color: #ffffff;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: 8px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}

.data-table th {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 12px 14px;
  border-bottom: 1.5px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-send { background: var(--accent-rose-soft); color: var(--accent-rose); }
.badge-receive { background: var(--emerald-soft); color: var(--emerald); }
.badge-adjustment { background: var(--accent-amber-soft); color: var(--accent-amber); }
.badge-blue { background: var(--accent-blue-soft); color: var(--accent-blue); }

.tx-preview-box {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tx-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-color);
}

.tx-preview-row.highlight {
  background: var(--primary-soft);
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--primary);
}

/* Modals & Toasts */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 660px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.modal-box.wide {
  max-width: 920px;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-item {
  background: var(--bg-card);
  border-right: 5px solid var(--emerald);
  color: var(--text-primary);
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  min-width: 290px;
  max-width: 420px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toast-item.error {
  border-right-color: var(--accent-rose);
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-mesh);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 34px 30px;
  box-shadow: var(--shadow-md);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.auth-brand img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.auth-brand h1 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}

.auth-brand p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-right: 0;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .global-search-trigger {
    min-width: auto;
  }
}

@media (max-width: 640px) {
  .content-container {
    padding: 14px;
  }
  .topbar {
    padding: 0 14px;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpi-value {
    font-size: 1.3rem;
  }
}

@media print {
  .sidebar, .topbar, .section-tabs-bar, .no-print, .toast-container {
    display: none !important;
  }
  .main-wrapper {
    margin-right: 0 !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
}
