:root {
  --sidebar-width: 240px;
  --sidebar-bg: #006d5e;
  --sidebar-text: #c8d3e0;
  --sidebar-hover: #007d6e;
  --sidebar-active: #1a2332;
  --top-bar-height: 56px;

  --bs-primary: #006d5e;
  --bs-primary-rgb: 0, 109, 94;
  --bs-link-color: #006d5e;
  --bs-link-hover-color: #005a4d;
}

.btn-primary {
  --bs-btn-bg: #006d5e;
  --bs-btn-border-color: #006d5e;
  --bs-btn-hover-bg: #005a4d;
  --bs-btn-hover-border-color: #005a4d;
  --bs-btn-active-bg: #004d42;
  --bs-btn-active-border-color: #004d42;
  --bs-btn-disabled-bg: #006d5e;
  --bs-btn-disabled-border-color: #006d5e;
}

.btn-outline-primary {
  --bs-btn-color: #006d5e;
  --bs-btn-border-color: #006d5e;
  --bs-btn-hover-bg: #006d5e;
  --bs-btn-hover-border-color: #006d5e;
  --bs-btn-active-bg: #005a4d;
  --bs-btn-active-border-color: #005a4d;
}

.text-primary { color: #006d5e !important; }
.bg-primary   { background-color: #006d5e !important; }
.border-primary { border-color: #006d5e !important; }

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

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 1.25rem 1rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  display: block;
  line-height: 1.3;
}

.sidebar-brand small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--sidebar-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar .nav-section {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 1.2rem 1rem 0.3rem;
}

.sidebar .nav-link {
  color: var(--sidebar-text);
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  border-radius: 6px;
  margin: 1px 8px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

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

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

.sidebar .nav-link svg,
.sidebar .nav-link i {
  width: 16px;
  flex-shrink: 0;
  opacity: 0.75;
}

/* ── Main content ── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--top-bar-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
}

.topbar-title {
  font-weight: 600;
  font-size: 1rem;
  color: #1a202c;
  flex: 1;
}

.page-content {
  flex: 1;
  padding: 1.75rem 1.5rem;
}

/* ── Cards ── */
.stat-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.stat-card .stat-number {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-top: 0.25rem;
}

/* ── Tables ── */
.table-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.table thead th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

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

/* ── Badges ── */
.badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.3em 0.65em;
  border-radius: 6px;
}

/* ── Priority indicators ── */
.priority-urgent { border-left: 3px solid #ef4444; }
.priority-high    { border-left: 3px solid #f59e0b; }
.priority-normal  { border-left: 3px solid #3b82f6; }
.priority-low     { border-left: 3px solid #94a3b8; }

/* ── Login page ── */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #006d5e 0%, #007d6e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: 16px;
  border: none;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .sidebar { display: none; }
  .main-wrapper { margin-left: 0; }
}
