/* ==========================================================================
   PrintFlow ERP - Complete UI Prototype CSS Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Brand Colors */
  --primary: #1E285C;
  --primary-light: #2a3a7c;
  --primary-dark: #151d45;
  --primary-50: rgba(30, 40, 92, 0.05);
  --primary-100: rgba(30, 40, 92, 0.1);
  --primary-200: rgba(30, 40, 92, 0.2);
  
  --secondary: #FFD83D;
  --secondary-light: #FFE066;
  --secondary-dark: #E6C235;
  --secondary-50: rgba(255, 216, 61, 0.1);

  /* Status Colors */
  --success: #10b981;
  --success-50: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-50: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-50: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;
  --info-50: rgba(59, 130, 246, 0.1);

  /* Light Mode Backgrounds */
  --bg-body: #F5F6FA;
  --bg-card: #FFFFFF;
  --bg-sidebar: #1E285C;
  --bg-header: #FFFFFF;
  --bg-input: #F0F2F8;
  --bg-hover: rgba(30, 40, 92, 0.04);
  --bg-active: rgba(30, 40, 92, 0.08);
  --bg-overlay: rgba(0, 0, 0, 0.4);
  --bg-tooltip: #1E285C;

  /* Light Mode Text */
  --text-primary: #1E285C;
  --text-secondary: #4A5568;
  --text-tertiary: #A0AEC0;
  --text-white: #FFFFFF;
  --text-on-primary: #FFFFFF;
  --text-sidebar: rgba(255, 255, 255, 0.7);
  --text-sidebar-active: #FFFFFF;

  /* Borders & Shadows */
  --border: #E2E8F0;
  --border-light: #EDF2F7;
  --border-focus: #1E285C;
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.15);

  /* Layout & Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  --space-2xl: 2rem;
  --space-3xl: 3rem;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  --font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 72px;
  --header-height: 64px;
}

/* Dark Mode Overrides */
html.dark {
  --bg-body: #0D1117;
  --bg-card: #161B22;
  --bg-sidebar: #0D1117;
  --bg-header: #161B22;
  --bg-input: #21262D;
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-active: rgba(255, 255, 255, 0.08);
  --text-primary: #F0F0F0;
  --text-secondary: #8B949E;
  --text-tertiary: #6B737E;
  --border: #30363D;
  --border-light: #21262D;
  --border-focus: #FFD83D;

  --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.5);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.6);
}

/* --------------------------------------------------------------------------
   2. Reset & Base Settings
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-primary);
  direction: rtl;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-base), color var(--transition-base);
}

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

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

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  margin: 0 0 var(--space-sm) 0;
  color: var(--text-primary);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

/* --------------------------------------------------------------------------
   3. Layout Structure
   -------------------------------------------------------------------------- */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.app-sidebar {
  background-color: var(--bg-sidebar);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  z-index: 100;
  transition: transform var(--transition-base), width var(--transition-base);
}

.app-main-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-header {
  background-color: var(--bg-header);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

.app-main {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
}

.app-content {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Mobile Sidebar Menu Button toggle */
.mobile-menu-btn {
  display: none;
}

/* --------------------------------------------------------------------------
   4. Sidebar Components
   -------------------------------------------------------------------------- */
.sidebar-logo {
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: var(--header-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background-color: var(--secondary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
}
.sidebar-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sidebar-group-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.4);
  padding: var(--space-sm) var(--space-md) var(--space-xs) var(--space-md);
  font-weight: 700;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  color: var(--text-sidebar);
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  border-right: 3px solid transparent;
}
.sidebar-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-sidebar-active);
}
.sidebar-item.active {
  background-color: rgba(255, 255, 255, 0.12);
  color: var(--text-sidebar-active);
  border-right-color: var(--secondary);
}
.sidebar-item .icon {
  width: 20px;
  height: 20px;
  opacity: 0.85;
}
.sidebar-item.active .icon {
  opacity: 1;
  stroke: var(--secondary);
}

.sidebar-badge {
  margin-right: auto;
  background-color: var(--secondary);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* --------------------------------------------------------------------------
   5. Header Components
   -------------------------------------------------------------------------- */
.header-search {
  display: flex;
  align-items: center;
  background-color: var(--bg-input);
  border-radius: var(--radius-full);
  padding: 0 var(--space-lg);
  width: 320px;
  height: 40px;
  border: 1px solid var(--border);
  transition: border-color var(--transition-fast);
}
.header-search:focus-within {
  border-color: var(--primary);
}
.header-search input {
  border: none;
  background: transparent;
  flex: 1;
  outline: none;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-right: var(--space-xs);
}
.header-search svg {
  color: var(--text-tertiary);
}

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

.header-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background-color: transparent;
  border: none;
  position: relative;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.header-icon-btn:hover {
  background-color: var(--bg-hover);
}
.header-icon-btn .notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: var(--danger);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-header);
}

.header-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}
.header-user:hover {
  background-color: var(--bg-hover);
}
.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--primary);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.header-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.header-user-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
}
.header-user-role {
  font-size: 0.725rem;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   6. Buttons & Interactive Elements
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.6rem 1.25rem;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn-primary {
  background-color: var(--primary);
  color: var(--text-white);
}
.btn-primary:hover {
  background-color: var(--primary-light);
}
.btn-secondary {
  background-color: var(--bg-card);
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-tertiary);
}
.btn-success { background-color: var(--success); color: white; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background-color: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-warning { background-color: var(--warning); color: var(--primary); }
.btn-warning:hover { opacity: 0.9; }
.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}
.btn-icon {
  padding: 0.5rem;
}
.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}
.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
}
.btn-block {
  width: 100%;
}

/* --------------------------------------------------------------------------
   7. Page Headers & Toolbar
   -------------------------------------------------------------------------- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}
.page-title {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--text-primary);
}
.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.page-actions {
  display: flex;
  gap: var(--space-sm);
}

.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
  background-color: var(--bg-card);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.toolbar-right, .toolbar-left {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   8. Cards & Container Elements
   -------------------------------------------------------------------------- */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--space-lg);
  transition: box-shadow var(--transition-base), background-color var(--transition-base);
}
.card-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-body {
  padding: var(--space-xl);
}
.card-footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  background-color: rgba(0, 0, 0, 0.01);
}
.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}

/* --------------------------------------------------------------------------
   9. Data Tables & Pagination
   -------------------------------------------------------------------------- */
.table-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}
.data-table th {
  padding: var(--space-md) var(--space-lg);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  background-color: var(--bg-input);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: var(--space-md) var(--space-lg);
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background-color var(--transition-fast);
}
.data-table tbody tr:hover {
  background-color: var(--bg-hover);
}
.table-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.table-actions {
  display: flex;
  gap: var(--space-xs);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border);
  background-color: var(--bg-card);
}
.pagination-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.pagination-controls {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}
.pagination-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.pagination-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.pagination-btn.active {
  background-color: var(--primary);
  color: var(--text-white);
  border-color: var(--primary);
}
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   10. Forms & Input Fields
   -------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}
.form-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.form-label .required {
  color: var(--danger);
  margin-right: 2px;
}
.form-input, .form-select, .form-textarea {
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.875rem;
  font-size: 0.875rem;
  font-family: inherit;
  width: 100%;
  transition: all var(--transition-fast);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}
.form-textarea {
  min-height: 100px;
  resize: vertical;
}
.form-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
.form-error {
  font-size: 0.75rem;
  color: var(--danger);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}
.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

/* Toggle Switch */
.form-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}
.form-switch input {
  display: none;
}
.form-switch-slider {
  width: 44px;
  height: 24px;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  position: relative;
  transition: background-color 200ms;
}
.form-switch-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background-color: var(--text-secondary);
  transition: transform 200ms;
}
.form-switch input:checked + .form-switch-slider {
  background-color: var(--primary);
}
.form-switch input:checked + .form-switch-slider::before {
  transform: translateX(-20px);
  background-color: var(--secondary);
}

/* --------------------------------------------------------------------------
   11. Badges & Tags
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.25rem 0.65rem;
  font-size: 0.725rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.badge-primary { background-color: var(--primary-100); color: var(--primary); }
.badge-success { background-color: var(--success-50); color: var(--success); }
.badge-warning { background-color: var(--warning-50); color: var(--warning); }
.badge-danger { background-color: var(--danger-50); color: var(--danger); }
.badge-info { background-color: var(--info-50); color: var(--info); }
.badge-gray { background-color: var(--bg-input); color: var(--text-secondary); }
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
}

/* --------------------------------------------------------------------------
   12. Modals & Dialogs
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal {
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-slow);
}
.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
}
.modal-close:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}
.modal-body {
  padding: var(--space-xl);
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* --------------------------------------------------------------------------
   13. Filter Chips
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-chip:hover {
  border-color: var(--primary);
}
.filter-chip.active {
  background-color: var(--primary-50);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

/* Inline Search Box */
.search-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 var(--space-md);
  height: 40px;
  width: 260px;
  transition: border-color var(--transition-fast);
}
.search-box:focus-within {
  border-color: var(--primary);
}
.search-box input {
  border: none;
  background: transparent;
  flex: 1;
  outline: none;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-right: var(--space-xs);
}
.search-box svg {
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   14. Professional Empty State
   -------------------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
  text-align: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.empty-state-icon {
  width: 80px;
  height: 80px;
  background-color: var(--primary-50);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-xl);
  font-size: 2.25rem;
  color: var(--primary);
}
.empty-state-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: var(--space-xs);
}
.empty-state-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  max-width: 420px;
}

/* --------------------------------------------------------------------------
   15. Toast Notifications
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-xl);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  min-width: 320px;
}
.toast-success { border-right: 4px solid var(--success); }
.toast-danger { border-right: 4px solid var(--danger); }
.toast-warning { border-right: 4px solid var(--warning); }
.toast-info { border-right: 4px solid var(--info); }

/* --------------------------------------------------------------------------
   16. KPI/Stats Grid & Cards
   -------------------------------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}
.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}
.kpi-info {
  display: flex;
  flex-direction: column;
}
.kpi-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 700;
}
.kpi-value {
  font-size: 1.625rem;
  font-weight: 800;
  margin-top: 4px;
  color: var(--text-primary);
}
.kpi-change {
  font-size: 0.725rem;
  font-weight: 700;
  margin-top: 4px;
}
.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

/* --------------------------------------------------------------------------
   17. Login Screen
   -------------------------------------------------------------------------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: var(--space-xl);
}
.login-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 420px;
  padding: var(--space-3xl);
  display: flex;
  flex-direction: column;
}
.login-logo {
  text-align: center;
  margin-bottom: var(--space-2xl);
}
.login-logo-icon {
  width: 48px;
  height: 48px;
  background-color: var(--secondary);
  color: var(--primary);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}
.login-logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}
.login-logo-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 2px 0 0 0;
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  font-size: 0.85rem;
}
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
}
.checkbox-label input {
  width: 16px;
  height: 16px;
}
.login-forgot-link {
  color: var(--primary);
  font-weight: 700;
}
.login-forgot-link:hover {
  text-decoration: underline;
}

.login-footer {
  text-align: center;
  margin-top: var(--space-2xl);
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   18. Dropdowns & Navigation Menus
   -------------------------------------------------------------------------- */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: var(--space-xs);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition: all var(--transition-fast);
}
.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.dropdown-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}
.dropdown-divider {
  height: 1px;
  background-color: var(--border-light);
  margin: var(--space-xs) 0;
}

/* --------------------------------------------------------------------------
   19. Tabs & Steppers
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--space-lg);
}
.tab-btn {
  padding: var(--space-md) var(--space-xl);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-tertiary);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
}
.tab-btn:hover {
  color: var(--text-primary);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Stepper progress indicator */
.stepper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg) var(--space-2xl);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-sm);
}
.step-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  position: relative;
  flex: 1;
}
.step-indicator:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 50px;
  left: -20px;
  height: 2px;
  background-color: var(--border);
  z-index: 1;
}
.step-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--bg-input);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  z-index: 2;
  border: 2px solid var(--border);
  transition: all var(--transition-base);
}
.step-indicator.active .step-circle {
  background-color: var(--primary);
  color: var(--text-white);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-100);
}
.step-indicator.completed .step-circle {
  background-color: var(--success);
  color: var(--text-white);
  border-color: var(--success);
}
.step-label {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-secondary);
  z-index: 2;
}
.step-indicator.active .step-label {
  color: var(--primary);
}
.step-indicator.completed .step-label {
  color: var(--success);
}

/* --------------------------------------------------------------------------
   20. Side Drawer & click backdrop overlays
   -------------------------------------------------------------------------- */
.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 90vw;
  background-color: var(--bg-card);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  z-index: 1050;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
}
.side-drawer.active {
  transform: translateX(0);
}
.side-drawer-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--primary);
  color: var(--text-white);
}
.side-drawer-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
}
.side-drawer-close {
  background: transparent;
  border: none;
  color: var(--text-white);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.side-drawer-close:hover {
  background-color: rgba(255, 255, 255, 0.15);
}
.side-drawer-body {
  padding: var(--space-xl);
  overflow-y: auto;
  flex: 1;
}
.side-drawer-footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  background-color: rgba(0,0,0,0.01);
}

/* --------------------------------------------------------------------------
   21. Clickable Finish Checklist Cards
   -------------------------------------------------------------------------- */
.finish-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background-color: var(--bg-card);
}
.finish-card:hover {
  border-color: var(--primary-light);
  background-color: var(--bg-hover);
}
.finish-card.active {
  border-color: var(--primary);
  background-color: var(--primary-50);
  box-shadow: 0 0 0 3px var(--primary-100);
}
.finish-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   22. Drag & Drop Attachment Area
   -------------------------------------------------------------------------- */
.drag-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  background-color: var(--bg-input);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.drag-drop-zone:hover {
  border-color: var(--primary);
}
.drag-drop-icon {
  font-size: 2rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

/* --------------------------------------------------------------------------
   23. Sticky Pricing Summary Sidebar
   -------------------------------------------------------------------------- */
.sticky-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
  height: auto;
  z-index: 40;
}

/* --------------------------------------------------------------------------
   24. Advanced Odoo-like Product Cards Styles
   -------------------------------------------------------------------------- */
.product-cards-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.product-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background-color: var(--bg-card);
  transition: box-shadow var(--transition-base);
}
.product-card:hover {
  box-shadow: var(--shadow-md);
}

.product-card-header {
  padding: var(--space-md) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background-color: var(--bg-card);
  transition: background-color var(--transition-fast);
}
.product-card-header:hover {
  background-color: var(--bg-hover);
}

.product-card-img {
  width: 42px;
  height: 42px;
  background-color: var(--primary-50);
  color: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.product-card-body {
  padding: var(--space-xl);
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-card);
}

.mini-stepper {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0 var(--space-xl);
}
.mini-step {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background-color: var(--bg-input);
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
}
.mini-step.completed {
  background-color: var(--success-50);
  color: var(--success);
}
.mini-step.active {
  background-color: var(--primary-50);
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   25. Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fadeIn { animation: fadeIn 250ms ease forwards; }
.animate-slideDown { animation: slideDown 250ms ease forwards; }
.animate-slideUp { animation: slideUp 250ms ease forwards; }
.animate-scaleIn { animation: scaleIn 200ms ease forwards; }

/* --------------------------------------------------------------------------
   26. Minimal Utility Classes
   -------------------------------------------------------------------------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.15rem; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.w-full { width: 100%; }
.h-full { height: 100%; }
.m-0 { margin: 0; }
.p-0 { padding: 0; }
.hidden { display: none !important; }
.block { display: block !important; }
.inline-block { display: inline-block !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   27. Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: var(--sidebar-width);
    transform: translateX(100%);
    transition: transform var(--transition-base);
  }
  .app-sidebar.sidebar-open {
    transform: translateX(0);
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .header-search {
    width: 200px;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
  }
  .page-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-right, .toolbar-left {
    justify-content: space-between;
  }
  .search-box {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   28. Print Styles
   -------------------------------------------------------------------------- */
@media print {
  .app-sidebar, .app-header, .page-toolbar, .pagination, .btn, .table-actions {
    display: none !important;
  }
  body, .app-layout, .app-main-wrapper, .app-main {
    background-color: white !important;
    color: black !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .card, .table-container {
    border: none !important;
    box-shadow: none !important;
  }
  .data-table th {
    background-color: #f0f0f0 !important;
    color: black !important;
    border-bottom: 2px solid black !important;
  }
  .data-table td {
    border-bottom: 1px solid #ccc !important;
  }
}
