:root {
  --sidebar-w: 230px;
  --navy: #3a3a3c;       /* charcoal, matches logo wordmark */
  --navy-dark: #2a2a2c;
  --accent: #00b2da;      /* teal, matches logo test-tube liquid */
  --accent-light: #e5f8fb;
  --brand-green: #8cc63f; /* green, matches logo wordmark */

  /* Re-theme Bootstrap's own color variables so .btn-primary, .bg-primary,
     .text-primary, .badge.bg-primary etc. pick up the brand color everywhere
     without having to touch every template. */
  --bs-primary: var(--accent);
  --bs-primary-rgb: 0, 178, 218;
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: 0, 178, 218;
  --bs-link-hover-color: #0090ad;
  --bs-link-hover-color-rgb: 0, 144, 173;
}

body {
  background: #f5f7fa;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #22283a;
}

/* ---- Sidebar ---- */
.ia-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--navy); color: #cdd6e6; overflow-y: auto; z-index: 1030;
}
.ia-sidebar .brand {
  display: flex; align-items: center; gap: .5rem; padding: 1.1rem;
  background: #fff; border-bottom: 1px solid rgba(255,255,255,.08);
}
.ia-sidebar .nav-link {
  color: #b9c3d6; padding: .55rem 1.1rem; font-size: .92rem; border-left: 3px solid transparent;
  display: flex; align-items: center; gap: .6rem;
}
.ia-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.ia-sidebar .nav-link.active { background: var(--navy-dark); color: #fff; border-left-color: var(--accent); }
.ia-sidebar .nav-section { padding: .8rem 1.1rem .3rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #7c8aa5; }

/* ---- Main area ---- */
.ia-main { margin-left: var(--sidebar-w); min-height: 100vh; }
.ia-topbar {
  background: #fff; border-bottom: 1px solid #e6e9ef; padding: .6rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1020;
}
.ia-content { padding: 1.4rem; }

.card { border: 1px solid #e6e9ef; box-shadow: 0 1px 2px rgba(20,30,60,.03); }
.card-header { background: #fff; border-bottom: 1px solid #eef0f4; font-weight: 600; }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.text-muted-sm { font-size: .78rem; color: #8992a3; }

.table thead th { font-size: .78rem; text-transform: uppercase; color: #7c8aa5; border-bottom-width: 1px; }
.table td, .table th { vertical-align: middle; }

.badge-status { font-weight: 500; text-transform: capitalize; }

/* ---- Printable documents ---- */
.doc-sheet { background: #fff; max-width: 900px; margin: 0 auto; padding: 2.2rem; border: 1px solid #e6e9ef; }
.doc-sheet h2 { letter-spacing: .02em; }
.doc-meta-table td { padding: .15rem .4rem; }
.doc-items-table th { background: #f5f7fa; }

@media print {
  .ia-sidebar, .ia-topbar, .no-print { display: none !important; }
  .ia-main { margin-left: 0 !important; }
  .doc-sheet { border: none; padding: 0; }
  body { background: #fff; }
}

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #202022 0%, #3a3a3c 45%, #00b2da 100%);
}
.login-wrap::before, .login-wrap::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none;
}
.login-wrap::before { width: 460px; height: 460px; background: #8cc63f; opacity: .30; top: -140px; left: -120px; }
.login-wrap::after { width: 420px; height: 420px; background: #00b2da; opacity: .35; bottom: -160px; right: -100px; }
.login-card {
  width: 380px; position: relative; z-index: 1;
  background: rgba(255,255,255,.98) !important; border: none !important; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35) !important;
}

.form-label { font-size: .85rem; font-weight: 600; color: #445; }
.required::after { content: " *"; color: #d33; }

.line-items-table input, .line-items-table select { min-width: 90px; }

/* ---- Mobile / small-screen layout ---- */
.navbar-toggle-btn { display: none; }

@media (max-width: 991.98px) {
  .navbar-toggle-btn { display: inline-flex !important; align-items: center; justify-content: center; }

  .ia-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
  }
  .ia-sidebar.show { transform: translateX(0); }

  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,15,17,.45);
    z-index: 1025;
  }
  .sidebar-backdrop.show { display: block; }

  .ia-main { margin-left: 0; }

  .ia-topbar { flex-wrap: wrap; row-gap: .5rem; padding: .6rem .9rem; }
  .ia-topbar form.d-flex { order: 3; max-width: 100% !important; flex-basis: 100%; }
}

@media (max-width: 575.98px) {
  .ia-content { padding: .9rem; }
  .stat-value { font-size: 1.2rem; }
  .doc-sheet { padding: 1.1rem; }
  .card-body, .card-header { padding: .85rem; }
  h5 { font-size: 1.05rem; }

  /* Stack action-button rows instead of letting them overflow */
  .d-flex.gap-2.no-print, .d-flex.justify-content-between.align-items-center.mb-3 {
    flex-wrap: wrap;
    row-gap: .5rem;
  }
}
