/* ── COAT Connect Global Styles ──────────────────────────────────────────── */

:root {
  --navy: #0d2b4e;
  --navy-dark: #091e38;
  --navy-light: #163a62;
  --coat-orange: #e8621a;
  --coat-orange-dark: #c9541a;
  --sidebar-width: 240px;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

#app-wrapper {
  min-height: 100vh;
}

#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--navy);
  color: white;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

#main-content {
  min-height: 100vh;
  background: #f4f6f9;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.sidebar-brand {
  color: white !important;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand:hover {
  background: rgba(255,255,255,0.05);
}

.sidebar-org {
  font-size: 0.78rem;
}

.sidebar-link {
  color: rgba(255,255,255,0.75) !important;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.1) !important;
  color: white !important;
}

.sidebar-link.active {
  background: rgba(255,255,255,0.15) !important;
  color: white !important;
  font-weight: 600;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
}

/* ── Accreditation status banner ──────────────────────────────────────────── */
.accred-banner {
  font-size: .82rem;
  flex-shrink: 0;
}

/* ── User avatar ─────────────────────────────────────────────────────────── */

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 0.72rem;
  background: rgba(255,255,255,0.15);
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

/* ── Dashboard stat cards ────────────────────────────────────────────────── */

.stat-card {
  border-radius: 10px;
  transition: box-shadow 0.2s;
}

.stat-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bg-primary-soft { background: rgba(13,110,253,0.1); }
.bg-warning-soft { background: rgba(255,193,7,0.1); }
.bg-success-soft { background: rgba(25,135,84,0.1); }
.bg-info-soft    { background: rgba(13,202,240,0.1); }

/* ── Cards ───────────────────────────────────────────────────────────────── */

.card {
  border-radius: 10px;
}

.card-header {
  background: transparent;
  font-size: 0.95rem;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */

.table th {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
}

.table td {
  vertical-align: middle;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--navy-light);
  border-color: var(--navy-light);
}

.btn-outline-primary {
  color: var(--navy);
  border-color: var(--navy);
}

.btn-outline-primary:hover {
  background: var(--navy);
  border-color: var(--navy);
}

/* ── Badges ──────────────────────────────────────────────────────────────── */

.badge {
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */

.form-control:focus,
.form-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 0.2rem rgba(30,58,95,0.15);
}

/* ── Alert overrides ─────────────────────────────────────────────────────── */

.alert {
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
}

/* ── Unauthenticated layout ──────────────────────────────────────────────── */

body > .d-flex.min-vh-100 {
  background: linear-gradient(135deg, #f4f6f9 0%, #e8edf5 100%);
}

/* ── Responsive sidebar collapse ─────────────────────────────────────────── */

@media (max-width: 768px) {
  #sidebar {
    width: 60px;
  }
  #sidebar .sidebar-brand span,
  #sidebar .sidebar-org,
  #sidebar .sidebar-link span:not(.bi),
  #sidebar .sidebar-footer span,
  #sidebar .sidebar-footer a {
    display: none;
  }
  #sidebar .sidebar-link {
    justify-content: center;
    padding: 0.6rem;
  }
  #sidebar .nav-item small.text-white-50 {
    display: none;
  }
  :root {
    --sidebar-width: 60px;
  }
}

/* ── Quill editor overrides ──────────────────────────────────────────────── */

.ql-toolbar.ql-snow {
  border-color: #dee2e6;
  background: #f8f9fa;
}

.ql-container.ql-snow {
  border-color: #dee2e6;
  font-size: 0.95rem;
}

/* ── Agenda drag ─────────────────────────────────────────────────────────── */

.agenda-item {
  transition: background 0.1s;
}

.agenda-item:hover {
  background: #f8f9fa;
}

.agenda-item.dragging {
  background: #e8edf5;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ced4da; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #adb5bd; }

/* ── Utility ─────────────────────────────────────────────────────────────── */

.text-navy { color: var(--navy) !important; }
.bg-navy   { background: var(--navy) !important; }

.fs-tiny { font-size: 0.72rem; }

.sticky-top { top: 0; }

/* ── Print ───────────────────────────────────────────────────────────────── */

@media print {
  #sidebar, .btn, form { display: none !important; }
  #main-content { margin: 0 !important; }
}
