/* ========== CSS Variables ========== */
:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: #10b981;
  --accent-hover: #059669;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --bg-main: #f1f5f9;
  --bg-white: #ffffff;
  --border: #e2e8f0;
  --sidebar-width: 280px;
  --navbar-height: 70px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg-main);
  color: var(--text-dark);
  direction: rtl;
  min-height: 100vh;
}

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

ul {
  list-style: none;
}

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

.main-wrapper {
  flex: 1;
  margin-right: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-right 0.3s ease;
}

.main-content {
  flex: 1;
  padding: 30px;
  margin-top: var(--navbar-height);
}

/* ========== Sidebar ========== */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}

.sidebar-logo span {
  color: var(--accent);
}

.sidebar-nav {
  padding: 16px 0;
  flex: 1;
}

.nav-section-title {
  padding: 12px 24px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: rgba(255,255,255,0.7);
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: right;
  direction: rtl;
}

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

.nav-link.active {
  color: #fff;
  background: rgba(16, 185, 129, 0.15);
  border-left: 3px solid var(--accent);
}

.nav-link i {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-link .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: auto;
  margin-left: 0;
}

/* ========== Navbar ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: var(--sidebar-width);
  height: var(--navbar-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 999;
  transition: right 0.3s ease;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-right .page-title {
  font-size: 20px;
  font-weight: 700;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-dark);
  padding: 8px;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-search {
  position: relative;
}

.navbar-search input {
  padding: 10px 40px 10px 16px;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-family: inherit;
  font-size: 14px;
  width: 220px;
  background: var(--bg-main);
  direction: rtl;
  transition: width 0.3s ease;
}

.navbar-search input:focus {
  outline: none;
  border-color: var(--accent);
  width: 280px;
}

.navbar-search i {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.nav-icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-dark);
  transition: all 0.2s ease;
}

.nav-icon-btn:hover {
  background: var(--bg-main);
}

.nav-icon-btn .badge {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 50px;
  transition: background 0.2s ease;
}

.user-menu:hover {
  background: var(--bg-main);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-info {
  text-align: right;
}

.user-info .name {
  font-size: 14px;
  font-weight: 700;
}

.user-info .status {
  font-size: 12px;
  color: var(--accent);
}

/* ========== Dropdowns ========== */
.dropdown-wrapper {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 320px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu.dropdown-sm {
  min-width: 220px;
}

.dropdown-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dropdown-header h4 {
  font-size: 15px;
  font-weight: 700;
}

.dropdown-header .mark-read {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-weight: 600;
}

.dropdown-header .mark-read:hover {
  text-decoration: underline;
}

.dropdown-body {
  max-height: 320px;
  overflow-y: auto;
}

.dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.dropdown-item:hover {
  background: var(--bg-main);
}

.dropdown-item.unread {
  background: #f0fdf4;
}

.dropdown-item .notif-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.dropdown-item .notif-icon.green { background: #ecfdf5; color: #10b981; }
.dropdown-item .notif-icon.blue { background: #eff6ff; color: #3b82f6; }
.dropdown-item .notif-icon.orange { background: #fff7ed; color: #f97316; }
.dropdown-item .notif-icon.red { background: #fef2f2; color: #ef4444; }

.dropdown-item .notif-content {
  flex: 1;
  min-width: 0;
}

.dropdown-item .notif-content p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dark);
}

.dropdown-item .notif-content .notif-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.dropdown-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.dropdown-footer a {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

.dropdown-footer a:hover {
  text-decoration: underline;
}

/* Profile Dropdown */
.profile-dropdown {
  min-width: 240px;
}

.profile-dropdown .profile-header {
  padding: 18px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.profile-dropdown .profile-header .avatar-lg {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  margin: 0 auto 10px;
}

.profile-dropdown .profile-header .profile-name {
  font-size: 16px;
  font-weight: 700;
}

.profile-dropdown .profile-header .profile-role {
  font-size: 13px;
  color: var(--text-muted);
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  font-size: 14px;
  color: var(--text-dark);
  cursor: pointer;
  transition: background 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  text-align: right;
  direction: rtl;
}

.profile-menu-item:hover {
  background: var(--bg-main);
}

.profile-menu-item i {
  width: 20px;
  text-align: center;
  color: var(--text-muted);
}

.profile-menu-item.danger {
  color: var(--danger);
}

.profile-menu-item.danger i {
  color: var(--danger);
}

.profile-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  z-index: 1100;
  display: none;
  max-height: 350px;
  overflow-y: auto;
}

.search-results.show {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 14px;
}

.search-result-item:hover {
  background: var(--bg-main);
}

.search-result-item i {
  color: var(--text-muted);
  width: 20px;
  text-align: center;
}

.search-result-item .result-label {
  color: var(--text-muted);
  font-size: 12px;
  margin-right: auto;
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Search User Items */
.search-section-title {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
}

.search-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.search-user-item:hover {
  background: var(--bg-main);
}

.search-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.search-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.search-user-name {
  font-size: 14px;
  font-weight: 600;
}

.search-user-phone {
  font-size: 12px;
  color: var(--text-muted);
}

.search-user-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.search-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.15s ease;
}

.search-action-btn.green { background: #ecfdf5; color: #10b981; }
.search-action-btn.green:hover { background: #10b981; color: #fff; }
.search-action-btn.orange { background: #fff7ed; color: #f97316; }
.search-action-btn.orange:hover { background: #f97316; color: #fff; }
.search-action-btn.blue { background: #eff6ff; color: #3b82f6; }
.search-action-btn.blue:hover { background: #3b82f6; color: #fff; }

/* ========== User Profile Page ========== */
.profile-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 30px;
  margin-bottom: 24px;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  flex-shrink: 0;
}

.profile-details h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.profile-details .profile-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.profile-details .profile-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-actions-bar {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.profile-tab {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

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

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

.profile-tab-content {
  display: none;
}

.profile-tab-content.active {
  display: block;
}

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #cbd5e1; border-radius: 24px; transition: 0.3s; }
.toggle-slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
input:checked + .toggle-slider { background: #10b981; }
input:checked + .toggle-slider::before { transform: translateX(20px); }

/* btn-warning */
.btn-warning {
  background: #f59e0b;
  color: #fff;
}

.btn-warning:hover {
  background: #d97706;
}

/* ========== Dashboard Cards ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-card .stat-info h3 {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-card .stat-info .amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
}

.stat-card .stat-info .amount span {
  font-size: 16px;
  color: var(--text-muted);
  margin-right: 4px;
}

.stat-card .stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.blue {
  background: #eff6ff;
  color: #3b82f6;
}

.stat-icon.green {
  background: #ecfdf5;
  color: #10b981;
}

.stat-icon.purple {
  background: #f5f3ff;
  color: #8b5cf6;
}

.stat-icon.orange {
  background: #fff7ed;
  color: #f97316;
}

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

.section-header h2 {
  font-size: 20px;
  font-weight: 700;
}

/* ========== Quick Actions ========== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.action-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.action-card .action-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.action-icon.green {
  background: #ecfdf5;
  color: #10b981;
}

.action-icon.blue {
  background: #eff6ff;
  color: #3b82f6;
}

.action-icon.orange {
  background: #fff7ed;
  color: #f97316;
}

.action-icon.red {
  background: #fef2f2;
  color: #ef4444;
}

.action-card h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
}

/* ========== Table ========== */
.table-container {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 30px;
}

.table-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-header h3 {
  font-size: 18px;
  font-weight: 700;
}

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

.data-table thead th {
  padding: 14px 24px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: 16px 24px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

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

.data-table tbody tr:hover {
  background: #f8fafc;
}

.badge-status {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.badge-status.low {
  background: #fef2f2;
  color: #ef4444;
}

.badge-status.good {
  background: #ecfdf5;
  color: #10b981;
}

.badge-status.medium {
  background: #fff7ed;
  color: #f97316;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

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

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

.btn-outline {
  background: transparent;
  color: var(--text-dark);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg-main);
}

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

.btn-danger:hover {
  background: #dc2626;
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.modal {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 30px;
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-main);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

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

/* ========== Forms ========== */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  direction: rtl;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 36px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* ========== Page: Users ========== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 800;
}

.filters-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filters-bar input,
.filters-bar select {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-white);
  direction: rtl;
}

.filters-bar input:focus,
.filters-bar select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ========== Alerts ========== */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ========== Empty State ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-dark);
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
}

.pagination button {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-white);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s ease;
}

.pagination button:hover {
  background: var(--bg-main);
}

.pagination button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ========== Toast Notification ========== */
.toast-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  animation: slideIn 0.3s ease;
  font-size: 14px;
}

.toast.success {
  border-right: 4px solid var(--accent);
}

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

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

/* ========== Responsive ========== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

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

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

  .navbar {
    right: 0;
  }

  .menu-toggle {
    display: flex;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 20px 16px;
  }

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

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

  .navbar-search input {
    width: 160px;
  }

  .navbar-search input:focus {
    width: 200px;
  }

  .user-info {
    display: none;
  }
}

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

  .navbar-search {
    display: none;
  }

  .dropdown-menu {
    min-width: 280px;
    left: auto;
    right: 0;
  }
}

/* ========== Dark Mode ========== */
body.dark-mode {
  --bg-main: #0f172a;
  --bg-white: #1e293b;
  --text-dark: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

body.dark-mode .navbar {
  background: #1e293b;
  border-bottom-color: #334155;
}

body.dark-mode .navbar-search input {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}

body.dark-mode .nav-icon-btn {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark-mode .form-control {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}

body.dark-mode .data-table thead th {
  background: #0f172a;
  color: #94a3b8;
}

body.dark-mode .data-table tbody tr:hover {
  background: #0f172a;
}

body.dark-mode .filters-bar input,
body.dark-mode .filters-bar select {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}

body.dark-mode .dropdown-menu {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .dropdown-item:hover,
body.dark-mode .search-result-item:hover,
body.dark-mode .profile-menu-item:hover {
  background: #0f172a;
}

body.dark-mode .dropdown-item.unread {
  background: rgba(16, 185, 129, 0.1);
}

body.dark-mode .search-results {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .stat-card,
body.dark-mode .table-container,
body.dark-mode .modal,
body.dark-mode .action-card,
body.dark-mode .user-card,
body.dark-mode .invoice-card {
  background: #1e293b;
  color: #e2e8f0;
}

body.dark-mode .stat-card .stat-info h3,
body.dark-mode .stat-card .stat-info .amount {
  color: #e2e8f0;
}

body.dark-mode .data-table {
  background: #1e293b;
  color: #e2e8f0;
}

body.dark-mode .data-table tbody td {
  border-color: #334155;
  color: #e2e8f0;
}

body.dark-mode .modal-header {
  border-bottom-color: #334155;
}

body.dark-mode .modal-header h3 {
  color: #e2e8f0;
}

body.dark-mode .page-header h1 {
  color: #e2e8f0;
}

body.dark-mode .badge-status {
  opacity: 0.9;
}

body.dark-mode .section-header h2 {
  color: #e2e8f0;
}

body.dark-mode .filters-bar {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode code {
  background: #0f172a;
  color: #10b981;
}
