/*
 * BluGate styles, following the Blupacetech design system (docs/design-system.md):
 * Bootstrap 5.3.3 from the CDN plus this small layer, both linked in app/layout.tsx.
 * This file is linked AFTER Bootstrap so it wins the cascade; keep it a plain
 * stylesheet in public/ (no bundler, no preprocessing).
 * Use Bootstrap classes first; only the app shell and the recipes below are custom.
 */

/* §5.2 Shell ------------------------------------------------------------- */
:root {
  --sidebar-width: 240px;
  --sidebar-bg: #1a1f2e;
  --sidebar-hover: #2d3348;
  --sidebar-active: #0d6efd;
  --sidebar-text: #adb5bd;
  --sidebar-text-active: #ffffff;
  --topbar-height: 60px;
}
body { background-color: #f4f6f9; min-height: 100vh; }

/* Sidebar */
#sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-width); height: 100vh;
  background-color: var(--sidebar-bg); overflow-y: auto; overflow-x: hidden; z-index: 1040;
  transition: transform .3s ease; display: flex; flex-direction: column; }
#sidebar .sidebar-brand { display: flex; align-items: center; padding: 1rem 1.25rem;
  height: var(--topbar-height); background-color: rgba(0,0,0,.2); text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
#sidebar .sidebar-brand .brand-icon { width: 36px; height: 36px;
  background: linear-gradient(135deg, #0d6efd, #0dcaf0); border-radius: 8px; display: flex;
  align-items: center; justify-content: center; margin-right: .75rem; flex-shrink: 0; }
#sidebar .sidebar-brand .brand-icon i { color: #fff; font-size: 1.1rem; }
#sidebar .sidebar-brand span { color: #fff; font-size: 1.25rem; font-weight: 700; letter-spacing: .5px; }
#sidebar .sidebar-nav { padding: .75rem 0; flex: 1; }
#sidebar .nav-section-label { color: #6c757d; font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; padding: 1rem 1.25rem .4rem; }
#sidebar .nav-link { display: flex; align-items: center; color: var(--sidebar-text);
  padding: .6rem 1.25rem; text-decoration: none; font-size: .875rem;
  border-left: 3px solid transparent; transition: all .2s ease; white-space: nowrap; }
#sidebar .nav-link i { font-size: 1.05rem; margin-right: .75rem; width: 20px; text-align: center; flex-shrink: 0; }
#sidebar .nav-link:hover { color: var(--sidebar-text-active); background-color: var(--sidebar-hover);
  border-left-color: rgba(13,110,253,.5); }
#sidebar .nav-link.active { color: var(--sidebar-text-active); background-color: var(--sidebar-active);
  border-left-color: #0a58ca; }
#sidebar .sidebar-footer { padding: .75rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

/* Main + topbar */
#main-content { margin-left: var(--sidebar-width); min-height: 100vh; display: flex;
  flex-direction: column; transition: margin-left .3s ease; }
#topbar { position: sticky; top: 0; z-index: 1030; background-color: #fff; height: var(--topbar-height);
  border-bottom: 1px solid #e9ecef; box-shadow: 0 1px 4px rgba(0,0,0,.06); display: flex;
  align-items: center; padding: 0 1.5rem; }
#topbar .topbar-title { font-size: 1rem; font-weight: 600; color: #343a40; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #0d6efd, #0dcaf0); display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 600; font-size: .85rem; flex-shrink: 0; }
#sidebarToggle { background: none; border: none; color: #6c757d; padding: .25rem .5rem;
  margin-right: .5rem; border-radius: 4px; cursor: pointer; font-size: 1.25rem; line-height: 1; }
#sidebarToggle:hover { color: #343a40; background-color: #f0f0f0; }

/* Page */
.page-content { padding: .5rem 1.5rem 1.75rem 1.5rem; flex: 1; }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.4rem; font-weight: 700; color: #212529; margin: 0; }

/* Bootstrap refinements */
.card { border: none; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.card-header { background-color: #fff; border-bottom: 1px solid #f0f0f0;
  border-radius: 10px 10px 0 0 !important; padding: 1rem 1.25rem; }
.stat-card { border: none; border-radius: 10px; overflow: hidden; }
.alert { border: none; border-radius: 8px; }
.table th { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
  color: #6c757d; border-top: none; }
.badge { font-weight: 500; }
.pagination { margin-bottom: 0; font-size: .875rem; }
.pagination .page-link { padding: .375rem .65rem; line-height: 1.5; color: #0d6efd; border-color: #dee2e6; }
.pagination .page-item.active .page-link { background-color: #0d6efd; border-color: #0d6efd; color: #fff; }
.pagination .page-item.disabled .page-link { color: #adb5bd; }
.pagination .page-link:focus { box-shadow: 0 0 0 .2rem rgba(13,110,253,.25); }

/* Responsive */
@media (max-width: 991.98px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.show { transform: translateX(0); }
  #main-content { margin-left: 0; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1039; }
  .sidebar-overlay.show { display: block; }
}
@media (min-width: 992px) {
  body.sidebar-collapsed #sidebar { transform: translateX(-100%); }
  body.sidebar-collapsed #main-content { margin-left: 0; }
  .sidebar-overlay { display: none; }
}

/* §5.5 Auth layout (sign-in, awaiting access, signed-out approval links) --- */
.auth-body { background: linear-gradient(135deg, #1a1f2e 0%, #2d3348 50%, #1a1f2e 100%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-wrapper { width: 100%; max-width: 420px; padding: 1rem; }
.auth-brand { text-align: center; margin-bottom: 2rem; }
.auth-brand .brand-icon { width: 60px; height: 60px; background: linear-gradient(135deg, #0d6efd, #0dcaf0);
  border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.auth-brand .brand-icon i { color: #fff; font-size: 1.75rem; }
.auth-brand h1 { color: #fff; font-size: 1.75rem; font-weight: 700; margin: 0; }
.auth-brand p { color: #adb5bd; font-size: .875rem; margin-top: .25rem; }
.auth-card { background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.4); padding: 2rem; }
.auth-card .card-title { font-size: 1.25rem; font-weight: 700; color: #212529; margin-bottom: .25rem; }
.auth-card .card-subtitle { color: #6c757d; font-size: .875rem; margin-bottom: 1.5rem; }
.auth-card .form-label { font-weight: 600; font-size: .875rem; color: #495057; }
.auth-card .btn-primary { border-radius: 8px; padding: .625rem; font-weight: 600; }
.auth-footer { text-align: center; margin-top: 1.5rem; color: #adb5bd; font-size: .8rem; }

/* §6.12 Workflow tracker ------------------------------------------------- */
.wf-tracker { display: flex; align-items: center; padding: 1.25rem 1.5rem; background: #fff; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07); margin-bottom: 1.5rem; overflow-x: auto; }
.wf-step { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 72px; position: relative; z-index: 1; }
.wf-icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .95rem; border: 2px solid #dee2e6; background: #fff; color: #adb5bd; transition: all .3s; }
.wf-icon.done { background: #198754; border-color: #198754; color: #fff; }
.wf-icon.active { background: #0d6efd; border-color: #0d6efd; color: #fff; box-shadow: 0 0 0 4px rgba(13,110,253,.2); }
.wf-icon.rejected { background: #dc3545; border-color: #dc3545; color: #fff; }
.wf-lbl { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: #adb5bd;
  margin-top: .4rem; text-align: center; }
.wf-lbl.done { color: #198754; }
.wf-lbl.active { color: #0d6efd; }
.wf-lbl.rejected { color: #dc3545; }
.wf-connector { flex: 1; height: 2px; background: #dee2e6; min-width: 18px; margin-bottom: 22px; transition: background .3s; }
.wf-connector.done { background: #198754; }

/* §6.13 Approval / activity timeline ------------------------------------- */
.approval-timeline { position: relative; padding-left: 1.5rem; }
.approval-timeline::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: #e9ecef; }
.timeline-item { position: relative; margin-bottom: 1.25rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot { position: absolute; left: -1.5rem; top: 3px; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 2px #dee2e6; background: #dee2e6; }
.timeline-dot.approved { background: #198754; box-shadow: 0 0 0 2px #198754; }
.timeline-dot.rejected { background: #dc3545; box-shadow: 0 0 0 2px #dc3545; }
.timeline-dot.current { background: #0d6efd; box-shadow: 0 0 0 2px #0d6efd; }

/* Project helpers (kept minimal) ----------------------------------------- */
/* Tiny uppercase label used in dense summaries (§3.5 micro label). */
.micro-label { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #8a9ab0; }
/* Selectable option card (licence choice); Bootstrap has no card-radio. */
.choice-card { display: flex; gap: .75rem; padding: .75rem; border: 1px solid #dee2e6; border-radius: 8px;
  background: #fff; cursor: pointer; transition: all .2s ease; }
.choice-card:hover { border-color: #adb5bd; }
.choice-card:has(input:checked) { border-color: #0d6efd; background: #f0f5ff; }
.choice-card:has(input:focus-visible) { box-shadow: 0 0 0 .2rem rgba(13,110,253,.25); }
