/* ── Bootstrap color overrides ────────────────────────────────────────────── */
:root {
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37,99,235;
  --bs-link-color: #2563eb;
  --bs-link-hover-color: #1d4ed8;

  --sidebar-w: 220px;
  --topbar-h: 52px;
  --nav-bg: #1e3a8a;
}
.btn-primary {
  --bs-btn-bg: #2563eb;
  --bs-btn-border-color: #2563eb;
  --bs-btn-hover-bg: #1d4ed8;
  --bs-btn-hover-border-color: #1d4ed8;
  --bs-btn-active-bg: #1a4bc4;
}
.text-primary { color: #2563eb !important; }
.border-primary { border-color: #2563eb !important; }

/* ── Top bar ──────────────────────────────────────────────────────────────── */
.app-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: .75rem;
  z-index: 1040;
  box-shadow: 0 1px 6px rgba(0,0,0,.3);
}

/* Hamburger — hidden on desktop where sidebar is always visible */
.app-sidebar-toggle {
  background: none;
  border: none;
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
@media (max-width: 767.98px) {
  .app-sidebar-toggle { display: flex; }
}
.toggler-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,.85);
  border-radius: 2px;
}

.app-brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff !important;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -.01em;
}
.brand-prefix { font-weight: 400; color: rgba(255,255,255,.7); }
.brand-mark   { font-weight: 800; color: #fff; }
.brand-service{ font-weight: 600; color: rgba(255,255,255,.9); }

.topbar-end {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
}
.topbar-username {
  font-size: .875rem;
  color: rgba(255,255,255,.75);
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.app-sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--nav-bg);
  border-right: 1px solid rgba(255,255,255,.08);
  overflow-y: auto;
  z-index: 1035;
  padding: .75rem 0;
}

/* Mobile: slide out by default, slide in when .is-open */
@media (max-width: 767.98px) {
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: none;
  }
  .app-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.45);
  }
}

/* ── Sidebar backdrop (mobile only) ──────────────────────────────────────── */
@media (max-width: 767.98px) {
  .app-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1034;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  .app-sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ── Sidebar nav links ────────────────────────────────────────────────────── */
.sidebar-nav {
  display: flex;
  flex-direction: column;
}
.sidebar-link {
  display: block;
  padding: .5rem 1.25rem;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  font-size: .9rem;
  transition: background .15s, color .15s;
}
.sidebar-link:hover,
.sidebar-link:focus {
  background: rgba(255,255,255,.1);
  color: #fff;
  text-decoration: none;
}
.sidebar-divider {
  border-color: rgba(255,255,255,.15);
  margin: .5rem 1.25rem;
}

/* ── Main content area ────────────────────────────────────────────────────── */
.app-main {
  padding-top: var(--topbar-h);
  min-height: 100vh;
}
@media (min-width: 768px) {
  .app-main { margin-left: var(--sidebar-w); }
}

/* ── Tier badges ──────────────────────────────────────────────────────────── */
.badge-easy   { background: #d1fae5 !important; color: #065f46 !important; }
.badge-smart  { background: #dbeafe !important; color: #1e40af !important; }
.badge-pro    { background: #ede9fe !important; color: #5b21b6 !important; }
.badge-custom { background: #fef3c7 !important; color: #92400e !important; }

/* ── Action box ───────────────────────────────────────────────────────────── */
.action-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: .375rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.action-box .action-label {
  font-size: .75rem;
  font-weight: 600;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .25rem;
}
.action-box .action-text { font-size: 1rem; font-weight: 500; }

/* Bootstrap .card sets display:flex — reset so content flows normally */
.card { display: block; }
