/* =====================================================================
   Flash Drive Long-Distance — shared prototype styles.
   Matches the existing Flash Drive sidebar UI (blue sidebar, light bg,
   white cards, navy hero card, blue Contractor Hub pill bottom right).
   ===================================================================== */
:root{
  --blue:#0b5fe8; --blue-dark:#0a4ec1; --blue-darker:#073999;
  --navy:#0b1f44; --navy-2:#13294e;
  --text:#16233a; --muted:#64748b; --muted-2:#475569;
  --bg:#eef3fb; --card:#ffffff; --border:#dbe4f0;
  --green:#16a34a; --amber:#d97706; --red:#b91c1c;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:Inter,-apple-system,Segoe UI,Arial,sans-serif;
  background:var(--bg); color:var(--text); line-height:1.55; font-size:15px;
}
a{color:var(--blue);text-decoration:none}

/* =========== PROTOTYPE DEV TOOLBAR =========== */
.dev-toolbar{
  background:#1a1d29; color:#e5e7eb; padding:8px 14px;
  font-size:12px; display:flex; gap:14px; align-items:center;
  border-bottom:2px solid #ff9800;
}
.dev-toolbar strong{color:#ff9800; letter-spacing:.04em}
.dev-roles{display:flex; gap:6px; margin-left:auto}
.dev-roles button{
  background:#2a2d3a; color:#e5e7eb; border:1px solid #444; border-radius:6px;
  padding:4px 10px; font-family:inherit; font-size:12px; cursor:pointer; font-weight:600;
}
.dev-roles button.on{ background:#ff9800; color:#1a1d29; border-color:#ff9800 }

/* =========== APP SHELL =========== */
.shell{display:flex; min-height:calc(100vh - 36px)}

/* =========== SIDEBAR =========== */
.sidebar{
  width:240px; flex:0 0 240px; background:linear-gradient(180deg,#1e5bdb,#0b5fe8 30%);
  color:#fff; display:flex; flex-direction:column;
  padding:22px 16px;
}
.sidebar .logo-block{margin:0 0 26px}
.sidebar .logo{
  font-family:Georgia,'Times New Roman',serif; font-size:30px; font-style:italic;
  color:#fff; letter-spacing:0; line-height:1;
}
.sidebar .sub{
  font-size:10.5px; letter-spacing:.22em; color:#cfe1ff; margin-top:6px;
  text-transform:uppercase; font-weight:700;
}
.sidebar nav{display:flex;flex-direction:column;gap:2px;flex:1}
.sidebar nav a{
  display:block; padding:11px 14px; border-radius:11px; color:#dce8ff;
  font-size:14.5px; font-weight:600; transition:all .12s;
}
.sidebar nav a:hover{ background:rgba(255,255,255,.07); color:#fff }
.sidebar nav a.active{ background:#fff; color:var(--blue); font-weight:800 }
.sidebar nav a.special{
  background:rgba(255,193,7,.18); color:#fff; margin-bottom:10px;
  border:1px solid rgba(255,193,7,.4); font-weight:800;
}
.sidebar nav a.special:hover{ background:rgba(255,193,7,.28) }
.sidebar .user-card{
  background:rgba(255,255,255,.1); border-radius:12px; padding:12px 14px;
  margin:14px 0 10px; font-size:13px;
}
.sidebar .user-card .name{font-weight:700; color:#fff}
.sidebar .user-card .email{color:#cfe1ff; font-size:11.5px; margin-top:2px; word-break:break-all}
.sidebar .logout{
  background:#0b1f44; color:#fff; border:none; border-radius:11px;
  padding:11px 14px; font-family:inherit; font-weight:700; font-size:14px;
  cursor:pointer; text-align:left;
}

/* =========== MAIN AREA =========== */
.main{flex:1; padding:24px 30px 80px; min-width:0}
.topbar{display:flex; align-items:center; gap:14px; margin:0 0 18px}
.topbar .biz{
  font-size:13px; color:var(--muted); font-weight:700; letter-spacing:.05em;
  text-transform:uppercase;
}
.topbar .biz strong{color:var(--text); margin-left:6px; letter-spacing:0; text-transform:none}
.topbar .pagetitle{font-size:30px; font-weight:800; color:var(--text); line-height:1; margin-top:2px}
.topbar-right{margin-left:auto; display:flex; gap:10px; align-items:center}
.topbar-right .email-chip{
  background:#fff; border:1.5px solid var(--border); border-radius:999px;
  padding:8px 16px; font-size:13px; color:var(--text);
}

/* =========== HERO CARD =========== */
.hero{
  background:linear-gradient(135deg,var(--navy),var(--navy-2));
  color:#fff; border-radius:18px; padding:26px 28px; margin:0 0 22px;
  display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap;
}
.hero .eyebrow{
  font-size:11px; font-weight:800; letter-spacing:.18em;
  color:#7eb0ff; text-transform:uppercase; margin-bottom:6px;
}
.hero h1{font-size:30px; margin:0; color:#fff; font-weight:800}
.hero p{margin:8px 0 0; color:#9fb3d0; font-size:14.5px; max-width:560px}
.hero-actions{display:flex; gap:10px; flex-wrap:wrap}

/* =========== HEADINGS =========== */
h2{font-size:20px; margin:0 0 12px; font-weight:800; color:var(--text)}
h3{font-size:15.5px; margin:0 0 8px; font-weight:700; color:var(--text)}
.muted{color:var(--muted); font-size:13px}
.lead{color:var(--muted); margin:0 0 16px}

/* =========== STAT GRID =========== */
.stat-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; margin:0 0 18px}
.stat{
  background:#fff; border:1px solid var(--border); border-radius:18px;
  padding:20px 22px;
}
.stat .label{
  font-size:13.5px; color:var(--muted); font-weight:600; margin:0 0 8px;
}
.stat .num{font-size:38px; font-weight:800; color:var(--text); line-height:1.05}
.stat .sub{font-size:12px; color:var(--muted); margin-top:6px}
.stat.outlined{border:2px solid var(--blue)}
.stat.green-border{border-left:4px solid var(--green)}
.stat.amber-border{border-left:4px solid var(--amber)}
.stat.blue-border{border-left:4px solid var(--blue)}

/* =========== CARDS =========== */
.card{
  background:#fff; border:1px solid var(--border); border-radius:18px;
  padding:22px 24px; margin:0 0 16px;
}
.card-tight{padding:14px 18px}
.section-title{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin:0 0 14px; flex-wrap:wrap;
}
.section-title h2{margin:0}

/* =========== TABLES =========== */
.tbl{width:100%; border-collapse:collapse; font-size:14.5px}
.tbl th{
  text-align:left; padding:12px 16px; font-weight:700; color:var(--muted);
  font-size:12px; text-transform:uppercase; letter-spacing:.07em;
  border-bottom:1px solid var(--border);
}
.tbl td{padding:14px 16px; border-bottom:1px solid var(--border)}
.tbl tr:last-child td{border-bottom:none}
.tbl tr:hover td{background:#f7fafd}
.tbl-wrap{overflow-x:auto; border-radius:14px; background:#fff}

/* =========== BUTTONS =========== */
.btn{
  display:inline-flex; align-items:center; gap:6px; background:var(--blue);
  color:#fff; border:none; border-radius:12px; padding:11px 20px; cursor:pointer;
  font-family:inherit; font-weight:700; font-size:14.5px; text-decoration:none;
  transition:transform .1s;
}
.btn:hover{transform:translateY(-1px)}
.btn-light{background:#fff; color:var(--blue); border:2px solid var(--blue)}
.btn-secondary{background:#fff; color:var(--blue); border:1.5px solid var(--border)}
.btn-ghost{background:transparent; color:var(--blue); border:1px solid var(--border)}
.btn-danger{background:var(--red)}
.btn-success{background:var(--green)}
.btn-lg{padding:14px 26px; font-size:15.5px}
.btn-sm{padding:7px 13px; font-size:13px}
.btn:disabled{opacity:.5; cursor:not-allowed; transform:none}
.btn-row{display:flex; gap:10px; flex-wrap:wrap; margin:14px 0 0}

/* =========== FORMS =========== */
.field{margin:0 0 14px}
.field label{display:block; font-weight:700; font-size:13px; margin:0 0 6px; color:var(--text)}
.field input,.field select,.field textarea{
  width:100%; padding:12px 14px; border:1.5px solid var(--border);
  border-radius:11px; font-family:inherit; font-size:14.5px; background:#fff; color:var(--text);
}
.field input:focus,.field select:focus,.field textarea:focus{
  outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(11,95,232,.15);
}
.field textarea{resize:vertical; min-height:88px}
.field .hint{font-size:12px; color:var(--muted); margin-top:4px}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:14px}
@media(max-width:640px){
  .grid2{grid-template-columns:1fr}
  .sidebar{display:none}
  .main{padding:18px}
}

/* =========== BADGES =========== */
.badge{display:inline-block; padding:4px 10px; border-radius:999px; font-size:11.5px; font-weight:700}
.badge-amber{background:#fef3c7; color:#92400e}
.badge-green{background:#d1fae5; color:#065f46}
.badge-blue{background:#dbeafe; color:#1e40af}
.badge-red{background:#fee2e2; color:#991b1b}
.badge-gray{background:#e5e7eb; color:#475569}
.badge-purple{background:#ede9fe; color:#5b21b6}

/* =========== EMPTY STATE =========== */
.empty{text-align:center; padding:40px 20px; color:var(--muted)}
.empty .ico{font-size:48px; margin:0 0 10px; opacity:.45}

/* =========== ALERTS =========== */
.alert{padding:13px 18px; border-radius:12px; margin:0 0 14px; font-size:14px}
.alert-warn{background:#fef3c7; border:1px solid #fcd34d; color:#92400e}
.alert-info{background:#dbeafe; border:1px solid #93c5fd; color:#1e3a8a}
.alert-success{background:#d1fae5; border:1px solid #6ee7b7; color:#065f46}
.alert-error{background:#fee2e2; border:1px solid #fca5a5; color:#991b1b}

/* =========== MODALS =========== */
.modal-backdrop{
  position:fixed; inset:0; background:rgba(11,31,68,.6); z-index:200;
  display:flex; align-items:center; justify-content:center; padding:20px;
}
.modal-backdrop.hidden{display:none}
.modal{
  background:#fff; border-radius:18px; max-width:620px; width:100%;
  max-height:90vh; overflow-y:auto; padding:26px 28px;
  box-shadow:0 30px 60px rgba(11,31,68,.25);
}
.modal h2{margin:0 0 16px}
.modal-close{
  float:right; background:none; border:none; font-size:26px; cursor:pointer;
  color:var(--muted); margin:-8px -8px 0 0; line-height:1;
}

/* =========== FILE UPLOAD =========== */
.dropzone{
  border:2px dashed var(--border); border-radius:14px; padding:24px;
  text-align:center; background:#fafcff; cursor:pointer; transition:all .15s;
  display:block;
}
.dropzone:hover{border-color:var(--blue); background:#f1f6ff}
.dropzone .ico{font-size:36px; color:var(--blue)}
.dropzone .lbl{font-weight:700; margin-top:8px}
.dropzone .sub{font-size:12px; color:var(--muted); margin-top:4px}
.dropzone input[type=file]{display:none}

/* =========== SIGNATURE CANVAS =========== */
.sigwrap{
  border:1.5px solid var(--border); border-radius:12px; background:#fff; padding:8px;
}
.sigwrap canvas{display:block; width:100%; height:160px; background:#fafcff; border-radius:8px; touch-action:none}
.sig-actions{margin-top:8px; display:flex; gap:8px; justify-content:flex-end}

/* =========== T&C SCROLL BOX =========== */
.tcbox{
  background:#fafcff; border:1.5px solid var(--border); border-radius:12px;
  max-height:360px; overflow-y:auto; padding:18px 22px;
  font-size:13.5px; line-height:1.65;
}
.tcbox h3{margin:14px 0 6px; color:var(--text)}
.tcbox p,.tcbox li{margin:0 0 6px}

/* =========== CHECKBOX ROW =========== */
.check-row{
  display:flex; gap:10px; align-items:flex-start; margin:14px 0;
  background:#f1f8e9; border:1.5px solid #c5e1a5; border-radius:11px; padding:13px 16px;
}
.check-row input{margin-top:3px}
.check-row label{font-weight:600; color:var(--text); font-size:14px; cursor:pointer}

/* =========== CAMERA AREA =========== */
.cam-area{
  border:2px solid var(--blue); border-radius:14px; padding:22px; text-align:center;
  background:#f1f6ff;
}
.cam-area .preview{
  width:100%; max-width:300px; height:200px; margin:0 auto 12px;
  background:#13294e; border-radius:10px; display:flex; align-items:center;
  justify-content:center; color:#9fb3d0; font-size:14px; overflow:hidden;
}
.cam-area .preview img{width:100%; height:100%; object-fit:cover}

/* =========== MAP PLACEHOLDER =========== */
.mapbox{
  width:100%; height:340px; background:#e6edf5; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  background-image:
    linear-gradient(rgba(11,95,232,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,95,232,.05) 1px, transparent 1px);
  background-size:30px 30px; color:var(--muted); font-size:14px;
  position:relative; border:1px solid var(--border);
}
.mapbox .pin{
  position:absolute; width:36px; height:36px; border-radius:50% 50% 50% 0;
  background:var(--red); transform:rotate(-45deg);
  box-shadow:0 4px 12px rgba(0,0,0,.25);
}

/* =========== FLOATING PILLS (bottom right) =========== */
.float-pills{
  position:fixed; right:20px; bottom:20px; z-index:50;
  display:flex; flex-direction:column; gap:10px; align-items:flex-end;
}
.float-pill{
  display:inline-flex; align-items:center; gap:8px;
  background:var(--blue); color:#fff; border:none; border-radius:999px;
  padding:11px 20px; cursor:pointer; font-family:inherit;
  font-weight:800; font-size:14px; box-shadow:0 8px 24px rgba(11,95,232,.4);
}
.float-pill.dark{background:#0b1f44}
.float-pill .ico{
  width:30px; height:30px; border-radius:50%; background:#15170a;
  display:flex; align-items:center; justify-content:center; font-size:16px;
}

/* =========== TOGGLE SWITCHES =========== */
.toggle{
  position:relative; width:44px; height:24px; background:#cbd5e1;
  border-radius:999px; cursor:pointer; transition:background .15s;
}
.toggle.on{background:var(--green)}
.toggle::after{
  content:''; position:absolute; top:2px; left:2px;
  width:20px; height:20px; background:#fff; border-radius:50%;
  transition:transform .15s; box-shadow:0 1px 3px rgba(0,0,0,.2);
}
.toggle.on::after{transform:translateX(20px)}

/* =========== PIPELINE PILL =========== */
.pipeline-pill{
  display:inline-block; background:#e0e7ff; color:#3730a3;
  padding:3px 10px; border-radius:999px; font-size:11.5px; font-weight:700;
  margin-right:4px;
}
.pipeline-pill.ld{background:#fce7f3; color:#9d174d}

/* =========== PIPELINE SWITCHER (Reports/Invoices) =========== */
.pipeline-switch{
  display:inline-flex; background:#fff; border:1.5px solid var(--border);
  border-radius:999px; padding:4px; margin:0 0 18px; gap:0;
}
.pipeline-switch button{
  background:none; border:none; padding:9px 18px; border-radius:999px;
  font-family:inherit; font-size:13.5px; font-weight:700; color:var(--muted);
  cursor:pointer; transition:all .15s; display:inline-flex; align-items:center; gap:6px;
}
.pipeline-switch button.on[data-p="md"]{ background:#dbeafe; color:#1e40af }
.pipeline-switch button.on[data-p="ld"]{ background:#fce7f3; color:#9d174d }
.pipeline-switch button:not(.on):hover{ background:#f1f5f9; color:var(--text) }
.pipeline-pane{display:none}
.pipeline-pane.on{display:block}

/* =========== CONTRACTOR HUB OVERLAY =========== */
.hub-backdrop{
  position:fixed; inset:0; background:rgba(8,20,45,.5); z-index:300;
  display:flex; align-items:flex-end; justify-content:center;
}
.hub-backdrop.hidden{display:none}
.hub-panel{
  background:#eef2f8; width:100%; max-width:680px; height:92vh;
  border-radius:18px 18px 0 0; display:flex; flex-direction:column;
  overflow:hidden; box-shadow:0 -20px 50px rgba(11,31,68,.3);
}
.hub-top{
  display:flex; align-items:center; gap:12px; padding:16px 22px;
  background:var(--navy); color:#fff;
}
.hub-top h3{margin:0; font-size:16px; font-weight:800; color:#fff; flex:1}
.hub-close{
  background:none; border:none; color:#9fb3d0; font-size:26px; cursor:pointer;
  line-height:1; padding:4px;
}
.hub-close:hover{color:#fff}
.hub-tabs{
  display:flex; background:#fff; border-bottom:1px solid #dbe3ee; overflow-x:auto;
}
.hub-tabs button{
  flex:none; padding:13px 16px; border:none; background:#fff;
  font-family:inherit; font-weight:700; font-size:13.5px; color:#5b6b85;
  cursor:pointer; border-bottom:2.5px solid transparent; white-space:nowrap;
}
.hub-tabs button.on{color:var(--blue); border-bottom-color:var(--blue)}
.hub-body{flex:1; overflow-y:auto; padding:18px 22px}
.hub-pane{display:none}
.hub-pane.on{display:block}
.hub-card{
  background:#fff; border:1px solid #dbe3ee; border-radius:14px;
  padding:14px 16px; margin:0 0 12px;
}
.hub-card h4{margin:0 0 8px; font-size:14.5px}

/* =========== QUICK LINKS CARD =========== */
.quick-links{
  background:#fff; border:1px solid var(--border); border-radius:18px;
  padding:22px 24px;
}
.quick-links h2{margin:0 0 8px}
.quick-links .lbl{font-size:13px; color:var(--muted); margin:0 0 10px; font-weight:600}
.quick-links ul{margin:0; padding-left:20px}
.quick-links li{margin:0 0 8px; font-size:14px}
.quick-links li strong{color:var(--text)}

/* =========== SETTINGS GRID =========== */
.settings-grid{display:grid; grid-template-columns:1.4fr 1fr; gap:18px; margin:0 0 18px}
@media(max-width:880px){.settings-grid{grid-template-columns:1fr}}
.danger-zone{
  background:#fef2f2; border:2px solid #fecaca; border-radius:18px;
  padding:22px 24px;
}
.danger-zone h2{color:var(--red); margin:0 0 8px}

/* =========== OFFICER CARD =========== */
.officer-card{
  background:#fff; border:1.5px solid var(--border); border-radius:14px;
  padding:16px 18px; margin:0 0 12px;
}
.officer-card .perms{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(140px,1fr));
  gap:6px 12px; margin:10px 0 0;
}
.officer-card .perms label{
  display:flex; align-items:center; gap:6px; font-size:12.5px;
  font-weight:600; color:var(--text);
}

/* =========== FULL INVOICE DOCUMENT VIEW =========== */
.invoice-doc{
  background:#fff; border:1px solid var(--border); border-radius:14px;
  padding:32px 36px; box-shadow:0 4px 12px rgba(11,31,68,.06);
}
.invoice-doc .doc-header{
  display:flex; justify-content:space-between; align-items:flex-start;
  border-bottom:3px solid var(--blue); padding-bottom:14px; margin:0 0 22px;
}
.invoice-doc .doc-brand{font-family:Georgia,'Times New Roman',serif; font-size:32px; font-style:italic; color:var(--blue); line-height:1}
.invoice-doc .doc-brand-sub{font-size:10px; letter-spacing:.22em; color:var(--muted); text-transform:uppercase; font-weight:700; margin-top:4px}
.invoice-doc .doc-num{text-align:right}
.invoice-doc .doc-num h1{font-size:30px; font-weight:800; color:var(--navy); margin:0; letter-spacing:-.5px}
.invoice-doc .doc-num .meta{font-size:13px; color:var(--muted); margin-top:6px; line-height:1.6}
.invoice-doc .doc-parties{display:grid; grid-template-columns:1fr 1fr; gap:24px; margin:0 0 22px}
.invoice-doc .doc-parties h4{
  font-size:11px; letter-spacing:.14em; color:var(--muted); text-transform:uppercase;
  font-weight:700; margin:0 0 6px;
}
.invoice-doc .doc-parties .block{font-size:13.5px; line-height:1.65; color:var(--text)}
.invoice-doc .doc-parties .block strong{font-size:15px; color:var(--navy); display:block; margin-bottom:2px}
.invoice-doc .doc-job{
  background:#f6f9fd; border:1px solid var(--border); border-radius:10px;
  padding:14px 16px; margin:0 0 22px;
}
.invoice-doc .doc-job h4{
  font-size:11px; letter-spacing:.14em; color:var(--muted); text-transform:uppercase;
  font-weight:700; margin:0 0 8px;
}
.invoice-doc .doc-job .row{display:flex; gap:18px; flex-wrap:wrap; font-size:13px}
.invoice-doc .doc-job .row > div{flex:1; min-width:140px}
.invoice-doc .doc-job .lbl{font-size:11px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.05em}
.invoice-doc .doc-job .val{font-size:14px; color:var(--text); margin-top:2px}
.invoice-doc table.doc-items{width:100%; border-collapse:collapse; margin:0 0 18px}
.invoice-doc table.doc-items th{
  text-align:left; padding:10px 12px; font-size:11px; font-weight:700;
  color:var(--muted); text-transform:uppercase; letter-spacing:.06em;
  border-bottom:2px solid var(--border); background:#fafcff;
}
.invoice-doc table.doc-items th.right,
.invoice-doc table.doc-items td.right{text-align:right}
.invoice-doc table.doc-items td{padding:14px 12px; border-bottom:1px solid var(--border); font-size:14px; color:var(--text)}
.invoice-doc .doc-totals{
  display:flex; justify-content:flex-end; margin:0 0 22px;
}
.invoice-doc .doc-totals .box{width:min(320px, 100%); border-top:2px solid var(--border)}
.invoice-doc .doc-totals .row{display:flex; justify-content:space-between; padding:8px 12px; font-size:14px}
.invoice-doc .doc-totals .row.grand{
  background:var(--blue); color:#fff; border-radius:8px; margin-top:6px;
  font-size:18px; font-weight:800; padding:14px 16px;
}
.invoice-doc .doc-pay{
  background:#fff8e1; border:1.5px solid #fcd34d; border-radius:10px;
  padding:14px 16px; margin:0 0 18px; font-size:13px;
}
.invoice-doc .doc-pay h4{margin:0 0 6px; font-size:13px; color:#78350f}
.invoice-doc .doc-pay code{
  background:#fff; padding:1px 7px; border-radius:5px; font-weight:700;
  font-family:'Courier New', monospace; color:var(--text);
}
.invoice-doc .doc-foot{
  text-align:center; font-size:11px; color:var(--muted);
  border-top:1px solid var(--border); padding-top:14px; line-height:1.6;
}

/* =========== MISC =========== */
.divider{height:1px; background:var(--border); margin:18px 0}
.row{display:flex; gap:14px; align-items:center; flex-wrap:wrap}
.spacer{flex:1}
.pill-row{display:flex; gap:8px; flex-wrap:wrap; margin:8px 0}
.pill-row span{
  display:inline-block; background:#eef3fb; color:var(--text);
  padding:5px 11px; border-radius:999px; font-size:12px; font-weight:600;
}
