/* Solfa Admin — custom styles */
:root {
  --sidebar-width: 250px;
  --topbar-height: 56px;
  --primary: #4a6cf7;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
}

body {
  background: #f1f5f9;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Top Navbar */
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--sidebar-bg);
  color: #fff;
  overflow-y: auto;
  z-index: 200;
  transition: transform 0.3s ease;
}

.sidebar .brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

.sidebar .brand:hover {
  color: #fff;
}

.sidebar nav {
  padding: 0.75rem 0;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar nav a .icon {
  width: 20px;
  text-align: center;
}

.sidebar .nav-section {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-top: 0.5rem;
}

/* Main content */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
  min-height: 100vh;
}

.content-wrapper {
  padding: 1.5rem;
}

/* Cards */
.stat-card {
  background: #fff;
  border-radius: 0.5rem;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.15s;
}

.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-card .stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  color: #64748b;
  font-size: 0.85rem;
}

/* Table */
.table-card {
  background: #fff;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.table-card .table {
  margin-bottom: 0;
}

.table-card .table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: #3b5de7;
  border-color: #3b5de7;
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
  background: #fff;
  border-radius: 1rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-card .brand-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  margin-bottom: 0.25rem;
}

.login-card .brand-subtitle {
  color: #64748b;
  text-align: center;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

/* Toast container */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
}

/* Dark theme */
body.theme-dark {
  background: #0f172a;
  color: #e2e8f0;
}

body.theme-dark .topbar {
  background: #111827;
  border-bottom-color: #1f2937;
}

body.theme-dark .table-card,
body.theme-dark .stat-card {
  background: #1e293b;
  border-color: #334155;
}

body.theme-dark .table-card .table th {
  background: #1e293b;
  color: #94a3b8;
  border-bottom-color: #334155;
}

body.theme-dark .table-hover tbody tr:hover {
  --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
}

body.theme-dark .form-control,
body.theme-dark .form-select {
  background: #111827;
  color: #e2e8f0;
  border-color: #334155;
}

body.theme-dark .form-control::placeholder {
  color: #64748b;
}

body.theme-dark .text-muted,
body.theme-dark .small {
  color: #94a3b8 !important;
}

body.theme-dark .table-striped > tbody > tr:nth-of-type(odd) {
  --bs-table-bg: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
}

body.theme-dark .login-card {
  background: #1e293b;
}

body.theme-dark .login-card .brand-title {
  color: #e2e8f0;
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs .sep {
  color: #94a3b8;
  margin: 0 0.35rem;
}

.breadcrumbs .current {
  color: #64748b;
}

/* Theme toggle button */
.theme-toggle {
  border: none;
  background: transparent;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  border-radius: 0.375rem;
}

.theme-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
}

body.theme-dark .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .topbar {
    left: 0;
  }
  .main-content {
    margin-left: 0;
  }
}
