/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../nodevenv/sas4-panel/20/lib/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!../nodevenv/sas4-panel/20/lib/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./app/globals.css ***!
  \*********************************************************************************************************************************************************************************************************************************************************************************************************************/
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --font-arabic: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-numeric: 'Outfit', 'Cairo', sans-serif;
  
  /* Light Mode Palette */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;
  
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  /* Brand / Primary (Professional SaaS Indigo/Blue) */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  /* Status Colors */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;
  
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;
  
  --info: #06b6d4;
  --info-bg: #ecfeff;
  --info-border: #a5f3fc;
  --info-text: #155e75;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
  
  --sidebar-width: 270px;
  --topbar-height: 68px;
}

[data-theme='dark'] {
  --bg-main: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1e293b;
  --bg-subtle: #1a2234;
  --bg-hover: #26334d;
  
  --border-subtle: #1e293b;
  --border-strong: #334155;
  
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-border: rgba(59, 130, 246, 0.3);
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --success-border: rgba(16, 185, 129, 0.3);
  --success-text: #34d399;
  
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --warning-border: rgba(245, 158, 11, 0.3);
  --warning-text: #fbbf24;
  
  --danger: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-border: rgba(239, 68, 68, 0.3);
  --danger-text: #fca5a5;
  
  --info: #38bdf8;
  --info-bg: rgba(56, 189, 248, 0.15);
  --info-border: rgba(56, 189, 248, 0.3);
  --info-text: #7dd3fc;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6), 0 8px 10px -6px rgb(0 0 0 / 0.4);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

html, body {
  min-height: 100%;
  font-family: var(--font-arabic);
  background-color: var(--bg-main);
  color: var(--text-main);
  direction: rtl;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body.drawer-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Layout Core */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  width: 100%;
  overflow-x: hidden;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 50;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease;
  will-change: transform;
}

.main-content {
  flex: 1 1;
  margin-right: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Prevents flex children from causing horizontal scroll */
  transition: margin-right 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Off-canvas behavior for Tablet & Mobile (<= 1024px) */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.28);
  }
  .main-content {
    margin-right: 0;
  }
}

/* Drawer Backdrop */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  z-index: 45;
  animation: fadeIn 0.2s ease;
}

/* Page Container */
.page-container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(14px, 2.5vw, 28px) clamp(12px, 2vw, 24px);
  flex: 1 1;
  min-width: 0;
}

/* Header & Topbar */
.topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px clamp(12px, 2vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--topbar-height);
  gap: 12px;
}

/* Header Responsive Utilities */
@media (max-width: 580px) {
  .btn-label-check {
    display: none !important;
  }
}

/* Cards & Surfaces */
.card {

  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: clamp(16px, 2.5vw, 24px);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

/* Stat Cards */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: clamp(14px, 2vw, 20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  min-height: 126px;
}

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

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

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.stat-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.3;
}

.stat-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--icon-bg, var(--bg-subtle));
  color: var(--icon-color, var(--primary));
}

.stat-value {
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  font-weight: 800;
  font-family: var(--font-numeric);
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.stat-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.35;
}

/* Responsive Grids */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-gap: clamp(12px, 1.8vw, 18px);
  gap: clamp(12px, 1.8vw, 18px);
  margin-bottom: 24px;
}

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

@media (max-width: 540px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Two-column responsive layout */
.responsive-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap: 20px;
  gap: 20px;
}

@media (max-width: 900px) {
  .responsive-split-grid {
    grid-template-columns: 1fr;
  }
}

/* Tables & Wrappers */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.9rem;
  min-width: 640px; /* Ensures columns maintain shape in scroll container */
}

.table th {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  font-size: 0.84rem;
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  background: var(--bg-surface);
  vertical-align: middle;
}

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

.table tr:hover td {
  background: var(--bg-subtle);
}

/* Mobile vs Desktop View Toggle */
.desktop-only-table {
  display: block;
}

.mobile-only-stream {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only-table {
    display: none;
  }
  .mobile-only-stream {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
}

/* Mobile Record Card for Managers / Billing / Subscriptions */
.mobile-record-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s ease;
}

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

.mobile-record-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.mobile-record-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap: 10px;
  gap: 10px;
  font-size: 0.85rem;
}

.mobile-record-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-record-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.mobile-record-value {
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
}

.mobile-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.mobile-record-actions .btn {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: calc(50% - 6px);
  min-height: 40px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.2;
}

.badge-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.badge-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
}

.badge-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.badge-info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info-text);
}

.badge-muted {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  min-height: 42px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  outline: none;
  white-space: nowrap;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
}

.btn-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}
.btn-danger:hover {
  background: #ef4444;
  color: #fff;
}

.btn-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}
.btn-success:hover {
  background: #10b981;
  color: #fff;
}

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

.btn-icon {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 10px;
  flex-shrink: 0;
}

/* Inputs & Form Controls */
.input, .select, .textarea {
  width: 100%;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea {
  min-height: 80px;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Tabs Scroller */
.tabs-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
  flex-wrap: nowrap;
}

.tabs-scroll::-webkit-scrollbar {
  display: none;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: clamp(10px, 3vw, 24px);
  animation: fadeIn 0.15s ease;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: clamp(14px, 2vw, 20px);
  width: min(100%, 560px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  padding: clamp(16px, 3vw, 24px);
  position: relative;
  animation: scaleUp 0.15s ease;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.modal-title {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-close:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .modal-footer {
    flex-direction: column-reverse;
  }
  .modal-footer .btn {
    width: 100%;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Comprehensive Print Styles for Reports, Invoices, Receipts & Statements */
@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 10mm;
  }

  @page landscape {
    size: A4 landscape;
    margin: 10mm;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 11pt !important;
    line-height: 1.4 !important;
  }

  /* Hide UI chrome */
  .sidebar,
  .topbar,
  .btn,
  .no-print,
  .drawer-backdrop,
  .modal-overlay:not(.print-modal-active),
  .modal-close,
  .pagination-container,
  .filter-panel,
  nav {
    display: none !important;
  }

  .main-content {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .print-only {
    display: block !important;
  }

  /* Table rules for multi-page printing */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    page-break-inside: auto !important;
  }

  tr {
    page-break-inside: avoid !important;
    page-break-after: auto !important;
  }

  thead {
    display: table-header-group !important; /* Repeats table header across pages */
  }

  tfoot {
    display: table-footer-group !important;
  }

  th, td {
    border: 1px solid #cbd5e1 !important;
    padding: 6px 8px !important;
    font-size: 9.5pt !important;
    color: #000000 !important;
  }

  th {
    background: #f1f5f9 !important;
    font-weight: 700 !important;
  }

  /* Page break controls */
  .page-break-before {
    page-break-before: always !important;
  }

  .page-break-after {
    page-break-after: always !important;
  }

  .avoid-break {
    page-break-inside: avoid !important;
  }

  /* Force landscape when class is applied */
  .print-landscape {
    page: landscape;
  }
}

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

