:root {
  /* Brand palette (adjust as needed) */
  --brand-primary: #0aa2c0;   /* primary: teal/blue from logo */
  --brand-secondary: #9bc6e3; /* secondary: soft sky */
  --brand-success: #28a745;
  --brand-warning: #f0ad4e;
  --brand-danger: #dc3545;
  --brand-muted: #6c757d;

  --card-radius: 12px;
  --card-shadow: 0 6px 16px rgba(0,0,0,0.08);
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border-subtle: rgba(0,0,0,.06);
  --focus-ring: 0 0 0 0.25rem color-mix(in srgb, var(--brand-primary) 35%, transparent);
}

body {
  background: var(--surface-2);
  color: #2b2f36;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sidebar */
#sidebar .nav-link {
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  transition: background-color .15s ease, color .15s ease;
}
#sidebar .nav-link:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

/* Cards */
.card {
  border-radius: var(--card-radius) !important;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-subtle) !important;
  background: var(--surface);
}
.card-header {
  border-top-left-radius: var(--card-radius) !important;
  border-top-right-radius: var(--card-radius) !important;
  background: linear-gradient(180deg, #fff, #fafbfc);
  border-bottom: 1px solid var(--border-subtle) !important;
}

/* KPI cards */
.card.border-primary { border: 1px solid color-mix(in srgb, var(--brand-primary), transparent 65%) !important; }
.card.border-success { border: 1px solid rgba(40,167,69,.35) !important; }
.card.border-danger  { border: 1px solid rgba(220,53,69,.35) !important; }
.card.border-warning { border: 1px solid rgba(240,173,78,.35) !important; }
.card.border-primary .h5,
.card.border-success .h5,
.card.border-danger  .h5,
.card.border-warning .h5 { letter-spacing: .2px; }

/* Buttons */
.btn { border-radius: 8px; }
.btn-primary,
.btn-primary:focus {
  background-color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
}
.btn-primary:hover { filter: brightness(0.95); }
.btn-outline-primary { color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-outline-primary:hover { color: #fff !important; background-color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-outline-secondary:hover { color: #fff !important; }
.btn-outline-danger:hover { color: #fff !important; }
.btn:focus { box-shadow: var(--focus-ring) !important; }
.btn-group .btn + .btn { margin-left: 4px; }

/* Badges */
.badge { border-radius: 10px; }

/* Tables */
.table thead th { position: sticky; top: 0; z-index: 2; background: #f1f3f5; border-bottom: 1px solid var(--border-subtle); }
.table td, .table th { vertical-align: middle; }
.table-hover tbody tr:hover { background-color: #f8fbff; }
.table.zebra tbody tr:nth-child(odd){ background: #fcfdff; }
.table.compact td, .table.compact th { padding-top: .5rem; padding-bottom: .5rem; }
.table .actions { white-space: nowrap; }

/* Forms */
.form-select, .form-control { border-radius: 8px; border: 1px solid var(--border-subtle); }
.form-control:focus, .form-select:focus { box-shadow: var(--focus-ring); border-color: var(--brand-primary); }
.form-label.small { opacity: .85; }
.form-text { color: #6b7380; }
.is-invalid ~ .invalid-feedback { display: block; }

/* Utilities */
.text-muted { color: #6c757d !important; }
.text-primary { color: var(--brand-primary) !important; }
.text-success { color: var(--brand-success) !important; }
.text-danger  { color: var(--brand-danger)  !important; }
.shadow-soft { box-shadow: 0 10px 20px rgba(0,0,0,.08) !important; }
.rounded-12 { border-radius: 12px !important; }
.rounded-16 { border-radius: 16px !important; }
.gap-6 { gap: 1.5rem !important; }
.muted { color: var(--brand-muted) !important; }

/* Navbar brand coloring when authenticated header is present */
.navbar .btn-primary { background-color: var(--brand-primary); border-color: var(--brand-primary); }

/* Section header with icon and actions */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-header .title { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.35rem; }
.section-header .title i { color: var(--brand-primary); }

/* Flash messages */
.alert { border-radius: 10px; border: 1px solid var(--border-subtle); }
.alert-success { border-color: rgba(40,167,69,.3); }
.alert-danger  { border-color: rgba(220,53,69,.3); }
.alert-warning { border-color: rgba(240,173,78,.35); }

/* Checklist rows */
.list-group-item { border-left: none; border-right: none; }
.list-group-item:first-child { border-top-left-radius: 0; border-top-right-radius: 0; }
.list-group-item:last-child { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* Responsive helpers */
@media (max-width: 576px){
  .table { font-size: .925rem; }
}
