/* ================================================================
   BuildTrack Pro — Design System
   Color Palette: Deep Navy #0F2544, Gold #F5A623, White #FFFFFF
   ================================================================ */
:root {
    --btp-primary: #1a2a3a;
    --btp-primary-lt: #243a4e;
    --btp-gold: #E8671A;
    --btp-gold-dk: #c45512;
    --btp-success: #198754;
    --btp-danger: #dc3545;
    --btp-warning: #ffc107;
    --btp-info: #0dcaf0;
    --btp-sidebar-w: 260px;
    --btp-topbar-h: 60px;
    --btp-radius: 10px;
    --btp-shadow: 0 2px 12px rgba(0,0,0,.08);
    --btp-font: 'Inter', system-ui, sans-serif;
}

/* ── Base ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--btp-font);
  background: #f4f6fb;
  color: #1e293b;
  margin: 0;
}

.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }

/* ── Topbar ──────────────────────────────────────────────────── */
.btp-topbar {
  background: var(--btp-primary);
  height: var(--btp-topbar-h);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  z-index: 1040;
}
.btp-topbar .navbar-brand { padding: 0; }

/* ── Avatar ──────────────────────────────────────────────────── */
.btp-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--btp-gold);
  color: var(--btp-primary);
  font-weight: 700;
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.btp-sidebar {
  position: fixed;
  top: var(--btp-topbar-h);
  left: 0;
  width: var(--btp-sidebar-w);
  height: calc(100vh - var(--btp-topbar-h));
  background: var(--btp-primary);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1030;
  transition: transform .25s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}

.btp-sidebar-inner { padding: 1rem 0 2rem; }

/* Nav sections */
.btp-nav-section {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 1.2rem 1.2rem .3rem;
  margin-top: .2rem;
}

/* Nav items */
.btp-nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .62rem 1.25rem;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .15s ease;
}
.btp-nav-item i { font-size: 1.05rem; flex-shrink: 0; }
.btp-nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-left-color: var(--btp-gold);
}
.btp-nav-item.active {
  background: rgba(245,166,35,.15);
  color: var(--btp-gold);
  border-left-color: var(--btp-gold);
}

/* Overlay */
.btp-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1025;
}
.btp-overlay.show { display: block; }

/* ── Main Content ────────────────────────────────────────────── */
.btp-main {
  margin-left: var(--btp-sidebar-w);
  margin-top: var(--btp-topbar-h);
  padding: 1.75rem;
  min-height: calc(100vh - var(--btp-topbar-h));
  transition: margin-left .25s ease;
}

/* ── Page Header ─────────────────────────────────────────────── */
.btp-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.btp-page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--btp-primary);
  margin: 0;
}
.btp-breadcrumb { font-size: .8rem; color: #64748b; }

/* ── Stat Cards ──────────────────────────────────────────────── */
.btp-stat-card {
  background: #fff;
  border-radius: var(--btp-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--btp-shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btp-stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.btp-stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.btp-stat-icon.navy   { background: rgba(15,37,68,.1);  color: var(--btp-primary); }
.btp-stat-icon.gold   { background: rgba(245,166,35,.15); color: var(--btp-gold-dk); }
.btp-stat-icon.green  { background: rgba(25,135,84,.1);  color: var(--btp-success); }
.btp-stat-icon.red    { background: rgba(220,53,69,.1);  color: var(--btp-danger); }
.btp-stat-icon.blue   { background: rgba(13,110,253,.1); color: #0d6efd; }
.btp-stat-icon.purple { background: rgba(111,66,193,.1); color: #6f42c1; }

.btp-stat-card h3 { font-size: 1.8rem; font-weight: 700; margin: 0; line-height: 1.1; }
.btp-stat-card p  { font-size: .78rem; color: #64748b; margin: 0; }

/* ── Cards ───────────────────────────────────────────────────── */
.btp-card {
  background: #fff;
  border-radius: var(--btp-radius);
  box-shadow: var(--btp-shadow);
  border: none;
}
.btp-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.btp-card-header h5 { font-size: .95rem; font-weight: 600; color: var(--btp-primary); margin: 0; }
.btp-card-body { padding: 1.25rem; }

/* ── Tables ──────────────────────────────────────────────────── */
.btp-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.btp-table thead th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .75rem 1rem;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.btp-table tbody td {
  padding: .75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.btp-table tbody tr:hover { background: #f8faff; }
.btp-table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────────── */
.btp-badge {
  display: inline-flex; align-items: center;
  gap: .3rem;
  padding: .3em .65em;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.btp-badge.pending  { background: #fff3cd; color: #856404; }
.btp-badge.approved { background: #d1e7dd; color: #0a3622; }
.btp-badge.rejected { background: #f8d7da; color: #58151c; }
.btp-badge.released { background: #cff4fc; color: #055160; }
.btp-badge.active   { background: #d1e7dd; color: #0a3622; }
.btp-badge.inactive { background: #e2e8f0; color: #64748b; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-btp-primary {
  background: var(--btp-primary);
  color: #fff; border: none;
  font-weight: 500; border-radius: 8px;
  padding: .5rem 1.1rem;
  transition: background .15s ease;
}
.btn-btp-primary:hover { background: var(--btp-primary-lt); color: #fff; }

.btn-btp-gold {
  background: var(--btp-gold);
  color: var(--btp-primary); border: none;
  font-weight: 600; border-radius: 8px;
  padding: .5rem 1.1rem;
  transition: background .15s ease;
}
.btn-btp-gold:hover { background: var(--btp-gold-dk); color: var(--btp-primary); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  font-size: .875rem;
  padding: .55rem .9rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--btp-gold);
  box-shadow: 0 0 0 3px rgba(245,166,35,.15);
}
.form-label { font-weight: 500; font-size: .85rem; color: #374151; margin-bottom: .35rem; }
.btp-form-section { background: #f8fafc; border-radius: var(--btp-radius); padding: 1.25rem; margin-bottom: 1rem; }

/* ── Login Page ──────────────────────────────────────────────── */
.btp-login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--btp-primary) 0%, #1a3a6b 60%, #0d1f3c 100%);
  display: flex; align-items: center; justify-content: center;
}
.btp-login-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
}
.btp-login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.btp-login-logo img { max-height: 64px; margin-bottom: .5rem; }
.btp-login-logo h2 { font-size: 1.5rem; font-weight: 700; color: var(--btp-primary); margin: 0; }
.btp-login-logo span { color: var(--btp-gold); }
.btp-login-logo p { font-size: .8rem; color: #64748b; margin: .25rem 0 0; }

/* ── Budget Bar ──────────────────────────────────────────────── */
.btp-budget-bar { background: #e2e8f0; border-radius: 8px; overflow: hidden; height: 8px; }
.btp-budget-fill { height: 100%; border-radius: 8px; background: var(--btp-gold); transition: width .5s ease; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .btp-sidebar { transform: translateX(-100%); }
  .btp-sidebar.open { transform: translateX(0); }
  .btp-main { margin-left: 0; }
}

@media (max-width: 575.98px) {
  .btp-main { padding: 1rem; }
  .btp-login-card { margin: 1rem; padding: 1.75rem; }
}
/* ── Login Logo ──────────────────────────────────────────────── */
.btp-login-logo img {
    max-height: 140px !important;
    width: auto;
    margin-bottom: 1rem;
}

/* ── Dark Mode ───────────────────────────────────────────────── */
[data-bs-theme="dark"] body {
    background: #0f1923;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .btp-card {
    background: #1a2a3a;
    border: 1px solid #243a4e;
}

[data-bs-theme="dark"] .btp-card-header {
    border-bottom-color: #243a4e;
}

    [data-bs-theme="dark"] .btp-card-header h5 {
        color: #e2e8f0;
    }

[data-bs-theme="dark"] .btp-table thead th {
    background: #152030;
    color: #94a3b8;
    border-bottom-color: #243a4e;
}

[data-bs-theme="dark"] .btp-table tbody td {
    border-bottom-color: #1e3248;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .btp-table tbody tr:hover {
    background: #1e3248;
}

[data-bs-theme="dark"] .btp-page-header h1 {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .btp-breadcrumb {
    color: #94a3b8;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: #1a2a3a;
    border-color: #243a4e;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .btp-stat-card {
    background: #1a2a3a;
}

[data-bs-theme="dark"] .section-title {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .btp-main {
    background: #0f1923;
}