:root {
  --navy: #071018;
  --navy-2: #0c1c2e;
  --panel: #12283f;
  --line: rgba(212, 176, 106, .22);
  --gold: #d4b06a;
  --gold-2: #f0d7a3;
  --text: #eef3f8;
  --muted: #9bb0c9;
  --ok: #3dba8b;
  --warn: #e0a54b;
  --bad: #e05a5a;
  --bs-primary: #d4b06a;
  --bs-body-bg: #071018;
  --bs-body-color: #eef3f8;
}
html { font-size: 14px; }
html, body { background: var(--navy); color: var(--text); font-family: "Segoe UI", system-ui, sans-serif; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { color: var(--gold); }
img { max-width: 100%; }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #071018 url("img/dunesair-login-bg.jpg") center/cover no-repeat;
  padding: 16px;
}
.login-page::before {
  content: "";
  position: fixed; inset: 0;
  background: rgba(7, 16, 24, .42);
}
.login-box {
  position: relative;
  z-index: 1;
  width: 340px;
  max-width: 100%;
  background: rgba(10, 22, 36, .94);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.erp-logo-svg { height: 36px; width: auto; display: block; }
.brand-kicker { letter-spacing: .18em; font-size: .65rem; color: var(--gold); text-transform: uppercase; }

.erp-shell { min-height: 100vh; }
.erp-side {
  width: 196px;
  flex: 0 0 196px;
  background: #0a1a2c;
}
.erp-side a.nav-link {
  color: #d7e3ef;
  border-radius: 8px;
  padding: .4rem .7rem;
  font-size: .86rem;
}
.erp-side a.nav-link:hover, .erp-side a.nav-link.active {
  background: rgba(212, 176, 106, .16);
  color: var(--gold-2);
}
.erp-main { background: #071018; min-width: 0; }
.topbar-erp { border-bottom: 1px solid var(--line); min-height: 42px; padding-top: .25rem; padding-bottom: .25rem; }

.card, .card.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
}
.card-header { background: transparent; border-bottom-color: var(--line); color: var(--gold-2); padding: .5rem .75rem; }
.stat { padding: .65rem .8rem !important; }
.stat .lbl { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.stat .val { font-size: 1.1rem; font-weight: 700; margin-top: .15rem; }
.stat .val.ok, .ok { color: var(--ok); }
.stat .val.bad, .err { color: var(--bad); }
.stat .val.warn, .warn { color: var(--warn); }
.tiny, .muted { color: var(--muted); font-size: .8rem; }

.form-control, .form-select, textarea, input:not([type=checkbox]):not([type=radio]):not([type=file]), select {
  background: #0b1a28 !important;
  color: var(--text) !important;
  border: 1px solid #1e3f5f;
  padding: .3rem .55rem;
  font-size: .85rem;
}
.form-control:focus, .form-select:focus {
  background: #0b1a28 !important;
  color: var(--text) !important;
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 .15rem rgba(212,176,106,.2) !important;
}
.card input, .card select, .card textarea { width: 100%; margin-bottom: .45rem; }
.form-check-input { background: #0b1a28; border-color: #2a4a66; }
.alert-success { background: #163d32; border-color: #1e5a45; color: #c8f0d8; }
.alert-danger { background: #4a1f1f; border-color: #6a2a1f; color: #ffd0d0; }
.input-group-text { padding: .3rem .55rem; font-size: .85rem; }
.btn, button.btn, input.btn {
  background: var(--gold);
  color: #071018;
  font-weight: 600;
  border: 0;
  padding: .3rem .75rem;
  font-size: .85rem;
}
.btn:hover { background: var(--gold-2); color: #071018; }
.btn.ghost, .btn-outline-light {
  background: transparent;
  color: var(--gold-2);
  border: 1px solid var(--gold);
}
.btn.danger { background: var(--bad); color: #fff; }

table { width: 100%; color: var(--text); }
th, td { padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .85rem; }
th { color: var(--muted); font-weight: 600; font-size: .75rem; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); }
.table > :not(caption) > * > * { padding: .4rem .5rem; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; }
.pill.draft { background: #2a3d55; }
.pill.sent, .pill.partial { background: #4a3b16; color: var(--warn); }
.pill.locked, .pill.invoiced, .pill.paid { background: #163d32; color: var(--ok); }
.pill.unpaid { background: #4a1f1f; color: #ffb4b4; }
.flash { padding: 8px 10px; border-radius: 6px; margin-bottom: 10px; font-size: .85rem; }
.flash.ok { background: #163d32; }
.flash.err { background: #4a1f1f; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.full { grid-column: 1 / -1; }
.grid { display: grid; gap: 10px; }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
h1.page { font-size: 1.2rem; margin-bottom: .25rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: .5rem; }
label { font-size: .78rem; color: var(--muted); margin-bottom: .2rem; }
.ac-thumb { height: 56px; width: 88px; object-fit: cover; border-radius: 6px; flex: 0 0 88px; }
.ac-card { display: flex; gap: 10px; align-items: flex-start; }
.nav-pills .nav-link { color: #d7e3ef; border: 1px solid var(--line); margin: 0 4px 6px 0; }
.nav-pills .nav-link.active { background: var(--gold); color: #071018; }
@media (max-width: 991px) {
  .g-4, .g-3, .g-2, .form-grid { grid-template-columns: 1fr; }
}
