/* ============================================
   WashFlow - نظام إدارة مغسلة السيارات
   Design System v1.0
   جميع الحقوق محفوظة
   ============================================ */

/* ===== خط IBM Plex Sans Arabic ===== */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* ===== CSS Variables / Design Tokens ===== */
:root {
  --primary: #0F766E;
  --primary-dark: #115E59;
  --primary-light: #D1FAE5;
  --secondary: #2563EB;
  --secondary-light: #DBEAFE;
  --background: #F8FAFC;
  --card: #FFFFFF;
  --text: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --success: #16A34A;
  --success-light: #DCFCE7;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #DC2626;
  --danger-light: #FEE2E2;
  --cash: #15803D;
  --card-payment: #2563EB;
  --discount: #7C3AED;
  --discount-light: #EDE9FE;

  --font-family: 'IBM Plex Sans Arabic', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;

  --header-height: 64px;
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --bottom-nav-height: 64px;

  --font-h1: 2rem;
  --font-h2: 1.5rem;
  --font-h3: 1.25rem;
  --font-body: 1rem;
  --font-small: 0.875rem;
  --font-caption: 0.75rem;
  --font-finance: 1.125rem;
  --font-order: 0.875rem;
  --font-mono: 'IBM Plex Sans Arabic', monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: var(--primary-dark); }

ul, ol { list-style: none; padding: 0; margin: 0; }

img { max-width: 100%; height: auto; display: block; }

input, textarea, select, button {
  font-family: var(--font-family);
  direction: rtl;
  text-align: right;
}

table { border-collapse: collapse; width: 100%; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Utility Classes ===== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.page-section {
  padding: 2rem 1rem;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.grid { display: grid; }
.hidden { display: none !important; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

/* ===== Typography ===== */
.h1 {
  font-size: var(--font-h1);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.h2 {
  font-size: var(--font-h2);
  font-weight: 600;
  line-height: 1.35;
}

.h3 {
  font-size: var(--font-h3);
  font-weight: 600;
  line-height: 1.4;
}

.body-text {
  font-size: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
}

.small-text {
  font-size: var(--font-small);
  font-weight: 400;
  line-height: 1.5;
}

.caption {
  font-size: var(--font-caption);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-muted);
}

.finance-number {
  font-size: var(--font-finance);
  font-weight: 700;
  font-feature-settings: "kern" 1;
  letter-spacing: 0.02em;
}

.order-number {
  font-size: var(--font-order);
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.section-title {
  font-size: var(--font-body);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
  padding-right: 0.75rem;
  border-right: 3px solid var(--primary);
}

.page-title {
  font-size: var(--font-h2);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  font-size: var(--font-small);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: var(--font-small);
  font-weight: 500;
  line-height: 1.4;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background-color: var(--primary);
  color: white;
}
.btn-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--card);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: #F0FDFA;
}

.btn-success {
  background-color: var(--success);
  color: white;
}
.btn-success:hover { background-color: #15803D; }

.btn-danger {
  background-color: var(--danger);
  color: white;
}
.btn-danger:hover { background-color: #B91C1C; }

.btn-warning {
  background-color: var(--warning);
  color: white;
}
.btn-warning:hover { background-color: #D97706; }

.btn-discount {
  background-color: var(--discount);
  color: white;
}
.btn-discount:hover { background-color: #6D28D9; }

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover {
  background-color: var(--primary);
  color: white;
}

.btn-disabled,
.btn:disabled {
  background-color: #E2E8F0;
  color: var(--text-muted);
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.6;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-xl);
  min-height: 56px;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: var(--font-caption);
  border-radius: var(--radius-md);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-block { width: 100%; }

.btn-pos {
  padding: 1.25rem 1.5rem;
  font-size: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-xl);
  min-height: 64px;
  min-width: 120px;
}

.btn-pos-lg {
  padding: 1.5rem 2rem;
  font-size: 1.125rem;
  font-weight: 700;
  border-radius: var(--radius-2xl);
  min-height: 72px;
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background-color: var(--background);
  color: var(--text);
}

/* Button Group */
.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ===== Inputs ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.form-label {
  font-size: var(--font-small);
  font-weight: 500;
  color: var(--text);
}

.form-label .required {
  color: var(--danger);
  margin-right: 2px;
}

.form-input,
.form-number,
.form-amount,
.form-date,
.form-search,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: var(--font-small);
  font-weight: 400;
  color: var(--text);
  background-color: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-number:focus,
.form-amount:focus,
.form-date:focus,
.form-search:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

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

.form-input.error,
.form-number.error,
.form-amount.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-error-text {
  font-size: var(--font-caption);
  color: var(--danger);
  margin-top: 0.25rem;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1rem center;
  padding-left: 2.5rem;
  cursor: pointer;
}

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

.form-search {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.search-wrapper {
  position: relative;
}

.search-wrapper .form-search {
  padding-right: 2.75rem;
}

.search-wrapper .search-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* File Upload */
.file-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background-color: #FAFBFC;
  cursor: pointer;
  transition: all var(--transition);
}

.file-upload:hover {
  border-color: var(--primary);
  background-color: #F0FDFA;
}

.file-upload input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  right: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-icon {
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.file-upload-text {
  font-size: var(--font-small);
  color: var(--text-muted);
}

.file-upload-hint {
  font-size: var(--font-caption);
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Coupon Input */
.coupon-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.coupon-input-wrapper .form-input {
  flex: 1;
  text-align: center;
  letter-spacing: 0.1em;
  font-weight: 600;
  text-transform: uppercase;
}

.coupon-input-wrapper .btn {
  flex-shrink: 0;
  min-width: 80px;
}

/* Discount Input */
.discount-amount-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--discount-light);
  border: 1.5px solid var(--discount);
  border-radius: var(--radius-md);
  color: var(--discount);
  font-weight: 600;
  font-size: var(--font-small);
}

/* ===== Cards ===== */
.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: var(--font-body);
  font-weight: 600;
}

.card-body {
  font-size: var(--font-small);
  color: var(--text);
  line-height: 1.6;
}

.card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: var(--font-small);
}

/* Stat Card */
.stat-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition);
}

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

.stat-card-label {
  font-size: var(--font-caption);
  color: var(--text-muted);
  font-weight: 500;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-card-icon.primary { background-color: var(--primary-light); color: var(--primary); }
.stat-card-icon.success { background-color: var(--success-light); color: var(--success); }
.stat-card-icon.warning { background-color: var(--warning-light); color: var(--warning); }
.stat-card-icon.danger { background-color: var(--danger-light); color: var(--danger); }
.stat-card-icon.discount { background-color: var(--discount-light); color: var(--discount); }

.stat-card-change {
  font-size: var(--font-caption);
  font-weight: 500;
}

.stat-card-change.up { color: var(--success); }
.stat-card-change.down { color: var(--danger); }

/* POS Service Card */
.service-card {
  background-color: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.service-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.service-card.active,
.service-card.selected {
  border-color: var(--primary);
  background-color: #F0FDFA;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.service-card-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.5rem;
  border-radius: var(--radius-md);
  background-color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.service-card-name {
  font-size: var(--font-small);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.service-card-price {
  font-size: var(--font-caption);
  color: var(--primary);
  font-weight: 600;
}

/* Car Type Card */
.car-card {
  background-color: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 0.875rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.car-card:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow-md);
}

.car-card.active,
.car-card.selected {
  border-color: var(--secondary);
  background-color: var(--secondary-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.car-card-icon {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.car-card-name {
  font-size: var(--font-caption);
  font-weight: 600;
}

/* Payment Method Card */
.payment-card {
  background-color: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.payment-card:hover {
  box-shadow: var(--shadow-md);
}

.payment-card.active,
.payment-card.selected {
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.payment-card.active.cash,
.payment-card.selected.cash { border-color: var(--cash); background-color: #F0FDF4; }
.payment-card.active.card,
.payment-card.selected.card { border-color: var(--card-payment); background-color: var(--secondary-light); }
.payment-card.active.transfer,
.payment-card.selected.transfer { border-color: var(--discount); background-color: var(--discount-light); }

.payment-card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.payment-card-name {
  font-size: var(--font-caption);
  font-weight: 600;
}

/* Discount Card */
.discount-card {
  background-color: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
}

.discount-card:hover {
  border-color: var(--discount);
  box-shadow: var(--shadow-md);
}

.discount-card.active,
.discount-card.selected {
  border-color: var(--discount);
  background-color: var(--discount-light);
}

.discount-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--discount-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--discount);
  font-size: 1.125rem;
  flex-shrink: 0;
}

.discount-card-info { flex: 1; }

.discount-card-name {
  font-size: var(--font-small);
  font-weight: 600;
}

.discount-card-value {
  font-size: var(--font-caption);
  color: var(--discount);
  font-weight: 500;
}

.discount-card-badge {
  font-size: var(--font-caption);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background-color: var(--discount-light);
  color: var(--discount);
  font-weight: 500;
}

/* Report Card */
.report-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--transition);
}

.report-card:hover {
  box-shadow: var(--shadow-md);
}

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

.report-card-title {
  font-size: var(--font-small);
  font-weight: 600;
}

.report-card-date {
  font-size: var(--font-caption);
  color: var(--text-muted);
}

.report-card-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

/* Worker / Employee Card */
.worker-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all var(--transition);
}

.worker-card:hover {
  box-shadow: var(--shadow-md);
}

.worker-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 700;
  font-size: var(--font-body);
  flex-shrink: 0;
}

.worker-card-info { flex: 1; }

.worker-card-name {
  font-size: var(--font-small);
  font-weight: 600;
}

.worker-card-role {
  font-size: var(--font-caption);
  color: var(--text-muted);
}

/* Supplier Card */
.supplier-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all var(--transition);
}

.supplier-card:hover {
  box-shadow: var(--shadow-md);
}

.supplier-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: var(--warning-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warning);
  font-size: 1.125rem;
  flex-shrink: 0;
}

.supplier-card-info { flex: 1; }

.supplier-card-name {
  font-size: var(--font-small);
  font-weight: 600;
}

.supplier-card-phone {
  font-size: var(--font-caption);
  color: var(--text-muted);
}

/* ===== Section Cards (Landing Page) ===== */
.section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.section-card:hover {
  box-shadow: var(--shadow-md);
}
.section-card-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9375rem;
}
.section-card-icon {
  font-size: 1.25rem;
}
.section-card-title {
  color: var(--text);
}
.section-card-items {
  display: flex;
  flex-direction: column;
}
.section-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), color var(--transition);
}
.section-card-link:last-child {
  border-bottom: none;
}
.section-card-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.section-card-link span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: var(--font-caption);
  font-weight: 500;
  border-radius: var(--radius-full);
  white-space: nowrap;
  line-height: 1.4;
}

.badge-success {
  background-color: var(--success-light);
  color: var(--success);
}

.badge-danger {
  background-color: var(--danger-light);
  color: var(--danger);
}

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

.badge-info {
  background-color: var(--secondary-light);
  color: var(--secondary);
}

.badge-neutral {
  background-color: #F1F5F9;
  color: var(--text-muted);
}

.badge-primary {
  background-color: var(--primary-light);
  color: var(--primary);
}

.badge-discount {
  background-color: var(--discount-light);
  color: var(--discount);
}

.badge-cash {
  background-color: #F0FDF4;
  color: var(--cash);
}

.badge-cardpay {
  background-color: var(--secondary-light);
  color: var(--card-payment);
}

.badge-transfer {
  background-color: var(--discount-light);
  color: var(--discount);
}

/* ===== Tables ===== */
.table-container {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.table-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.table thead {
  background-color: #F8FAFC;
  border-bottom: 1px solid var(--border);
}

.table th {
  padding: 0.75rem 1rem;
  font-size: var(--font-caption);
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

.table td {
  padding: 0.75rem 1rem;
  font-size: var(--font-small);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr {
  transition: var(--transition);
}

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

.table tbody tr:hover {
  background-color: #FAFBFC;
}

.table .actions-cell {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

.table .amount-cell {
  font-weight: 600;
  font-feature-settings: "kern" 1;
}

.table .status-cell {
  text-align: center;
}

/* Responsive Table (Mobile) */
@media (max-width: 768px) {
  .table-responsive-mobile .table,
  .table-responsive-mobile thead,
  .table-responsive-mobile tbody,
  .table-responsive-mobile th,
  .table-responsive-mobile td,
  .table-responsive-mobile tr {
    display: block;
  }

  .table-responsive-mobile thead {
    display: none;
  }

  .table-responsive-mobile tbody tr {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.875rem;
    margin-bottom: 0.625rem;
  }

  .table-responsive-mobile td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0;
    border-bottom: none;
    font-size: var(--font-small);
  }

  .table-responsive-mobile td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: var(--font-caption);
    margin-left: 1rem;
  }

  .table-responsive-mobile td:last-child {
    padding-bottom: 0;
  }

  .table-responsive-mobile .actions-cell {
    justify-content: flex-start;
  }
}

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-slow);
}

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

.modal {
  background-color: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: all var(--transition-slow);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

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

.modal-title {
  font-size: var(--font-body);
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: var(--transition);
}

.modal-close:hover {
  background-color: var(--background);
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
}

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

.modal-footer-between {
  justify-content: space-between;
}

/* Discount Modal */
.discount-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.discount-type-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.discount-type-btn {
  flex: 1;
  padding: 0.625rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--card);
  cursor: pointer;
  font-size: var(--font-caption);
  font-weight: 500;
  color: var(--text);
  text-align: center;
  transition: all var(--transition);
}

.discount-type-btn:hover {
  border-color: var(--discount);
}

.discount-type-btn.active {
  border-color: var(--discount);
  background-color: var(--discount-light);
  color: var(--discount);
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: calc(100% - 2rem);
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--font-small);
  animation: toastSlideIn 0.3s ease;
  direction: rtl;
}

.toast.success { border-right: 4px solid var(--success); }
.toast.error { border-right: 4px solid var(--danger); }
.toast.warning { border-right: 4px solid var(--warning); }
.toast.info { border-right: 4px solid var(--primary); }

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--primary); }

.toast-message { flex: 1; }

.toast-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
}

.toast-close:hover {
  background-color: var(--background);
}

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

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

/* ===== Empty States ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background-color: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 2rem;
  color: var(--text-muted);
}

.empty-state-title {
  font-size: var(--font-body);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.empty-state-desc {
  font-size: var(--font-small);
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  max-width: 280px;
}

/* ===== Layout ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  z-index: 100;
  transition: all var(--transition-slow);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
  min-height: var(--header-height);
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background-color: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: var(--font-body);
  font-weight: 700;
  color: var(--text);
}

.sidebar-logo-sub {
  font-size: var(--font-caption);
  color: var(--text-muted);
  display: block;
  margin-top: -2px;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--font-small);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  margin-bottom: 0.25rem;
}

.sidebar-nav-item:hover {
  background-color: var(--background);
  color: var(--text);
}

.sidebar-nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-nav-item-icon {
  width: 20px;
  text-align: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.sidebar-nav-item-badge {
  margin-right: auto;
}

.sidebar-section-label {
  padding: 0.75rem 1rem 0.375rem;
  font-size: var(--font-caption);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

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

/* Header */
.header {
  height: var(--header-height);
  background-color: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-page-title {
  font-size: var(--font-body);
  font-weight: 600;
}

.header-search {
  position: relative;
  width: 240px;
}

.header-search .form-search {
  padding: 0.5rem 2.25rem 0.5rem 0.75rem;
  font-size: var(--font-caption);
  border-radius: var(--radius-md);
}

.header-search .search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.header-user:hover {
  background-color: var(--background);
}

.header-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--font-small);
}

.header-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.header-user-name {
  font-size: var(--font-small);
  font-weight: 600;
}

.header-user-role {
  font-size: var(--font-caption);
  color: var(--text-muted);
}

/* Page Content */
.page-content {
  padding: 1.5rem;
  flex: 1;
}

/* ===== POS Layout ===== */
.pos-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--background);
}

.pos-header {
  background-color: var(--primary);
  color: white;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 56px;
}

.pos-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pos-header-logo {
  font-weight: 700;
  font-size: var(--font-body);
}

.pos-header-cashier {
  font-size: var(--font-caption);
  opacity: 0.9;
}

.pos-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pos-header-date {
  font-size: var(--font-caption);
  opacity: 0.85;
}

.pos-body {
  flex: 1;
  display: flex;
  padding: 0.75rem;
  gap: 0.75rem;
}

.pos-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pos-sidebar-summary {
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* POS Section */
.pos-section {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1rem;
}

.pos-section-title {
  font-size: var(--font-small);
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* POS Items Grid */
.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}

.pos-grid-services {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

/* POS Order Summary */
.pos-summary {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1rem;
}

.pos-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.pos-summary-title {
  font-size: var(--font-small);
  font-weight: 600;
}

.pos-summary-items {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.pos-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-small);
}

.pos-summary-item-label {
  color: var(--text-muted);
}

.pos-summary-item-value {
  font-weight: 500;
}

.pos-summary-divider {
  height: 1px;
  background-color: var(--border);
  margin: 0.5rem 0;
}

.pos-summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 2px solid var(--border);
  margin-top: 0.5rem;
}

.pos-summary-total-label {
  font-size: var(--font-body);
  font-weight: 700;
}

.pos-summary-total-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.pos-summary-discount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-small);
  color: var(--discount);
  font-weight: 500;
}

.pos-summary-before-discount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-small);
  color: var(--text-muted);
}

.pos-summary-before-discount .pos-summary-item-value {
  text-decoration: line-through;
}

/* POS Payment Methods */
.pos-payment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

/* POS Action Button */
.pos-confirm-btn {
  width: 100%;
  padding: 1.25rem;
  font-size: 1.125rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-xl);
  background-color: var(--primary);
  color: white;
  cursor: pointer;
  transition: var(--transition);
  min-height: 64px;
}

.pos-confirm-btn:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.pos-confirm-btn:active {
  transform: scale(0.98);
}

/* POS Discount Area */
.pos-discount-area {
  margin-top: 0.5rem;
}

.pos-discount-btn {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--discount-light);
  border: 1.5px dashed var(--discount);
  border-radius: var(--radius-lg);
  color: var(--discount);
  font-weight: 600;
  font-size: var(--font-small);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.pos-discount-btn:hover {
  background-color: var(--discount);
  color: white;
}

.pos-discount-applied {
  padding: 0.75rem;
  background-color: var(--discount-light);
  border: 1.5px solid var(--discount);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pos-discount-applied-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pos-discount-applied-value {
  font-weight: 600;
  color: var(--discount);
  font-size: var(--font-small);
}

.pos-discount-applied-name {
  font-size: var(--font-caption);
  color: var(--discount);
}

.pos-discount-remove {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: none;
  background-color: rgba(124, 58, 237, 0.15);
  color: var(--discount);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.pos-discount-remove:hover {
  background-color: var(--discount);
  color: white;
}

/* ===== Bottom Navigation (Mobile) ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--card);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 0.375rem 0;
  height: var(--bottom-nav-height);
}

.bottom-nav-items {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: 0.25rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  font-size: var(--font-caption);
  font-weight: 500;
  text-decoration: none;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item-icon {
  font-size: 1.375rem;
}

/* ===== Dashboard Styles ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.dashboard-grid-wide {
  grid-template-columns: 2fr 1fr;
  gap: 0.75rem;
}

.dashboard-section {
  margin-bottom: 1.5rem;
}

/* Recent Orders */
.recent-order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.recent-order-item:last-child {
  border-bottom: none;
}

.recent-order-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.recent-order-id {
  font-weight: 600;
  font-size: var(--font-small);
}

.recent-order-service {
  font-size: var(--font-caption);
  color: var(--text-muted);
}

.recent-order-amount {
  font-weight: 600;
  font-size: var(--font-small);
}

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 1rem;
}

.login-card {
  background-color: var(--card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 64px;
  height: 64px;
  background-color: var(--primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 auto 0.75rem;
}

.login-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.login-logo-sub {
  font-size: var(--font-small);
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-forgot {
  text-align: left;
  font-size: var(--font-caption);
  color: var(--primary);
  cursor: pointer;
  display: inline-block;
}

.login-forgot:hover {
  text-decoration: underline;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.login-divider::after,
.login-divider::before {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border);
}

/* ===== Discounts Page ===== */
.filters-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filters-row select,
.filters-row .form-search {
  width: auto;
  min-width: 150px;
}

/* ===== Responsive - Mobile ===== */
@media (max-width: 768px) {
  :root {
    --font-h1: 1.5rem;
    --font-h2: 1.25rem;
    --font-h3: 1.125rem;
    --font-body: 0.9375rem;
  }

  .sidebar {
    transform: translateX(100%);
    width: 280px;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

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

  .header {
    padding: 0 1rem;
  }

  .header-search {
    display: none;
  }

  .page-content {
    padding: 1rem;
  }

  .bottom-nav {
    display: block;
  }

  .pos-body {
    flex-direction: column;
    padding: 0.5rem;
  }

  .pos-sidebar-summary {
    width: 100%;
  }

  .pos-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  .pos-grid-services {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .pos-payment-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid-wide {
    grid-template-columns: 1fr;
  }

  .stat-card-value {
    font-size: 1.375rem;
  }

  .modal {
    max-width: 100%;
    margin: 0.5rem;
    border-radius: var(--radius-lg);
  }

  .login-card {
    padding: 1.5rem;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-toolbar-left,
  .table-toolbar-right {
    flex-wrap: wrap;
  }

  .filters-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-row select,
  .filters-row .form-search {
    width: 100%;
    min-width: unset;
  }

  .discount-type-group {
    flex-direction: column;
  }
}

/* ===== Responsive - Tablet ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: var(--sidebar-collapsed);
  }

  .sidebar .sidebar-logo-text,
  .sidebar .sidebar-logo-sub,
  .sidebar .sidebar-nav-item span:not(.sidebar-nav-item-icon),
  .sidebar .sidebar-section-label span,
  .sidebar .sidebar-footer span {
    display: none;
  }

  .sidebar .sidebar-nav-item {
    justify-content: center;
    padding: 0.75rem;
  }

  .sidebar .sidebar-logo {
    justify-content: center;
  }

  .main-content {
    margin-right: var(--sidebar-collapsed);
  }

  .pos-sidebar-summary {
    width: 280px;
  }
}

/* ===== Responsive - Small Mobile ===== */
@media (max-width: 480px) {
  .pos-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .pos-grid-services {
    grid-template-columns: repeat(2, 1fr);
  }

  .pos-payment-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .header-user-info {
    display: none;
  }

  .pos-header-date {
    display: none;
  }
}

/* ===== Mobile Overlay ===== */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.mobile-overlay.active {
  display: block;
}

/* ===== Style Guide Page ===== */
.style-guide {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  direction: rtl;
}

.style-guide h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.style-guide .sg-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: var(--font-body);
}

.style-guide .sg-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.style-guide .sg-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.style-guide .sg-section-subtitle {
  font-size: var(--font-body);
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.color-swatch {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.color-swatch-box {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-caption);
  font-weight: 600;
}

.color-swatch-info {
  padding: 0.75rem;
  background-color: var(--card);
}

.color-swatch-name {
  font-size: var(--font-caption);
  font-weight: 600;
}

.color-swatch-value {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.component-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.empty-state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.table-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* ===== Demo Modal Trigger ===== */
.demo-modal-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-caption);
  font-weight: 500;
  color: var(--text);
  transition: var(--transition);
}

.demo-modal-trigger:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== Discount Summary in POS ===== */
.discount-summary {
  background-color: var(--discount-light);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin: 0.5rem 0;
}

.discount-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-caption);
  padding: 0.25rem 0;
}

.discount-summary-row.total {
  font-weight: 700;
  font-size: var(--font-small);
  border-top: 1px solid rgba(124, 58, 237, 0.2);
  margin-top: 0.25rem;
  padding-top: 0.5rem;
}

/* Sidebar toggle button */
.sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.25rem;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background-color: var(--background);
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: flex;
  }
}

/* Permissions Modal Specific */
.permission-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background-color: var(--danger-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
  color: var(--danger);
}

/* Coupon Result */
.coupon-result {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: var(--font-caption);
  font-weight: 500;
}

.coupon-result.valid {
  background-color: var(--success-light);
  color: var(--success);
}

.coupon-result.invalid {
  background-color: var(--danger-light);
  color: var(--danger);
}

/* ============================================
   Phase 2 - New Components
   ============================================ */

/* ===== Loading Overlay ===== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  direction: rtl;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

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

.loading-text {
  font-size: var(--font-body);
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Password Toggle ===== */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-left: 3rem;
}

.password-toggle {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1rem;
  transition: var(--transition);
}

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

/* ===== Login Error Alert ===== */
.login-error {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--danger-light);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: var(--font-small);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.login-error-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
}

/* ===== Final Login Page ===== */
.login-page-v2 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--background);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.login-bg-decoration {
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.login-bg-decoration-2 {
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.login-card-v2 {
  background-color: var(--card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
}

.login-illustration {
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 3rem;
  line-height: 1;
}

.login-header-v2 {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.login-desc {
  font-size: var(--font-small);
  color: var(--text-muted);
}

.login-form-v2 {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-forgot-link {
  text-align: left;
  font-size: var(--font-caption);
  color: var(--primary);
  cursor: pointer;
  display: inline-block;
  margin-top: -0.5rem;
}

.login-forgot-link:hover {
  text-decoration: underline;
}

.login-quick-access {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.login-quick-title {
  font-size: var(--font-caption);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.75rem;
}

.login-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.login-quick-btn {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--card);
  cursor: pointer;
  font-size: var(--font-caption);
  color: var(--text-muted);
  transition: var(--transition);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
}

.login-quick-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: #F0FDFA;
}

.login-quick-btn-role {
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
}

/* ===== Forgot Password ===== */
.forgot-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--background);
  padding: 1rem;
}

.forgot-card {
  background-color: var(--card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
}

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

.forgot-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
  color: var(--primary);
}

.forgot-success {
  display: none;
  text-align: center;
  padding: 1rem 0;
}

.forgot-success-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background-color: var(--success-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
  color: var(--success);
}

.forgot-back {
  text-align: center;
  margin-top: 1rem;
}

.forgot-back a {
  font-size: var(--font-small);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.forgot-back a:hover {
  color: var(--primary);
}

/* ===== Branch Selection ===== */
.branch-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--background);
  padding: 1rem;
}

.branch-card-container {
  width: 100%;
  max-width: 500px;
}

.branch-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.branch-card {
  background-color: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.branch-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.branch-card.selected {
  border-color: var(--primary);
  background-color: #F0FDFA;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.branch-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  flex-shrink: 0;
}

.branch-card-info { flex: 1; }

.branch-card-name {
  font-size: var(--font-body);
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.branch-card-city {
  font-size: var(--font-caption);
  color: var(--text-muted);
}

.branch-card-status {
  font-size: var(--font-caption);
}

/* ===== Access Denied & Session Expired ===== */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--background);
  padding: 1rem;
}

.error-card {
  text-align: center;
  background-color: var(--card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 3rem 2rem;
  width: 100%;
  max-width: 400px;
}

.error-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 2rem;
}

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

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

.error-icon.info {
  background-color: var(--secondary-light);
  color: var(--secondary);
}

.error-title {
  font-size: var(--font-h2);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.error-desc {
  font-size: var(--font-small);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.error-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ===== Drawer Menu (Mobile Admin) ===== */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-slow);
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.drawer-menu {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background-color: var(--card);
  z-index: 100;
  transition: all var(--transition-slow);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}

.drawer-menu.open {
  right: 0;
}

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

.drawer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-logo-icon {
  width: 36px;
  height: 36px;
  background-color: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: var(--font-small);
}

.drawer-logo-text {
  font-size: var(--font-body);
  font-weight: 700;
}

.drawer-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1.125rem;
}

.drawer-close:hover {
  background-color: var(--background);
  color: var(--text);
}

.drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--font-small);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  margin-bottom: 0.125rem;
}

.drawer-nav-item:hover {
  background-color: var(--background);
}

.drawer-nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.drawer-nav-item-icon {
  width: 20px;
  text-align: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.drawer-section-label {
  padding: 0.5rem 0.875rem 0.25rem;
  font-size: var(--font-caption);
  font-weight: 600;
  color: var(--text-muted);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--font-caption);
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.breadcrumb-item {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb-item:hover {
  color: var(--primary);
}

.breadcrumb-item.active {
  color: var(--text);
  font-weight: 600;
}

.breadcrumb-sep {
  color: var(--border);
  font-size: 10px;
}

/* ===== Account Page ===== */
.account-page {
  max-width: 600px;
  margin: 0 auto;
}

.account-header-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1rem;
}

.account-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}

.account-name {
  font-size: var(--font-h3);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.account-role-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--font-caption);
  font-weight: 600;
  margin-bottom: 1rem;
}

.account-role-badge.admin { background-color: var(--primary-light); color: var(--primary); }
.account-role-badge.manager { background-color: var(--secondary-light); color: var(--secondary); }
.account-role-badge.accountant { background-color: var(--warning-light); color: var(--warning); }
.account-role-badge.cashier { background-color: var(--discount-light); color: var(--discount); }

.account-details {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.account-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
}

.account-detail-row:last-child {
  border-bottom: none;
}

.account-detail-label {
  font-size: var(--font-small);
  color: var(--text-muted);
}

.account-detail-value {
  font-size: var(--font-small);
  font-weight: 600;
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Change Password Section */
.change-password-section {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.change-password-title {
  font-size: var(--font-body);
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* ===== Users Page ===== */
.users-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-caption);
}

.user-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 0.375rem;
}

.user-status-dot.active { background-color: var(--success); }
.user-status-dot.inactive { background-color: var(--text-muted); }

/* ===== Permissions Matrix ===== */
.permissions-matrix-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.permissions-matrix {
  min-width: 600px;
  width: 100%;
  border-collapse: collapse;
}

.permissions-matrix th {
  padding: 0.75rem 0.75rem;
  font-size: var(--font-caption);
  font-weight: 600;
  color: var(--text);
  text-align: center;
  background-color: #F8FAFC;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.permissions-matrix th:first-child {
  text-align: right;
  min-width: 180px;
}

.permissions-matrix td {
  padding: 0.5rem 0.75rem;
  font-size: var(--font-small);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.permissions-matrix td:first-child {
  text-align: right;
  font-weight: 500;
}

.permission-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  font-size: var(--font-small);
}

.permission-check.allowed {
  background-color: var(--success-light);
  color: var(--success);
}

.permission-check.denied {
  background-color: var(--danger-light);
  color: var(--danger);
}

.permission-check.partial {
  background-color: var(--warning-light);
  color: var(--warning);
}

/* Role header colors */
.role-header-owner { background-color: var(--primary-light); color: var(--primary); }
.role-header-manager { background-color: var(--secondary-light); color: var(--secondary); }
.role-header-accountant { background-color: var(--warning-light); color: var(--warning); }
.role-header-cashier { background-color: var(--discount-light); color: var(--discount); }

/* ===== POS Account Section (Modal) ===== */
.pos-account-section {
  padding: 1rem;
}

/* ===== Form Enhancement for Auth ===== */
.form-group-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-group-inline .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* ===== Role Badge in Table ===== */
.role-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-caption);
  font-weight: 600;
}

.role-badge.owner { background-color: var(--primary-light); color: var(--primary); }
.role-badge.manager { background-color: var(--secondary-light); color: var(--secondary); }
.role-badge.accountant { background-color: var(--warning-light); color: #92400E; }
.role-badge.cashier { background-color: var(--discount-light); color: var(--discount); }

/* ===== Page Header with Actions ===== */
.page-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ===== Mobile Sidebar Drawer Toggle Button ===== */
.menu-toggle-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.25rem;
  align-items: center;
  justify-content: center;
}

.menu-toggle-btn:hover {
  background-color: var(--background);
}

/* ===== Responsive Additions for Phase 2 ===== */
@media (max-width: 768px) {
  .login-card-v2 {
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-xl);
  }

  .login-illustration {
    font-size: 2.5rem;
  }

  .login-quick-grid {
    grid-template-columns: 1fr 1fr;
  }

  .forgot-card {
    padding: 1.75rem 1.25rem;
  }

  .error-card {
    padding: 2rem 1.25rem;
  }

  .account-header-card {
    padding: 1.5rem 1rem;
  }

  .account-avatar {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .account-page {
    padding: 0;
  }

  .users-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .menu-toggle-btn {
    display: flex;
  }

  .drawer-menu {
    width: 260px;
  }
}

@media (max-width: 480px) {
  .login-quick-grid {
    grid-template-columns: 1fr;
  }

  .branch-card {
    padding: 1rem;
  }

  .branch-card-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .users-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .login-page-v2 {
    padding: 2rem;
  }

  .login-card-v2 {
    max-width: 420px;
  }
}

/* ===== Cashier Account Bottom Sheet (Mobile) ===== */
.cashier-account-sheet {
  background-color: var(--card);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: 1.5rem;
  box-shadow: var(--shadow-xl);
}

/* ===== Tab System for Account ===== */
.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.tab-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: var(--font-small);
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ===== Form Row ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Phase 4 - Admin Dashboard & Operations
   ============================================ */

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar .form-search,
.filter-bar .form-date {
  width: auto;
  min-width: 130px;
  padding: 0.5rem 0.75rem;
  font-size: var(--font-caption);
}

@media (max-width: 768px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar select,
  .filter-bar .form-search,
  .filter-bar .form-date {
    width: 100%;
    min-width: unset;
  }
}

/* ===== Dashboard Stats Grid (Enhanced) ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

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

/* ===== Dashboard Chart Cards ===== */
.chart-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

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

.chart-card-title {
  font-size: var(--font-small);
  font-weight: 600;
}

.chart-card-body {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-card-body canvas {
  max-width: 100%;
  max-height: 200px;
}

/* ===== Dashboard Two Column ===== */
.dashboard-two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .dashboard-two-col {
    grid-template-columns: 1fr;
  }
}

/* ===== Dashboard Three Column ===== */
.dashboard-three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .dashboard-three-col {
    grid-template-columns: 1fr;
  }
}

/* ===== Mini Table in Dashboard ===== */
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-caption);
}

.mini-table th {
  text-align: right;
  padding: 0.5rem 0.5rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.mini-table td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

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

/* ===== KPI Change Indicator ===== */
.kpi-change {
  font-size: var(--font-caption);
  font-weight: 500;
}
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }

/* ===== Order Cancel Banner ===== */
.cancel-banner {
  background-color: var(--danger-light);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--font-small);
}

.cancel-banner-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.cancel-banner-text {
  flex: 1;
}

.cancel-banner-text strong {
  display: block;
  color: var(--danger);
}

.cancel-banner-text span {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

/* ===== Detail Row ===== */
.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--font-small);
}

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

.detail-label {
  color: var(--text-muted);
  font-weight: 500;
}

.detail-value {
  font-weight: 600;
  text-align: left;
}

/* ===== Detail Section ===== */
.detail-section {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.detail-section-title {
  font-size: var(--font-small);
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== Audit Log ===== */
.audit-log {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.audit-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--font-caption);
}

.audit-entry:last-child {
  border-bottom: none;
}

.audit-time {
  min-width: 50px;
  color: var(--text-muted);
  font-size: 11px;
}

.audit-content {
  flex: 1;
}

.audit-user {
  font-weight: 600;
  color: var(--text);
}

.audit-action {
  color: var(--text);
}

.audit-detail {
  color: var(--text-muted);
  display: block;
}

/* ===== Services Table ===== */
.service-price {
  font-weight: 700;
  color: var(--primary);
  font-size: var(--font-body);
}

/* ===== Discount Coupon Code Display ===== */
.coupon-code-display {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--discount-light);
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-weight: 700;
  font-size: var(--font-caption);
  color: var(--discount);
  letter-spacing: 0.05em;
  direction: ltr;
}

/* ===== Detail Page Two Column ===== */
.detail-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .detail-two-col {
    grid-template-columns: 1fr;
  }
}

/* ===== Status Timeline ===== */
.status-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-right: 1.5rem;
  position: relative;
}

.status-timeline::before {
  content: '';
  position: absolute;
  right: 6px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background-color: var(--border);
}

.timeline-item {
  position: relative;
  padding-right: 1rem;
  font-size: var(--font-caption);
}

.timeline-item::before {
  content: '';
  position: absolute;
  right: -1.25rem;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--border);
}

.timeline-item.completed::before {
  background-color: var(--success);
}

.timeline-item.cancelled::before {
  background-color: var(--danger);
}

.timeline-item.active::before {
  background-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2);
}

.timeline-time {
  color: var(--text-muted);
  font-size: 10px;
}

/* ===== Order Services List ===== */
.order-service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 0;
  font-size: var(--font-small);
}

.order-service-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

/* ===== Print Receipt Button ===== */
.btn-print {
  background-color: var(--card);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-print:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== Empty State in Table ===== */
.table-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.table-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.table-empty-text {
  font-size: var(--font-body);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.table-empty-desc {
  font-size: var(--font-small);
  color: var(--text-muted);
}

/* ===== Period Filter ===== */
.period-filter {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.period-btn {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--card);
  cursor: pointer;
  font-size: var(--font-caption);
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.period-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.period-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ===== Order ID Badge ===== */
.order-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  background-color: #F1F5F9;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--font-caption);
  color: var(--text);
}

/* ===== Selection Card for Modals ===== */
.selection-card {
  background-color: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.selection-card.selected {
  border-color: var(--primary);
  background-color: #F0FDFA;
}

/* ===== Usage Stats Card ===== */
.usage-stat {
  text-align: center;
  padding: 1rem;
  background-color: var(--background);
  border-radius: var(--radius-md);
}

.usage-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.usage-stat-label {
  font-size: var(--font-caption);
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ===== Mobile Bottom Sheet Filters ===== */
@media (max-width: 768px) {
  .desktop-filters {
    display: none;
  }
  .mobile-filter-btn {
    display: flex !important;
  }
}

.mobile-filter-btn {
  display: none;
}

@media (min-width: 769px) {
  .mobile-filter-btn {
    display: none !important;
  }
}

/* ============================================
   Phase 5 - Suppliers, Purchases, Expenses
   ============================================ */

/* ===== Supplier/Expense Detail Tabs ===== */
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.detail-tab-btn {
  padding: 0.625rem 1rem;
  font-size: var(--font-small);
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.detail-tab-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}
.detail-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.detail-tab-panel {
  display: none;
}
.detail-tab-panel.active {
  display: block;
}

/* ===== Supplier Cards Grid ===== */
.supplier-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.supplier-summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}
.supplier-summary-card .stat-card-label {
  font-size: var(--font-caption);
}
.supplier-summary-card .stat-card-value {
  font-size: 1.125rem;
}

/* ===== Dynamic Invoice Items Table ===== */
.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-small);
}
.invoice-items-table th {
  padding: 0.5rem 0.5rem;
  text-align: right;
  border-bottom: 1.5px solid var(--border);
  font-weight: 600;
  color: var(--text-muted);
  font-size: var(--font-caption);
}
.invoice-items-table td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.invoice-items-table .item-total {
  font-weight: 600;
  color: var(--text);
}
.invoice-items-table .item-remove {
  color: var(--danger);
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1rem;
  padding: 0.25rem;
}
.invoice-items-table .item-remove:hover {
  opacity: 0.7;
}
.invoice-items-table input,
.invoice-items-table select {
  width: 100%;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--font-caption);
  background: var(--card);
  color: var(--text);
  font-family: var(--font-family);
}
.invoice-items-table input:focus,
.invoice-items-table select:focus {
  outline: none;
  border-color: var(--primary);
}

/* ===== Invoice Summary ===== */
.invoice-summary {
  background: var(--background);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}
.invoice-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.375rem 0;
  font-size: var(--font-small);
}
.invoice-summary-row.total {
  border-top: 1.5px solid var(--border);
  margin-top: 0.375rem;
  padding-top: 0.75rem;
  font-weight: 700;
  font-size: var(--font-body);
}

/* ===== Supplier Info Header ===== */
.supplier-info-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.supplier-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}
.supplier-info-meta {
  flex: 1;
}
.supplier-info-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.125rem;
}
.supplier-info-detail {
  font-size: var(--font-small);
  color: var(--text-muted);
}

/* ===== File Upload Card ===== */
.file-upload-card {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--card);
}
.file-upload-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.file-upload-card-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.file-upload-card-text {
  font-size: var(--font-small);
  color: var(--text-muted);
  font-weight: 500;
}
.file-upload-card-hint {
  font-size: var(--font-caption);
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.file-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--background);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.file-preview-icon {
  font-size: 1.5rem;
}
.file-preview-info {
  flex: 1;
}
.file-preview-name {
  font-size: var(--font-small);
  font-weight: 500;
}
.file-preview-size {
  font-size: var(--font-caption);
  color: var(--text-muted);
}
.file-preview-actions {
  display: flex;
  gap: 0.375rem;
}
.file-preview-actions .btn {
  font-size: var(--font-caption);
  padding: 0.25rem 0.5rem;
}

/* ===== Payment Record Card ===== */
.payment-record {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
}
.payment-record:last-child {
  border-bottom: none;
}
.payment-record-info {
  flex: 1;
}
.payment-record-amount {
  font-weight: 600;
  color: var(--success);
}
.payment-record-method {
  font-size: var(--font-caption);
  color: var(--text-muted);
}
.payment-record-date {
  font-size: var(--font-caption);
  color: var(--text-muted);
}

/* ===== Statement Row ===== */
.statement-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--font-small);
}
.statement-row.header {
  font-weight: 600;
  color: var(--text-muted);
  font-size: var(--font-caption);
  border-bottom: 1.5px solid var(--border);
}
.statement-row .debit {
  color: var(--danger);
  font-weight: 500;
}
.statement-row .credit {
  color: var(--success);
  font-weight: 500;
}
.statement-row .balance {
  font-weight: 600;
}

/* ===== Attachments Grid ===== */
.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.attachment-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: var(--transition);
}
.attachment-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.attachment-card-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.attachment-card-name {
  font-size: var(--font-small);
  font-weight: 500;
  word-break: break-all;
}
.attachment-card-type {
  font-size: var(--font-caption);
  color: var(--text-muted);
}
.attachment-card-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.375rem;
  justify-content: center;
}

/* ===== Attachment Modal ===== */
.attachment-modal-body {
  text-align: center;
  padding: 0.5rem;
}
.attachment-modal-preview {
  max-width: 100%;
  max-height: 60vh;
  border-radius: var(--radius-md);
  background: var(--background);
  margin-bottom: 0.75rem;
}
.attachment-modal-placeholder {
  width: 100%;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--text-muted);
}

/* ===== Responsive Table to Cards ===== */
@media (max-width: 768px) {
  .responsive-card-table .table { display: none; }
  .responsive-card-list { display: block; }
  .responsive-card-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.875rem;
    margin-bottom: 0.75rem;
  }
  .responsive-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    font-size: var(--font-small);
    border-bottom: 1px solid var(--border);
  }
  .responsive-card-row:last-child {
    border-bottom: none;
  }
  .responsive-card-label {
    color: var(--text-muted);
    font-size: var(--font-caption);
  }
  .responsive-card-actions {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
  }
}
@media (min-width: 769px) {
  .responsive-card-list { display: none; }
}

/* ===== Mobile Sticky Button ===== */
@media (max-width: 768px) {
  .mobile-sticky-btn {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    background: var(--card);
    border-top: 1px solid var(--border);
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
  }
  .mobile-sticky-btn .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===== Bottom Sheet Filters Mobile ===== */
@media (max-width: 768px) {
  .bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    display: none;
  }
  .bottom-sheet-overlay.active {
    display: block;
  }
  .bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: 1000;
    padding: 1.25rem;
    transform: translateY(100%);
    transition: transform var(--transition-slow);
    max-height: 80vh;
    overflow-y: auto;
  }
  .bottom-sheet.active {
    transform: translateY(0);
  }
  .bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
    margin: 0 auto 1rem;
  }
}

/* ===== Phase 6 - Payroll Summary ===== */
.payroll-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.payroll-summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

/* ===== Salary Slip ===== */
.salary-slip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: var(--font-small);
  border-bottom: 1px solid var(--border);
}
.salary-slip-row:last-child { border-bottom: none; }
.salary-slip-row.total {
  border-top: 1.5px solid var(--border);
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  font-weight: 700;
  font-size: var(--font-body);
}
.salary-slip-label { color: var(--text-muted); }
.salary-slip-value { font-weight: 600; }

/* ===== Advance Card ===== */
.advance-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  margin-bottom: 0.625rem;
}
.advance-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.advance-card-amount {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.125rem;
}
.advance-card-remaining {
  font-size: var(--font-caption);
  color: var(--danger);
}
.advance-card-detail {
  font-size: var(--font-caption);
  color: var(--text-muted);
}

/* ============================================
   Phase 7 - Chart of Accounts & Financial
   ============================================ */

/* ===== Account Tree ===== */
.account-tree {
  direction: ltr;
  text-align: right;
}
.tree-section-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  padding: 0.75rem 0;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin: 1px 0;
  cursor: pointer;
  transition: var(--transition);
}
.tree-item:hover {
  background: var(--primary-light);
}
.tree-item.level-0 { padding-right: 0.75rem; }
.tree-item.level-1 { padding-right: 2rem; }
.tree-item.level-2 { padding-right: 3.5rem; }
.tree-item-code {
  font-size: var(--font-caption);
  color: var(--text-muted);
  min-width: 70px;
  font-family: monospace;
}
.tree-item-name {
  flex: 1;
  font-size: var(--font-small);
  font-weight: 500;
}
.tree-item-balance {
  font-weight: 600;
  font-size: var(--font-small);
  min-width: 100px;
  text-align: left;
  direction: ltr;
}
.tree-item-status {
  min-width: 60px;
  text-align: center;
}

/* ===== Financial Accounts Cards ===== */
.financial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}
.financial-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: var(--transition);
}
.financial-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.financial-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.financial-card-name {
  font-weight: 600;
  font-size: 0.9375rem;
}
.financial-card-type {
  font-size: var(--font-caption);
  color: var(--text-muted);
}
.financial-card-balance {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  direction: ltr;
}
.financial-card-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-caption);
  color: var(--text-muted);
  padding: 0.25rem 0;
}
.financial-card-row.inflow {
  color: var(--success);
}
.financial-card-row.outflow {
  color: var(--danger);
}

/* ===== Journal Table ===== */
.journal-table th {
  font-size: var(--font-caption);
  color: var(--text-muted);
  font-weight: 600;
}
.journal-entry-id {
  font-weight: 600;
  font-family: monospace;
  font-size: var(--font-small);
}
.journal-status-badge {
  font-size: var(--font-caption);
}

/* ===== Statement Account Page ===== */
.statement-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.statement-balance-large {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}
.statement-meta {
  font-size: var(--font-small);
  color: var(--text-muted);
}
.statement-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.statement-summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
}
.statement-summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

/* ===== Report Cards ===== */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}
.report-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.report-card-label {
  font-size: var(--font-caption);
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.report-card-value {
  font-size: 1.375rem;
  font-weight: 700;
}
.report-card-value.success { color: var(--success); }
.report-card-value.danger { color: var(--danger); }
.report-card-value.warning { color: var(--warning); }
.report-card-value.primary { color: var(--primary); }

/* ===== Profit Report ===== */
.profit-section {
  margin-bottom: 0.75rem;
}
.profit-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.profit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: var(--font-small);
  border-bottom: 1px solid var(--border);
}
.profit-row.total {
  border-top: 1.5px solid var(--text);
  border-bottom: none;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-weight: 700;
  font-size: var(--font-body);
}
.profit-net {
  background: var(--primary-light);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  margin-top: 1rem;
}
.profit-net-label {
  font-size: var(--font-small);
  color: var(--primary);
  font-weight: 600;
}
.profit-net-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0.5rem 0;
}
.profit-net-note {
  font-size: var(--font-caption);
  color: var(--text-muted);
  font-style: italic;
}

/* ===== Chart Placeholder ===== */
.chart-placeholder {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.chart-placeholder-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* ===== Journal Entry Create ===== */
.entry-line-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-small);
}
.entry-line-table th {
  padding: 0.5rem 0.375rem;
  text-align: right;
  border-bottom: 1.5px solid var(--border);
  font-weight: 600;
  color: var(--text-muted);
  font-size: var(--font-caption);
}
.entry-line-table td {
  padding: 0.375rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.entry-line-table select,
.entry-line-table input {
  width: 100%;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--font-caption);
  background: var(--card);
  color: var(--text);
  font-family: var(--font-family);
}
.entry-line-table select:focus,
.entry-line-table input:focus {
  outline: none;
  border-color: var(--primary);
}
.entry-line-table .line-remove {
  color: var(--danger);
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1rem;
  padding: 0.25rem;
}
.entry-line-table .line-remove:hover { opacity: 0.7; }

/* ===== Entry Summary Sidebar ===== */
.entry-summary {
  background: var(--background);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.entry-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 0;
  font-size: var(--font-small);
}
.entry-summary-row.total {
  border-top: 1.5px solid var(--border);
  margin-top: 0.375rem;
  padding-top: 0.75rem;
  font-weight: 700;
}
.entry-summary-row.diff {
  color: var(--danger);
}
.entry-summary-row.balanced {
  color: var(--success);
}

/* ===== Audit Log Compact ===== */
.audit-log-compact {
  max-height: 400px;
  overflow-y: auto;
}
.audit-entry-compact {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--font-small);
}
.audit-entry-compact:last-child { border-bottom: none; }
.audit-compact-date {
  min-width: 80px;
  color: var(--text-muted);
  font-size: var(--font-caption);
}
.audit-compact-content { flex: 1; }
.audit-compact-user {
  font-weight: 500;
  color: var(--primary);
}
.audit-compact-detail {
  display: block;
  color: var(--text-muted);
  font-size: var(--font-caption);
  margin-top: 1px;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}
.empty-state-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.empty-state-desc {
  font-size: var(--font-small);
  color: var(--text-muted);
}

/* ===== Mobile Card List ===== */
@media (max-width: 768px) {
  .financial-grid {
    grid-template-columns: 1fr;
  }
  .report-grid {
    grid-template-columns: 1fr 1fr;
  }
  .statement-summary-cards {
    grid-template-columns: 1fr 1fr;
  }
  .profit-net-value {
    font-size: 1.5rem;
  }
  .entry-line-table th:nth-child(2),
  .entry-line-table td:nth-child(2) {
    display: none;
  }
}

@media (max-width: 480px) {
  .report-grid {
    grid-template-columns: 1fr;
  }
  .statement-summary-cards {
    grid-template-columns: 1fr;
  }
}

/* ===== Credit/Debit Colors ===== */
.text-debit { color: var(--danger); }
.text-credit { color: var(--success); }
.text-balance-positive { color: var(--primary); }
.text-balance-negative { color: var(--danger); }

/* ============================================
   Phase 8 - Print Styles
   ============================================ */
@media print {
  body { background: #fff !important; color: #000 !important; font-family: 'IBM Plex Sans Arabic', sans-serif; }
  .sidebar, .sidebar-overlay, .sidebar-backdrop, .sidebar-footer,
  .bottom-nav, .header, .header-left, .header-right, .header-user,
  .breadcrumb, .page-header-actions, .filter-bar, .card > .filter-bar,
  .actions-cell, .btn, .btn-primary, .btn-secondary, .btn-sm, .btn-danger, .btn-warning, .btn-success,
  .responsive-card-list, .mobile-overlay, .sidebar-toggle,
  .toast-container, .modal-overlay, .loading-overlay,
  .page-header-actions, [data-logout], .form-actions, .footer-links,
  .print-hide { display: none !important; }
  .app-layout { display: block !important; }
  .main-content { margin: 0 !important; padding: 0.5in !important; width: 100% !important; }
  .page-content { max-width: 100% !important; }
  .table { width: 100% !important; border-collapse: collapse !important; font-size: 10pt !important; }
  .table th { background: #f5f5f5 !important; color: #000 !important; border: 1px solid #ddd !important; padding: 6px 8px !important; }
  .table td { border: 1px solid #ddd !important; padding: 4px 8px !important; color: #000 !important; }
  .card { border: 1px solid #ddd !important; box-shadow: none !important; break-inside: avoid; }
  .stat-card, .detail-section, .report-card, .financial-card { break-inside: avoid; }
  h1, h2, h3, h4 { color: #000 !important; }
  .badge { border: 1px solid #999 !important; background: #f5f5f5 !important; color: #000 !important; }
  .badge-success { background: #e8f5e9 !important; color: #2e7d32 !important; }
  .badge-danger { background: #fce4ec !important; color: #c62828 !important; }
  .badge-warning { background: #fff8e1 !important; color: #f57f17 !important; }
  .badge-primary { background: #e3f2fd !important; color: #1565c0 !important; }
  a { color: #000 !important; text-decoration: none !important; }
  .print-header { display: block !important; text-align: center; margin-bottom: 1rem; font-size: 16pt; font-weight: 700; }
  .print-date { display: block !important; text-align: left; font-size: 9pt; color: #666; margin-bottom: 0.5rem; }
  .page-content { padding: 0 !important; }
  .detail-two-col { display: block !important; }
  .detail-section { margin-bottom: 1rem !important; }
  .detail-row { padding: 3px 0 !important; font-size: 10pt !important; }
  .amount-cell { font-size: 11pt !important; }
  @page { margin: 1.5cm; size: A4; }
}

/* ===== Bottom Nav Padding Fix ===== */
@media (max-width: 768px) {
  .main-content { padding-bottom: 70px; }
}

/* ===== Bottom Nav Unified ===== */
.bottom-nav { z-index: 100; }

/* ============================================
   Phase 9 - POS Completion & Car Queue
   ============================================ */

/* ===== POS Layout ===== */
.pos-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--background);
}
.pos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--primary);
  color: white;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pos-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.pos-header-logo {
  font-weight: 700;
  font-size: 1.125rem;
}
.pos-header-cashier {
  font-size: var(--font-small);
  opacity: 0.9;
}
.pos-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.pos-header-date {
  font-size: var(--font-caption);
  opacity: 0.85;
}
.pos-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  flex: 1;
  padding: 1rem;
  gap: 1rem;
}
.pos-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.pos-section {
  margin-bottom: 0.5rem;
}
.pos-section-title {
  font-size: var(--font-small);
  font-weight: 600;
  margin-bottom: 0.625rem;
  color: var(--text);
}
.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}
.pos-grid-services {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.car-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.car-card:hover {
  border-color: var(--primary);
}
.car-card.selected {
  border-color: var(--primary);
  background: rgba(15, 118, 110, 0.06);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}
.car-card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.car-card-name {
  font-size: var(--font-caption);
  font-weight: 500;
}
.service-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.service-card:hover {
  border-color: var(--primary);
}
.service-card.selected {
  border-color: var(--success);
  background: rgba(22, 163, 74, 0.06);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}
.service-card-icon {
  font-size: 1.375rem;
  margin-bottom: 0.25rem;
}
.service-card-name {
  font-size: var(--font-caption);
  font-weight: 500;
}
.service-card-price {
  font-size: 10px;
  color: var(--primary);
  font-weight: 700;
  margin-top: 0.125rem;
}

/* ===== POS Summary Sidebar ===== */
.pos-sidebar-summary {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pos-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}
.pos-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.pos-summary-title {
  font-weight: 600;
  font-size: var(--font-small);
}
.order-number {
  font-size: var(--font-caption);
  color: var(--text-muted);
  font-weight: 500;
}
.pos-summary-items {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.pos-summary-item {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-small);
}
.pos-summary-item-label {
  color: var(--text-muted);
}
.pos-summary-item-value {
  font-weight: 500;
}
.pos-summary-divider {
  height: 1px;
  background: var(--border);
  margin: 0.375rem 0;
}
.pos-summary-before-discount,
.pos-summary-discount {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-small);
  padding: 0.125rem 0;
}
.pos-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.125rem;
  font-weight: 700;
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  border-top: 1.5px solid var(--border);
}
.pos-summary-total-value {
  color: var(--primary);
}
.pos-payment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.375rem;
}
.payment-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.375rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: var(--font-caption);
}
.payment-card:hover {
  border-color: var(--primary);
}
.payment-card.selected.cash {
  border-color: var(--cash);
  background: rgba(21, 128, 61, 0.06);
  box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.15);
}
.payment-card.selected.card {
  border-color: var(--secondary);
  background: rgba(37, 99, 235, 0.06);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.payment-card.selected.transfer {
  border-color: var(--discount);
  background: rgba(124, 58, 237, 0.06);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}
.payment-card.selected.applepay {
  border-color: #1a1a1a;
  background: rgba(0,0,0,0.04);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}
.pos-confirm-btn {
  width: 100%;
  padding: 0.875rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-family);
}
.pos-confirm-btn:hover {
  background: var(--primary-dark);
}
.pos-confirm-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pos-discount-area {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.pos-discount-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--discount-light);
  border: 1px solid var(--discount);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
}
.pos-discount-applied-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pos-discount-applied-value {
  font-weight: 700;
  color: var(--discount);
  font-size: var(--font-small);
}
.pos-discount-applied-name {
  font-size: var(--font-caption);
  color: var(--text-muted);
}
.pos-discount-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.25rem;
}
.pos-discount-btn {
  width: 100%;
  padding: 0.5rem;
  background: var(--card);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-small);
  color: var(--text-muted);
  font-family: var(--font-family);
  transition: var(--transition);
}
.pos-discount-btn:hover {
  border-color: var(--discount);
  color: var(--discount);
}

/* ===== Invoice Popup ===== */
.invoice-popup-icon {
  width: 64px;
  height: 64px;
  background: var(--success-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 2rem;
}
.invoice-popup-title {
  text-align: center;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 1rem;
}
.invoice-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 0;
  font-size: var(--font-small);
  border-bottom: 1px solid var(--border);
}
.invoice-detail-row:last-child {
  border-bottom: none;
}
.invoice-detail-label {
  color: var(--text-muted);
}
.invoice-detail-value {
  font-weight: 600;
}
.invoice-total-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  margin-top: 0.5rem;
  border-top: 2px solid var(--primary);
  font-size: 1.125rem;
  font-weight: 700;
}
.invoice-total-value {
  color: var(--primary);
}
.invoice-services-list {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0;
}
.invoice-services-list li {
  font-size: var(--font-small);
  color: var(--text);
  padding: 0.125rem 0;
}
.invoice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ===== Receipt ===== */
.receipt {
  background: white;
  color: #000;
  padding: 1.5rem;
  max-width: 80mm;
  margin: 0 auto;
  font-size: 12px;
  line-height: 1.5;
}
.receipt-header {
  text-align: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed #ccc;
}
.receipt-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}
.receipt-company {
  font-size: 11px;
  color: #666;
  margin-top: 0.125rem;
}
.receipt-title {
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 0.75rem;
}
.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 11px;
}
.receipt-row.total {
  border-top: 2px solid #000;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  font-weight: 700;
  font-size: 14px;
}
.receipt-divider {
  border-top: 1px dashed #ccc;
  margin: 0.5rem 0;
}
.receipt-footer {
  text-align: center;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #ccc;
  font-size: 10px;
  color: #999;
}
.receipt-services {
  margin: 0.25rem 0;
}
.receipt-service-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 1px 0;
}

/* ===== Receipt Modal Print Styles ===== */
@media print {
  body * { visibility: hidden; }
  #receipt-content, #receipt-content * { visibility: visible; }
  #receipt-content { position: absolute; left: 0; top: 0; width: 80mm; padding: 0; background: white; color: black; }
  .modal-overlay, .modal-header, .modal-footer, .pos-header, .pos-body, .bottom-nav { display: none !important; }
}

/* ===== Car Queue ===== */
.car-queue-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: var(--transition);
}
.car-queue-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.car-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.car-queue-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.375rem;
  font-size: var(--font-small);
  color: var(--text-muted);
  margin: 0.5rem 0;
}
.car-queue-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ===== Status Timeline Detail ===== */
.status-timeline-detail {
  position: relative;
  padding-right: 1.5rem;
}
.status-timeline-detail::before {
  content: '';
  position: absolute;
  right: 6px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}
.timeline-entry {
  position: relative;
  padding: 0.25rem 0 0.25rem 0;
  font-size: var(--font-small);
}
.timeline-entry::before {
  content: '';
  position: absolute;
  right: -1.25rem;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}
.timeline-entry.active::before {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2);
}
.timeline-entry.completed::before {
  background: var(--success);
}
.timeline-status-name {
  font-weight: 500;
}
.timeline-status-time {
  color: var(--text-muted);
  font-size: 10px;
}

/* ===== Night Mode ===== */
body.night-mode {
  --background: #0F172A;
  --card: #111827;
  --card-soft: #1E293B;
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --border: #334155;
  --primary: #14B8A6;
  --primary-dark: #0D9488;
  --primary-light: #134E4A;
  --success: #22C55E;
  --success-light: #14532D;
  --warning: #F59E0B;
  --warning-light: #713F12;
  --danger: #F87171;
  --danger-light: #7F1D1D;
  --discount: #A78BFA;
  --discount-light: #3B0764;
  --cash: #22C55E;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
}
body.night-mode .pos-layout {
  background: var(--background);
}
body.night-mode .pos-header {
  background: #0D9488;
}
body.night-mode .car-card,
body.night-mode .service-card,
body.night-mode .payment-card,
body.night-mode .pos-summary,
body.night-mode .car-queue-card {
  background: var(--card);
  border-color: var(--border);
}
body.night-mode .car-card.selected,
body.night-mode .service-card.selected {
  border-color: var(--primary);
}
body.night-mode .receipt {
  background: #1E293B;
  color: #F8FAFC;
}
body.night-mode .receipt-logo { color: var(--primary); }
body.night-mode .receipt-company { color: #94A3B8; }
body.night-mode .receipt-footer { color: #94A3B8; }
body.night-mode .receipt-row.total { border-color: var(--primary); }
body.night-mode .invoice-popup-icon { background: var(--success-light); }

/* ===== POS Responsive ===== */
@media (max-width: 900px) {
  .pos-body {
    grid-template-columns: 1fr;
  }
  .pos-sidebar-summary {
    order: -1;
  }
  .pos-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
  .pos-grid-services {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}
@media (max-width: 480px) {
  .pos-body {
    padding: 0.5rem;
  }
  .pos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .pos-grid-services {
    grid-template-columns: repeat(2, 1fr);
  }
  .pos-payment-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .invoice-actions {
    grid-template-columns: 1fr;
  }
}

/* ===== Badge Info ===== */
.badge-info {
  background: rgba(37, 99, 235, 0.12);
  color: var(--secondary);
}
.badge-neutral {
  background: #F1F5F9;
  color: var(--text-muted);
}

/* ===== POS Header Night Toggle ===== */
.night-toggle-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-caption);
  font-family: var(--font-family);
  transition: var(--transition);
}
.night-toggle-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* ===== Discount Modal Enhancements ===== */
.discount-type-group {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.discount-type-btn {
  flex: 1;
  min-width: 80px;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  cursor: pointer;
  font-size: var(--font-caption);
  font-weight: 500;
  color: var(--text-muted);
  font-family: var(--font-family);
  transition: var(--transition);
  text-align: center;
}
.discount-type-btn.active {
  border-color: var(--discount);
  background: var(--discount-light);
  color: var(--discount);
}
.discount-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.discount-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.discount-card:hover {
  border-color: var(--discount);
}
.discount-card.selected {
  border-color: var(--discount);
  background: var(--discount-light);
}
.discount-card-icon {
  font-size: 1.25rem;
}
.discount-card-info {
  flex: 1;
}
.discount-card-name {
  font-weight: 600;
  font-size: var(--font-small);
}
.discount-card-value {
  font-size: var(--font-caption);
  color: var(--text-muted);
}
.discount-card-badge {
  font-size: 10px;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  background: var(--background);
  color: var(--text-muted);
  font-weight: 500;
}
.coupon-input-wrapper {
  display: flex;
  gap: 0.5rem;
}
.coupon-input-wrapper input {
  flex: 1;
  direction: ltr;
  text-align: center;
  letter-spacing: 0.1em;
  font-weight: 600;
}
