:root {
  --sidebar-bg: #1e293b;
  --sidebar-hover: rgba(255,255,255,0.1);
  --sidebar-active: #475569;
  --body-bg: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border-color: #e2e8f0;
  --accent: #334155;
  --accent-light: #64748b;
}

[data-bs-theme="dark"] {
  --body-bg: #0f172a;
  --card-bg: #1e293b;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --border-color: #334155;
}

body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background-color: var(--body-bg);
  color: var(--text-primary);
  margin: 0;
  transition: background-color 0.3s, color 0.3s;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background-color: var(--sidebar-bg);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  box-shadow: 2px 0 10px rgba(0,0,0,0.08);
  z-index: 10;
}

.sidebar-header {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}
.sidebar-header i { margin-left: 0.5rem; }

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav-item:hover {
  background-color: var(--sidebar-hover);
  color: white;
  transform: translateX(-4px);
}

.nav-item.router-link-active {
  background-color: var(--sidebar-active);
  color: white;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.2);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem;
  overflow-x: hidden;
}

/* Cards */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s;
}
.card:hover {
  box-shadow: 0 8px 16px rgba(0,0,0,0.06);
}

.page-heading {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.75rem;
}

/* Tables */
.table-wrapper {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background-color: #f1f5f9;
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  text-align: right;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background-color: rgba(0,0,0,0.02); }

/* Dark mode table headers – ensure visible text */
[data-bs-theme="dark"] .table-wrapper th,
[data-bs-theme="dark"] th {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
}

/* Buttons */
.btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }

.btn-primary {
  background-color: #334155;
  color: white;
}
.btn-primary:hover { background-color: #475569; }

.btn-success {
  background-color: #0f766e;
  color: white;
}
.btn-success:hover { background-color: #115e59; }

.btn-outline {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: var(--text-primary);
}
.btn-outline:hover { background: #f1f5f9; }

.btn-danger {
  background-color: #b91c1c;
  color: white;
}

.btn-warning {
  background-color: #a16207;
  color: white;
}
.btn-warning:hover { background-color: #854d0e; }

/* Form controls */
.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: var(--card-bg);
  color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
  border-color: #475569;
  box-shadow: 0 0 0 3px rgba(71,85,105,0.2);
}
.form-label {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

/* Modals */
.modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
  animation: modalUp 0.3s ease;
}
@keyframes modalUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dashboard stat cards */
.stat-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: 0 8px 16px rgba(0,0,0,0.06); }
.stat-icon { font-size: 2.2rem; color: var(--accent); }
.stat-details h3 { font-size: 1.8rem; margin-bottom: 0.1rem; }
.stat-details p { margin: 0; color: var(--text-secondary); }

/* Toast */
.toast { border-radius: 8px; font-size: 0.9rem; }

/* Responsive */
@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 0.5rem; }
  .sidebar-header, .sidebar-footer { display: none; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item span { display: none; }
  .main-content { padding: 1rem; }
}




@media (max-width: 768px) {
  .main-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrapper {
    overflow-x: visible;
  }
  table {
    min-width: 600px;
    white-space: nowrap;
  }
}
}


