:root {
  --navy:     #0d1b2a;
  --navyLt:   #162d47;
  --navyMid:  #1c3355;
  --yellow:   #f3ae1c;
  --yellowLt: #f8c964;
  --yellowGrad: linear-gradient(104deg, #f8c964 5%, #f3ae1c 94%);
  --teal:     #0ea5c8;
  --tealDim:  rgba(14,165,200,.15);
}

html, body {
  min-height: 100vh;
  background: var(--navy);
  color: #dce6f0;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ── Nav ── */
.navbar {
  background: linear-gradient(135deg, #091522 0%, #112540 40%, #163058 70%, #0e2038 100%) !important;
  border-bottom: 2px solid rgba(243,174,28,.3);
  box-shadow: 0 2px 24px rgba(0,0,0,.55), inset 0 -1px 0 rgba(255,255,255,.05);
}
.navbar-brand {
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: .04em;
  background: var(--yellowGrad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.navbar-toggler { border-color: rgba(255,255,255,.2); }
.navbar-toggler-icon { filter: invert(1); }
.nav-link {
  color: rgba(255,255,255,.55) !important;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 10px 16px !important;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.nav-link:hover { color: #fff !important; background: rgba(255,255,255,.07); }
.nav-link.active {
  color: #000 !important;
  font-weight: 800;
  background: var(--yellowGrad);
  box-shadow: 0 2px 10px rgba(243,174,28,.3);
}

/* ── Cards ── */
.card-navy {
  background: radial-gradient(ellipse at 38% 32%, #1a3a5c 0%, #112540 45%, #0a1828 100%);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  box-shadow:
    0 2px 16px rgba(0,0,0,.4),
    inset 0 1px 0 rgba(255,255,255,.07);
  transition: box-shadow .2s, border-color .2s, transform .15s;
}
.card-navy:hover {
  box-shadow:
    0 10px 36px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(255,255,255,.1);
  border-color: rgba(243,174,28,.3);
  transform: translateY(-2px);
}
.card-hdr {
  background: linear-gradient(135deg, rgba(26,58,92,.8) 0%, rgba(17,37,64,.6) 100%);
  border-bottom: 1px solid rgba(255,255,255,.1);
  padding: 11px 18px;
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.55);
  border-radius: 16px 16px 0 0;
}
.card-body-pad { padding: 18px; }

/* ── Page header ── */
.pg-hdr {
  margin: 24px 0 20px;
  padding-left: 16px;
  border-left: 4px solid var(--yellow);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.pg-hdr h1 { font-size: 1.65rem; font-weight: 800; color: #fff; margin: 0; }
.pg-hdr-sub { color: rgba(255,255,255,.38); font-size: .85rem; margin-top: 4px; }

/* ── Stats bar ── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.stat-tile {
  background: radial-gradient(ellipse at 50% 30%, #1a3a5c 0%, #0d1f38 60%, #090f1d 100%);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 18px 10px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  transition: transform .15s, box-shadow .15s;
}
.stat-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.09); }
.stat-num { font-size: 1.75rem; font-weight: 800; color: #fff; }
.stat-num.green  { color: #4ade80; text-shadow: 0 0 18px rgba(74,222,128,.3); }
.stat-num.yellow { color: var(--yellow); text-shadow: 0 0 22px rgba(243,174,28,.45); }
.stat-num.red    { color: #f87171; }
.stat-lbl {
  font-size: .69rem;
  color: rgba(255,255,255,.36);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Section label ── */
.sec-lbl {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--yellowLt);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ── Progress bar ── */
.prog-bar { height: 10px; background: rgba(255,255,255,.09); border-radius: 6px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 6px; background: var(--yellowGrad); transition: width .4s; box-shadow: 0 0 10px rgba(243,174,28,.45); }
.prog-fill.doubled { background: linear-gradient(90deg, var(--yellowLt), #fff5c0); box-shadow: 0 0 16px rgba(248,201,100,.6); }
.prog-fill.red { background: #f87171; box-shadow: none; }

/* ── Breakdown rows ── */
.bkd-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: .9rem;
}
.bkd-row:last-child { border-bottom: none; }
.bkd-lbl { color: rgba(255,255,255,.42); }
.bkd-val { font-weight: 600; color: #dce6f0; }
.bkd-val.green  { color: #4ade80; }
.bkd-val.yellow { color: var(--yellow); font-size: 1.05rem; font-weight: 800; text-shadow: 0 0 16px rgba(243,174,28,.35); }
.bkd-val.red    { color: #f87171; }

/* ── Badges ── */
.badge-qual { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; padding: 5px 14px; border-radius: 24px; }
.badge-qual.green  { background: rgba(74,222,128,.12);  color: #4ade80;       border: 1px solid rgba(74,222,128,.25); }
.badge-qual.yellow { background: rgba(243,174,28,.14);  color: var(--yellow); border: 1px solid rgba(243,174,28,.3);  }
.badge-qual.red    { background: rgba(248,113,113,.12); color: #f87171;       border: 1px solid rgba(248,113,113,.22);}
.badge-qual.gray   { background: rgba(255,255,255,.07); color: rgba(255,255,255,.38); border: 1px solid rgba(255,255,255,.1); }

/* ── Form inputs ── */
.form-label { color: rgba(255,255,255,.52); font-size: .82rem; margin-bottom: 5px; }
.form-control, .form-select {
  background: rgba(255,255,255,.07) !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  color: #dce6f0 !important;
  border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: rgba(255,255,255,.2) !important; }
.form-control:focus, .form-select:focus {
  border-color: var(--yellow) !important;
  box-shadow: 0 0 0 3px rgba(243,174,28,.2) !important;
  background: rgba(255,255,255,.1) !important;
}
.form-select option { background: var(--navyLt); color: #dce6f0; }
.input-group-text {
  background: rgba(255,255,255,.07) !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  color: rgba(255,255,255,.38) !important;
}
.form-check-input:checked {
  background-color: var(--yellow) !important;
  border-color: var(--yellow) !important;
}

/* ── Buttons ── */
.btn-yellow {
  background: var(--yellowGrad);
  color: #000;
  font-weight: 800;
  border: none;
  border-radius: 8px;
  transition: opacity .15s, box-shadow .15s, transform .1s;
}
.btn-yellow:hover {
  opacity: .9;
  color: #000;
  box-shadow: 0 4px 20px rgba(243,174,28,.5);
  transform: translateY(-1px);
}
.btn-yellow:active { transform: translateY(0); box-shadow: none; }

/* alias — orange class now also uses torch yellow */
.btn-orange {
  background: var(--yellowGrad);
  color: #000;
  font-weight: 800;
  border: none;
  border-radius: 8px;
  transition: opacity .15s, box-shadow .15s, transform .1s;
}
.btn-orange:hover {
  opacity: .9;
  color: #000;
  box-shadow: 0 4px 20px rgba(243,174,28,.5);
  transform: translateY(-1px);
}
.btn-orange:active { transform: translateY(0); box-shadow: none; }

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.55);
  border-radius: 8px;
  font-size: .82rem;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-ghost:hover { border-color: rgba(243,174,28,.4); color: #fff; background: rgba(243,174,28,.06); }

.btn-danger-soft {
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.2);
  color: #f87171;
  border-radius: 8px;
  font-size: .82rem;
  transition: background .15s, color .15s;
}
.btn-danger-soft:hover { background: rgba(248,113,113,.2); color: #fca5a5; border-color: rgba(248,113,113,.35); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: rgba(255,255,255,.26);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
}

/* ── Mini week calendar ── */
.cal-day {
  flex: 1;
  text-align: center;
  background: rgba(243,174,28,.1);
  border: 1px solid rgba(243,174,28,.28);
  border-radius: 8px;
  padding: 5px 2px;
  transition: background .15s;
}
.cal-dow {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(255,255,255,.36);
  margin-bottom: 4px;
}
.cal-dt {
  font-size: .88rem;
  font-weight: 700;
  color: var(--yellow);
}

@media (max-width: 480px) {
  .stats-bar { gap: 8px; }
  .stat-num { font-size: 1.35rem; }
  .pg-hdr h1 { font-size: 1.35rem; }
  /* The full-size logo + "PO Dashboard" label together are wider than a phone screen and
     were overflowing off the right edge — shrink the logo and drop the label on narrow
     screens rather than letting the brand link overflow. */
  .brand-logo { height: 40px !important; }
  .brand-title { display: none; }
}

/* ── Login page ── */
.login-outer {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: radial-gradient(ellipse at 38% 32%, #1a3a5c 0%, #112540 45%, #0a1828 100%);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.07);
  padding: 32px 28px;
}
.login-brand {
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: .04em;
  background: var(--yellowGrad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 22px;
  text-align: center;
}
.login-brand span {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  -webkit-text-fill-color: rgba(255,255,255,.35);
  margin-top: 4px;
}

/* ── PO status chips ── */
.po-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(243,174,28,.14);
  color: var(--yellow);
  border: 1px solid rgba(243,174,28,.3);
}
