@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Kufi+Arabic:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #EEF2F6;
  --bg-secondary: #E2E8F0;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --border: #D8E2EF;
  --border-light: #B4C6DC;
  --accent: #003A70;
  --accent-hover: #002b54;
  --accent-glow: rgba(0, 58, 112, 0.08);
  --success: #16A34A;
  --success-bg: rgba(22, 163, 74, 0.08);
  --warning: #C19A5B;
  --warning-bg: rgba(193, 154, 91, 0.08);
  --danger: #DC2626;
  --danger-bg: rgba(220, 38, 38, 0.08);
  --text-primary: #0A0F1D;
  --text-secondary: #2D3748;
  --text-muted: #5A6A85;
  --sidebar-width: 260px;
  --bg-main: #EEF2F6;
}

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

html {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: clip;
}

body {
  font-family: 'Inter', 'Noto Kufi Arabic', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

body.sidebar-open {
  overflow: hidden;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

html[dir="rtl"] body {
  font-family: 'Noto Kufi Arabic', 'Inter', sans-serif;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

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

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-width);
  background: #003A70;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 40;
  transition: transform 0.3s ease;
}

html[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  background: #C19A5B;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
}

.sidebar-logo-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  padding: 12px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.15s ease;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.nav-item.active {
  background: rgba(193, 154, 91, 0.15);
  color: #C19A5B;
  border: 1px solid rgba(193, 154, 91, 0.3);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 70%;
  background: #C19A5B;
  border-radius: 0 2px 2px 0;
}

html[dir="rtl"] .nav-item.active::before {
  left: auto;
  right: 0;
  border-radius: 2px 0 0 2px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #FFFFFF !important;
}

.sidebar-footer div {
  color: #FFFFFF !important;
}

.sidebar-footer .btn-secondary {
  color: var(--text-primary) !important;
  background: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.sidebar-footer .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.9) !important;
}

.sidebar-footer .btn-primary {
  color: #003A70 !important;
  background: #C19A5B !important;
}

.sidebar-footer .btn-primary:hover {
  background: #b28e50 !important;
}

.sidebar-footer .avatar {
  background: #C19A5B !important;
  color: #003A70 !important;
}

/* ============ MAIN CONTENT ============ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

html[dir="rtl"] .main-content {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}

/* ============ TOPBAR ============ */
.topbar {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 30;
  min-width: 0;
}

.topbar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============ PAGE CONTENT ============ */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ============ CARDS ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

.card-sm {
  padding: 16px;
}

/* ============ KPI CARDS ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.kpi-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  transform: translateY(-1px);
}

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--border);
  border-color: var(--border-light);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-icon {
  padding: 8px;
  border-radius: 8px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-blue {
  background: rgba(0, 58, 112, 0.08);
  color: #003A70;
}

.badge-green {
  background: rgba(22, 163, 74, 0.08);
  color: #16A34A;
}

.badge-yellow {
  background: rgba(193, 154, 91, 0.1);
  color: #9A773C;
}

.badge-red {
  background: rgba(220, 38, 38, 0.08);
  color: #DC2626;
}

.badge-purple {
  background: rgba(139, 92, 246, 0.08);
  color: #7C3AED;
}

.badge-gray {
  background: rgba(100, 116, 139, 0.08);
  color: #475569;
}

.badge-orange {
  background: rgba(249, 115, 22, 0.08);
  color: #EA580C;
}

/* ============ FORM CONTROLS ============ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.form-input {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  font-family: inherit;
  min-height: 44px;
  appearance: auto !important;
  -webkit-appearance: auto !important;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

/* ============ TABLE ============ */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

html[dir="rtl"] thead th {
  text-align: right;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

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

tbody tr:hover {
  background: var(--bg-card-hover);
}

tbody td {
  padding: 13px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

/* ============ MODAL (Bootstrap 5 Overrides) ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

/* Modernized Bootstrap 5 Modal Overlay & Blur */
.modal {
  backdrop-filter: blur(5px) !important;
  transition: backdrop-filter 0.3s ease !important;
}

/* Modal Dialog centering, sizing, and responsiveness */
.modal-dialog {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: calc(100% - 3.5rem) !important;
  max-width: 520px !important;
  width: 95% !important;
  margin: 1.75rem auto !important;
}

/* For small screens: width 95%, max-height 90vh */
@media (max-width: 576px) {
  .modal-dialog {
    width: 95% !important;
    max-width: 100% !important;
    margin: 0.5rem auto !important;
    min-height: calc(100% - 1rem) !important;
  }
}

/* Modal Content box: styling, shadow, border radius, animations */
.modal-content {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  overflow: hidden !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(20px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Modal Header: padding and typography */
.modal-header {
  background-color: var(--bg-card) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 20px 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.modal-title {
  font-family: 'Noto Kufi Arabic', sans-serif !important;
  font-weight: 700 !important;
  font-size: 16.5px !important;
  color: var(--text-primary) !important;
  margin: 0 !important;
}

/* Modal Body: spacing & scrollability */
.modal-body {
  padding: 24px !important;
  overflow-y: auto !important;
  max-height: calc(90vh - 140px) !important;
  background-color: var(--bg-card) !important;
  text-align: right !important; /* RTL Support */
}

/* Modal Footer: spacing & buttons container */
.modal-footer {
  background-color: var(--bg-card-hover) !important;
  border-top: 1px solid var(--border) !important;
  padding: 16px 24px !important;
  display: flex !important;
  gap: 12px !important;
  align-items: center !important;
  justify-content: flex-end !important;
}

html[dir="rtl"] .modal-footer {
  justify-content: flex-start !important;
}

/* Close button animations & proper margin */
.modal-header .btn-close {
  margin: -0.5rem auto -0.5rem -0.5rem !important; /* RTL margins */
  background-size: 0.8rem !important;
  transition: transform 0.2s ease !important;
}

html[dir="rtl"] .modal-header .btn-close {
  margin: -0.5rem -0.5rem -0.5rem auto !important;
}

.modal-header .btn-close:hover {
  transform: rotate(90deg) !important;
}

/* Overlay backdrop blur and opacity transition */
.modal-backdrop {
  background-color: rgba(0, 5, 20, 0.4) !important;
  backdrop-filter: blur(4px) !important;
  transition: opacity 0.3s ease !important;
}

/* Prevent scrollbar shake and page vibration */
body.modal-open {
  overflow: hidden !important;
  padding-right: 0 !important;
}

/* Enhanced Forms inside Modals */
.modal-body .form-group {
  margin-bottom: 16px !important;
}

.modal-body .form-group:last-child {
  margin-bottom: 0 !important;
}

.modal-body .form-label {
  font-weight: 600 !important;
  font-size: 13px !important;
  margin-bottom: 6px !important;
  color: var(--text-secondary) !important;
}

.modal-body .form-input,
.modal-body .form-select {
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  padding: 10px 14px !important;
  font-size: 13.5px !important;
  transition: all 0.2s ease !important;
}

.modal-body .form-input:focus,
.modal-body .form-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
  background-color: var(--bg-card) !important;
}

/* Buttons Styling inside Modals */
.modal-footer .btn {
  min-height: 40px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  padding: 8px 20px !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
}

/* Cancel button style */
.modal-footer .btn-secondary,
.modal-footer [data-bs-dismiss="modal"] {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

.modal-footer .btn-secondary:hover,
.modal-footer [data-bs-dismiss="modal"]:hover {
  background-color: #e2e8f0 !important;
  color: #334155 !important;
  border-color: #94a3b8 !important;
}

/* Save / Confirm button style */
.modal-footer .btn-primary {
  background-color: var(--accent) !important;
  color: #ffffff !important;
  border: 1px solid var(--accent) !important;
}

.modal-footer .btn-primary:hover {
  background-color: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
  box-shadow: 0 4px 12px var(--accent-glow) !important;
}

/* Delete button style */
.modal-footer .btn-danger {
  background-color: var(--danger) !important;
  color: #ffffff !important;
  border: 1px solid var(--danger) !important;
}

.modal-footer .btn-danger:hover {
  background-color: #be123c !important;
  border-color: #be123c !important;
  box-shadow: 0 4px 12px var(--danger-bg) !important;
}

/* Override common utility resets to ensure unified modal design across all templates */
.modal-header.border-0,
.modal-header.pb-0 {
  border-bottom: 1px solid var(--border) !important;
  padding: 20px 24px !important;
}

.modal-body.pt-3 {
  padding: 24px !important;
}

.modal-footer.border-0,
.modal-footer.px-0,
.modal-footer.pb-0,
.modal-footer.mt-3 {
  background-color: var(--bg-card-hover) !important;
  border-top: 1px solid var(--border) !important;
  padding: 16px 24px !important;
  margin-top: 0 !important;
}


/* ============ KANBAN ============ */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 600px;
}

.kanban-column {
  flex: 0 0 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.kanban-column-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.kanban-column-body {
  padding: 10px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.task-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.task-card.overdue {
  border-left: 3px solid var(--danger);
}

html[dir="rtl"] .task-card.overdue {
  border-left: 1px solid var(--border);
  border-right: 3px solid var(--danger);
}

.task-card-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ============ PROGRESS BAR ============ */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-fill.green {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.progress-fill.yellow {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.progress-fill.red {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

/* ============ ALERTS ============ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 13.5px;
}

.alert-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #B91C1C;
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid rgba(193, 154, 91, 0.2);
  color: #9A773C;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid rgba(22, 163, 74, 0.2);
  color: #15803D;
}

/* ============ SECTION HEADER ============ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ============ EMPTY STATE ============ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 12px;
}

.empty-state-icon {
  font-size: 48px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state-sub {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ============ TABS ============ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab {
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

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

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

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

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

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

.animate-spin {
  animation: spin 0.8s linear infinite;
}

/* ============ LOADING SPINNER ============ */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ============ USER AVATAR ============ */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #C19A5B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #003A70;
  flex-shrink: 0;
}

/* ============ DIVIDER ============ */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ============ NUMERIC DISPLAY ============ */
.money {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.money-positive {
  color: var(--success);
}

.money-negative {
  color: var(--danger);
}

.money-neutral {
  color: var(--text-primary);
}

/* ============ RESPONSIVE ============ */
#mobile-menu-btn {
  display: none;
}

@media (max-width: 768px) {
  #mobile-menu-btn {
    display: inline-flex !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: auto;
    right: 0;
    height: 100vh;
    width: min(85vw, 300px);
    z-index: 1000;
    transform: translateX(100%);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
  }

  html[dir="ltr"] .sidebar {
    left: 0;
    right: auto;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
  }

  html[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
  }

  .sidebar.open,
  html[dir="ltr"] .sidebar.open,
  html[dir="rtl"] .sidebar.open {
    transform: translateX(0) !important;
  }

  .main-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100%;
    min-width: 0;
  }

  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 12px;
  }

  .kpi-value {
    font-size: clamp(18px, 5vw, 26px);
  }

  .page-content {
    padding: 12px;
  }

  .topbar {
    padding: 0 14px;
    height: 56px;
  }

  .topbar-title {
    font-size: clamp(14px, 4vw, 18px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-actions {
    gap: 6px;
    flex-shrink: 0;
  }

  .section-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .modal, .modal-content {
    padding: 20px 16px;
    max-height: 95vh;
    margin: 10px;
  }

  .card {
    padding: 16px;
  }

  .btn {
    font-size: 13px;
    padding: 8px 14px;
  }

  table {
    font-size: 12px;
  }

  thead th,
  tbody td {
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .kpi-card {
    padding: 14px;
  }

  .kpi-value {
    font-size: clamp(16px, 4.5vw, 22px);
  }

  .kpi-label {
    font-size: 10px;
  }

  .page-content {
    padding: 10px;
  }

  .section-title {
    font-size: 17px;
  }

  thead th,
  tbody td {
    padding: 8px 10px;
  }
}

@media (max-width: 360px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 10px;
  }
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
  color: var(--text-primary);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.15s;
}

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

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

html[dir="rtl"] .modal-actions {
  justify-content: flex-start;
}

/* ============ PRINT STYLES ============ */
@media print {
  :root {
    --bg-primary: #ffffff !important;
    --bg-secondary: #ffffff !important;
    --bg-card: #ffffff !important;
    --border: #000000 !important;
    --border-light: #000000 !important;
    --text-primary: #000000 !important;
    --text-secondary: #000000 !important;
    --text-muted: #333333 !important;
    --success: #000000 !important;
    --danger: #000000 !important;
  }

  body, html {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt !important;
  }

  .sidebar,
  .topbar,
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .btn-icon,
  form,
  .form-input,
  select,
  .modal-overlay,
  .tabs {
    display: none !important;
  }

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

  .page-content {
    padding: 0 !important;
    margin: 0 !important;
  }

  .card, .kpi-card {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin-bottom: 20px !important;
  }

  .table-container {
    overflow: visible !important;
    width: 100% !important;
  }

  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;
  }

  th, td {
    border: 1px solid #000000 !important;
    color: #000000 !important;
    padding: 8px !important;
    font-size: 10pt !important;
    background: transparent !important;
  }

  th {
    font-weight: bold !important;
  }

  span, div, h1, h2, h3, h4, h5, h6, p, td {
    color: #000000 !important;
    background: transparent !important;
  }

  .money, .money-positive, .money-negative, .money-neutral {
    color: #000000 !important;
    font-weight: bold !important;
  }

  .kpi-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
  }

  .kpi-card {
    flex: 1 !important;
    min-width: 150px !important;
    border: 1px solid #000000 !important;
    padding: 10px !important;
  }

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

/* Premium Bootstrap Modal Overrides */
.modal {
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  background-color: rgba(15, 23, 42, 0.4) !important;
  transition: all 0.3s ease !important;
}

.modal.fade .modal-dialog {
  transform: scale(0.95) !important;
  transition: transform 0.25s ease-out !important;
}

.modal.show .modal-dialog {
  transform: scale(1) !important;
}

.modal-dialog {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: calc(100% - 3.5rem) !important;
  margin: 1.75rem auto !important;
}

.modal-content {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  padding: 1.5rem !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  width: 100% !important;
}

.modal-header {
  border-bottom: none !important;
  padding: 0 0 1rem 0 !important;
}

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

.modal-body {
  padding: 0 !important;
}

.modal-footer {
  border-top: none !important;
  padding: 1rem 0 0 0 !important;
  display: flex !important;
  gap: 8px !important;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
  .modal-dialog {
    margin: 0.5rem auto !important;
    width: 95% !important;
    max-width: none !important;
  }
  .modal-content {
    padding: 1.25rem !important;
    max-height: 85vh !important;
  }
}
