:root{
  --bg: #0b0b0b;
  --panel: transparent;
  --panel-2: rgba(255,255,255,.12);
  --text: #f3f3f3;
  --muted: rgba(255,255,255,.7);
  --gold: #FFD200;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --line: rgba(255,255,255,.18);
  --radius: 14px;
}

*{ box-sizing:border-box; margin:0; padding:0; }
html,body{ height:100%; }
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 900px at 20% 10%, #1b1b1b, #050505);
  color: var(--text);
}

a{ color: inherit; text-decoration:none; }
.container{ width: min(1200px, 92%); margin: 0 auto; }

.topbar{
  position: sticky;
  top:0;
  z-index: 50;
  background: rgba(0,0,0,.7);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 1rem;
  padding: 14px 0;
  min-height: 62px;
  max-height: 62px;
  overflow: hidden;
}
.brand{
  display:flex;
  align-items:center;
  gap: .75rem;
  font-weight: 800;
  letter-spacing: .6px;
}
.badge{
  font-size: 12px;
  color: #000;
  background: var(--gold);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
}
.navlinks{
  display:flex;
  gap: .5rem;
  align-items:center;
  flex-wrap:wrap;
}
.navlinks a{
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
}
.navlinks a.active{
  background: rgba(255,210,0,.14);
  color: #fff;
  border: 1px solid rgba(255,210,0,.25);
}
.navlinks a:hover{
  background: rgba(255,255,255,.08);
  color: #fff;
}

.page{
  padding: 22px 0 60px;
}

.panel{
  background: transparent;
  border: none;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: none;
}


.grid{
  display:grid;
  gap: 16px;
}
.grid-2{
  grid-template-columns: 1.1fr .9fr;
}
@media (max-width: 900px){
  .grid-2{ grid-template-columns: 1fr; }
}

.h1{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .2px;
  margin-bottom: 6px;
}
.sub{
  color: var(--muted);
  font-size: 14px;
}

.btnrow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 12px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-weight: 800;
  border-radius: 12px;
  padding: 11px 14px;
  text-decoration: none;
}

/* Ensure anchor buttons match button buttons exactly */
a.btn {
  display: inline-flex !important;
  font-weight: 800 !important;
  border-radius: 12px !important;
  padding: 11px 14px !important;
}

a.btn:hover {
  text-decoration: none !important;
}

.btn-primary{
  background: var(--gold);
  color:#000;
}
.btn-primary:hover{ filter: brightness(.95); }
.btn-ghost{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: #fff;
}
.btn-ghost:hover{ background: rgba(255,255,255,.12); }

.btn-danger{
  background: var(--bad);
  color: #fff;
}
.btn-danger:hover{ filter: brightness(.95); }

/* Intake pretty display */
.intake-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.intake-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 12px 14px;
}
.raw-json pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  font-size: 0.9rem;
  line-height: 1.35;
}

@media (max-width: 900px){
  .intake-grid { grid-template-columns: 1fr; }
}

.table{
  width:100%;
  border-collapse: collapse;
  margin-top: 10px;
  overflow:hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
}
.table th, .table td{
  text-align:left;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 14px;
}
.table th{
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-size: 12px;
}
.table tr:hover td{ background: rgba(255,255,255,.06); }

.flash{
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: #fff;
}
.flash.success{ border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.12); }
.flash.error{ border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.12); }

.form{
  display:grid;
  gap: 12px;
}
.field label{
  display:block;
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field textarea, .field select{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.25);
  color: #fff;
  outline:none;
}
.field textarea{ min-height: 120px; resize: vertical; }

/* --- Fix dropdown/select readability (dark) --- */
select,
.form-select,
select.form-control {
  color: #f5f5f5;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.18);
}

select option {
  color: #111;     /* keep options readable on OS dropdown */
  background: #fff;
}

.card{
  background: var(--panel-2);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 14px;
}
.cardtop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.title{
  font-weight: 900;
  font-size: 16px;
}
.meta{
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* -------- Progress Bar (segmented) -------- */
.progress-wrap{
  margin-top: 10px;
  width: 100%;
  overflow-x: auto;
}
.progress-labels{
  display:flex;
  justify-content:space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.progress-labels span{
  flex:1;
  text-align:center;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
.progress-bar{
  display:flex;
  gap: 6px;
  width: 100%;
  min-width: 100%;
}
.seg{
  flex:1;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
}
.seg.done{
  background: rgba(34,197,94,.75);
  border-color: rgba(34,197,94,.6);
}
.seg.current{
  background: rgba(255,210,0,.80);
  border-color: rgba(255,210,0,.65);
}
.seg.pending{
  background: rgba(255,255,255,.08);
}

.kv{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
@media (max-width: 700px){
  .kv{ grid-template-columns: 1fr; }
}
.kv .item{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  padding: 10px 12px;
  border-radius: 12px;
}
.kv .item .k{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.kv .item .v{
  margin-top: 6px;
  font-size: 14px;
}
.small{
  font-size: 12px;
  color: var(--muted);
}

.details-pre{
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.4;

  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;

  padding: 14px;
  margin-top: 8px;

  max-height: 420px;
  overflow: auto;
}


/* ===== Job View (only): structured cards ===== */
.section-label{
  margin: 14px 4px 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
}

.job-card{ margin-bottom: 14px; }

.overview-row{
  display:flex;
  justify-content:space-between;
  gap: 32px;
  margin-top: 10px;
}
.overview-pair{
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 1;
}
.overview-pair .label{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.overview-pair .value{
  font-size: 15px;
  margin-left: auto;
  text-align: right;
}
@media (max-width: 700px){
  .overview-row{ flex-direction: column; gap: 8px; }
  .overview-pair .value{ margin-left: 0; text-align: left; }
}

/* clean non-monospace detail blocks */
.kvrows{ display:grid; gap: 10px; margin-top: 6px; }
.kvrows .row{
  display:grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items:start;
}
.kvrows .row .k{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.kvrows .row .v{ font-size: 14px; }

.textblock{
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 12px;
}

@media (max-width: 700px){
  .kvrows .row{ grid-template-columns: 1fr; }
}

/* =========================
   Brand logo + watermark
   ========================= */
.brand-link{
  text-decoration:none;
  color: inherit;
}
.brand-logo{
  /* LOCKED: Logo sizing */
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  width: auto !important;
  max-width: 280px !important;
  object-fit: contain !important;
  display: block !important;
  flex-shrink: 0 !important;
  filter: drop-shadow(0 10px 22px rgba(255,209,122,.22));
}

/* ===== Crown Admin Background (Original Gold Glow) ===== */
html, body{
  min-height: 100%;

  background-image:
    radial-gradient(1200px 700px at 20% 10%, rgba(255,210,0,.10), transparent 60%),
    radial-gradient(900px 600px at 80% 20%, rgba(255,255,255,.06), transparent 55%),
    radial-gradient(1100px 800px at 50% 85%, rgba(255,255,255,.05), transparent 65%),
    linear-gradient(180deg, #0b0b0b 0%, #070707 55%, #050505 100%);

  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
}




/* -----------------------------
   Job View Layout (fix spacing)
------------------------------ */
.two-col{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
@media (max-width: 900px){
  .two-col{ grid-template-columns: 1fr; }
}

.overview-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}
@media (max-width: 900px){
  .overview-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .overview-grid{ grid-template-columns: 1fr; }
}
.overview-item{
  padding: 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(0,0,0,.20);
}
.overview-item .label{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
}
.overview-item .value{
  margin-top: 6px;
  font-size: 15px;
}

.info-grid{
  display:grid;
  gap: 10px;
  margin-top: 8px;
}
.info-row{
  display:grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: start;
}
@media (max-width: 520px){
  .info-row{ grid-template-columns: 1fr; }
}
.info-row .label{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
}
.info-row .value{
  font-size: 14px;
  line-height: 1.35;
}

.prewrap{
  white-space: pre-wrap;
  word-break: break-word;
}

.table-wrap{ overflow-x: auto; margin-top: 10px; }
.items-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.items-table th, .items-table td{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  vertical-align: top;
}

/* Gold attachment links */
.attachment-link {
  color: var(--gold) !important;
  font-weight: 600;
  text-decoration: underline;
  transition: opacity 0.2s ease;
}
.attachment-link:hover {
  opacity: 0.8;
}
.items-table th{
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
}

/* ===== BULLETPROOF LOGO SIZING (DO NOT CHANGE) ===== */
/* Lock logo to exactly 34px, all selector variations */
.brand-logo,
.topbar .brand img,
.topbar a img,
.brand img {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  width: auto !important;
  max-width: 280px !important;
  object-fit: contain !important;
  display: block !important;
  flex-shrink: 0 !important;
}

/* Container constraints */
.topbar-inner{
  min-height: 62px !important;
  max-height: 62px !important;
  overflow: hidden !important;
}

/* Restore “gold” feel consistently */
:root{
  --gold-strong: rgba(255,210,0,.92);
  --gold-soft: rgba(255,210,0,.22);
}

/* Primary headings + key titles */
.h1{ color: var(--gold-strong); }
.card .title{ color: var(--gold-strong); }

/* Section label: gold accent bar */
.section-label{
  margin: 22px 4px 12px !important;
  border-left: 3px solid var(--gold-strong);
  padding-left: 10px;
  color: rgba(255,255,255,.78) !important;
}

/* Bring back gold borders/glow on “cards” without being loud */
.card,
.job-card,
.overview-item{
  border-color: rgba(255,210,0,.18) !important;
}

/* Make nav active state pop gold again */
.navlinks a.active{
  border-color: rgba(255,210,0,.45) !important;
}

/* ===========================
   Job View spacing + alignment
   =========================== */

/* Prevent uneven column content from visually “stretching” cards */
.grid-2,
.two-col{
  align-items: start !important;
}
.grid-2 > *,
.two-col > *{
  align-self: start !important;
}

/* Give job cards better padding/breathing */
.job-card{
  margin-bottom: 18px !important;
}

/* If your job view uses .card containers, ensure consistent interior spacing */
.card{
  padding: 16px !important;
}

/* Overview grid items a little roomier */
.overview-item{
  padding: 16px !important;
}

/* Make the title wrap nicely and not look “busted” */
.cardtop{
  align-items: center !important;
}
.title{
  line-height: 1.15 !important;
  word-break: break-word;
}

/* Info grid spacing */
.info-grid{ gap: 14px !important; }
.info-row{ padding: 6px 0; }

/* Table spacing + gold headers */
.table-wrap{ margin-top: 16px !important; }
.items-table th,
.items-table td{ padding: 12px 12px !important; }
.items-table th{ color: rgba(255,210,0,.85) !important; }

/* Make “prewrap” blocks readable and not cramped */
.prewrap{
  line-height: 1.45;
}

/* Slightly stronger divider lines on job view tables/cards */
.items-table th, .items-table td,
.table th, .table td{
  border-bottom-color: rgba(255,255,255,.12);
}

/* =========================
   Attachment download styling
========================= */

.attachments-list{
  list-style: none;
  padding: 0;
  margin-top: 10px;
}





/* =========================
   Job View: always two columns
   ========================= */
.job-two-col{
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 16px;
  align-items: start;
}

/* Force two columns even on smaller screens (per request) */
@media (max-width: 900px){
  .job-two-col{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px){
  .job-two-col{ grid-template-columns: 1fr 1fr; }
}

/* FINAL: Attachment links must be gold - overrides all */
a.attachment-link,
.attachment-link {
  color: #FFD200 !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  transition: opacity 0.2s ease;
}

a.attachment-link:hover,
.attachment-link:hover {
  opacity: 0.8 !important;
  text-decoration: underline !important;
}
