@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

:root {
  --sidebar-w: 272px;
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', sans-serif;
  --c-bg: #f0f4f8;
  --c-surface: #ffffff;
  --c-sidebar: #0b1120;
  --c-sidebar-hover: rgba(255,255,255,0.06);
  --c-sidebar-active: rgba(56,189,248,0.12);
  --c-sidebar-active-border: #38bdf8;
  --c-sidebar-text: #7c8db5;
  --c-primary: #2563eb;
  --c-primary-hover: #1d4ed8;
  --c-primary-soft: rgba(37,99,235,0.08);
  --c-accent: #f59e0b;
  --c-accent-soft: rgba(245,158,11,0.1);
  --c-success: #10b981;
  --c-success-soft: rgba(16,185,129,0.1);
  --c-warning: #f59e0b;
  --c-warning-soft: rgba(245,158,11,0.1);
  --c-danger: #ef4444;
  --c-danger-soft: rgba(239,68,68,0.08);
  --c-text: #1e293b;
  --c-text-secondary: #64748b;
  --c-text-muted: #94a3b8;
  --c-border: #e2e8f0;
  --c-border-light: #f1f5f9;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 16px -4px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 40px -8px rgba(0,0,0,0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* ===================== SIDEBAR ===================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--c-sidebar);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(56,189,248,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(99,102,241,0.05) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  z-index: 40;
  transition: transform 0.35s var(--ease);
  overflow: hidden;
}
.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-brand h1 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
}
.sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand .brand-icon svg { width: 20px; height: 20px; color: #fff; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar-section { margin-bottom: 4px; }
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.25);
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--c-sidebar-text);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.nav-item:hover {
  background: var(--c-sidebar-hover);
  color: #e2e8f0;
}
.nav-item.active {
  background: var(--c-sidebar-active);
  color: #38bdf8;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--c-sidebar-active-border);
  border-radius: 3px 0 0 3px;
}
[dir="ltr"] .nav-item.active::before { right: auto; left: 0; border-radius: 0 3px 3px 0; }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.2s;
}
.sidebar-user:hover { background: var(--c-sidebar-hover); }
.sidebar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { color: #e2e8f0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: var(--c-sidebar-text); font-size: 11px; }
.sidebar-reset-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(239,68,68,0.2);
  background: rgba(239,68,68,0.08);
  color: #fca5a5;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}
.sidebar-reset-btn:hover { background: rgba(239,68,68,0.15); color: #fecaca; }

/* ===================== MAIN LAYOUT ===================== */
.main-wrapper {
  margin-right: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
[dir="ltr"] .main-wrapper { margin-right: 0; margin-left: var(--sidebar-w); }

/* ===================== TOPBAR ===================== */
.topbar {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border-light);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.3px;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ===================== CONTENT ===================== */
.content-area { flex: 1; padding: 24px 28px 40px; }

/* ===================== PAGE HEADER / TOOLBAR ===================== */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.toolbar-start { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-end { display: flex; align-items: center; gap: 10px; }

/* ===================== SEARCH BOX ===================== */
.search-box {
  position: relative;
  width: 280px;
}
.search-box .search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--c-text-muted);
  pointer-events: none;
  transition: color 0.2s;
}
[dir="ltr"] .search-box .search-icon { right: auto; left: 12px; }
.search-box input {
  width: 100%;
  padding: 9px 14px;
  padding-right: 40px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-body);
  background: var(--c-surface);
  color: var(--c-text);
  transition: all 0.2s var(--ease);
}
[dir="ltr"] .search-box input { padding-right: 14px; padding-left: 40px; }
.search-box input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.search-box input:focus + .search-icon,
.search-box input:focus ~ .search-icon { color: var(--c-primary); }
.search-box input::placeholder { color: var(--c-text-muted); }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
  line-height: 1.4;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }

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

.btn-success { background: var(--c-success); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-warning { background: var(--c-warning); color: #fff; }
.btn-warning:hover { background: #d97706; }

.btn-ghost {
  background: transparent;
  color: var(--c-text-secondary);
  border: 1.5px solid var(--c-border);
}
.btn-ghost:hover { background: var(--c-border-light); border-color: #cbd5e1; }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 5px; }
.btn-icon { padding: 8px; border-radius: 8px; }

.btn-outline-primary { background: var(--c-primary-soft); color: var(--c-primary); border: 1.5px solid rgba(37,99,235,0.2); }
.btn-outline-primary:hover { background: var(--c-primary); color: #fff; }
.btn-outline-success { background: var(--c-success-soft); color: var(--c-success); }
.btn-outline-success:hover { background: var(--c-success); color: #fff; }
.btn-outline-danger { background: var(--c-danger-soft); color: var(--c-danger); }
.btn-outline-danger:hover { background: var(--c-danger); color: #fff; }
.btn-outline-warning { background: var(--c-warning-soft); color: #b45309; }
.btn-outline-warning:hover { background: var(--c-warning); color: #fff; }

/* ===================== CARDS ===================== */
.card {
  background: var(--c-surface);
  border-radius: var(--radius);
  border: 1px solid var(--c-border-light);
  box-shadow: var(--shadow-xs);
  transition: all 0.25s var(--ease);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }

/* Stat cards */
.stat-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--c-border-light);
  box-shadow: var(--shadow-xs);
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
}
.stat-card:nth-child(1)::before { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card .stat-label { font-size: 12px; color: var(--c-text-muted); font-weight: 500; margin-bottom: 6px; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -0.5px; color: var(--c-text); }

/* Safe cards */
.safe-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--c-border-light);
  box-shadow: var(--shadow-xs);
  transition: all 0.25s var(--ease);
}
.safe-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.safe-card .safe-name { font-size: 13px; color: var(--c-text-secondary); font-weight: 500; margin-bottom: 8px; }
.safe-card .safe-balance {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--c-success);
  letter-spacing: -0.3px;
}

/* ===================== DATA TABLE ===================== */
.table-wrapper {
  background: var(--c-surface);
  border-radius: var(--radius);
  border: 1px solid var(--c-border-light);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: #f8fafc; border-bottom: 1.5px solid var(--c-border); }
.data-table thead th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--c-text-muted);
  text-align: start;
  white-space: nowrap;
}
.data-table tbody tr {
  border-bottom: 1px solid var(--c-border-light);
  transition: background 0.15s;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.clickable:hover { background: var(--c-primary-soft); }
.data-table tbody td {
  padding: 13px 16px;
  font-size: 13px;
  color: var(--c-text);
  vertical-align: middle;
}
.data-table .cell-name { font-weight: 600; }
.data-table .cell-money { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.2px; }
.data-table .cell-actions { white-space: nowrap; }

.table-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--c-text-muted);
  font-size: 13px;
}
.table-empty svg { width: 40px; height: 40px; color: var(--c-border); margin: 0 auto 12px; display: block; }

/* ===================== PAGINATION ===================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}
.pagination .page-btn {
  padding: 7px 14px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font-body);
}
.pagination .page-btn:hover:not(:disabled) { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-soft); }
.pagination .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info {
  padding: 7px 14px;
  font-size: 12px;
  color: var(--c-text-muted);
  font-weight: 500;
}
.pagination .page-badge {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-primary);
  background: var(--c-primary-soft);
  border-radius: 99px;
  margin-inline-end: 8px;
  white-space: nowrap;
}

/* ===================== BADGES ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-green { background: var(--c-success-soft); color: #047857; }
.badge-red { background: var(--c-danger-soft); color: #b91c1c; }
.badge-yellow { background: var(--c-warning-soft); color: #92400e; }
.badge-blue { background: var(--c-primary-soft); color: #1e40af; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-purple { background: rgba(139,92,246,0.1); color: #6d28d9; }

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-xs);
  font-size: 13.5px;
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-surface);
  transition: all 0.2s var(--ease);
  line-height: 1.5;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--c-text-muted); }
.form-select { cursor: pointer; }
.form-textarea { resize: vertical; min-height: 80px; }

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 20px;
  animation: fadeIn 0.2s var(--ease);
}
.modal-panel {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: modalSlide 0.3s var(--ease-spring);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 22px 24px 0;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.3px;
}
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 0 24px 22px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlide { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ===================== TOAST ===================== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.35s var(--ease-spring);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 420px;
}
.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-warning { background: #d97706; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(0.96); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }

/* ===================== TABS ===================== */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1.5px solid var(--c-border-light);
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  white-space: nowrap;
  font-family: var(--font-body);
  position: relative;
}
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1.5px;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  border-radius: 2px 2px 0 0;
  transition: background 0.2s;
}
.tab-btn:hover { color: var(--c-text); }
.tab-btn.active { color: var(--c-primary); }
.tab-btn.active::after { background: var(--c-primary); }

/* ===================== BACK LINK ===================== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--c-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
  margin-bottom: 16px;
  text-decoration: none;
}
.back-link:hover { color: var(--c-primary); }
.back-link svg { width: 16px; height: 16px; }

/* ===================== DETAIL SECTION ===================== */
.detail-card { margin-bottom: 20px; }
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.detail-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.detail-subtitle { font-size: 13px; color: var(--c-text-muted); margin-top: 2px; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.detail-stat {
  background: var(--c-bg);
  padding: 14px;
  border-radius: var(--radius-sm);
}
.detail-stat .ds-label { font-size: 11px; color: var(--c-text-muted); font-weight: 500; margin-bottom: 4px; }
.detail-stat .ds-value { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }

/* ===================== REPORT SUMMARY ===================== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.summary-item {
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border-light);
}
.summary-item .si-label { font-size: 12px; color: var(--c-text-muted); margin-bottom: 6px; }
.summary-item .si-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }

/* ===================== FILTER SELECT ===================== */
.filter-select {
  padding: 9px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-surface);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.filter-select:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }

/* ===================== ACTION BUTTONS (table) ===================== */
.action-btn {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: transparent;
  font-family: var(--font-body);
}
.action-btn-edit { color: var(--c-primary); }
.action-btn-edit:hover { background: var(--c-primary-soft); }
.action-btn-toggle { color: #b45309; }
.action-btn-toggle:hover { background: var(--c-warning-soft); }
.action-btn-confirm { color: var(--c-success); }
.action-btn-confirm:hover { background: var(--c-success-soft); }
.action-btn-cancel { color: var(--c-danger); }
.action-btn-cancel:hover { background: var(--c-danger-soft); }

/* ===================== LOGIN PAGE ===================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-sidebar);
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(56,189,248,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(99,102,241,0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(15,23,42,1) 0%, rgba(11,17,32,1) 100%);
  padding: 20px;
}
.login-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 40px 80px rgba(0,0,0,0.3);
  animation: loginCardIn 0.5s var(--ease-spring);
}
@keyframes loginCardIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.login-card .login-brand {
  text-align: center;
  margin-bottom: 32px;
}
.login-card .login-brand .brand-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card .login-brand .brand-icon svg { width: 28px; height: 28px; color: #fff; }
.login-card .login-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.3px;
}
.login-card .login-subtitle {
  font-size: 13px;
  color: var(--c-sidebar-text);
  margin-top: 4px;
}
.login-card .form-label { color: #94a3b8; }
.login-card .form-input {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: #e2e8f0;
}
.login-card .form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }
.login-card .form-input::placeholder { color: rgba(255,255,255,0.25); }
.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  margin-bottom: 16px;
}

/* ===================== SPINNER ===================== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== MOBILE ===================== */
.mobile-toggle {
  display: none;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--c-text-secondary);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}
.mobile-toggle:hover { background: var(--c-border-light); }
.mobile-toggle svg { width: 22px; height: 22px; }
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 35;
  animation: fadeIn 0.2s;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(100%); }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-right: 0 !important; margin-left: 0 !important; }
  .mobile-toggle { display: block; }
  .content-area { padding: 16px; }
  .topbar { padding: 0 16px; }
  .search-box { width: 100%; }
  .page-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-start, .toolbar-end { width: 100%; }
}

/* ===================== PRINT ===================== */
@media print {
  .sidebar, .topbar, .no-print, .mobile-overlay { display: none !important; }
  .main-wrapper { margin: 0 !important; }
  .content-area { padding: 0 !important; }
  .card, .table-wrapper { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ===================== RTL ===================== */
[dir="rtl"] .flip-icon { transform: scaleX(-1); }

/* ===================== STAGGER ANIMATION ===================== */
.stagger-in { animation: staggerFadeIn 0.4s var(--ease) backwards; }
.stagger-in:nth-child(1) { animation-delay: 0s; }
.stagger-in:nth-child(2) { animation-delay: 0.05s; }
.stagger-in:nth-child(3) { animation-delay: 0.1s; }
.stagger-in:nth-child(4) { animation-delay: 0.15s; }
.stagger-in:nth-child(5) { animation-delay: 0.2s; }
@keyframes staggerFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===================== MISC ===================== */
.text-success { color: var(--c-success) !important; }
.text-danger { color: var(--c-danger) !important; }
.text-warning { color: #b45309 !important; }
.text-primary { color: var(--c-primary) !important; }
.text-muted { color: var(--c-text-muted) !important; }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }

.section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 14px;
  letter-spacing: -0.2px;
}

.inline-actions { display: flex; gap: 4px; align-items: center; }

.status-actions { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }

/* ===================== TOPBAR SHORTCUTS ===================== */
.topbar-shortcuts {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  max-width: 50%;
  scrollbar-width: none;
}
.topbar-shortcuts::-webkit-scrollbar { display: none; }
.shortcut-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 6px;
  background: var(--c-bg);
  border: 1px solid var(--c-border-light);
  border-radius: 99px;
  text-decoration: none;
  color: var(--c-text);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}
[dir="rtl"] .shortcut-chip { padding: 5px 6px 5px 12px; }
.shortcut-chip:hover {
  background: var(--c-primary-soft);
  border-color: rgba(37,99,235,0.2);
  color: var(--c-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.shortcut-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--c-surface);
}
.shortcut-name { line-height: 1; }

/* ===================== DASHBOARD ===================== */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .dash-stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .dash-stats-grid { grid-template-columns: 1fr; } }

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon--blue { background: rgba(59,130,246,0.1); color: #3b82f6; }
.stat-icon--emerald { background: rgba(16,185,129,0.1); color: #10b981; }
.stat-icon--amber { background: rgba(245,158,11,0.1); color: #f59e0b; }
.stat-icon--violet { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.stat-content { flex: 1; min-width: 0; }

.stat-card--blue::before { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.stat-card--emerald::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card--amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card--violet::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

/* Finance summary cards */
.dash-finance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 768px) { .dash-finance-grid { grid-template-columns: 1fr; } }

.finance-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--c-border-light);
  box-shadow: var(--shadow-xs);
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}
.finance-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.finance-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  border-radius: 0 0 0 60px;
  opacity: 0.06;
}
.finance-card--revenue::after { background: var(--c-success); }
.finance-card--expenses::after { background: var(--c-danger); }
.finance-card--profit::after { background: var(--c-primary); }

.finance-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.finance-icon svg { width: 22px; height: 22px; }
.finance-card--revenue .finance-icon { color: var(--c-success); }
.finance-card--expenses .finance-icon { color: var(--c-danger); }
.finance-card--profit .finance-icon { color: var(--c-primary); }

.finance-label {
  font-size: 12px;
  color: var(--c-text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.finance-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.finance-card--revenue .finance-value { color: var(--c-success); }
.finance-card--expenses .finance-value { color: var(--c-danger); }
.finance-card--profit .finance-value { color: var(--c-primary); }

/* Two column layout */
.dash-two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .dash-two-col { grid-template-columns: 1fr; } }

/* Chart */
.dash-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding: 0 4px;
}
.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}
.chart-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 100%;
  justify-content: center;
}
.chart-bar {
  width: 14px;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  transition: height 0.6s var(--ease-spring);
}
.chart-bar--revenue { background: linear-gradient(180deg, #10b981, #34d399); }
.chart-bar--expense { background: linear-gradient(180deg, #ef4444, #fca5a5); }
.chart-label {
  font-size: 10px;
  color: var(--c-text-muted);
  margin-top: 6px;
  white-space: nowrap;
  font-weight: 500;
}
.chart-trips {
  font-size: 9px;
  color: var(--c-text-muted);
  opacity: 0.7;
}
.chart-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 14px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--c-text-muted);
  font-weight: 500;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.legend-dot--revenue { background: #10b981; }
.legend-dot--expense { background: #ef4444; }

/* Dashboard safes list */
.dash-safes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.safe-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.safe-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(6,182,212,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.safe-icon-wrap svg { width: 20px; height: 20px; color: var(--c-success); }

/* Recent items list */
.dash-recent-list {
  display: flex;
  flex-direction: column;
}
.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-border-light);
  cursor: pointer;
  transition: background 0.15s;
  gap: 12px;
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: rgba(0,0,0,0.01); }
.recent-info { flex: 1; min-width: 0; }
.recent-name { font-size: 13px; font-weight: 600; color: var(--c-text); }
.recent-meta { font-size: 11px; color: var(--c-text-muted); margin-top: 2px; }
.recent-sep { margin: 0 4px; }
.recent-count {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text-secondary);
  background: var(--c-bg);
  padding: 3px 8px;
  border-radius: 6px;
}
.client-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text-muted);
  flex-shrink: 0;
}

/* Shortcuts management */
.shortcuts-manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.shortcut-manage-card {
  background: var(--c-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
}
.shortcut-manage-card:hover { box-shadow: var(--shadow-sm); }
.shortcut-manage-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px;
  display: block;
  background: var(--c-surface);
}
.shortcut-manage-name { font-size: 13px; font-weight: 600; color: var(--c-text); }
.shortcut-manage-url { font-size: 11px; color: var(--c-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; direction: ltr; }
.shortcut-manage-actions { display: flex; gap: 4px; justify-content: center; margin-top: 8px; }

/* Shortcut icon SVG in topbar */
.shortcut-icon-svg {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.shortcut-icon-svg svg { width: 14px; height: 14px; }

.shortcut-manage-svg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
}
.shortcut-manage-svg svg { width: 20px; height: 20px; }

/* Icon mode tabs */
.icon-mode-tabs {
  display: flex;
  gap: 2px;
  background: var(--c-bg);
  border-radius: var(--radius-xs);
  padding: 3px;
}
.icon-mode-tab {
  flex: 1;
  padding: 7px 12px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--c-text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}
.icon-mode-tab.active {
  background: var(--c-surface);
  color: var(--c-primary);
  box-shadow: var(--shadow-xs);
}

/* Icon preview */
.icon-preview {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-preview svg { width: 26px; height: 26px; }

/* Icon picker grid */
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
@media (max-width: 500px) { .icon-picker-grid { grid-template-columns: repeat(6, 1fr); } }
.icon-pick-btn {
  width: 100%;
  aspect-ratio: 1;
  border: 1.5px solid var(--c-border-light);
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-muted);
  transition: all 0.15s;
  padding: 6px;
}
.icon-pick-btn:hover { border-color: var(--c-border); background: var(--c-bg); color: var(--c-text); }
.icon-pick-btn.active { border-width: 2px; }
.icon-pick-btn svg { width: 18px; height: 18px; }

/* Color picker grid */
.color-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.color-pick-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.color-pick-btn:hover { transform: scale(1.15); }
.color-pick-btn.active { border-color: var(--c-text); box-shadow: 0 0 0 2px var(--c-surface), 0 0 0 4px currentColor; transform: scale(1.1); }
.color-pick-btn svg { width: 14px; height: 14px; }

/* Upload area */
.upload-area {
  display: block;
  cursor: pointer;
}
.upload-area-inner {
  border: 2px dashed var(--c-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  color: var(--c-text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.upload-area:hover .upload-area-inner {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: var(--c-primary-soft);
}

/* Category tree */
.cat-tree-item { margin-bottom: 4px; }
.cat-tree-parent {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--c-bg);
  border-radius: var(--radius-xs);
  margin-bottom: 2px;
}
.cat-tree-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 10px 40px;
  border-bottom: 1px solid var(--c-border-light);
}
[dir="ltr"] .cat-tree-child { padding-left: 40px; padding-right: 14px; }
.cat-tree-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-text);
}

@media (max-width: 768px) {
  .topbar-shortcuts { display: none; }
}
