/**
 * QuoteMaster Pro - Professional Quotation System Styles
 * نظام إدارة عروض الأسعار الاحترافي
 * Developed by NGU Systems
 */

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

:root {
  /* Original Brand Colors - Blue Gradient */
  --primary-start: #2563eb;
  --primary-end: #1d4ed8;
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;

  /* Semantic Colors */
  --success: #10b981;
  --success-light: #d1fae5;
  --success-dark: #059669;
  --info: #06b6d4;
  --info-light: #cffafe;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --danger-dark: #dc2626;

  /* Neutrals */
  --ink: #0f172a;
  --slate: #334155;
  --slate-light: #64748b;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --canvas: #f8fafc;
  --white: #ffffff;

  /* Typography - NGU Systems Guidelines */
  --font-ar: "Cairo", sans-serif;
  --font-he: "Rubik", "Varela Round", sans-serif;
  --font-en: "Inter", sans-serif;
  --font-logo: "Varela Round", sans-serif;

  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Font Sizes - Mobile First */
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 32px;
  --font-size-4xl: 40px;

  /* Spacing - 8px base grid */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;
  --spacing-2xl: 64px;

  /* Border Radius - NGU Systems Guidelines */
  --radius-xs: 6px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-2xl: 32px;

  /* Shadows - NGU Systems Guidelines */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 12px 24px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.16);
  --shadow-xl: 0 30px 60px rgba(15, 23, 42, 0.2);

  /* Transitions - NGU Systems Guidelines */
  --transition-fast: 150ms ease-out;
  --transition: 200ms ease-out;
  --transition-slow: 300ms ease-out;

  /* Touch Targets - Mobile First */
  --touch-target-min: 44px;
  --touch-target-comfortable: 48px;
}

body {
  font-family: var(--font-he);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  direction: rtl;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Language-specific fonts */
html[lang="he"] body {
  font-family: var(--font-he);
}

html[lang="ar"] body {
  font-family: var(--font-ar);
}

html[lang="en"] body {
  font-family: var(--font-en);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
  width: 100%;
}

/* Mobile First Container */
@media (min-width: 640px) {
  .container {
    padding: 0 var(--spacing-md);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--spacing-lg);
  }
}

/* ==================== Header ==================== */
.header {
  background: linear-gradient(
    135deg,
    var(--primary-start) 0%,
    var(--primary-end) 100%
  );
  color: white;
  padding: var(--spacing-sm) 0;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Mobile First Header */
@media (min-width: 640px) {
  .header {
    padding: var(--spacing-md) 0;
  }
}

.header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.05) 25%,
    transparent 25%,
    transparent 75%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 40px 40px;
  opacity: 0.3;
}

/* ==================== Header Layout ==================== */
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  min-height: 80px;
}

.logo-section {
  display: flex;
  align-items: center;
  flex: 1;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo {
  font-family: var(--font-logo);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.5px;
  margin: 0;
  line-height: 1.2;
}

.tagline {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  opacity: 0.9;
  margin: 0;
  line-height: 1.3;
}

.logo-title-group {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-xs);
}

.company-display {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: rgba(255, 255, 255, 0.95);
}

.company-title-group .company-display {
  color: var(--slate);
  font-size: var(--font-size-lg);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.company-branding {
  text-align: center;
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.company-text {
  font-size: var(--font-size-xs);
  opacity: 0.8;
  margin-left: var(--spacing-xs);
}

.company-name {
  font-family: var(--font-en);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 1px;
}

/* Mobile First Header Layout */
@media (min-width: 640px) {
  .header-content {
    gap: var(--spacing-md);
    flex-wrap: nowrap;
  }

  .logo {
    font-size: var(--font-size-3xl);
  }

  .tagline {
    font-size: 15px;
  }

  .company-branding {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
  }

  .company-name {
    font-size: var(--font-size-base);
  }
}

/* ==================== Quote Card Visibility ==================== */
.quote-card {
  transition: all var(--transition-slow);
  opacity: 0;
  transform: translateY(20px);
}

.quote-card.show {
  opacity: 1;
  transform: translateY(0);
}

.quote-card[style*="display: block"] {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== Enhanced Action Cards ==================== */
.main-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

@media (min-width: 768px) {
  .main-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
  }
}

.action-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--line);
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.action-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
}

.action-card.primary-action::before {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
}

.action-card.secondary-action::before {
  background: linear-gradient(135deg, var(--slate), var(--muted));
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-start);
}

.action-card.primary-action:hover {
  border-color: var(--primary-start);
}

.action-card.secondary-action:hover {
  border-color: var(--slate);
}

/* ==================== Quote Number Animation ==================== */
.quote-number {
  transition: all var(--transition);
  position: relative;
}

.quote-number.animate {
  animation: pulse-glow 0.6s ease-in-out;
}

@keyframes pulse-glow {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

@media (min-width: 768px) {
  .main-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

.action-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--line);
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.action-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-start);
}

.action-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--spacing-md);
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
}

.action-card.primary-action .action-icon {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
}

.action-card.secondary-action .action-icon {
  background: linear-gradient(135deg, var(--slate), var(--muted));
}

.action-card:hover .action-icon {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.action-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--ink);
  margin-bottom: var(--spacing-sm);
  line-height: 1.3;
}

.action-description {
  font-size: var(--font-size-base);
  color: var(--slate);
  margin-bottom: var(--spacing-lg);
  line-height: 1.5;
}

.btn-large {
  padding: 16px var(--spacing-lg);
  font-size: 18px;
  font-weight: 700;
  min-width: 200px;
  border-radius: var(--radius-lg);
}

.btn i {
  margin-left: var(--spacing-xs);
}

/* ==================== Updated Header Styles ==================== */

/* Mobile Responsive Header */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: var(--spacing-sm);
    text-align: center;
  }

  .logo-section {
    width: 100%;
    justify-content: center;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
  }

  .company-branding {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
  }
}

@media (min-width: 640px) {
  .header-content {
    gap: var(--spacing-md);
    flex-wrap: nowrap;
  }
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.logo-icon {
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Mobile First Logo Icon */
@media (min-width: 640px) {
  .logo-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
  }
}

.logo-text {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-xs);
}

.logo {
  font-family: var(--font-logo);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.5px;
  margin: 0;
}

/* Mobile First Logo */
@media (min-width: 640px) {
  .logo {
    font-size: var(--font-size-3xl);
  }
}

.tagline {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  opacity: 0.92;
  margin-right: auto;
  text-align: center;
  width: 100%;
  order: 3;
}

/* Mobile First Tagline */
@media (min-width: 640px) {
  .tagline {
    font-size: 15px;
    text-align: right;
    width: auto;
    order: unset;
  }
}

.header-badge {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 0.5px;
}

/* ==================== Language Switcher ==================== */
.language-switcher {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  order: 1;
  margin: 0 auto;
}

/* Mobile First Language Switcher */
@media (min-width: 640px) {
  .language-switcher {
    order: unset;
    margin: 0;
  }
}

.lang-btn {
  font-family: var(--font-en);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  padding: 8px 12px;
  background: transparent;
  color: white;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.5px;
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile First Language Button */
@media (min-width: 640px) {
  .lang-btn {
    font-size: var(--font-size-xs);
    padding: 6px 12px;
    min-height: auto;
    min-width: auto;
  }
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lang-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

/* ==================== Main Content ==================== */
.main-content {
  flex: 1;
  padding: var(--spacing-md) 0;
}

/* Mobile First Main Content */
@media (min-width: 640px) {
  .main-content {
    padding: var(--spacing-xl) 0;
  }
}

/* ==================== Enhanced Quote Card Header ==================== */
.quote-card .quote-card-header {
  background: linear-gradient(
    135deg,
    var(--primary-start) 0%,
    var(--primary-end) 100%
  ) !important;
  color: white !important;
  padding: var(--spacing-xl) var(--spacing-lg);
  border-bottom: none !important;
}

.quote-header-main {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.quote-header-badge {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.quote-header-badge i {
  width: 32px;
  height: 32px;
  stroke-width: 2px;
  color: white !important;
}

.quote-header-text {
  flex: 1;
}

.quote-header-text .card-title {
  color: white !important;
  margin-bottom: 8px;
  font-size: 28px;
}

.quote-header-text .card-title::before {
  display: none;
}

.quote-header-hint {
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 16px;
  margin: 0;
  font-weight: 400;
}

.quote-header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  justify-content: flex-end;
}

.quote-header-actions .quote-number {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  color: white !important;
  font-weight: 700;
  padding: 12px 20px;
  font-size: 17px;
}

.quote-header-actions .btn-icon {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: white !important;
}

.quote-header-actions .btn-icon:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Help button in quote header - more prominent */
.quote-header-actions .btn-help-header {
  background: rgba(6, 182, 212, 0.2) !important;
  border-color: rgba(6, 182, 212, 0.4) !important;
  color: white !important;
  position: relative;
}

.quote-header-actions .btn-help-header:hover {
  background: rgba(6, 182, 212, 0.35) !important;
  border-color: rgba(6, 182, 212, 0.6) !important;
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.quote-header-actions .btn-help-header i {
  width: 22px;
  height: 22px;
}

/* تأكيد أن كل العناصر في الرأس بيضاء */
.quote-card-header * {
  color: white;
}

.quote-card-header .card-title,
.quote-card-header .quote-header-hint,
.quote-card-header .quote-number {
  color: white !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .quote-card-header {
    padding: var(--spacing-md);
  }

  .quote-header-main {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-sm);
  }

  .quote-header-badge {
    width: 56px;
    height: 56px;
  }

  .quote-header-badge i {
    width: 28px;
    height: 28px;
  }

  .quote-header-text .card-title {
    font-size: 22px;
  }

  .quote-header-hint {
    font-size: 14px;
  }

  .quote-header-actions {
    flex-direction: column;
    width: 100%;
  }

  .quote-header-actions .quote-number {
    width: 100%;
  }
}

.quote-card-body {
  padding: var(--spacing-xl) var(--spacing-lg);
}

@media (max-width: 768px) {
  .quote-card-body {
    padding: var(--spacing-md);
  }
}

/* ==================== Enhanced Form Sections ==================== */
.form-section {
  background: white;
  border: 2px solid var(--line);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.form-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    135deg,
    var(--primary-start) 0%,
    var(--primary-end) 100%
  );
}

.form-section:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .form-section {
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
  }
}

.section-header-enhanced {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--line);
}

.section-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.section-icon i {
  width: 28px;
  height: 28px;
  stroke-width: 2.5px;
}

/* Icon colors for different sections */
.customer-icon {
  background: linear-gradient(
    135deg,
    var(--success) 0%,
    var(--success-dark) 100%
  );
  color: white;
}

.project-icon {
  background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
  color: white;
}

.product-icon {
  background: linear-gradient(
    135deg,
    var(--primary-start) 0%,
    var(--primary-end) 100%
  );
  color: white;
}

.products-icon {
  background: linear-gradient(135deg, var(--info) 0%, #0891b2 100%);
  color: white;
}

.totals-icon {
  background: linear-gradient(
    135deg,
    var(--success) 0%,
    var(--success-dark) 100%
  );
  color: white;
}

.notes-icon {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

@media (max-width: 768px) {
  .section-icon {
    width: 48px;
    height: 48px;
  }

  .section-icon i {
    width: 24px;
    height: 24px;
  }
}

.section-header-text {
  flex: 1;
  min-width: 0; /* Allow text to shrink if needed */
}

.section-title-enhanced {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.section-title-enhanced span:first-child {
  flex: 1;
}

.section-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.1),
    rgba(29, 78, 216, 0.1)
  );
  border: 2px solid rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.section-description {
  font-size: 15px;
  color: var(--slate);
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .section-title-enhanced {
    font-size: 18px;
    flex-direction: column;
    align-items: flex-start;
  }

  .section-step {
    font-size: 12px;
    padding: 3px 10px;
  }

  .section-description {
    font-size: 14px;
  }

  .section-header-enhanced {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
}

.form-content-enhanced {
  position: relative;
}

/* ==================== Cards ==================== */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-md);
  transition: all var(--transition);
  border: 1px solid var(--line);
  overflow: hidden;
}

/* Mobile First Cards */
@media (min-width: 640px) {
  .card {
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-lg);
  }
}

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

.card-header {
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 3px solid var(--primary-start);
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.03),
    rgba(29, 78, 216, 0.01)
  );
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

/* Mobile First Card Header */
@media (min-width: 640px) {
  .card-header {
    padding: var(--spacing-md) var(--spacing-lg);
    flex-wrap: nowrap;
    gap: var(--spacing-md);
  }
}

.card-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
  gap: var(--spacing-md);
}

.card-header .btn-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
}

.card-header .btn-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(91, 108, 249, 0.2);
}

.card-header .btn-icon i {
  width: 22px;
  height: 22px;
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  order: 1;
}

/* Mobile First Card Title */
@media (min-width: 640px) {
  .card-title {
    font-size: 22px;
    width: auto;
    order: unset;
  }
}

.card-title::before {
  content: "";
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  border-radius: 4px;
}

/* Mobile First Card Title Line */
@media (min-width: 640px) {
  .card-title::before {
    height: 24px;
  }
}

.quote-number {
  font-family: var(--font-en);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--primary-start);
  background: var(--info-light);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(37, 99, 235, 0.2);
  order: 2;
  text-align: center;
  width: 100%;
}

/* Mobile First Quote Number */
@media (min-width: 640px) {
  .quote-number {
    font-size: 15px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    order: unset;
    text-align: right;
    width: auto;
  }
}

.card-body {
  padding: var(--spacing-md);
}

/* Mobile First Card Body */
@media (min-width: 640px) {
  .card-body {
    padding: var(--spacing-lg);
  }
}

/* ==================== Forms ==================== */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
  }
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
  color: var(--ink);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 768px) {
  .form-group {
    margin-bottom: var(--spacing-md);
  }

  .form-label {
    font-size: 14px;
    margin-bottom: 10px;
  }
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-ar);
  font-size: 16px;
  color: var(--ink);
  background: white;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  outline: none;
  min-height: var(--touch-target-min);
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

/* Mobile First Form Inputs */
@media (min-width: 640px) {
  .form-input,
  .form-textarea {
    padding: 12px var(--spacing-sm);
    min-height: auto;
  }
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--primary-start);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15),
    0 4px 12px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

/* ==================== Form Error States & Required Mark ==================== */
.required-mark {
  color: var(--danger);
  margin-inline-start: 4px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.input-error {
  display: none;
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

.form-input.is-invalid,
.form-textarea.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-textarea {
  resize: vertical;
}

/* ==================== Search Section ==================== */
.search-section {
  margin-bottom: var(--spacing-lg);
}

.section-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--ink);
  margin-bottom: var(--spacing-sm);
}

/* Mobile First Section Title */
@media (min-width: 640px) {
  .section-title {
    font-size: var(--font-size-xl);
  }
}

.search-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-sm);
  align-items: start;
}

/* Mobile First Search Container */
@media (min-width: 640px) {
  .search-container {
    grid-template-columns: 1fr 200px 140px;
  }
}

.search-input-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
}

.search-input {
  width: 100%;
}

.search-results {
  /* position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0; */
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--transition);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--canvas);
}

.search-result-item.selected {
  background: linear-gradient(
    135deg,
    rgba(91, 108, 249, 0.1),
    rgba(122, 89, 237, 0.1)
  );
  border-left: 3px solid var(--primary-start);
  border-right: 3px solid var(--primary-end);
}

.search-result-name {
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}

.search-result-new-product {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.05),
    rgba(5, 150, 105, 0.05)
  );
  border-left: 3px solid #10b981;
  border-right: 3px solid #059669;
  font-weight: 600;
}

.search-result-new-product:hover {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1),
    rgba(5, 150, 105, 0.1)
  );
}

.search-result-new-product .search-result-name {
  color: #059669;
}

/* ==================== Product Filters Styles ==================== */
.product-filters-section {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--line);
}

.filters-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--slate);
  margin: 0;
  display: flex;
  align-items: center;
}

.filters-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

@media (min-width: 640px) {
  .filters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .filters-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filters-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--line);
}

.search-header {
  display: flex;
  gap: var(--spacing-sm);
  align-items: flex-end;
  grid-column: 1 / -1;
}

.search-header .search-input-wrapper {
  flex: 1;
}

.search-header #showFiltersBtn {
  white-space: nowrap;
  height: fit-content;
  align-self: flex-end;
}

/* ==================== Customer Smart Search Styles ==================== */
.customer-search-field {
  position: relative;
}

.customer-search-container {
  position: relative;
  width: 100%;
}

.customer-search-input {
  width: 100%;
  padding-right: 12px;
  padding-left: 12px;
}

.customer-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  max-height: 320px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 4px;
  display: none;
}

.customer-search-results::-webkit-scrollbar {
  width: 6px;
}

.customer-search-results::-webkit-scrollbar-track {
  background: var(--canvas);
  border-radius: 3px;
}

.customer-search-results::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 3px;
}

.customer-search-results::-webkit-scrollbar-thumb:hover {
  background: var(--slate-light);
}

.customer-result {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
}

.customer-result:last-child {
  border-bottom: none;
}

.customer-result:hover {
  background: var(--canvas);
}

.customer-result.selected {
  background: linear-gradient(
    135deg,
    rgba(91, 108, 249, 0.15),
    rgba(122, 89, 237, 0.15)
  );
  border-left: 3px solid var(--primary-start);
  border-right: 3px solid var(--primary-end);
  padding-left: 13px;
  padding-right: 13px;
}

.customer-result-main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.customer-result-main strong {
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
}

.customer-company {
  color: var(--slate-light);
  font-size: 13px;
  font-weight: 400;
}

.customer-result-details {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.customer-result-details span {
  display: inline-flex;
  align-items: center;
}

.customer-search-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(
    135deg,
    rgba(91, 108, 249, 0.05),
    rgba(122, 89, 237, 0.05)
  );
  border: 1px solid rgba(91, 108, 249, 0.1);
  border-radius: 12px;
  color: var(--slate);
  font-size: 13px;
  margin-top: 12px;
}

.customer-search-hint i {
  color: var(--info);
  width: 18px;
  height: 18px;
}

.no-results {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.no-results p {
  margin: 0;
}

.search-result-details {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  gap: var(--spacing-sm);
}

.search-result-price {
  font-family: var(--font-en);
  color: var(--success);
  font-weight: 500;
}

.quantity-wrapper,
.button-wrapper {
  display: flex;
  flex-direction: column;
}

.button-wrapper {
  align-items: stretch;
}

.quantity-input {
  text-align: center;
  font-family: var(--font-en);
}

/* ==================== Buttons ==================== */
.btn {
  padding: 14px var(--spacing-lg);
  font-family: var(--font-ar);
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  min-height: var(--touch-target-min);
  width: 100%;
  letter-spacing: 0.3px;
  box-shadow: var(--shadow-sm);
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn i {
  font-size: 18px;
  line-height: 1;
}

/* Mobile First Buttons */
@media (min-width: 640px) {
  .btn {
    width: auto;
    min-height: auto;
  }
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==================== Admin Button - Under Development ==================== */
.admin-button-wrapper {
  position: relative;
  width: 100%;
}

.admin-btn-disabled {
  position: relative;
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  pointer-events: none;
  background: var(--muted) !important;
  border-color: var(--line) !important;
  color: var(--slate) !important;
}

.admin-btn-disabled:hover {
  transform: none !important;
  box-shadow: none !important;
  border-color: var(--line) !important;
  color: var(--slate) !important;
}

.dev-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(
    135deg,
    var(--warning),
    var(--warning) 85%,
    rgba(245, 158, 11, 0.8)
  );
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  margin-right: var(--spacing-xs);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.dev-badge i {
  width: 14px;
  height: 14px;
  stroke-width: 2.5px;
}

.dev-text {
  font-family: var(--font-ar);
  font-weight: var(--font-weight-bold);
}

.dev-countdown {
  font-family: "Courier New", monospace;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.5px;
  direction: ltr;
  display: inline-block;
  min-width: 65px;
  text-align: center;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
}

@media (max-width: 640px) {
  .dev-badge {
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    font-size: 11px;
  }

  .dev-countdown {
    font-size: 13px;
    min-width: 60px;
  }

  .admin-btn-disabled {
    font-size: 16px;
    padding: 14px var(--spacing-md);
  }
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  position: relative;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: white;
  color: var(--slate);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary-start);
  color: var(--primary-start);
  box-shadow: var(--shadow-sm);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  font-size: 17px;
  font-weight: 700;
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-success:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: var(--danger);
  color: white;
  padding: 8px var(--spacing-sm);
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-xs);
  min-height: var(--touch-target-min);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-warning {
  background: var(--warning);
  color: white;
  padding: 8px var(--spacing-sm);
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-xs);
  min-height: var(--touch-target-min);
}

.btn-warning:hover:not(:disabled) {
  background: #d97706;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-info {
  background: var(--info);
  color: white;
  padding: 8px var(--spacing-sm);
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-xs);
  min-height: var(--touch-target-min);
}

.btn-info:hover:not(:disabled) {
  background: #0891b2;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ==================== Enhanced Table Responsive ==================== */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  margin-bottom: var(--spacing-md);
}

.table-wrapper {
  min-width: 100%;
}

.products-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 800px;
}

@media (max-width: 768px) {
  .products-table {
    font-size: 12px;
    min-width: 600px;
  }

  .products-table th,
  .products-table td {
    padding: 8px 4px;
    white-space: nowrap;
  }

  .products-table th:nth-child(3),
  .products-table th:nth-child(4),
  .products-table th:nth-child(5),
  .products-table th:nth-child(6),
  .products-table th:nth-child(7),
  .products-table td:nth-child(3),
  .products-table td:nth-child(4),
  .products-table td:nth-child(5),
  .products-table td:nth-child(6),
  .products-table td:nth-child(7) {
    text-align: center;
  }
}

.products-table thead {
  background: var(--canvas);
}

.products-table th {
  padding: var(--spacing-sm);
  text-align: right;
  font-weight: 700;
  color: var(--slate);
  border-bottom: 2px solid var(--line);
}

.products-table td {
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.products-table tbody tr:last-child td {
  border-bottom: none;
}

.products-table tbody tr:hover {
  background: var(--canvas);
}

/* ⚠️ صف مع سعر بيع صفر - تحذير */
.products-table tbody tr.sale-price-zero {
  background: #fee2e2 !important; /* خلفية حمراء فاتحة */
  border-left: 4px solid #ef4444; /* خط أحمر على اليسار */
  animation: shake 0.3s ease-in-out;
}

.products-table tbody tr.sale-price-zero td {
  color: #dc2626;
}

.products-table tbody tr.sale-price-zero .sale-price-input {
  border-color: #ef4444 !important;
  background: #ffffff;
  color: #dc2626;
  font-weight: 600;
}

.products-table tbody tr.sale-price-zero .sale-price-warning {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #dc2626;
  font-weight: 600;
  margin-right: 8px;
}

/* ⚠️ صف مع سعر تكلفة صفر - تحذير */
.products-table tbody tr.cost-price-zero {
  background: #fee2e2 !important; /* خلفية حمراء فاتحة */
  border-left: 4px solid #ef4444; /* خط أحمر على اليسار */
  animation: shake 0.3s ease-in-out;
}

.products-table tbody tr.cost-price-zero td {
  color: #dc2626;
}

.products-table tbody tr.cost-price-zero .cost-price-input {
  border-color: #ef4444 !important;
  background: #ffffff;
  color: #dc2626;
  font-weight: 600;
}

.products-table tbody tr.cost-price-zero .cost-price-warning {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #dc2626;
  font-weight: 600;
  margin-right: 8px;
}

/* إذا كان كلا السعرين صفر */
.products-table tbody tr.sale-price-zero.cost-price-zero {
  background: #fee2e2 !important;
  border-left: 4px solid #dc2626; /* خط أحمر أغمق */
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.product-name {
  font-weight: 500;
  color: var(--ink);
}

.product-sku {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-en);
}

/* Price Issue Styles */
.price-error {
  background: var(--danger-light) !important;
  color: var(--danger-dark) !important;
  font-weight: var(--font-weight-bold) !important;
  border: 2px solid var(--danger) !important;
}

.price-warning {
  background: var(--warning-light) !important;
  color: #92400e !important;
  font-weight: var(--font-weight-semibold) !important;
  border: 2px solid var(--warning) !important;
}

.price-error-row {
  background: #fef2f2 !important;
}

.price-error-row:hover {
  background: #fee2e2 !important;
}

.price-warning-row {
  background: #fffbeb !important;
}

.price-warning-row:hover {
  background: #fef3c7 !important;
}

.price-issue-badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.price-issue-badge i {
  display: inline-block;
}

/* Quick Fix Buttons */
.quick-fix-buttons {
  border-top: 1px solid var(--line);
}

.quick-fix-buttons .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  margin-inline-start: 8px;
  background: rgba(255, 255, 255, 0.3);
  color: inherit;
  font-weight: var(--font-weight-bold);
  border-radius: 12px;
  font-size: var(--font-size-xs);
}

.btn-warning .badge {
  background: rgba(255, 255, 255, 0.3);
  color: #92400e;
}

.btn-danger .badge {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

.btn-info .badge {
  background: rgba(255, 255, 255, 0.3);
  color: var(--info-dark);
}

.price-cell {
  font-family: var(--font-en);
  font-weight: 500;
}

.profit-cell {
  font-family: var(--font-en);
  font-weight: 500;
  color: var(--success);
}

/* ==================== Editable Cells in Products Table ==================== */
.editable-cell {
  position: relative;
  padding: var(--spacing-xs);
}

.editable-input {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 8px;
  border: 2px solid var(--line);
  border-radius: var(--radius-xs);
  background: white;
  color: var(--ink);
  text-align: center;
  transition: all var(--transition);
  outline: none;
}

.editable-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: var(--canvas);
}

.editable-input:hover:not(:disabled) {
  border-color: var(--primary-light);
}

.editable-input:disabled {
  background: var(--canvas);
  cursor: not-allowed;
  opacity: 0.7;
}

.qty-input {
  width: 80px;
  min-width: 60px;
}

.sale-price-input,
.cost-price-input {
  width: 100px;
  min-width: 80px;
}

.unit-display {
  display: inline-block;
  margin-right: 4px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 768px) {
  .editable-input {
    font-size: 12px;
    padding: 4px 6px;
  }

  .qty-input {
    width: 60px;
    min-width: 50px;
  }

  .sale-price-input,
  .cost-price-input {
    width: 80px;
    min-width: 70px;
  }
}

/* ==================== Enhanced Totals Section ==================== */
.totals-section {
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.05),
    rgba(29, 78, 216, 0.05)
  );
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
  border: 2px solid var(--line);
}

@media (min-width: 640px) {
  .totals-section {
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
  }
}

.totals-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-sm);
}

@media (min-width: 640px) {
  .totals-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--spacing-md);
  }
}

.total-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--line);
  transition: all var(--transition);
}

.total-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.total-item.cost-total:hover {
  border-color: var(--info);
}

.total-item.sale-total:hover {
  border-color: var(--success);
}

.total-item.profit-total:hover {
  border-color: var(--success);
}

.total-item.margin-total:hover {
  border-color: var(--info);
}

.total-item-highlight {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: white;
  border-color: var(--primary-start);
  position: relative;
  overflow: hidden;
}

.total-item-highlight::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 200%;
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(45deg);
}

.total-label {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--slate);
}

.total-item-highlight .total-label {
  color: white;
}

.total-label-sub {
  font-size: 11px;
  opacity: 0.7;
  font-family: var(--font-en);
  font-weight: 500;
}

.total-value {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-en);
  color: var(--ink);
}

.total-value-primary {
  color: white;
}

.total-value-success {
  color: white;
}

.total-value-info {
  color: white;
}

/* ==================== New Totals Layout - Grouped Sections ==================== */
.totals-section-group {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.totals-section-group:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.totals-group-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 var(--spacing-md) 0;
  display: flex;
  align-items: center;
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--line);
}

/* Compact Grid - للتحليل الداخلي */
.totals-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

@media (max-width: 768px) {
  .totals-grid-compact {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
}

.total-item-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--canvas);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  transition: all var(--transition);
}

.total-item-compact:hover {
  background: white;
  border-color: var(--primary);
}

.total-label-compact {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
}

.total-value-compact {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-en);
  color: var(--ink);
}

/* Payment Grid - للعميل */
.totals-grid-payment {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.total-item-payment {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  background: var(--canvas);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  transition: all var(--transition);
}

.total-item-payment:hover {
  background: white;
  border-color: var(--info);
}

.total-label-payment {
  font-size: 15px;
  font-weight: 600;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.total-value-payment {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-en);
  color: var(--ink);
}

.vat-rate-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--info);
  color: white;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-en);
}

/* Grand Total - בולט במיוחד */
.grand-total-item {
  background: linear-gradient(
    135deg,
    var(--primary-start),
    var(--primary-end)
  ) !important;
  border: none !important;
  padding: var(--spacing-lg) !important;
  margin-top: var(--spacing-sm);
  box-shadow: 0 4px 16px rgba(91, 108, 249, 0.35);
}

.grand-total-item:hover {
  box-shadow: 0 6px 24px rgba(91, 108, 249, 0.45);
  transform: translateY(-2px);
}

.total-label-payment-highlight {
  font-size: 16px;
  font-weight: 700;
  color: white !important;
}

.total-value-payment-highlight {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-en);
  color: white !important;
}

/* Profit Margin Dynamic Colors */
.total-value-dynamic {
  transition: all 0.3s ease;
}

.profit-excellent {
  color: #10b981 !important;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.profit-good {
  color: #f59e0b !important;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.profit-low {
  color: #ef4444 !important;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

/* Profit Margin Indicator */
.profit-margin-indicator {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.indicator-excellent {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.indicator-good {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.indicator-low {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ==================== Actions Section ==================== */
.actions-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  align-items: center;
  margin-top: var(--spacing-xl);
  padding: var(--spacing-xl);
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.03),
    rgba(29, 78, 216, 0.03)
  );
  border-radius: var(--radius-xl);
  border: 2px solid var(--line);
}

.action-buttons-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
  width: 100%;
  max-width: 600px;
}

.btn-save-main {
  font-size: 18px;
  font-weight: 700;
  padding: 18px var(--spacing-xl);
  min-height: 60px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.btn-save-main:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.45);
}

.btn-save-main i {
  width: 22px;
  height: 22px;
}

.btn-reset-main {
  font-size: 16px;
  font-weight: 600;
  padding: 18px var(--spacing-lg);
  min-height: 60px;
}

.btn-reset-main i {
  width: 20px;
  height: 20px;
}

@media (max-width: 768px) {
  .action-buttons-group {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: var(--spacing-sm);
  }

  .btn-save-main,
  .btn-reset-main {
    width: 100%;
    font-size: 16px;
    padding: 16px var(--spacing-md);
    min-height: 54px;
  }

  .btn-save-main {
    font-size: 17px;
  }

  .actions-section {
    padding: var(--spacing-lg);
  }

  .action-hint {
    font-size: 13px;
    padding: 10px 16px;
  }

  .keyboard-shortcuts-hint {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* ==================== Download and Print Section (للعروض المحفوظة فقط) ==================== */
/* ⛔ تم إخفاء قسم التحميل والطباعة مؤقتًا - لا تقم بإعادة تفعيله حتى يتم الطلب */

.download-print-section {
  display: none !important; /* إخفاء القسم بالكامل */
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--line);
}

/* إخفاء أزرار التحميل والطباعة بشكل منفصل (في حالة وجودها في أماكن أخرى) */
#downloadPdfBtn,
#printBtn,
.download-print-buttons,
.download-print-buttons .btn {
  display: none !important;
}

.section-divider {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  position: relative;
}

.section-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
  z-index: 1;
}

.section-divider span {
  background: white;
  padding: 0 var(--spacing-md);
  color: var(--slate-light);
  font-size: 16px;
  font-weight: 600;
  position: relative;
  z-index: 2;
}

.download-print-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  justify-content: center;
  align-items: stretch;
}

.download-print-buttons .btn {
  flex: 1 1 auto;
  min-width: 160px;
  max-width: 220px;
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  white-space: nowrap;
}

.download-print-buttons .btn i {
  font-size: 18px;
}

.action-buttons-group .btn {
  min-width: 160px;
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 15px;
  font-weight: 600;
}

.btn-outline-primary {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  transition: all var(--transition-normal);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline-success {
  background: transparent;
  border: 2px solid var(--success);
  color: var(--success);
  transition: all var(--transition-normal);
}

.btn-outline-success:hover {
  background: var(--success);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline-info {
  background: transparent;
  border: 2px solid var(--info);
  color: var(--info);
  transition: all var(--transition-normal);
}

.btn-outline-info:hover {
  background: var(--info);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline-secondary {
  background: transparent;
  border: 2px solid var(--slate-light);
  color: var(--slate-light);
  transition: all var(--transition-normal);
}

.btn-outline-secondary:hover {
  background: var(--slate-light);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Desktop Responsive - Large Screens */
@media (min-width: 1200px) {
  .action-buttons-group {
    gap: var(--spacing-lg);
  }

  .action-buttons-group .btn {
    min-width: 180px;
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 16px;
  }

  .download-print-buttons {
    gap: var(--spacing-lg);
  }

  .download-print-buttons .btn {
    min-width: 180px;
    max-width: 240px;
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 16px;
  }

  .section-divider span {
    font-size: 18px;
  }
}

/* Tablet Responsive */
@media (max-width: 1024px) {
  .download-print-buttons .btn {
    min-width: 140px;
    max-width: 200px;
  }
}

/* Mobile Responsive Download Print */
@media (max-width: 768px) {
  .action-buttons-group {
    gap: var(--spacing-sm);
    justify-content: stretch;
  }

  .action-buttons-group .btn {
    flex: 1 1 45%;
    min-width: 120px;
  }

  .download-print-buttons {
    gap: var(--spacing-sm);
  }

  .download-print-buttons .btn {
    flex: 1 1 45%;
    min-width: 130px;
    max-width: none;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .action-buttons-group {
    flex-direction: column;
  }

  .action-buttons-group .btn {
    width: 100%;
    max-width: none;
  }

  .download-print-buttons {
    flex-direction: column;
  }

  .download-print-buttons .btn {
    width: 100%;
    max-width: none;
    min-width: auto;
  }
}

/* ==================== Recent Quotes ==================== */
.recent-quotes-list {
  display: grid;
  gap: var(--spacing-sm);
}

/* Recent Quotes Controls */
.recent-controls {
  display: grid;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

@media (min-width: 640px) {
  .recent-controls {
    grid-template-columns: 1fr 280px;
    align-items: end;
  }
}

.recent-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.recent-stat {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--slate);
}

.recent-search .form-input {
  width: 100%;
}

.quote-item-number {
  font-family: var(--font-en);
  font-size: 12px;
  color: var(--muted);
}

.quote-item {
  padding: var(--spacing-sm);
  background: var(--canvas);
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: all var(--transition);
  min-height: var(--touch-target-min);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Mobile First Quote Item */
@media (min-width: 640px) {
  .quote-item {
    min-height: auto;
  }
}

.quote-item:hover {
  border-color: var(--primary-start);
  transform: translateX(-4px);
}

.quote-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xs);
}

.quote-item-date {
  font-size: 14px;
  color: var(--muted);
  font-family: var(--font-en);
}

.quote-item-user {
  font-weight: 500;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quote-item-main-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.quote-item-contact {
  font-size: 13px;
  color: var(--slate);
  font-weight: 500;
  margin-top: 2px;
}

.quote-item-company {
  font-size: 13px;
  color: var(--slate-light);
  font-weight: 400;
}

.quote-item-project {
  font-size: 12px;
  color: var(--primary);
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.quote-item-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-sm);
}

.quote-item-actions {
  display: flex;
  gap: var(--spacing-xs);
  justify-content: flex-end;
  padding-top: var(--spacing-xs);
  border-top: 1px solid var(--line);
}

.quote-item-actions .btn-icon {
  padding: 6px;
  min-width: auto;
  border-radius: var(--radius-sm);
  background: var(--canvas);
  border: 1px solid var(--line);
  color: var(--slate);
  transition: all var(--transition-fast);
}

.quote-item-actions .btn-icon:hover {
  background: var(--primary-start);
  color: white;
  border-color: var(--primary-start);
  transform: translateY(-2px);
}

.quote-item-actions .btn-icon i {
  width: 16px;
  height: 16px;
}

/* Button color variants for actions */
.quote-item-actions .btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.quote-item-actions .btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.quote-item-actions .btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.quote-item-actions .btn-success:hover {
  background: var(--success-dark);
  border-color: var(--success-dark);
}

.quote-item-actions .btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--line);
}

.quote-item-actions .btn-danger:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* Share Mode Styling - تصميم ممتاز للمشاركة */
body.share-mode {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

body.share-mode .quote-view-card {
  box-shadow: 0 20px 60px rgba(91, 108, 249, 0.15);
  border: 2px solid transparent;
  background: linear-gradient(white, white) padding-box,
    linear-gradient(135deg, var(--primary-start), var(--primary-end)) border-box;
}

body.share-mode .quote-view-header {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: white;
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin: calc(-1 * var(--spacing-lg)) calc(-1 * var(--spacing-lg))
    var(--spacing-lg);
}

body.share-mode .company-name {
  color: white;
  font-size: 32px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.share-mode .company-tagline,
body.share-mode .company-details {
  color: rgba(255, 255, 255, 0.9);
}

body.share-mode .quote-info-header {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
}

body.share-mode .quote-title {
  color: white;
  font-size: 24px;
}

body.share-mode .quote-number-large {
  color: white;
  font-size: 40px;
  font-weight: 700;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

body.share-mode .quote-date {
  color: rgba(255, 255, 255, 0.95);
}

body.share-mode .section-title {
  color: var(--primary-start);
  font-size: 20px;
  font-weight: 700;
  padding-bottom: var(--spacing-sm);
  border-bottom: 3px solid var(--primary-start);
  margin-bottom: var(--spacing-md);
}

body.share-mode .products-table thead {
  background: linear-gradient(
    135deg,
    rgba(91, 108, 249, 0.1),
    rgba(122, 89, 237, 0.1)
  );
}

body.share-mode .products-table thead th {
  color: var(--primary-start);
  font-weight: 700;
}

body.share-mode .total-view-row-highlight {
  background: linear-gradient(
    135deg,
    rgba(91, 108, 249, 0.1),
    rgba(122, 89, 237, 0.1)
  );
  border: 2px solid var(--primary-start);
}

body.share-mode .quote-view-footer {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: white;
  padding: var(--spacing-lg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin: var(--spacing-lg) calc(-1 * var(--spacing-lg))
    calc(-1 * var(--spacing-lg));
  text-align: center;
}

body.share-mode .footer-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

body.share-mode .footer-company {
  font-size: 14px;
  opacity: 0.9;
}

/* أزرار المشاركة */
#shareButtons .btn-icon {
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: white;
  color: var(--slate);
  transition: all var(--transition-fast);
  cursor: pointer;
}

#shareButtons .btn-icon:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

#shareButtons .btn-icon svg {
  display: block;
}

/* ==================== UX/UI Enhancements ==================== */

/* Keyboard Hints */
.keyboard-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: var(--spacing-sm);
  font-size: 12px;
  color: var(--muted);
  opacity: 0.8;
}

.keyboard-hint kbd,
.keyboard-shortcuts-hint kbd,
kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-family: var(--font-en);
  font-weight: 600;
  line-height: 1;
  color: var(--slate);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Label Hints */
.label-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-inline-start: 4px;
}

/* Input Hints */
.input-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* Search Icon */
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

[dir="rtl"] .search-icon {
  left: auto;
  right: 12px;
}

/* Search Tips */
.search-tips {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: linear-gradient(
    135deg,
    rgba(91, 108, 249, 0.05),
    rgba(122, 89, 237, 0.05)
  );
  border: 1px solid rgba(91, 108, 249, 0.1);
  border-radius: var(--radius-sm);
}

.tip-text {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 13px;
  color: var(--slate);
  margin: 0;
}

.tip-text i {
  color: var(--primary-start);
  width: 16px;
  height: 16px;
}

/* Enhanced Empty States */
.empty-state,
.empty-state-enhanced {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl) var(--spacing-md);
  text-align: center;
}

.empty-state i,
.empty-state-enhanced i {
  width: 48px;
  height: 48px;
  color: var(--muted);
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.empty-message {
  font-size: var(--font-size-base);
  color: var(--slate);
  font-weight: 500;
  margin: 0 0 var(--spacing-xs) 0;
}

.empty-hint {
  font-size: var(--font-size-sm);
  color: var(--muted);
  display: block;
  margin-top: var(--spacing-xs);
}

/* Table Enhancements */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.table-actions {
  display: flex;
  gap: var(--spacing-xs);
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--line);
  font-size: var(--font-size-sm);
  color: var(--muted);
}

.items-count {
  font-weight: 500;
}

.items-count strong {
  color: var(--primary-start);
  font-size: var(--font-size-base);
}

/* Character Counter */
.char-counter {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-en);
}

/* Action Hint */
.action-hint {
  text-align: center;
  margin-top: var(--spacing-xs);
  font-size: 14px;
  color: var(--slate);
  font-style: normal;
  padding: 12px 20px;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  font-weight: 500;
}

.keyboard-shortcuts-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: var(--spacing-sm);
  font-size: 13px;
  color: var(--muted);
  padding: 8px 16px;
  background: rgba(37, 99, 235, 0.05);
  border-radius: var(--radius-sm);
}

/* Totals Note */
.totals-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-md);
  padding: var(--spacing-xs);
  background: rgba(91, 108, 249, 0.05);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--slate);
}

.totals-note i {
  width: 14px;
  height: 14px;
  color: var(--primary-start);
}

.system-signature {
  margin-top: var(--spacing-lg);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.4px;
}

/* High DPI screens optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .ngu-logo-inline {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Button Loading State */
.btn-loading {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 8px;
}

.btn-loading i.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Skeleton Loaders */
.quotes-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.skeleton-item {
  height: 120px;
  background: linear-gradient(
    90deg,
    var(--line) 0%,
    rgba(226, 232, 240, 0.5) 50%,
    var(--line) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Action Card Focus */
.action-card:focus {
  outline: 2px solid var(--primary-start);
  outline-offset: 4px;
}

.action-card:focus-visible {
  box-shadow: 0 0 0 4px rgba(91, 108, 249, 0.1);
}

/* Improve Input Focus States */
.form-input:focus,
.form-textarea:focus,
.search-input:focus {
  outline: 2px solid var(--primary-start);
  outline-offset: 2px;
  border-color: var(--primary-start);
}

/* Button Focus States */
.btn:focus-visible {
  outline: 2px solid var(--primary-start);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(91, 108, 249, 0.1);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .keyboard-hint kbd,
  kbd {
    border-width: 2px;
  }

  .empty-state i,
  .empty-state-enhanced i {
    opacity: 1;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .skeleton-item {
    animation: none;
    background: var(--line);
  }

  .btn-loading i.spin {
    animation: none;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile First Quote Stats */
@media (min-width: 640px) {
  .quote-item-stats {
    display: flex;
    gap: var(--spacing-md);
    font-size: var(--font-size-sm);
  }
}

.quote-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quote-stat-label {
  color: var(--muted);
}

.quote-stat-value {
  font-family: var(--font-en);
  font-weight: 500;
  color: var(--ink);
}

.quote-stat-value.success {
  color: var(--success);
}

/* ==================== Modal ==================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  max-width: 500px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.modal-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--spacing-md);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.modal-icon-success {
  background: var(--success);
  color: white;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--spacing-sm);
}

.modal-message {
  font-size: 16px;
  color: var(--slate);
  margin-bottom: var(--spacing-lg);
}

/* ==================== Enhanced Footer ==================== */
.footer {
  background: var(--ink);
  color: white;
  padding: var(--spacing-lg) 0;
  text-align: center;
  margin-top: auto;
  border-top: 3px solid var(--primary);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  align-items: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  text-align: center;
  font-size: 15px;
  opacity: 0.95;
}

.footer-brand strong {
  font-size: 20px;
  letter-spacing: 0.6px;
  color: var(--ink);
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo-img {
  height: 200px;
  width: auto;
  max-width: 400px;
  object-fit: contain;
  filter: brightness(1.05) contrast(1.05);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.footer-logo-img:hover {
  filter: brightness(1.12) contrast(1.08);
  transform: scale(1.02);
}

.footer-desc {
  font-size: 13px;
  opacity: 0.75;
  max-width: 320px;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .footer-logo-img {
    height: 180px;
    max-width: 360px;
  }

  .footer-brand strong {
    font-size: 18px;
  }

  .footer-desc {
    font-size: 12px;
    max-width: 280px;
  }
}

@media (max-width: 480px) {
  .footer-logo-img {
    height: 150px;
    max-width: 300px;
  }

  .footer-brand strong {
    font-size: 16px;
  }

  .footer-desc {
    font-size: 12px;
    max-width: 240px;
  }
}

.footer strong {
  font-weight: 700;
  color: var(--primary);
}

@media (min-width: 640px) {
  .footer-credit {
    flex-direction: row;
    gap: var(--spacing-sm);
  }

  .footer-powered {
    font-size: 12px;
  }
}

/* ==================== Loading State ==================== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.6s linear infinite;
}

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

/* ==================== Empty State ==================== */
.empty-state {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-sm);
}

.empty-state-text {
  font-size: 16px;
}

/* ==================== Enhanced Mobile Responsive ==================== */
@media (max-width: 768px) {
  /* Improve touch targets */
  .btn,
  .lang-btn,
  .logout-btn,
  .sound-toggle-btn {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 16px;
  }

  /* Better spacing for mobile */
  .main-actions {
    margin-bottom: var(--spacing-lg);
    padding: 0 var(--spacing-xs);
    gap: var(--spacing-md);
  }

  .action-card {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-lg);
    min-height: 250px;
  }

  .action-icon {
    width: 60px;
    height: 60px;
    font-size: 24px;
    margin-bottom: var(--spacing-sm);
  }

  .action-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xs);
  }

  .action-description {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
  }

  .btn-large {
    padding: 12px var(--spacing-md);
    font-size: 16px;
    min-width: 150px;
  }

  /* Improve form inputs */
  .form-input,
  .form-textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 16px;
    border-radius: var(--radius-md);
  }

  /* Better table scrolling */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
  }

  /* Improve search results */
  .search-results {
    max-height: 300px;
    border-radius: var(--radius-md);
  }

  .search-result-item {
    padding: 16px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Better card layouts */
  .card {
    margin-bottom: var(--spacing-md);
    border-radius: var(--radius-lg);
  }

  .card-header {
    padding: var(--spacing-md);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .card-body {
    padding: var(--spacing-md);
  }

  /* Improve totals section */
  .totals-section {
    margin: var(--spacing-md) 0;
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
  }

  .total-item {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-radius: var(--radius-md);
  }

  /* Better action buttons */
  .actions-section {
    gap: var(--spacing-md);
    padding-top: var(--spacing-md);
  }

  .btn {
    padding: 16px var(--spacing-md);
    font-size: 16px;
    border-radius: var(--radius-md);
  }

  /* Improve header on mobile */
  .header {
    padding: var(--spacing-md) 0;
  }

  .header-content {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    min-height: auto;
  }

  .logo-section {
    text-align: center;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
    padding: 0 var(--spacing-sm);
  }
}

/* ==================== Small Mobile Responsive ==================== */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-xs);
  }

  .main-actions {
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
  }

  .action-card {
    padding: var(--spacing-md);
    min-height: 200px;
  }

  .action-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
    margin-bottom: var(--spacing-sm);
  }

  .action-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xs);
  }

  .action-description {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
  }

  .btn-large {
    padding: 12px var(--spacing-md);
    font-size: 16px;
    min-width: 150px;
  }

  .card {
    margin-bottom: var(--spacing-sm);
  }

  .card-header {
    padding: var(--spacing-sm);
  }

  .card-body {
    padding: var(--spacing-sm);
  }

  .products-table {
    font-size: var(--font-size-xs);
  }

  .products-table th,
  .products-table td {
    padding: 4px;
  }

  .search-result-item {
    padding: var(--spacing-xs);
  }

  .quote-item {
    padding: var(--spacing-sm);
  }

  .quote-item-stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xs);
  }

  .header-content {
    flex-direction: column;
    gap: var(--spacing-xs);
    text-align: center;
  }

  .logo-section {
    width: 100%;
    justify-content: center;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
  }

  .logo-wrapper {
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  .language-switcher {
    order: -1;
    align-self: center;
  }

  .tagline {
    order: 3;
    width: 100%;
    text-align: center;
  }

  .footer-credit {
    flex-direction: column;
    gap: var(--spacing-xs);
    text-align: center;
  }
}

/* ==================== Quote View Styles ==================== */
.quote-view-card {
  max-width: 900px;
  margin: 0 auto;
}

.quote-view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.company-info {
  flex: 1;
}

.company-name {
  font-family: var(--font-en);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}

.company-tagline {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: var(--spacing-sm);
}

.company-details {
  font-size: 14px;
  line-height: 1.8;
  opacity: 0.85;
}

.quote-info-header {
  text-align: left;
  direction: ltr;
}

.quote-title {
  font-size: 16px;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: var(--spacing-xs);
}

.quote-number-large {
  font-family: var(--font-en);
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 4px;
}

.quote-date {
  font-size: 14px;
  opacity: 0.85;
}

.customer-section,
.products-section,
.notes-section {
  padding: var(--spacing-md);
  border-bottom: 2px solid var(--line);
}

.customer-details {
  background: var(--canvas);
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
}

.customer-details p {
  margin: var(--spacing-xs) 0;
}

.products-table-view {
  font-size: 15px;
}

.totals-view-section {
  padding: var(--spacing-md);
}

.totals-view-grid {
  background: var(--canvas);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.total-view-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--line);
}

.total-view-row:last-child {
  border-bottom: none;
}

.total-view-row-highlight {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: white;
  font-weight: 700;
  font-size: 20px;
  padding: var(--spacing-md);
}

.total-view-label {
  font-weight: 500;
}

.total-view-value {
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 18px;
}

.profit-info {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-md);
  background: #fff9e6;
  border-radius: var(--radius-sm);
  border: 2px solid var(--warning);
}

.profit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.profit-item {
  background: white;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.profit-item-success {
  background: var(--success);
  color: white;
}

.profit-item-info {
  background: var(--info);
  color: white;
}

.profit-label {
  font-size: 14px;
  font-weight: 500;
}

.profit-value {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 700;
}

.notes-content {
  background: var(--canvas);
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
}

.quote-view-footer {
  padding: var(--spacing-lg);
  text-align: center;
  background: var(--canvas);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.footer-text {
  font-size: 18px;
  font-weight: 500;
  color: var(--slate);
  margin-bottom: var(--spacing-xs);
}

.footer-company {
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-start);
}

/* ==================== Notification System ==================== */
/* ==================== Price Advisor Notification ==================== */
.price-advisor-stack {
  position: fixed;
  inset-inline-end: var(--spacing-lg);
  bottom: var(--spacing-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  width: min(360px, calc(100% - var(--spacing-xl) * 2));
  z-index: 10000;
  pointer-events: none;
}

[dir="rtl"] .price-advisor-stack {
  inset-inline-end: auto;
  inset-inline-start: var(--spacing-lg);
}

.price-advisor-notification {
  position: relative;
  width: 100%;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  padding: var(--spacing-md) var(--spacing-lg);
  animation: slideInRight 0.3s ease-out;
  border-left: 5px solid var(--primary-start);
  font-family: var(--font-ar);
  pointer-events: auto;
}

.price-advisor-notification.fade-out {
  animation: slideOutRight 0.3s ease-out;
}

/* Price Advisor Header with Branding */
.price-advisor-header {
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid rgba(37, 99, 235, 0.15);
}

.price-advisor-branding {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
}

.price-advisor-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-start);
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.price-advisor-name i {
  color: var(--primary-start) !important;
  stroke: var(--primary-start);
  -webkit-text-fill-color: var(--primary-start);
  opacity: 1;
}

.price-advisor-inline-anchor {
  margin-top: var(--spacing-xs);
}

.price-advisor-inline {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(6, 182, 212, 0.25);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: var(--shadow-xs);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  max-width: 100%;
}

.price-advisor-inline-warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.12),
    rgba(217, 119, 6, 0.08)
  );
  color: #92400e;
}

.price-advisor-inline-error {
  border-color: rgba(239, 68, 68, 0.35);
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.12),
    rgba(220, 38, 38, 0.08)
  );
  color: #991b1b;
}

.price-advisor-inline-info,
.price-advisor-inline-guide {
  border-color: rgba(6, 182, 212, 0.25);
  background: rgba(6, 182, 212, 0.08);
  color: #0e7490;
}

.price-advisor-inline-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.price-advisor-inline-icon i {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
}

.price-advisor-inline-text {
  flex: 1 1 auto;
  font-weight: 500;
  word-break: break-word;
}

.price-advisor-inline-dismiss {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.price-advisor-inline-dismiss:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.price-advisor-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.price-advisor-beta {
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.price-advisor-powered {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.price-advisor-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-advisor-title strong {
  color: var(--success);
}

.price-advisor-message {
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.price-advisor-message:last-of-type {
  margin-bottom: 0;
}

.price-advisor-error {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.1),
    rgba(220, 38, 38, 0.08)
  );
  border: 2px solid rgba(239, 68, 68, 0.3);
  color: #991b1b;
  font-weight: 600;
}

.price-advisor-warning {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.1),
    rgba(217, 119, 6, 0.08)
  );
  border: 2px solid rgba(245, 158, 11, 0.3);
  color: #92400e;
  font-weight: 600;
}

.price-advisor-success {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1),
    rgba(5, 150, 105, 0.08)
  );
  border: 2px solid rgba(16, 185, 129, 0.3);
  color: #065f46;
  font-weight: 600;
}

.price-advisor-info {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.08),
    rgba(14, 165, 233, 0.06)
  );
  border: 2px solid rgba(6, 182, 212, 0.25);
  color: #0e7490;
  font-weight: 500;
}

.price-advisor-guide {
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.08),
    rgba(124, 58, 237, 0.06)
  );
  border: 2px solid rgba(139, 92, 246, 0.25);
  color: #5b21b6;
  font-weight: 500;
  font-style: italic;
}

.price-advisor-close {
  position: absolute;
  top: var(--spacing-sm);
  inset-inline-start: var(--spacing-sm);
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.price-advisor-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  transform: scale(1.1);
}

[dir="rtl"] .price-advisor-close {
  inset-inline-start: auto;
  inset-inline-end: var(--spacing-sm);
}

@keyframes slideInRight {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* Mobile responsive for price advisor */
@media (max-width: 768px) {
  .price-advisor-stack {
    inset-inline-end: var(--spacing-md);
    inset-inline-start: var(--spacing-md);
    bottom: var(--spacing-xl);
    width: auto;
  }

  [dir="rtl"] .price-advisor-stack {
    inset-inline-start: var(--spacing-md);
  }

  .price-advisor-notification {
    width: 100%;
    max-width: none;
    padding: var(--spacing-md);
  }

  .price-advisor-branding {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }

  .price-advisor-name {
    font-size: 14px;
  }

  .price-advisor-meta {
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-xs);
  }

  .price-advisor-beta {
    font-size: 10px;
    padding: 2px 6px;
  }

  .price-advisor-powered {
    font-size: 9px;
  }

  .price-advisor-title {
    font-size: 16px;
    padding-right: 40px;
  }

  .price-advisor-message {
    font-size: 14px;
    padding: 10px 12px;
  }
}

.notification {
  position: fixed;
  top: var(--spacing-lg);
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  min-width: 320px;
  max-width: 500px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  z-index: 10000;
  transition: transform var(--transition-slow);
  border: 2px solid var(--line);
}

.notification-show {
  transform: translateX(-50%) translateY(0);
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.notification-content {
  flex: 1;
}

.notification-message {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

.notification-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--canvas);
  color: var(--slate);
  font-size: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-close:hover {
  background: var(--line);
  transform: rotate(90deg);
}

/* Notification Types */
.notification-success {
  border-color: var(--success);
}

.notification-success .notification-icon {
  background: var(--success-light);
  color: var(--success-dark);
}

.notification-error {
  border-color: var(--danger);
}

.notification-error .notification-icon {
  background: var(--danger-light);
  color: var(--danger-dark);
}

.notification-warning {
  border-color: var(--warning);
}

.notification-warning .notification-icon {
  background: var(--warning-light);
  color: var(--warning);
}

.initial-setup-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  padding: 18px 24px;
  margin-bottom: var(--spacing-lg);
  border-radius: 22px;
  background: linear-gradient(
    135deg,
    rgba(91, 108, 249, 0.12),
    rgba(122, 89, 237, 0.1)
  );
  border: 1px dashed rgba(91, 108, 249, 0.35);
  box-shadow: 0 16px 32px rgba(91, 108, 249, 0.12);
}

.initial-setup-banner.visible {
  display: flex;
}

.initial-setup-banner .banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(91, 108, 249, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--primary-start);
  flex-shrink: 0;
}

.initial-setup-banner .banner-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--slate);
}

.initial-setup-banner .banner-content strong {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.initial-setup-banner .banner-content p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}

.initial-setup-banner .banner-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.initial-setup-banner .banner-actions .btn {
  min-width: 140px;
}

@media (max-width: 820px) {
  .initial-setup-banner {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .initial-setup-banner .banner-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .initial-setup-banner .banner-actions .btn {
    min-width: 0;
  }
}

@media (max-width: 600px) {
  .initial-setup-banner {
    padding: 16px 18px;
    gap: var(--spacing-md);
    align-items: center;
    text-align: center;
  }

  .initial-setup-banner .banner-content {
    align-items: center;
  }

  .initial-setup-banner .banner-content strong {
    font-size: 1rem;
  }

  .initial-setup-banner .banner-content p {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .initial-setup-banner .banner-actions {
    justify-content: center;
  }

  .initial-setup-banner .banner-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

.notification-info {
  border-color: var(--info);
}

.notification-info .notification-icon {
  background: var(--info-light);
  color: var(--info-dark);
}

/* Mobile Responsive Notifications */
@media (max-width: 768px) {
  .notification {
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    right: var(--spacing-sm);
    transform: translateY(-120%);
    min-width: auto;
    max-width: none;
    padding: var(--spacing-sm);
    gap: var(--spacing-sm);
    border-radius: var(--radius-md);
  }

  .notification-show {
    transform: translateY(0);
  }

  .notification-icon {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .notification-message {
    font-size: 14px;
    line-height: 1.3;
  }

  .notification-close {
    width: 24px;
    height: 24px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .notification {
    top: var(--spacing-xs);
    left: var(--spacing-xs);
    right: var(--spacing-xs);
    padding: var(--spacing-xs);
    gap: var(--spacing-xs);
    border-radius: var(--radius-sm);
  }

  .notification-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .notification-message {
    font-size: 13px;
    line-height: 1.2;
  }

  .notification-close {
    width: 22px;
    height: 22px;
    font-size: 16px;
  }
}

/* ==================== Confirm Dialog ==================== */
.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.confirm-show {
  opacity: 1;
}

.confirm-dialog {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  max-width: 450px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  text-align: center;
  transform: scale(0.9);
  transition: transform var(--transition-slow);
}

.confirm-show .confirm-dialog {
  transform: scale(1);
}

/* Mobile Responsive Confirm Dialog */
@media (max-width: 768px) {
  .confirm-dialog {
    max-width: 90%;
    width: 95%;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
  }

  .confirm-icon {
    width: 56px;
    height: 56px;
    font-size: 28px;
    margin-bottom: var(--spacing-sm);
  }

  .confirm-title {
    font-size: 20px;
    margin-bottom: var(--spacing-sm);
  }

  .confirm-message {
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: var(--spacing-lg);
  }

  .confirm-actions {
    gap: var(--spacing-sm);
  }

  .confirm-actions .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .confirm-dialog {
    max-width: 95%;
    width: 98%;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
  }

  .confirm-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
    margin-bottom: var(--spacing-xs);
  }

  .confirm-title {
    font-size: 18px;
    margin-bottom: var(--spacing-xs);
  }

  .confirm-message {
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
  }

  .confirm-actions {
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  .confirm-actions .btn {
    width: 100%;
    padding: var(--spacing-sm);
    font-size: 13px;
  }
}

.confirm-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--spacing-md);
  background: var(--warning-light);
  color: var(--warning);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
}

.confirm-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--spacing-sm);
}

.confirm-message {
  font-size: 16px;
  color: var(--slate);
  margin-bottom: var(--spacing-lg);
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
}

.confirm-actions .btn {
  min-width: 120px;
}

/* ==================== Loading Overlay ==================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.loading-show {
  opacity: 1;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  color: white;
  font-size: 16px;
  font-weight: 500;
}

/* Mobile Responsive Loading Overlay */
@media (max-width: 768px) {
  .loading-spinner {
    width: 48px;
    height: 48px;
    border-width: 3px;
  }

  .loading-text {
    font-size: 14px;
    padding: 0 var(--spacing-sm);
  }
}

@media (max-width: 480px) {
  .loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
  }

  .loading-text {
    font-size: 13px;
    padding: 0 var(--spacing-xs);
  }
}

/* ==================== Search Loading ==================== */
.search-loading {
  padding: var(--spacing-md);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ==================== Button Icon ==================== */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  gap: 4px;
}

.btn-icon .icon {
  font-size: 16px;
}

/* ==================== Welcome Modal ==================== */
.welcome-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.95),
    rgba(29, 78, 216, 0.95)
  );
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-slow);
}

.welcome-modal.show {
  opacity: 1;
  visibility: visible;
}

.welcome-content {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  text-align: center;
  transform: scale(0.9);
  transition: transform var(--transition-slow);
}

.welcome-modal.show .welcome-content {
  transform: scale(1);
}

.welcome-icon {
  font-size: 100px;
  margin-bottom: var(--spacing-md);
  animation: pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.welcome-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--spacing-sm);
  font-family: var(--font-logo);
  letter-spacing: 0.5px;
}

.welcome-subtitle {
  font-size: 18px;
  color: var(--slate);
  margin-bottom: var(--spacing-xl);
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-xl) 0;
}

.welcome-feature {
  padding: var(--spacing-md);
  background: var(--canvas);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.welcome-feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  font-size: 40px;
  margin-bottom: var(--spacing-sm);
}

.feature-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--spacing-xs);
}

.feature-desc {
  font-size: 14px;
  color: var(--slate);
  line-height: 1.6;
}

.welcome-lang-selector {
  margin: var(--spacing-xl) 0;
  padding: var(--spacing-md);
  background: var(--canvas);
  border-radius: var(--radius-lg);
}

.lang-selector-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--spacing-sm);
}

.lang-buttons {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.lang-select-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-md);
  background: white;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  min-width: 120px;
}

.lang-select-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.lang-select-btn.active {
  border-color: var(--primary);
  background: var(--info-light);
}

.lang-flag {
  font-size: 32px;
}

.lang-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.btn-large {
  padding: 16px var(--spacing-lg);
  font-size: 18px;
  font-weight: 700;
  min-width: 200px;
}

.welcome-start-btn {
  margin-top: var(--spacing-md);
}

/* ==================== Performance & Accessibility Enhancements ==================== */
/* Hardware acceleration for animations */
.btn,
.card,
.quote-item,
.logo-icon,
.notification,
.action-card,
.total-item {
  will-change: transform;
  transform: translateZ(0);
}

/* Smooth scrolling for mobile */
@media (max-width: 768px) {
  html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  body {
    -webkit-overflow-scrolling: touch;
  }
}

/* Prevent text selection on UI elements */
.btn,
.lang-btn,
.logout-btn,
.sound-toggle-btn,
.action-card {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Improve focus indicators for mobile */
@media (max-width: 768px) {
  .btn:focus,
  .form-input:focus,
  .form-textarea:focus,
  .lang-btn:focus,
  .logout-btn:focus,
  .sound-toggle-btn:focus {
    outline: 3px solid var(--primary-start);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.2);
  }
}

/* Optimize font loading - Fonts are loaded via Google Fonts */

/* Optimize images */
img {
  max-width: 100%;
  height: auto;
}

/* Optimize scroll performance */
.search-results,
.recent-quotes-list {
  contain: layout style paint;
}

/* Optimize repaints */
.card-header,
.card-body,
.totals-section {
  contain: layout style;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --line: #000000;
    --muted: #000000;
    --slate: #000000;
  }

  .btn-primary {
    background: #000000;
    border: 2px solid #000000;
  }

  .btn-secondary {
    border: 2px solid #000000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .btn:hover:not(:disabled) {
    transform: none;
  }

  .card:hover {
    transform: none;
  }

  .quote-item:hover {
    transform: none;
  }

  .action-card:hover {
    transform: none;
  }

  .total-item:hover {
    transform: none;
  }
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip links */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-start);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: 10000;
}

.skip-link:focus {
  top: 6px;
}

/* ==================== Admin Panel Styles ==================== */
.admin-dashboard {
  padding: var(--spacing-lg) 0;
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-start);
}

.stat-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 32px;
  font-weight: var(--font-weight-bold);
  color: var(--ink);
  margin: 0 0 var(--spacing-xs) 0;
  font-family: var(--font-en);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--slate);
  margin: 0;
  font-weight: var(--font-weight-medium);
}

/* Management Sections */
.management-sections {
  display: grid;
  gap: var(--spacing-xl);
}

.management-card {
  margin-bottom: var(--spacing-xl);
}

.management-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.management-card .card-title {
  margin: 0;
}

/* Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

@media (min-width: 640px) {
  .settings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.setting-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--slate);
}

.settings-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
  padding-top: var(--spacing-lg);
  border-top: 2px solid var(--line);
}

@media (max-width: 640px) {
  .settings-actions {
    flex-direction: column;
  }
}

/* Enhanced Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  transition: transform var(--transition-slow);
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: var(--spacing-lg);
  border-bottom: 2px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--ink);
  margin: 0;
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--canvas);
  color: var(--slate);
  font-size: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--line);
  transform: rotate(90deg);
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  padding: var(--spacing-lg);
  border-top: 2px solid var(--line);
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .modal-footer {
    flex-direction: column;
  }
}

/* Enhanced Table Styles */
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 800px;
}

.users-table thead {
  background: var(--canvas);
}

.users-table th {
  padding: var(--spacing-sm);
  text-align: right;
  font-weight: 700;
  color: var(--slate);
  border-bottom: 2px solid var(--line);
}

.users-table td {
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.users-table tbody tr:last-child td {
  border-bottom: none;
}

.users-table tbody tr:hover {
  background: var(--canvas);
}

.user-name {
  font-weight: 500;
  color: var(--ink);
}

.user-email {
  color: var(--slate);
  font-family: var(--font-en);
}

.user-last-login {
  font-family: var(--font-en);
  color: var(--muted);
  font-size: var(--font-size-sm);
}

/* Status and Role Badges */
.status-badge,
.role-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active {
  background: var(--success-light);
  color: var(--success-dark);
}

.status-inactive {
  background: var(--danger-light);
  color: var(--danger-dark);
}

.role-admin {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.role-user {
  background: var(--info-light);
  color: var(--info-dark);
}

/* Action Buttons */
.actions-cell {
  display: flex;
  gap: var(--spacing-xs);
  justify-content: center;
}

.btn-sm {
  padding: 6px 8px;
  font-size: var(--font-size-xs);
  min-height: 32px;
  min-width: 32px;
}

.btn-sm i {
  font-size: 14px;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.loading-show {
  opacity: 1;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: white;
  font-size: 16px;
  font-weight: 500;
}

/* Mobile Responsive for Admin */
@media (max-width: 768px) {
  .admin-dashboard {
    padding: var(--spacing-md) 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
  }

  .stat-card {
    padding: var(--spacing-md);
  }

  .stat-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .stat-number {
    font-size: 24px;
  }

  .management-card .card-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-md);
  }

  .management-card .card-title {
    text-align: center;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .settings-actions {
    flex-direction: column;
  }

  .modal {
    padding: var(--spacing-sm);
  }

  .modal-content {
    max-height: 95vh;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: var(--spacing-md);
  }

  .users-table,
  .products-table {
    font-size: 12px;
    min-width: 600px;
  }

  .users-table th,
  .users-table td,
  .products-table th,
  .products-table td {
    padding: 6px 4px;
  }

  .actions-cell {
    flex-direction: column;
    gap: 4px;
  }

  .btn-sm {
    padding: 8px;
    font-size: var(--font-size-xs);
    min-height: 36px;
    min-width: 36px;
  }
}

@media (max-width: 480px) {
  .stat-card {
    flex-direction: column;
    text-align: center;
    padding: var(--spacing-sm);
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .stat-number {
    font-size: 20px;
  }

  .stat-label {
    font-size: var(--font-size-xs);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: var(--spacing-sm);
  }

  .users-table,
  .products-table {
    font-size: 11px;
    min-width: 500px;
  }

  .users-table th,
  .users-table td,
  .products-table th,
  .products-table td {
    padding: 4px 2px;
  }
}
@media print {
  .header,
  .footer,
  .search-section,
  .actions-section,
  .recent-quotes-card,
  .notification,
  .confirm-overlay,
  .loading-overlay,
  .welcome-modal {
    display: none !important;
  }

  .card {
    box-shadow: none;
    page-break-inside: avoid;
    border: 1px solid #000;
  }

  .products-table {
    page-break-inside: avoid;
  }

  .totals-section {
    page-break-inside: avoid;
  }

  * {
    color: #000 !important;
    background: #fff !important;
  }
}

/* ==================== Floating Action Button (FAB) - Create Quote ==================== */
.fab-create-quote {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow: visible;
  animation: fab-pulse 2s ease-in-out infinite;
}

.fab-create-quote i {
  font-size: 28px;
  transition: transform 0.3s ease;
}

.fab-create-quote:hover {
  transform: scale(1.1) translateY(-4px);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.5), 0 8px 16px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  animation: none;
}

.fab-create-quote:hover i {
  transform: rotate(90deg);
}

.fab-create-quote:active {
  transform: scale(1.05) translateY(-2px);
}

.fab-create-quote:focus {
  outline: 3px solid var(--primary-start);
  outline-offset: 4px;
}

/* Tooltip */
.fab-tooltip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.95);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.fab-tooltip::after {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: rgba(15, 23, 42, 0.95);
}

.fab-create-quote:hover .fab-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(8px);
}

/* Pulse animation */
@keyframes fab-pulse {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4),
      0 4px 12px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.6),
      0 4px 12px rgba(0, 0, 0, 0.2), 0 0 0 8px rgba(59, 130, 246, 0.2);
  }
}

/* ==================== Responsive - Welcome Modal ==================== */
@media (max-width: 768px) {
  .welcome-title {
    font-size: 24px;
  }

  .welcome-subtitle {
    font-size: 16px;
  }

  .welcome-features {
    grid-template-columns: 1fr;
  }

  .lang-buttons {
    flex-direction: column;
  }

  /* ==================== Logout Button ==================== */
  .logout-btn {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition);
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xs);
  }

  .logout-btn i {
    font-size: 18px;
  }

  /* Mobile First Logout Button */
  @media (min-width: 640px) {
    .logout-btn {
      min-height: auto;
      min-width: auto;
    }
  }

  .logout-btn:hover {
    background: var(--danger-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
  }

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

  /* ==================== Sound Toggle Button ==================== */
  .sound-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition);
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xs);
    backdrop-filter: blur(10px);
  }

  .sound-toggle-btn i {
    font-size: 18px;
  }

  .sound-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
  }

  .sound-toggle-btn:active {
    transform: translateY(0);
  }

  .sound-toggle-btn.sound-disabled {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
  }

  .sound-toggle-btn.sound-disabled:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.4);
  }

  /* Mobile First Sound Button */
  @media (min-width: 640px) {
    .sound-toggle-btn {
      min-height: auto;
      min-width: auto;
    }
  }

  /* ==================== Admin Quick Access Button ==================== */
  .admin-quick-btn {
    background: linear-gradient(
      135deg,
      rgba(139, 92, 246, 0.2) 0%,
      rgba(124, 58, 237, 0.2) 100%
    );
    color: white;
    border: 2px solid rgba(167, 139, 250, 0.4);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition);
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
  }

  .admin-quick-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
  }

  .admin-quick-btn:hover::before {
    width: 300px;
    height: 300px;
  }

  .admin-quick-btn i {
    font-size: 18px;
    position: relative;
    z-index: 1;
    animation: rotate-gear 3s linear infinite;
  }

  @keyframes rotate-gear {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }

  .admin-quick-btn:hover {
    background: linear-gradient(
      135deg,
      rgba(139, 92, 246, 0.35) 0%,
      rgba(124, 58, 237, 0.35) 100%
    );
    border-color: rgba(167, 139, 250, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5), 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .admin-quick-btn:active {
    transform: translateY(0);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
  }

  /* Mobile First Admin Button */
  @media (min-width: 640px) {
    .admin-quick-btn {
      min-height: auto;
      min-width: auto;
    }
  }

  /* Pause animation on hover for better UX */
  .admin-quick-btn:hover i {
    animation-play-state: paused;
  }

  /* FAB Responsive adjustments */
  @media (max-width: 768px) {
    .fab-create-quote {
      bottom: 1.5rem;
      left: 1.5rem;
      width: 56px;
      height: 56px;
    }

    .fab-create-quote i {
      font-size: 24px;
    }

    .fab-tooltip {
      display: none;
    }
  }

  @media (max-width: 480px) {
    .fab-create-quote {
      bottom: 1rem;
      left: 1rem;
      width: 52px;
      height: 52px;
    }

    .fab-create-quote i {
      font-size: 22px;
    }
  }

  /* ==================== Accessibility Improvements ==================== */
  /* Focus indicators */
  .btn:focus,
  .form-input:focus,
  .form-textarea:focus,
  .lang-btn:focus,
  .logout-btn:focus,
  .sound-toggle-btn:focus,
  .admin-quick-btn:focus {
    outline: 3px solid var(--primary-start);
    outline-offset: 2px;
  }

  /* High contrast mode support */
  @media (prefers-contrast: high) {
    :root {
      --line: #000000;
      --muted: #000000;
      --slate: #000000;
    }

    .btn-primary {
      background: #000000;
      border: 2px solid #000000;
    }

    .btn-secondary {
      border: 2px solid #000000;
    }
  }

  /* Reduced motion support */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }

    .btn:hover:not(:disabled) {
      transform: none;
    }

    .card:hover {
      transform: none;
    }

    .quote-item:hover {
      transform: none;
    }
  }

  /* Screen reader only content */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  /* Skip links */
  .skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-start);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    z-index: 10000;
  }

  .skip-link:focus {
    top: 6px;
  }

  /* ==================== Language Direction Fixes ==================== */
  [dir="rtl"] {
    direction: rtl;
    text-align: right;
  }

  [dir="ltr"] {
    direction: ltr;
    text-align: left;
  }

  /* Ensure proper text direction for all elements */
  body[dir="rtl"] * {
    direction: rtl;
  }

  body[dir="ltr"] * {
    direction: ltr;
  }

  /* Fix for mixed language display */
  .lang-fix {
    unicode-bidi: isolate;
    direction: inherit;
  }

  /* ==================== Tablet Responsive ==================== */
  @media (max-width: 768px) and (min-width: 481px) {
    .container {
      padding: 0 var(--spacing-sm);
    }

    .main-actions {
      grid-template-columns: 1fr;
      gap: var(--spacing-md);
    }

    .action-card {
      padding: var(--spacing-lg);
    }

    .action-icon {
      width: 60px;
      height: 60px;
      font-size: 24px;
    }

    .action-title {
      font-size: var(--font-size-lg);
    }

    .search-container {
      grid-template-columns: 1fr;
      gap: var(--spacing-sm);
    }

    .quantity-wrapper {
      width: 100%;
    }

    .products-table {
      font-size: var(--font-size-sm);
    }

    .products-table th,
    .products-table td {
      padding: var(--spacing-xs);
    }

    .totals-grid {
      grid-template-columns: 1fr;
      gap: var(--spacing-sm);
    }

    .actions-section {
      flex-direction: column;
      gap: var(--spacing-sm);
    }

    .btn {
      width: 100%;
      justify-content: center;
    }

    .welcome-modal {
      padding: var(--spacing-sm);
    }

    .welcome-features {
      grid-template-columns: 1fr;
      gap: var(--spacing-md);
    }

    .lang-buttons {
      flex-direction: column;
      gap: var(--spacing-sm);
    }

    .lang-select-btn {
      width: 100%;
    }
  }

  /* ==================== Small Mobile Responsive ==================== */
  @media (max-width: 480px) {
    .container {
      padding: 0 var(--spacing-xs);
    }

    .main-actions {
      gap: var(--spacing-md);
      margin-bottom: var(--spacing-lg);
    }

    .action-card {
      padding: var(--spacing-md);
    }

    .action-icon {
      width: 50px;
      height: 50px;
      font-size: 20px;
      margin-bottom: var(--spacing-sm);
    }

    .action-title {
      font-size: var(--font-size-lg);
      margin-bottom: var(--spacing-xs);
    }

    .action-description {
      font-size: var(--font-size-sm);
      margin-bottom: var(--spacing-md);
    }

    .btn-large {
      padding: 12px var(--spacing-md);
      font-size: 16px;
      min-width: 150px;
    }

    .card {
      margin-bottom: var(--spacing-sm);
    }

    .card-header {
      padding: var(--spacing-sm);
    }

    .card-body {
      padding: var(--spacing-sm);
    }

    .products-table {
      font-size: var(--font-size-xs);
    }

    .products-table th,
    .products-table td {
      padding: 4px;
    }

    .search-result-item {
      padding: var(--spacing-xs);
    }

    .quote-item {
      padding: var(--spacing-sm);
    }

    .quote-item-stats {
      grid-template-columns: 1fr 1fr;
      gap: var(--spacing-xs);
    }

    .header-content {
      flex-direction: column;
      gap: var(--spacing-xs);
      text-align: center;
    }

    .logo-section {
      width: 100%;
      justify-content: center;
    }

    .header-controls {
      width: 100%;
      justify-content: space-between;
    }

    .logo-wrapper {
      flex-direction: column;
      gap: var(--spacing-xs);
    }

    .language-switcher {
      order: -1;
      align-self: center;
    }

    .tagline {
      order: 3;
      width: 100%;
      text-align: center;
    }
  }
}

/* ==================== Customer Read-Only Display ==================== */
.customer-info-display {
  margin-bottom: var(--spacing-lg);
}

.customer-readonly-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #7dd3fc;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.15);
}

.customer-readonly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid #7dd3fc;
}

.customer-readonly-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: #0369a1;
}

.customer-readonly-title i {
  width: 28px;
  height: 28px;
  stroke-width: 2.5px;
}

.customer-readonly-body {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.customer-readonly-row {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid #bae6fd;
  transition: all 0.2s ease-out;
}

.customer-readonly-row:hover {
  border-color: #38bdf8;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.1);
  transform: translateX(-2px);
}

.customer-readonly-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  min-width: 140px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.customer-readonly-label i {
  width: 18px;
  height: 18px;
  color: #0ea5e9;
  flex-shrink: 0;
  stroke-width: 2px;
}

/* ==================== Footer Styling ==================== */
.footer {
  background: linear-gradient(135deg, var(--ink) 0%, #1e293b 100%);
  color: white;
  padding: var(--spacing-xl) 0;
  margin-top: auto;
}

.footer-content {
  text-align: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.footer-brand strong {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: white;
}

.footer-logo {
  margin: var(--spacing-sm) 0;
}

.footer-logo-img {
  height: 120px;
  width: auto;
  max-width: 300px;
  /* تطبيق فلتر لتفتيح اللوجو وجعله مناسب للخلفية الداكنة */
  filter: brightness(0) invert(1);
  opacity: 0.95;
  transition: all var(--transition);
}

.footer-logo-img:hover {
  opacity: 1;
  transform: scale(1.05);
}

.footer-desc {
  font-size: var(--font-size-base);
  color: rgba(255, 255, 255, 0.85);
  font-weight: var(--font-weight-medium);
}

@media (max-width: 768px) {
  .footer {
    padding: var(--spacing-lg) 0;
  }

  .footer-brand strong {
    font-size: var(--font-size-xl);
  }

  .footer-logo-img {
    height: 100px;
    max-width: 250px;
  }

  .footer-desc {
    font-size: var(--font-size-sm);
  }
}

.customer-readonly-value {
  flex: 1;
  font-size: var(--font-size-md);
  font-weight: 500;
  color: var(--ink);
  word-break: break-word;
  line-height: 1.5;
  padding: 2px 0;
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--font-size-sm);
  gap: 6px;
  font-weight: 600;
}

.btn-sm i {
  width: 16px;
  height: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .customer-readonly-card {
    padding: var(--spacing-md);
  }

  .customer-readonly-header {
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: flex-start;
  }

  .customer-readonly-row {
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  .customer-readonly-label {
    min-width: auto;
    font-size: var(--font-size-xs);
  }

  .customer-readonly-value {
    font-size: var(--font-size-sm);
  }
}

/* ==================== Discount Section Styling ==================== */
.discount-section {
  margin-bottom: var(--spacing-lg);
}

.discount-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--spacing-md);
  align-items: end;
}

.discount-type-wrapper,
.discount-value-wrapper,
.discount-amount-display-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.discount-amount-display {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--success);
  padding: var(--spacing-sm);
  background: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.discount-amount-display-wrapper.hidden {
  display: none;
}

.total-row.discount-row {
  color: #059669;
  font-weight: var(--font-weight-semibold);
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
  border-right: 3px solid var(--success);
}

.total-row.discount-row .label {
  color: #059669;
  display: flex;
  align-items: center;
  gap: 6px;
}

.total-row.discount-row .label::before {
  content: "🎁";
  font-size: 16px;
}

.total-row.discount-row .value.discount {
  color: var(--success);
  font-weight: var(--font-weight-bold);
}

@media (max-width: 768px) {
  .discount-controls {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
}

/* ==================== Settings Tabs ==================== */
.settings-tabs {
  display: flex;
  gap: var(--spacing-xs);
  border-bottom: 2px solid var(--line);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--slate);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary);
  background: var(--canvas);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: var(--font-weight-semibold);
}

.tab-btn i {
  width: 18px;
  height: 18px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

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

/* ==================== Settings Sections ==================== */
.settings-section {
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--line);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section .section-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--ink);
  margin-bottom: var(--spacing-lg);
}

.settings-section .section-title i {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.settings-form .form-group.full-width {
  grid-column: 1 / -1;
}

/* ==================== Data Management Tables ==================== */
.data-management-section {
  padding: var(--spacing-md);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table thead {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: white;
}

.data-table th {
  padding: var(--spacing-md);
  text-align: right;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
}

.data-table td {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--line);
  text-align: right;
}

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

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .empty-row td {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--muted);
  font-style: italic;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.badge-success {
  background: var(--success-light);
  color: var(--success-dark);
}

/* ==================== Card Header Actions ==================== */
.card-header-actions {
  display: flex;
  gap: var(--spacing-xs);
  align-items: center;
}

/* ==================== Responsive Settings ==================== */
@media (max-width: 768px) {
  .settings-tabs {
    gap: var(--spacing-xs);
  }

  .tab-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
  }

  .settings-section {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
  }

  .data-table {
    font-size: var(--font-size-sm);
  }

  .data-table th,
  .data-table td {
    padding: var(--spacing-sm);
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==================== Price Guide Modal ==================== */
.price-guide-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.price-guide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  cursor: pointer;
}

.price-guide-content {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-xl);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease-out;
  z-index: 1;
}

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

.price-guide-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--info-light), var(--white));
}

.price-guide-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--info);
  border-radius: var(--radius-md);
  color: var(--white);
  flex-shrink: 0;
}

.price-guide-icon i {
  width: 24px;
  height: 24px;
}

.price-guide-title {
  flex: 1;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--ink);
  margin: 0;
  font-family: var(--font-logo);
}

.price-guide-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--slate);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.price-guide-close:hover {
  background: var(--canvas);
  color: var(--ink);
}

.price-guide-close i {
  width: 20px;
  height: 20px;
}

.price-guide-body {
  padding: var(--spacing-lg);
}

.guide-intro {
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background: var(--warning-light);
  border-radius: var(--radius-md);
  border-right: 4px solid var(--warning);
}

.guide-intro-text {
  margin: 0;
  font-size: var(--font-size-base);
  color: var(--ink);
  line-height: 1.6;
}

.guide-section {
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-md);
  background: var(--canvas);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

.guide-section:last-child {
  margin-bottom: 0;
}

.guide-section-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.guide-section-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.guide-section-icon.update-icon {
  background: var(--success-light);
  color: var(--success);
}

.guide-section-icon.no-update-icon {
  background: var(--info-light);
  color: var(--info);
}

.guide-section-icon.admin-icon {
  background: var(--primary-light);
  color: var(--primary);
}

.guide-section-icon i {
  width: 20px;
  height: 20px;
}

.guide-section-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--ink);
  margin: 0;
}

.guide-section-content {
  margin-top: var(--spacing-md);
}

.guide-section-desc {
  margin: 0 0 var(--spacing-md) 0;
  font-size: var(--font-size-base);
  color: var(--slate);
  line-height: 1.6;
}

.guide-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.guide-item {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  transition: all var(--transition);
}

.guide-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateX(-4px);
}

.guide-item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  color: var(--primary);
  flex-shrink: 0;
}

.guide-item-icon i {
  width: 18px;
  height: 18px;
}

.guide-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.guide-item-content strong {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--ink);
}

.guide-item-hint {
  font-size: var(--font-size-sm);
  color: var(--slate-light);
  line-height: 1.5;
}

.guide-example {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  margin-bottom: var(--spacing-md);
}

.guide-example-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--info-light);
  border-radius: var(--radius-sm);
  color: var(--info);
  flex-shrink: 0;
}

.guide-example-icon i {
  width: 18px;
  height: 18px;
}

.guide-example-content {
  flex: 1;
}

.guide-example-content p {
  margin: 0 0 var(--spacing-xs) 0;
  font-size: var(--font-size-base);
  color: var(--ink);
  line-height: 1.6;
}

.guide-example-content p:last-child {
  margin-bottom: 0;
}

.guide-note {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-xs);
  padding: var(--spacing-md);
  background: var(--success-light);
  border-radius: var(--radius-md);
  border-right: 4px solid var(--success);
}

.guide-note span {
  font-size: var(--font-size-sm);
  color: var(--ink);
  line-height: 1.6;
}

.guide-action {
  text-align: center;
  padding: var(--spacing-md);
}

.guide-action .btn {
  margin-bottom: var(--spacing-sm);
}

.guide-action-hint {
  margin: var(--spacing-sm) 0 0 0;
  font-size: var(--font-size-sm);
  color: var(--slate-light);
  line-height: 1.5;
}

.guide-summary {
  margin-top: var(--spacing-xl);
  padding: var(--spacing-md);
  background: linear-gradient(135deg, var(--success-light), var(--info-light));
  border-radius: var(--radius-lg);
  border: 2px solid var(--success);
}

.guide-summary-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.guide-summary-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--ink);
  margin: 0;
}

.guide-summary-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.guide-summary-content p {
  margin: 0;
  font-size: var(--font-size-base);
  color: var(--ink);
  line-height: 1.8;
  padding: var(--spacing-xs) 0;
}

.price-guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--line);
  background: var(--canvas);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.guide-checkbox {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--slate);
  user-select: none;
}

.guide-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.guide-checkbox span {
  cursor: pointer;
}

/* Help button in section header */
.section-header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-inline-start: auto;
}

.btn-help {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--info-light);
  border: 1px solid var(--info);
  border-radius: var(--radius-sm);
  color: var(--info);
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}

.btn-help:hover {
  background: var(--info);
  color: var(--white);
  transform: scale(1.05);
}

.btn-help i {
  width: 18px;
  height: 18px;
}

/* Responsive adjustments for price guide */
@media (max-width: 768px) {
  .price-guide-content {
    max-width: 100%;
    max-height: 95vh;
    border-radius: var(--radius-lg);
  }

  .price-guide-header {
    padding: var(--spacing-md);
    flex-wrap: wrap;
  }

  .price-guide-title {
    font-size: var(--font-size-xl);
  }

  .price-guide-body {
    padding: var(--spacing-md);
  }

  .guide-section {
    padding: var(--spacing-sm);
  }

  .guide-item {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .guide-example {
    flex-direction: column;
  }

  .price-guide-footer {
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: stretch;
  }

  .price-guide-footer .btn {
    width: 100%;
  }
}

/* ==================== Tooltips ==================== */
.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-inline-start: 6px;
  color: var(--info);
  cursor: help;
  vertical-align: middle;
  position: relative;
}

.tooltip-trigger:hover {
  color: var(--primary);
}

.tooltip-trigger i {
  width: 16px;
  height: 16px;
}

/* SKU Input Wrapper */
.sku-input-wrapper {
  display: flex;
  gap: var(--spacing-xs);
  align-items: stretch;
}

.sku-input-wrapper .form-input {
  flex: 1;
}

.sku-input-wrapper .btn {
  flex-shrink: 0;
  padding: 0 12px;
  min-width: auto;
}

.sku-input-wrapper .form-input[readonly] {
  background-color: var(--canvas);
  cursor: not-allowed;
}

.sku-input-wrapper .form-input[readonly]:focus {
  border-color: var(--line);
  box-shadow: none;
}

/* Input Hints */
.input-hint {
  font-size: var(--font-size-xs);
  color: var(--slate-light);
  margin-top: 4px;
  line-height: 1.4;
}

/* Form Label with Tooltip */
.form-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

/* Select Styling */
.form-input[type="select"],
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-inline-start: 36px;
  cursor: pointer;
}

select.form-input:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232563eb' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}
