/* ==========================================================================
   Makhzan Smart Call - Modern SaaS Design System (RTL Native)
   Clean, Elegant, Responsive, Professional Multi-Tenant Inventory
   ========================================================================== */

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

:root {
  /* Color Palette */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;

  /* Neutrals & Surfaces */
  --bg-app: #0b1120;
  --bg-card: #1e293b;
  --bg-card-hover: #24344d;
  --bg-surface: #131d31;
  --bg-input: #0b1120;
  --border-color: #334155;
  --border-light: rgba(255, 255, 255, 0.08);

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-white: #ffffff;

  /* Status Colors */
  --status-normal: #10b981;
  --status-normal-bg: rgba(16, 185, 129, 0.15);
  --status-normal-border: rgba(16, 185, 129, 0.3);

  --status-low: #f59e0b;
  --status-low-bg: rgba(245, 158, 11, 0.15);
  --status-low-border: rgba(245, 158, 11, 0.3);

  --status-critical: #ef4444;
  --status-critical-bg: rgba(239, 68, 68, 0.15);
  --status-critical-border: rgba(239, 68, 68, 0.3);

  --status-out: #475569;
  --status-out-bg: rgba(71, 85, 105, 0.25);
  --status-out-border: rgba(71, 85, 105, 0.5);

  --status-info: #06b6d4;
  --status-info-bg: rgba(6, 182, 212, 0.15);
  --status-info-border: rgba(6, 182, 212, 0.3);

  /* Elevation & Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);

  /* Spacing & Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --sidebar-width: 270px;
  --topbar-height: 70px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-500);
}

/* Layout Elements */
#app {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.main-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 40;
  transition: transform var(--transition-normal);
}

.main-content {
  flex: 1;
  margin-right: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-app);
  transition: margin-right var(--transition-normal);
}

.topbar {
  height: var(--topbar-height);
  background: rgba(19, 29, 49, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.page-container {
  flex: 1;
  padding: 1.75rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Typography & Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { color: var(--text-muted); }

/* Unified Brand & Logo Rules */
.app-logo {
  object-fit: contain;
  display: block;
  transition: transform var(--transition-fast);
}

.brand-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: 0;
  line-height: 1.2;
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--primary-300);
}

/* Auth Cards & Brand Elements */
.auth-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0b1120 100%);
  padding: 1.5rem;
}

.auth-card {
  max-width: 460px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.auth-logo-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-logo-img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  margin: 0 auto 0.75rem;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.35));
}

.auth-brand-name {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: 0;
}

.auth-brand-subtitle {
  font-size: 0.85rem;
  color: var(--primary-300);
  margin-top: 0.15rem;
}

/* Auth Tabs / Toggle */
.auth-tabs {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.3rem;
  margin-bottom: 1.5rem;
  gap: 0.3rem;
}

.auth-tab-btn {
  flex: 1;
  padding: 0.6rem 0.8rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.auth-tab-btn.active {
  background: var(--primary-600);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* Password Input with Eye Icon */
.password-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-group .form-control {
  padding-left: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  left: 0.75rem;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle-btn:hover {
  color: var(--text-main);
}

/* Password Strength Indicator */
.password-strength-meter {
  margin-top: 0.4rem;
}

.strength-bar-bg {
  height: 4px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.strength-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-text {
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

/* Lockout Banner */
.lockout-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Navigation List */
.nav-list {
  list-style: none;
  padding: 1rem 0.75rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
}

.nav-item a:hover {
  background-color: var(--bg-card);
  color: var(--text-white);
}

.nav-item.active a {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.05));
  color: var(--primary-400);
  border-right: 3px solid var(--primary-500);
  font-weight: 700;
}

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

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: rgba(11, 17, 32, 0.6);
}

/* User Pill in Sidebar */
.user-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  overflow: hidden;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 0.7rem;
  color: var(--primary-400);
  background: rgba(99, 102, 241, 0.15);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.company-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--primary-300);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-white);
  border-color: var(--text-dim);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
  background: #ef4444;
  color: white;
}

.btn-success {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
  background: #10b981;
  color: white;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

/* Cards & Surface Containers */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Grid System */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--stat-accent, var(--primary-500));
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-white);
  font-family: 'JetBrains Mono', 'Cairo', monospace;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--stat-icon-bg, rgba(99, 102, 241, 0.15));
  color: var(--stat-icon-color, var(--primary-400));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

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

.data-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  user-select: none;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

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

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
}

.badge-normal {
  background: var(--status-normal-bg);
  color: #34d399;
  border-color: var(--status-normal-border);
}
.badge-normal .badge-dot { background: #34d399; }

.badge-low {
  background: var(--status-low-bg);
  color: #fbbf24;
  border-color: var(--status-low-border);
}
.badge-low .badge-dot { background: #fbbf24; }

.badge-critical {
  background: var(--status-critical-bg);
  color: #f87171;
  border-color: var(--status-critical-border);
}
.badge-critical .badge-dot { background: #f87171; }

.badge-out {
  background: var(--status-out-bg);
  color: #94a3b8;
  border-color: var(--status-out-border);
}
.badge-out .badge-dot { background: #94a3b8; }

.badge-primary {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-300);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Forms & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.15rem;
}

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

.form-label .required {
  color: #ef4444;
  margin-right: 0.25rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control::placeholder {
  color: var(--text-dim);
}

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

/* Select dropdown options - fix visibility in dark theme */
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: left 0.75rem center;
  background-size: 1rem;
  padding-left: 2.5rem !important;
}

select.form-control option {
  background-color: var(--bg-card);
  color: var(--text-main);
  padding: 0.5rem;
}

select.form-control option:checked {
  background-color: var(--primary-600);
  color: white;
}

select.form-control option:hover {
  background-color: var(--bg-card-hover);
}

/* ==========================================================================
   Modern Date Inputs (شكل حديث لحقل ومنتقي التاريخ)
   ========================================================================== */
input[type="date"].form-control,
input[type="datetime-local"].form-control {
  /* Tells the browser to render its native calendar POPUP in dark mode,
     so it matches the app's theme instead of a plain white box. */
  color-scheme: dark;
  font-family: 'JetBrains Mono', 'Cairo', monospace;
  letter-spacing: 0.3px;
  padding-left: 0.6rem;
  cursor: pointer;
  position: relative;
}

input[type="date"].form-control:hover,
input[type="datetime-local"].form-control:hover {
  border-color: rgba(99, 102, 241, 0.55);
}

/* The little calendar icon inside the field (Chromium-based browsers) */
input[type="date"].form-control::-webkit-calendar-picker-indicator,
input[type="datetime-local"].form-control::-webkit-calendar-picker-indicator {
  filter: invert(46%) sepia(60%) saturate(1000%) hue-rotate(215deg) brightness(1.05);
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  transition: background-color 0.15s ease, transform 0.15s ease;
  margin-inline-start: 0.4rem;
}

input[type="date"].form-control::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"].form-control::-webkit-calendar-picker-indicator:hover {
  background-color: rgba(99, 102, 241, 0.18);
  transform: scale(1.08);
}

input[type="date"].form-control::-webkit-datetime-edit,
input[type="datetime-local"].form-control::-webkit-datetime-edit {
  color: var(--text-main);
}

input[type="date"].form-control::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

input[type="date"].form-control::-webkit-datetime-edit-text,
input[type="date"].form-control::-webkit-datetime-edit-month-field,
input[type="date"].form-control::-webkit-datetime-edit-day-field,
input[type="date"].form-control::-webkit-datetime-edit-year-field {
  color: var(--text-main);
  padding: 0 1px;
}

input[type="date"].form-control::-webkit-datetime-edit-month-field:focus,
input[type="date"].form-control::-webkit-datetime-edit-day-field:focus,
input[type="date"].form-control::-webkit-datetime-edit-year-field:focus {
  background-color: rgba(99, 102, 241, 0.3);
  color: #fff;
  border-radius: 3px;
  outline: none;
}

/* Firefox fallback: no reliable pseudo-elements for date parts, but the
   dark color-scheme + accent-color still modernize its native picker. */
input[type="date"].form-control,
input[type="datetime-local"].form-control {
  accent-color: var(--primary-500);
}

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

.form-help {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Search & Filters Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 250px;
  max-width: 450px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 32, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(15px);
  transition: transform var(--transition-normal);
}

.modal-backdrop.active .modal-dialog {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-white);
}

.modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  line-height: 1;
  z-index: 10;
}

.modal-close:hover {
  color: #ffffff;
  background: #ef4444;
  border-color: #ef4444;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-surface);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.25s ease forwards;
  color: var(--text-main);
  font-size: 0.9rem;
}

.toast-success { border-right: 4px solid var(--status-normal); }
.toast-error { border-right: 4px solid var(--status-critical); }
.toast-warning { border-right: 4px solid var(--status-low); }
.toast-info { border-right: 4px solid var(--status-info); }

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive Mobile Navigation */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.4rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-right: 0;
  }
  .mobile-menu-btn {
    display: block;
  }
  .page-container {
    padding: 1rem;
  }
  .grid-stats {
    grid-template-columns: 1fr;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-input-wrapper {
    max-width: none;
  }
}

/* ==========================================================================
   Enterprise WMS Additions: Thermal Print, Barcode, Quick Actions, Valuation
   ========================================================================== */

/* Quick Stock Preset Chips */
.quick-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}
.quick-chip:hover {
  background: var(--primary-600);
  border-color: var(--primary-500);
  color: #fff;
}
.quick-chip.active {
  background: var(--primary-600);
  border-color: var(--primary-400);
  color: #fff;
}

/* Live Stock Progress Bar */
.stock-bar-container {
  height: 8px;
  width: 100%;
  background: var(--bg-app);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.stock-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* Barcode Label Card */
.barcode-sticker {
  background: #ffffff;
  color: #000000;
  padding: 12px;
  border-radius: 6px;
  text-align: center;
  width: 220px;
  margin: 0 auto;
  border: 1px dashed #ccc;
  font-family: 'Cairo', monospace, sans-serif;
}
.barcode-sticker .barcode-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.barcode-sticker .barcode-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: #111;
  margin-top: 4px;
}
.barcode-lines {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 48px;
  margin: 6px 0;
  background: repeating-linear-gradient(90deg, #000 0px, #000 2px, #fff 2px, #fff 4px, #000 4px, #000 5px, #fff 5px, #fff 8px);
  width: 100%;
}

/* Printable Slip & Thermal Layouts */
#print-target {
  display: none !important;
}

@media print {
  body > *:not(#print-target) {
    display: none !important;
  }
  #print-target {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #fff !important;
    color: #000 !important;
    padding: 20px;
    z-index: 9999999;
  }
  #print-target, #print-target * {
    visibility: visible !important;
  }
}

/* ==========================================================================
   Searchable Combobox / Select Component (البحث أو الاختيار التفاعلي)
   ========================================================================== */
.searchable-combobox-wrap {
  position: relative;
  width: 100%;
}

.searchable-combobox-input-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.searchable-combobox-icon {
  position: absolute;
  right: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
  pointer-events: none;
  z-index: 2;
}

.searchable-combobox-input {
  width: 100%;
  padding: 0.65rem 2.4rem 0.65rem 3.2rem !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-white) !important;
  font-size: 0.9rem !important;
  font-family: inherit !important;
  transition: all var(--transition-fast) !important;
  cursor: text;
}

.searchable-combobox-input:focus {
  border-color: var(--primary-500) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
  outline: none;
}

.searchable-combobox-controls {
  position: absolute;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

.searchable-combobox-clear {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 7px;
  font-size: 0.85rem;
  border-radius: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  user-select: none;
  line-height: 1;
}

.searchable-combobox-clear:hover {
  color: #ffffff;
  background: #ef4444;
  border-color: #ef4444;
}

#prod-search-clear:hover {
  color: #ffffff !important;
  background: #ef4444 !important;
  border-color: #ef4444 !important;
}

.searchable-combobox-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.95rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, color 0.15s;
}

.searchable-combobox-wrap.is-open .searchable-combobox-toggle {
  transform: rotate(180deg);
  color: var(--primary-400);
}

.searchable-combobox-dropdown {
  /* Default (non-portal) fallback positioning. When the dropdown is
     attached to <body> as a portal (see bundle.js), its position, top,
     left, width and max-height are set inline by JS and override these. */
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #0f172a;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.65), 0 8px 20px rgba(0, 0, 0, 0.45);
  max-height: 220px;
  overflow-y: auto;
  z-index: 99999;
  padding: 6px;
}

.searchable-combobox-dropdown-portal {
  /* Bigger, floating "window" feel for the portal-attached dropdown */
  padding: 8px;
}

.searchable-combobox-dropdown-portal .searchable-combobox-item {
  padding: 11px 14px;
  font-size: 0.92rem;
}

.searchable-combobox-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.searchable-combobox-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.searchable-combobox-item:hover,
.searchable-combobox-item.focused {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
}

.searchable-combobox-item.selected {
  background: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  font-weight: 700;
}

.searchable-combobox-item .combobox-check {
  color: var(--primary-400);
  font-weight: 900;
}

.searchable-combobox-empty {
  padding: 14px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.combobox-highlight {
  background: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 700;
}

/* ==========================================================================
   Premium 3D Visual Layer - 2026 SaaS Grade
   Visual-only overrides: preserves existing IDs, classes, markup, routing, and data logic.
   ========================================================================== */

:root {
  --motion-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --motion-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --glass-fill: linear-gradient(145deg, rgba(21, 31, 55, 0.84), rgba(11, 17, 32, 0.66));
  --glass-fill-strong: linear-gradient(145deg, rgba(30, 41, 72, 0.92), rgba(12, 18, 34, 0.78));
  --glass-line: rgba(255, 255, 255, 0.11);
  --glass-line-strong: rgba(255, 255, 255, 0.18);
  --rim-light: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(15, 23, 42, 0.7);
  --shadow-ambient: 0 22px 70px rgba(0, 0, 0, 0.46);
  --shadow-float: 0 18px 45px rgba(0, 0, 0, 0.36), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  --shadow-purple: 0 18px 55px rgba(99, 102, 241, 0.22);
  --shadow-cyan: 0 18px 55px rgba(6, 182, 212, 0.18);
  --shadow-green: 0 18px 55px rgba(16, 185, 129, 0.18);
  --shadow-amber: 0 18px 55px rgba(245, 158, 11, 0.18);
  --shadow-red: 0 18px 55px rgba(239, 68, 68, 0.18);
  --gradient-brand: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #06b6d4 100%);
  --gradient-success: linear-gradient(135deg, #34d399 0%, #10b981 55%, #0f766e 100%);
  --gradient-warning: linear-gradient(135deg, #fbbf24 0%, #f59e0b 55%, #ea580c 100%);
  --gradient-danger: linear-gradient(135deg, #fb7185 0%, #ef4444 55%, #b91c1c 100%);
  --gradient-muted: linear-gradient(135deg, #94a3b8 0%, #475569 100%);
  --surface-noise:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
}

*, *::before, *::after {
  letter-spacing: 0 !important;
}

html {
  background: #050816;
}

body {
  background:
    radial-gradient(circle at 12% 6%, rgba(99, 102, 241, 0.18), transparent 29rem),
    radial-gradient(circle at 86% 18%, rgba(6, 182, 212, 0.13), transparent 31rem),
    radial-gradient(circle at 42% 94%, rgba(16, 185, 129, 0.08), transparent 28rem),
    linear-gradient(145deg, #050816 0%, #0b1022 42%, #070716 100%) !important;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

body::before {
  background-size: 38px 38px, 38px 38px;
  background-image: var(--surface-noise);
  mask-image: radial-gradient(circle at center, black 0%, transparent 78%);
  opacity: 0.5;
}

body::after {
  background:
    conic-gradient(from 185deg at 20% 20%, rgba(139, 92, 246, 0.13), transparent, rgba(6, 182, 212, 0.1), transparent),
    conic-gradient(from 20deg at 85% 80%, rgba(16, 185, 129, 0.08), transparent, rgba(245, 158, 11, 0.06), transparent);
  filter: blur(32px);
  opacity: 0.72;
  transform: translate3d(var(--ambient-x, 0), var(--ambient-y, 0), 0);
  animation: ambientDrift 20s var(--motion-smooth) infinite alternate;
}

#app {
  position: relative;
  isolation: isolate;
}

.main-layout {
  padding: 14px;
  gap: 14px;
  perspective: 1400px;
}

.sidebar {
  top: 14px !important;
  bottom: 14px !important;
  right: 14px !important;
  height: calc(100vh - 28px);
  border: 1px solid var(--glass-line) !important;
  border-radius: 22px !important;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.88), rgba(8, 13, 28, 0.72)) !important;
  backdrop-filter: blur(22px) saturate(145%);
  box-shadow: var(--shadow-ambient), var(--rim-light);
  overflow: hidden;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.11), transparent 30%),
    radial-gradient(circle at 10% 0%, rgba(139, 92, 246, 0.18), transparent 18rem);
  pointer-events: none;
}

.main-content {
  margin-right: calc(var(--sidebar-width) + 14px) !important;
  background: transparent !important;
  min-width: 0;
}

.topbar {
  height: 78px;
  margin-bottom: 14px;
  border: 1px solid var(--glass-line) !important;
  border-radius: 20px !important;
  background: rgba(15, 23, 42, 0.62) !important;
  backdrop-filter: blur(22px) saturate(155%);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.26), var(--rim-light);
}

.topbar h2,
.auth-brand-name,
.card-title,
h1,
h2 {
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 52%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  text-shadow: 0 14px 34px rgba(99, 102, 241, 0.18);
}

.page-container {
  max-width: 1480px;
  padding: 0 0 1.5rem;
  animation: pageReveal 0.55s var(--motion-smooth) both;
}

.page-container > * {
  animation: sectionStagger 0.58s var(--motion-smooth) both;
}

.page-container > *:nth-child(1) { animation-delay: 30ms; }
.page-container > *:nth-child(2) { animation-delay: 90ms; }
.page-container > *:nth-child(3) { animation-delay: 150ms; }
.page-container > *:nth-child(4) { animation-delay: 210ms; }

.brand-header {
  position: relative;
  border-bottom-color: var(--glass-line) !important;
  background: rgba(255, 255, 255, 0.025);
}

.brand-logo-img,
.auth-logo-img,
.app-logo {
  background: radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.35), rgba(99, 102, 241, 0.12) 44%, rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.08), 0 20px 38px rgba(6, 182, 212, 0.2);
}

.company-badge {
  border-radius: 16px !important;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.24), rgba(15, 23, 42, 0.54)) !important;
  border-color: rgba(165, 180, 252, 0.28) !important;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.32), inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.nav-list {
  position: relative;
  gap: 0.4rem;
}

.nav-item a {
  position: relative;
  border: 1px solid transparent;
  transform: translateZ(0);
  transition: transform 0.36s var(--motion-spring), border-color 0.25s var(--motion-smooth), box-shadow 0.25s var(--motion-smooth), background 0.25s var(--motion-smooth), color 0.25s var(--motion-smooth);
}

.nav-item a::before {
  content: "";
  position: absolute;
  inset: 7px auto 7px 7px;
  width: 3px;
  border-radius: 999px;
  background: var(--gradient-brand);
  opacity: 0;
  transition: opacity 0.25s var(--motion-smooth);
}

.nav-item a:hover {
  transform: translateX(-5px) translateY(-1px);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(6, 182, 212, 0.08)) !important;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

.nav-item a:hover::before,
.nav-item.active a::before {
  opacity: 1;
}

.nav-item.active a {
  border: 1px solid rgba(165, 180, 252, 0.26) !important;
  border-right: 1px solid rgba(165, 180, 252, 0.26) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(6, 182, 212, 0.1)) !important;
  box-shadow: inset 0 1px 8px rgba(255, 255, 255, 0.05), 0 16px 34px rgba(99, 102, 241, 0.17);
}

.nav-icon,
.stat-icon {
  position: relative;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(99, 102, 241, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 20px rgba(0, 0, 0, 0.22);
}

.nav-item:has(a[href="#/alerts"]) .nav-icon {
  animation: alertBreath 2.4s var(--motion-smooth) infinite;
}

.nav-item:has(a[href="#/alerts"]) .nav-icon::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #fb7185;
  box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.55);
  animation: pulseDot 1.8s var(--motion-smooth) infinite;
}

.user-pill,
.card,
.auth-card,
.table-responsive,
.filter-bar,
.modal-dialog,
.toast,
.searchable-combobox-dropdown {
  background: var(--glass-fill) !important;
  border: 1px solid var(--glass-line) !important;
  backdrop-filter: blur(20px) saturate(145%);
  box-shadow: var(--shadow-float);
}

.card {
  position: relative;
  overflow: visible;
}

.table-responsive {
  position: relative;
}

.filter-bar {
  position: relative;
  overflow: visible;
}

.card::before,
.stat-card::after,
.auth-card::before,
.table-responsive::before,
.filter-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.12), transparent 28%, transparent 72%, rgba(103, 232, 249, 0.05));
  opacity: 0.58;
  pointer-events: none;
  z-index: 0;
}

.card,
.stat-card {
  transform-style: preserve-3d;
  transition: transform 0.42s var(--motion-spring), box-shadow 0.32s var(--motion-smooth), border-color 0.32s var(--motion-smooth), background 0.32s var(--motion-smooth);
}

.card:hover,
.stat-card:hover {
  transform: translateY(-6px) rotateX(1deg) rotateY(-1.2deg);
  border-color: rgba(165, 180, 252, 0.24) !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42), 0 0 38px rgba(99, 102, 241, 0.15), var(--rim-light);
}

.card.is-tilting,
.stat-card.is-tilting {
  transform: translateY(-8px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

.grid-stats {
  perspective: 1200px;
}

.stat-card {
  min-height: 138px;
  background: var(--glass-fill-strong) !important;
  border-color: var(--glass-line) !important;
  box-shadow: var(--shadow-float);
  animation: cardStagger 0.6s var(--motion-smooth) both;
}

.stat-card:nth-child(1) { --stat-accent: #06b6d4; --stat-icon-bg: var(--gradient-brand); animation-delay: 40ms; }
.stat-card:nth-child(2) { --stat-accent: #f59e0b; --stat-icon-bg: var(--gradient-warning); animation-delay: 110ms; }
.stat-card:nth-child(3) { --stat-accent: #ef4444; --stat-icon-bg: var(--gradient-danger); animation-delay: 180ms; }
.stat-card:nth-child(4) { --stat-accent: #10b981; --stat-icon-bg: var(--gradient-success); animation-delay: 250ms; }

.stat-card::before {
  height: 100%;
  width: 100%;
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--stat-accent) 24%, transparent), transparent 48%),
    linear-gradient(90deg, color-mix(in srgb, var(--stat-accent) 28%, transparent), transparent 30%);
  opacity: 0.7;
}

.stat-card:hover::after {
  animation: glareSweep 0.9s var(--motion-smooth);
}

.stat-value {
  font-variant-numeric: tabular-nums;
  animation: numberRise 0.78s var(--motion-spring) both;
}

.stat-label,
.card-subtitle,
.brand-tagline {
  color: #a9b7d0 !important;
}

.stat-icon {
  width: 52px;
  height: 52px;
  color: #fff !important;
  background: var(--stat-icon-bg, var(--gradient-brand)) !important;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn,
.auth-tab-btn,
.quick-chip,
.modal-close,
.searchable-combobox-clear,
.searchable-combobox-toggle {
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.32s var(--motion-spring), box-shadow 0.25s var(--motion-smooth), border-color 0.25s var(--motion-smooth), background 0.25s var(--motion-smooth), color 0.25s var(--motion-smooth);
}

.btn::before,
.auth-tab-btn::before,
.quick-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 48%);
  opacity: 0.48;
  pointer-events: none;
}

.btn::after,
.auth-tab-btn::after,
.quick-chip::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 0;
  height: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  transform: translate(-50%, -50%);
  opacity: 0;
}

.btn:hover {
  transform: perspective(700px) translateY(-3px) rotateX(-8deg) scale(1.025);
  box-shadow: 0 18px 30px -12px rgba(0, 0, 0, 0.55), 0 6px 16px -6px rgba(99, 102, 241, 0.4);
}

.auth-tab-btn:hover,
.quick-chip:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn:active,
.auth-tab-btn:active,
.quick-chip:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.22), inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn:active::after,
.auth-tab-btn:active::after,
.quick-chip:active::after {
  animation: rippleSoft 0.5s var(--motion-smooth);
}

.msc-ripple {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  animation: ripplePoint 0.58s var(--motion-smooth) forwards;
}

.btn-primary,
.auth-tab-btn.active {
  background: linear-gradient(135deg, #9f7aea 0%, #6366f1 48%, #22d3ee 100%) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #fff !important;
  box-shadow: var(--shadow-purple), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-success,
.badge-normal {
  background: var(--gradient-success) !important;
  color: #fff !important;
  border-color: rgba(167, 243, 208, 0.26) !important;
}

.btn-danger,
.badge-critical,
.badge-out {
  background: var(--gradient-danger) !important;
  color: #fff !important;
  border-color: rgba(254, 202, 202, 0.24) !important;
}

.btn-warning,
.badge-low {
  background: var(--gradient-warning) !important;
  color: #1f1300 !important;
  border-color: rgba(254, 240, 138, 0.26) !important;
}

.btn-secondary {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.58)) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

#btn-pull-cloud-data:active span,
#btn-save-sync-url:active span,
#btn-push-cloud-data:active span {
  animation: spinRefresh 0.72s var(--motion-smooth);
}

#btn-pull-cloud-data.is-refreshing span,
#btn-save-sync-url.is-refreshing span,
#btn-push-cloud-data.is-refreshing span {
  animation: spinRefresh 0.8s var(--motion-smooth);
}

.auth-wrapper {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(45, 212, 191, 0.15), transparent 28rem),
    radial-gradient(circle at 84% 24%, rgba(125, 211, 252, 0.12), transparent 30rem),
    linear-gradient(145deg, #031316 0%, #051d21 48%, #020b0f 100%) !important;
}

.auth-wrapper::before {
  content: "";
  position: absolute;
  width: min(34vw, 360px);
  aspect-ratio: 1;
  right: 8vw;
  top: 11vh;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 44%),
    linear-gradient(145deg, rgba(139, 92, 246, 0.28), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 40px 100px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: rotateX(58deg) rotateZ(22deg);
  filter: blur(0.1px);
  opacity: 0.42;
  animation: glassPrism 12s var(--motion-smooth) infinite alternate;
}

.auth-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 76%);
  opacity: 0.6;
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  border-radius: 24px !important;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.5), 0 0 60px rgba(99, 102, 241, 0.16), var(--rim-light);
  animation: authFloatIn 0.75s var(--motion-spring) both;
}

.auth-login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  direction: ltr;
  grid-template-columns: minmax(340px, 430px) minmax(420px, 540px);
  grid-template-areas: "form showcase";
  align-items: stretch;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  width: min(1120px, 100%);
}

.auth-card--login {
  grid-area: form;
  direction: rtl;
  max-width: none;
  min-height: 100%;
  padding: clamp(1.45rem, 3vw, 2.25rem) !important;
  background:
    linear-gradient(145deg, rgba(7, 35, 42, 0.86), rgba(3, 15, 22, 0.92)),
    radial-gradient(circle at 14% 10%, rgba(94, 234, 212, 0.14), transparent 18rem) !important;
  border-color: rgba(148, 236, 228, 0.2) !important;
}

.auth-showcase {
  grid-area: showcase;
  direction: rtl;
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
  gap: 1rem;
  min-height: 560px;
  padding: clamp(1.15rem, 2.4vw, 1.55rem);
  border: 1px solid rgba(148, 236, 228, 0.24);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(8, 47, 52, 0.74), rgba(3, 20, 24, 0.78)),
    radial-gradient(circle at 70% 14%, rgba(94, 234, 212, 0.16), transparent 24rem);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(140%);
  animation: authFloatIn 0.78s var(--motion-spring) 0.08s both;
}

.auth-showcase__top,
.auth-showcase__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-showcase__top {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(148, 236, 228, 0.18);
}

.auth-showcase__top span,
.auth-logo-mark,
.auth-showcase__bottom span {
  color: #dffdf8;
  font: 800 0.78rem/1 'JetBrains Mono', monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.auth-showcase__top strong {
  color: #72f3df;
  font-weight: 800;
}

.auth-showcase__image {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 50%, rgba(125, 211, 252, 0.2), transparent 44%),
    linear-gradient(145deg, rgba(0, 18, 24, 0.64), rgba(2, 10, 17, 0.95));
  border: 1px solid rgba(148, 236, 228, 0.12);
}

.auth-showcase__image::before {
  content: "";
  position: absolute;
  inset: -18%;
  background:
    linear-gradient(90deg, transparent 0 47%, rgba(94, 234, 212, 0.13) 48% 49%, transparent 50%),
    linear-gradient(0deg, transparent 0 47%, rgba(125, 211, 252, 0.11) 48% 49%, transparent 50%);
  background-size: 42px 42px;
  opacity: 0.32;
  transform: rotate(12deg);
}

.auth-showcase__image img {
  position: relative;
  z-index: 1;
  width: min(86%, 430px);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 22px;
  filter: drop-shadow(0 28px 52px rgba(0, 0, 0, 0.48));
}

.auth-showcase__bottom {
  align-items: end;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(148, 236, 228, 0.16);
}

.auth-showcase__bottom p {
  margin-top: 0.8rem;
  color: #c7fff8;
  font-size: 0.95rem;
}

.auth-showcase__bottom a {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #9cf4e9;
  color: #062024;
  font-size: 1.35rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 18px 36px rgba(45, 212, 191, 0.24);
}

.auth-card--login .auth-logo-header {
  text-align: center;
  margin-bottom: 1.55rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(148, 236, 228, 0.14);
}

.auth-card--login .auth-brand-name {
  margin-top: 0.8rem;
  color: #e8fff9;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  text-shadow: 0 14px 36px rgba(45, 212, 191, 0.16);
}

.auth-card--login .auth-brand-subtitle {
  color: #8eeadc;
}

.auth-heading {
  margin-bottom: 1.25rem;
  text-align: center;
}

.auth-heading h2 {
  color: #dffdf8;
  font-size: 1.16rem;
  margin-bottom: 0.32rem;
}

.auth-heading p {
  color: #8fa8b2;
  font-size: 0.86rem;
}

.auth-contact-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  color: var(--text-dim);
  font-size: 0.76rem;
  text-align: center;
}

.auth-contact-line a {
  color: #9cf4e9;
  direction: ltr;
  font-weight: 800;
  text-decoration: none;
}

.auth-card--login .auth-tabs {
  position: relative;
  gap: 0.45rem;
  padding: 0.38rem;
  border: 1px solid rgba(148, 236, 228, 0.16) !important;
  border-radius: 16px !important;
  background: rgba(1, 12, 18, 0.58) !important;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.34);
}

.auth-card--login .auth-tab-btn {
  min-height: 58px;
  flex-direction: column;
  gap: 0.42rem;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #9bb6c1;
  background: linear-gradient(145deg, rgba(8, 23, 36, 0.7), rgba(3, 11, 20, 0.64));
  box-shadow: none;
}

.auth-card--login .auth-tab-btn::before {
  opacity: 0.16;
}

.auth-card--login .auth-tab-btn:hover {
  transform: translateY(-1px);
  color: #dffdf8;
  border-color: rgba(148, 236, 228, 0.18);
}

.auth-card--login .auth-tab-btn.active {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.26), rgba(14, 165, 233, 0.2)) !important;
  border-color: rgba(156, 244, 233, 0.36) !important;
  color: #f8fffd !important;
  box-shadow: 0 16px 34px rgba(45, 212, 191, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.auth-tab-icon {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 24px;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: rgba(156, 244, 233, 0.1);
  color: #9cf4e9;
  font: 800 0.68rem/1 'JetBrains Mono', monospace;
  letter-spacing: 0;
}

.auth-card--login .form-label {
  color: #dffdf8;
  font-weight: 700;
}

.auth-card--login .form-control {
  min-height: 48px;
  border-radius: 12px !important;
  background: rgba(2, 10, 20, 0.66) !important;
  border-color: rgba(148, 236, 228, 0.16) !important;
  color: #f8fafc;
}

.auth-card--login .form-control:focus {
  border-color: rgba(156, 244, 233, 0.6) !important;
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.auth-card--login #submit-login-btn {
  min-height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #9cf4e9 0%, #35d5c6 48%, #19b5d2 100%) !important;
  border-color: rgba(204, 251, 241, 0.42) !important;
  color: #062024 !important;
  font-weight: 900;
  box-shadow: 0 20px 42px rgba(20, 184, 166, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.auth-card--login #submit-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 46px rgba(20, 184, 166, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.auth-card--login .password-toggle-btn {
  color: #9cf4e9;
  opacity: 0.9;
}

.auth-card--login .required {
  color: #f7c948;
}

@media (max-width: 980px) {
  .auth-login-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "showcase"
      "form";
    width: min(560px, 100%);
  }

  .auth-showcase {
    min-height: auto;
  }

  .auth-showcase__image {
    min-height: 240px;
  }
}

@media (max-width: 640px) {
  .auth-wrapper {
    padding: 1rem;
  }

  .auth-showcase {
    border-radius: 22px;
    padding: 1rem;
  }

  .auth-showcase__image {
    min-height: 210px;
  }

  .auth-showcase__top span,
  .auth-logo-mark,
  .auth-showcase__bottom span {
    font-size: 0.66rem;
    letter-spacing: 0.12em;
  }

  .auth-card--login .auth-logo-header,
  .auth-heading {
    text-align: center;
  }
}

.form-control,
.searchable-combobox-input {
  background: linear-gradient(145deg, rgba(2, 6, 23, 0.78), rgba(15, 23, 42, 0.58)) !important;
  border-color: rgba(255, 255, 255, 0.11) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 24px rgba(0, 0, 0, 0.16);
}

.form-control:focus,
.searchable-combobox-input:focus {
  border-color: rgba(129, 140, 248, 0.76) !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18), 0 16px 34px rgba(99, 102, 241, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  transform: translateY(-1px);
}

.password-toggle-btn {
  border-radius: 10px;
  transition: transform 0.25s var(--motion-spring), color 0.2s var(--motion-smooth);
}

.password-toggle-btn:hover {
  transform: translateY(-1px) scale(1.08);
}

.data-table {
  border-collapse: separate;
  border-spacing: 0 8px;
  padding: 8px;
}

.data-table th {
  background: rgba(2, 6, 23, 0.58) !important;
  border-bottom: 0 !important;
}

.data-table td {
  background: rgba(15, 23, 42, 0.44);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.data-table tbody tr {
  transition: transform 0.32s var(--motion-spring), box-shadow 0.25s var(--motion-smooth), background 0.25s var(--motion-smooth);
  animation: rowRise 0.5s var(--motion-smooth) both;
}

/* Stagger the entrance of the first rows so the table feels like it
   assembles into place rather than popping in all at once. */
.data-table tbody tr:nth-child(1)  { animation-delay: 0.02s; }
.data-table tbody tr:nth-child(2)  { animation-delay: 0.05s; }
.data-table tbody tr:nth-child(3)  { animation-delay: 0.08s; }
.data-table tbody tr:nth-child(4)  { animation-delay: 0.11s; }
.data-table tbody tr:nth-child(5)  { animation-delay: 0.14s; }
.data-table tbody tr:nth-child(6)  { animation-delay: 0.17s; }
.data-table tbody tr:nth-child(7)  { animation-delay: 0.20s; }
.data-table tbody tr:nth-child(8)  { animation-delay: 0.23s; }
.data-table tbody tr:nth-child(9)  { animation-delay: 0.26s; }
.data-table tbody tr:nth-child(10) { animation-delay: 0.29s; }
.data-table tbody tr:nth-child(n+11) { animation-delay: 0.32s; }

@keyframes rowRise {
  from { opacity: 0; transform: translateY(10px) rotateX(-6deg); }
  to   { opacity: 1; transform: translateY(0) rotateX(0deg); }
}

.data-table tbody tr:hover {
  transform: translateY(-2px) scale(1.003);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.24), 0 4px 12px -4px rgba(99, 102, 241, 0.25);
  position: relative;
  z-index: 1;
}

.data-table tbody tr td:first-child {
  border-radius: 0 12px 12px 0;
}

.data-table tbody tr td:last-child {
  border-radius: 12px 0 0 12px;
}

.badge {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 12px 22px rgba(0, 0, 0, 0.18);
}

.badge-dot {
  background: currentColor !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 20%, transparent);
  animation: dotPulse 2.2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 20%, transparent); }
  50%      { box-shadow: 0 0 0 7px color-mix(in srgb, currentColor 32%, transparent); }
}

.modal-backdrop {
  background: rgba(2, 6, 23, 0.72) !important;
  backdrop-filter: blur(14px) saturate(130%);
}

.modal-dialog {
  border-radius: 20px !important;
}

.modal-header,
.modal-footer,
.sidebar-footer {
  border-color: var(--glass-line) !important;
  background: rgba(2, 6, 23, 0.22) !important;
}

.toast {
  border-radius: 16px !important;
  animation: toastLift 0.38s var(--motion-spring) forwards;
}

.toast-success { box-shadow: var(--shadow-green), var(--shadow-float); }
.toast-error { box-shadow: var(--shadow-red), var(--shadow-float); }
.toast-warning { box-shadow: var(--shadow-amber), var(--shadow-float); }
.toast-info { box-shadow: var(--shadow-cyan), var(--shadow-float); }

.filter-bar {
  padding: 1rem;
  border-radius: 18px;
  margin-bottom: 1.4rem;
}

.stock-bar-container {
  background: rgba(2, 6, 23, 0.72) !important;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.36);
}

.stock-bar-fill {
  box-shadow: 0 0 18px currentColor;
}

.searchable-combobox-dropdown {
  border-radius: 16px !important;
}

.searchable-combobox-item {
  border-radius: 10px;
}

.searchable-combobox-item:hover,
.searchable-combobox-item.focused,
.searchable-combobox-item.selected {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.12)) !important;
}

@keyframes ambientDrift {
  from { transform: translate3d(var(--ambient-x, 0), var(--ambient-y, 0), 0) scale(1); }
  to { transform: translate3d(calc(var(--ambient-x, 0) - 18px), calc(var(--ambient-y, 0) + 14px), 0) scale(1.04); }
}

@keyframes pageReveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardStagger {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sectionStagger {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes authFloatIn {
  from { opacity: 0; transform: translateY(22px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes glassPrism {
  from { transform: rotateX(58deg) rotateZ(22deg) translate3d(0, 0, 0); }
  to { transform: rotateX(55deg) rotateZ(28deg) translate3d(-18px, 12px, 0); }
}

@keyframes glareSweep {
  from { transform: translateX(42%) skewX(-16deg); opacity: 0; }
  38% { opacity: 0.82; }
  to { transform: translateX(-42%) skewX(-16deg); opacity: 0; }
}

@keyframes numberRise {
  from { opacity: 0; transform: translateY(10px) scale(0.96); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes rippleSoft {
  from { width: 0; height: 0; opacity: 0.42; }
  to { width: 280px; height: 280px; opacity: 0; }
}

@keyframes ripplePoint {
  from { opacity: 0.46; transform: translate(-50%, -50%) scale(0); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(24); }
}

@keyframes pulseDot {
  to { box-shadow: 0 0 0 12px rgba(251, 113, 133, 0); }
}

@keyframes alertBreath {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  8% { transform: translateY(-1px) rotate(-5deg); }
  16% { transform: translateY(0) rotate(4deg); }
  24% { transform: translateY(-1px) rotate(0deg); }
}

@keyframes spinRefresh {
  to { transform: rotate(360deg); }
}

@keyframes toastLift {
  from { opacity: 0; transform: translateX(-18px) translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
}

@media (max-width: 900px) {
  .main-layout {
    padding: 10px;
  }

  .sidebar {
    top: 10px !important;
    bottom: 10px !important;
    right: 10px !important;
    height: calc(100vh - 20px);
    max-width: calc(100vw - 20px);
  }

  .main-content {
    margin-right: 0 !important;
  }

  .topbar {
    height: auto;
    min-height: 70px;
    border-radius: 16px !important;
    padding: 0.85rem 1rem;
  }

  .card:hover,
  .stat-card:hover,
  .btn:hover,
  .auth-tab-btn:hover,
  .quick-chip:hover {
    transform: translateY(-2px);
  }

  .data-table {
    border-spacing: 0 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .card:hover,
  .stat-card:hover,
  .btn:hover,
  .auth-tab-btn:hover,
  .quick-chip:hover,
  .nav-item a:hover {
    transform: none !important;
  }

  body::before,
  body::after {
    animation: none !important;
  }
}

/* ==========================================================================
   AURORA DEPTH — Signature 3D Identity Layer (additive only)
   هوية بصرية إضافية فوق نظام الـ3D الموجود مسبقًا في الملف — بدون تكرار أو
   تعارض مع أي قاعدة سابقة (الطبقة الجوية، تمييل الكروت بالماوس، الأزرار...).
   كل ما هنا جديد تمامًا: لا يغيّر أي اسم class أو بنية HTML التي يعتمد
   عليها bundle.js، فالوظائف الأساسية غير متأثرة إطلاقًا.
   ========================================================================== */

/* ---- Perspective "warehouse floor" grid — a receding glass-shelf floor
   rendered behind the content, distinct from the existing ambient aura on
   <body>. Attached to #app so it doesn't collide with body::before/::after. ---- */
#app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  transform: perspective(900px) rotateX(62deg) scale(1.7) translateY(-8%);
  transform-origin: 50% 0%;
  opacity: 0.5;
  mask-image: linear-gradient(to bottom, black 0%, transparent 65%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 65%);
  animation: floorDrift 18s linear infinite;
}

@keyframes floorDrift {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 0 84px, 84px 0; }
}

/* ---- A single travelling light-sheen across a card on hover — one
   deliberate signature motion, layered on top of the existing tilt/lift
   hover effect (adds a new ::after; the existing ::before shine and the
   existing hover transform are untouched). ---- */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.10) 50%, transparent 60%);
  background-size: 220% 220%;
  background-position: 130% 130%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.card:hover::after {
  opacity: 1;
  animation: sheenSweep 1.1s ease forwards;
}

@keyframes sheenSweep {
  from { background-position: 130% 130%; }
  to   { background-position: -20% -20%; }
}

/* ---- Sidebar signature: a slow travelling glow along the top edge.
   The sidebar is already position: fixed (see earlier rule), so this new
   ::after positions correctly with no change to .sidebar itself. ---- */
.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.85), rgba(129, 140, 248, 0.85), transparent);
  background-size: 240% 100%;
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.65));
  animation: edgeGlow 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes edgeGlow {
  0%   { background-position: 120% 0; opacity: 0.4; }
  50%  { background-position: -20% 0; opacity: 1; }
  100% { background-position: -120% 0; opacity: 0.4; }
}

/* ---- Logo: a gentle continuous 3D breathing, like a live signal —
   additive (no existing animation on these logo classes). ---- */
.app-logo,
.brand-logo-img,
.auth-logo-img {
  animation: logoBreathe 5s ease-in-out infinite;
}

@keyframes logoBreathe {
  0%, 100% { transform: perspective(400px) rotateY(0deg) scale(1); }
  50%      { transform: perspective(400px) rotateY(6deg) scale(1.035); }
}

/* ---- Respect reduced motion for everything added in this section ---- */
@media (prefers-reduced-motion: reduce) {
  #app::before,
  .sidebar::after,
  .app-logo,
  .brand-logo-img,
  .auth-logo-img,
  .card::after {
    animation: none !important;
  }
}

/* ==========================================================================
   Cinematic Earth Intro
   Standalone overlay loaded once per browser tab. The WebGL renderer is
   removed by src/earth-intro.js after the animation or Skip Intro action.
   ========================================================================== */

.earth-intro-pending body {
  overflow: hidden;
  background: #02050d;
}

.earth-intro-pending #app {
  visibility: hidden;
}

.earth-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(32, 80, 140, 0.28), transparent 28rem),
    linear-gradient(180deg, #01030a 0%, #050817 56%, #02050d 100%);
  color: #fff;
  direction: ltr;
  opacity: 1;
  transition: opacity 0.72s ease, visibility 0.72s ease;
}

.earth-intro::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 0%, transparent 48%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.2), transparent 34%, transparent 66%, rgba(0, 0, 0, 0.2));
}

.earth-intro--leaving {
  opacity: 0;
  visibility: hidden;
}

.earth-intro__canvas,
.earth-intro__canvas canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.earth-intro__skip {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 2;
  min-height: 42px;
  padding: 0 1rem;
  border: 1px solid rgba(226, 232, 240, 0.28);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.46);
  color: #e5edf8;
  font: 700 0.88rem/1 'Cairo', system-ui, sans-serif;
  letter-spacing: 0;
  cursor: pointer;
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.earth-intro__skip:hover,
.earth-intro__skip:focus-visible {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 255, 255, 0.52);
  transform: translateY(-1px);
  outline: none;
}

.earth-intro__caption {
  position: absolute;
  left: 50%;
  bottom: max(32px, env(safe-area-inset-bottom));
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 0.48rem;
  width: min(420px, calc(100vw - 32px));
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.7s ease 0.2s, transform 0.7s ease 0.2s;
}

.earth-intro--ready .earth-intro__caption {
  opacity: 1;
  transform: translate(-50%, 0);
}

.earth-intro__kicker {
  color: #93c5fd;
  font: 700 0.74rem/1 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.earth-intro__caption strong {
  color: #f7c948;
  font: 800 clamp(2.15rem, 7vw, 4.4rem)/0.95 'Cairo', system-ui, sans-serif;
  letter-spacing: 0;
  text-shadow: 0 8px 24px rgba(247, 201, 72, 0.28), 0 14px 42px rgba(0, 0, 0, 0.5);
}

.earth-intro__phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.44rem 0.78rem;
  border: 1px solid rgba(147, 197, 253, 0.28);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.42);
  color: #e0f2fe;
  font: 800 clamp(0.96rem, 3.8vw, 1.32rem)/1 'JetBrains Mono', 'Cairo', monospace;
  letter-spacing: 0;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px);
}

@media (max-width: 700px) {
  .earth-intro__skip {
    min-height: 40px;
    padding: 0 0.85rem;
    font-size: 0.8rem;
  }

  .earth-intro__caption {
    bottom: max(22px, env(safe-area-inset-bottom));
    gap: 0.42rem;
    width: min(360px, calc(100vw - 24px));
  }

  .earth-intro__caption strong {
    font-size: clamp(2.05rem, 13vw, 3.6rem);
  }

  .earth-intro__phone {
    max-width: 100%;
    min-height: 32px;
    padding-inline: 0.68rem;
    font-size: clamp(0.94rem, 5.4vw, 1.18rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .earth-intro,
  .earth-intro__caption,
  .earth-intro__skip {
    transition-duration: 0.001ms !important;
  }
}
