@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
  --nge-accent: #5b9dff;
  --glass: rgba(30, 48, 90, 0.52);
  --glass-border: rgba(255, 255, 255, 0.14);
  --card-bg: rgba(30, 48, 90, 0.52);
  --text: #f4f7ff;
  --muted: #c2cce6;
  --border: rgba(255, 255, 255, 0.14);
  --radius: 12px;
  --good: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --input-bg: rgba(255, 255, 255, 0.10);
}

html, body { height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text) !important;
  background: #0b1733 !important;
  margin: 0 !important;
  min-height: 100%;
}

/* Fixed night sky wash — same spirit as dashboard #fx */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(1200px 800px at 50% 110%, #2a4a8c 0%, #152a58 45%, #0b1733 100%);
}

body > * { position: relative; z-index: 1; }

a { color: #9ec1ff; }
a:hover { color: #c9dcff; }

h1, h2, h3 { color: var(--text); }
.muted, .sub { color: var(--muted) !important; }

.site-header, .site-nav, nav.site-header {
  background: var(--glass) !important;
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  padding: 10px 16px;
  margin-bottom: 8px;
}
.navbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
}
.nav-logo img { height: 34px; width: auto; filter: brightness(1.05); }
.search-box {
  margin-left: 8px;
  padding: 8px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--input-bg);
  color: var(--text);
  min-width: 180px;
}
.search-box::placeholder { color: var(--muted); }

.site-header .btn, .navbar .btn, nav .btn {
  background: rgba(91, 157, 255, 0.18) !important;
  border: 1px solid rgba(91, 157, 255, 0.35) !important;
  color: #e8f1ff !important;
  padding: 6px 10px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  display: inline-block;
}
.site-header .btn:hover, .navbar .btn:hover, nav .btn:hover {
  background: rgba(91, 157, 255, 0.3) !important;
}
.site-header a:not(.btn) {
  color: #dbe7ff;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
}
.site-header a:not(.btn):hover { background: rgba(255,255,255,0.08); }

.card, .table-card, .kpi, .box, .search-card, .unreceived-card {
  background: var(--glass) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  color: var(--text);
}
.kpi-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.kpi { padding: 14px; min-width: 160px; }

table { color: var(--text); }
th { color: var(--muted) !important; }
td, th { border-bottom-color: rgba(255,255,255,0.08) !important; }
tbody tr:nth-child(even) { background: rgba(255,255,255,0.03) !important; }

input[type=text], input[type=number], input[type=email], input[type=tel],
input[type=date], input[type=password], input[type=search], select, textarea {
  background: var(--input-bg) !important;
  color: var(--text) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 8px;
  padding: 8px 10px;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type=file] { color: var(--muted); }

.btn, button.btn, button[type=submit], .btn-primary {
  background: rgba(91, 157, 255, 0.22) !important;
  border: 1px solid rgba(91, 157, 255, 0.4) !important;
  color: #e8f1ff !important;
  border-radius: 8px;
  cursor: pointer;
  padding: 8px 12px;
  text-decoration: none;
  display: inline-block;
}
.btn-primary, button.btn-primary {
  background: rgba(91, 157, 255, 0.45) !important;
  border-color: rgba(91, 157, 255, 0.7) !important;
  font-weight: 600;
}
.btn:hover, button.btn:hover, button[type=submit]:hover { background: rgba(91, 157, 255, 0.35) !important; }

.ok, .status-ok {
  background: rgba(52, 211, 153, 0.12) !important;
  border: 1px solid rgba(52, 211, 153, 0.35) !important;
  color: #a7f3d0 !important;
  padding: 10px 12px;
  border-radius: 8px;
}
.err, .status-err {
  background: rgba(248, 113, 113, 0.12) !important;
  border: 1px solid rgba(248, 113, 113, 0.35) !important;
  color: #fecaca !important;
  padding: 10px 12px;
  border-radius: 8px;
}

.label { color: var(--muted) !important; }
.page { padding: 20px 24px 40px; max-width: 1400px; margin: 0 auto; }
.page-header h1 { color: var(--text); }

.status-pill, .pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.06);
  color: #dbe7ff;
}

/* Estimate / doc status — high contrast on night sky */
.pill-status-draft, .pill[data-status="draft"] {
  background: rgba(148, 163, 184, 0.22) !important;
  border-color: rgba(148, 163, 184, 0.55) !important;
  color: #e2e8f0 !important;
}
.pill-status-sent, .pill[data-status="sent"] {
  background: rgba(56, 189, 248, 0.22) !important;
  border-color: rgba(56, 189, 248, 0.65) !important;
  color: #7dd3fc !important;
}
.pill-status-accepted, .pill[data-status="accepted"],
.pill-status-won, .pill[data-status="won"] {
  background: rgba(52, 211, 153, 0.22) !important;
  border-color: rgba(52, 211, 153, 0.65) !important;
  color: #6ee7b7 !important;
}
.pill-status-converted, .pill[data-status="converted"] {
  background: rgba(167, 139, 250, 0.25) !important;
  border-color: rgba(167, 139, 250, 0.7) !important;
  color: #c4b5fd !important;
}
.pill-status-rejected, .pill[data-status="rejected"],
.pill-status-lost, .pill[data-status="lost"],
.pill-status-cancelled, .pill[data-status="cancelled"] {
  background: rgba(248, 113, 113, 0.2) !important;
  border-color: rgba(248, 113, 113, 0.65) !important;
  color: #fca5a5 !important;
}
.pill-status-expired, .pill[data-status="expired"] {
  background: rgba(251, 191, 36, 0.2) !important;
  border-color: rgba(251, 191, 36, 0.7) !important;
  color: #fde68a !important;
}


.pdf-modal { background: rgba(0,0,0,0.55) !important; }
.pdf-modal-card {
  background: #0c1428 !important;
  border: 1px solid var(--glass-border);
  color: var(--text);
}
.pdf-modal-head { border-bottom: 1px solid var(--glass-border) !important; }

/* Forms / intake spacing when pages used margin:24px on body */
.wrap, .content, main { max-width: 1200px; margin: 0 auto; padding: 18px 20px 48px; }

@media (max-width: 900px) {
  .kpi-row { flex-direction: column; }
}


/* Fireworks canvas (non-dashboard pages) */
#bg-fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}


/* High-contrast checkboxes on all non-dashboard pages */
body:not(.is-dashboard) input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0 4px 0 0;
  vertical-align: middle;
  cursor: pointer;
  border: 2px solid #fbbf24 !important;
  background: rgba(251, 191, 36, 0.14) !important;
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
}
body:not(.is-dashboard) input[type="checkbox"]:hover {
  background: rgba(251, 191, 36, 0.28) !important;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.28);
}
body:not(.is-dashboard) input[type="checkbox"]:checked {
  background: #fbbf24 !important;
  border-color: #f59e0b !important;
}
body:not(.is-dashboard) input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #1a1400;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
body:not(.is-dashboard) input[type="checkbox"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
body:not(.is-dashboard) .flag-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.32);
}
body:not(.is-dashboard) .flag-check span,
body:not(.is-dashboard) .flag-check .muted {
  color: #fde68a !important;
  font-weight: 600;
}

/* Bank feed contrast */
.pill-bank-categorized {
  background: rgba(52, 211, 153, 0.22) !important;
  border-color: rgba(52, 211, 153, 0.7) !important;
  color: #6ee7b7 !important;
}
.pill-bank-uncategorized {
  background: rgba(251, 191, 36, 0.22) !important;
  border-color: rgba(251, 191, 36, 0.75) !important;
  color: #fde68a !important;
}
