/* GreenLoop CRM — glassmorphism operations theme (v3) */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');
:root {
  --bg: #061a17; --glass: rgba(255,255,255,.055); --glass2: rgba(255,255,255,.09); --glass3: rgba(255,255,255,.13);
  --line: rgba(255,255,255,.10); --line2: rgba(255,255,255,.18);
  --text: #eaf6f2; --muted: #93b3aa; --teal: #2dd4bf; --teal-d: #0f9488; --mint: #6ee7b7;
  --green: #34d399; --red: #fb7185; --amber: #fbbf24; --blue: #7dd3fc; --violet: #c4b5fd;
  --blur: blur(18px) saturate(140%);
  --shadow: 0 10px 40px -12px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08);
  --panel: var(--glass); --panel2: var(--glass2);
}
* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); }
body {
  color: var(--text); font: 14px/1.5 'Manrope', 'Segoe UI', system-ui, sans-serif; font-feature-settings: 'tnum' 1;
  min-height: 100vh;
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(45,212,191,.28), transparent 60%),
    radial-gradient(700px 500px at 105% 10%, rgba(125,211,252,.16), transparent 60%),
    radial-gradient(800px 600px at 60% 120%, rgba(52,211,153,.18), transparent 60%),
    linear-gradient(160deg, #04221d 0%, #061a17 45%, #081820 100%);
  background-attachment: fixed;
}
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.err { color: var(--red); min-height: 18px; font-size: 13px; }
a { color: var(--teal); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* glass primitive */
.glass, .card, .kpi, .login-card, .sidebar, .modal, .toast, .ptabs, .lane, .alert-item, .opt-card {
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { border-radius: 24px; padding: 40px 34px; width: 360px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.logo { font-size: 22px; font-weight: 800; color: var(--teal); display: flex; align-items: center; gap: 8px; justify-content: center; letter-spacing: -.3px; }
.logo span { color: var(--text); }
input, select, textarea { background: rgba(0,0,0,.22); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; width: 100%; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(45,212,191,.18); }
select option { background: #0b2a25; }
input[type=checkbox] { width: auto; accent-color: var(--teal); }

/* buttons */
.btn { border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; background: var(--glass2); color: var(--text); transition: background .15s, transform .1s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, #14b8a6, #0d9488); box-shadow: 0 6px 20px -8px rgba(45,212,191,.7); }
.btn.primary:hover { background: linear-gradient(135deg, #2dd4bf, #14b8a6); color: #042b25; }
.btn.danger { background: rgba(251,113,133,.18); border-color: rgba(251,113,133,.35); color: #fecdd3; } .btn.danger:hover { background: rgba(251,113,133,.35); }
.btn.ghost { background: transparent; border-color: var(--line2); color: var(--text); } .btn.ghost:hover { background: var(--glass2); }
.btn.wa { background: rgba(37,211,102,.18); border-color: rgba(37,211,102,.4); color: #bbf7d0; }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* shell */
#app { display: flex; min-height: 100vh; gap: 0; }
.sidebar { width: 236px; margin: 12px 0 12px 12px; border-radius: 22px; padding: 20px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 12px; height: calc(100vh - 24px); overflow-y: auto; }
.sidebar nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav-group { font-size: 11px; color: var(--muted); padding: 12px 12px 4px; font-weight: 700; letter-spacing: .2px; }
.sidebar nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); cursor: pointer; user-select: none; display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13.5px; }
.sidebar nav a:hover { background: var(--glass2); color: var(--text); }
.sidebar nav a.active { background: linear-gradient(135deg, rgba(45,212,191,.28), rgba(45,212,191,.08)); color: #fff; box-shadow: inset 0 0 0 1px rgba(45,212,191,.35); }
.sidebar-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.role-chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: rgba(196,181,253,.16); color: var(--violet); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); display: inline-block; box-shadow: 0 0 10px var(--green); }
.dot.off { background: var(--red); box-shadow: 0 0 10px var(--red); }
main { flex: 1; padding: 26px 30px 60px; max-width: 1360px; min-width: 0; }

h1 { font-size: 26px; font-weight: 800; letter-spacing: -.6px; margin-bottom: 2px; }
.sub { color: var(--muted); margin-bottom: 20px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head .sub { margin-bottom: 0; }

/* cards & KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { border-radius: 18px; padding: 16px 18px; position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; inset: auto -30% -60% auto; width: 140px; height: 140px; border-radius: 50%; background: currentColor; opacity: .07; filter: blur(8px); }
.kpi .num { font-size: 30px; font-weight: 800; letter-spacing: -1px; line-height: 1.15; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi.green { color: var(--green); } .kpi.red { color: var(--red); } .kpi.amber { color: var(--amber); } .kpi.blue { color: var(--blue); } .kpi.violet { color: var(--violet); }
.kpi.green .num, .kpi.red .num, .kpi.amber .num, .kpi.blue .num, .kpi.violet .num { color: inherit; }
.card { border-radius: 20px; padding: 20px; margin-bottom: 16px; min-width: 0; }
.card h3 { font-size: 15px; font-weight: 800; margin-bottom: 12px; letter-spacing: -.2px; }
.scroll-x { overflow-x: auto; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: rgba(255,255,255,.025); }
.r { text-align: right; }

/* pills */
.pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill.pending, .pill.Due, .pill.draft, .pill.contacted, .pill.awaiting, .pill.requested { background: rgba(251,191,36,.15); color: var(--amber); }
.pill.collected, .pill.Paid, .pill.accepted, .pill.won, .pill.converted, .pill.confirmed, .pill.active, .pill.MET { background: rgba(52,211,153,.15); color: var(--green); }
.pill.canceled, .pill.Overdue, .pill.rejected, .pill.lost, .pill.disputed, .pill.declined, .pill.ATRISK { background: rgba(251,113,133,.15); color: var(--red); }
.pill.overdue { background: var(--red); color: #fff; animation: blink 1.2s infinite; }
.pill.rescheduled, .pill.sent, .pill.new, .pill.quoted, .pill.ONTRACK, .pill.Partly { background: rgba(125,211,252,.15); color: var(--blue); }
.pill.expired, .pill.superseded, .pill.Void, .pill.auto_confirmed, .pill.paused, .pill.ended { background: rgba(255,255,255,.08); color: var(--muted); }
.pill.pest { background: rgba(196,181,253,.16); color: var(--violet); } .pill.waste { background: rgba(45,212,191,.14); color: var(--teal); }
@keyframes blink { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .pill.overdue { animation: none; } }

/* fleet load bars */
.loadbar { background: rgba(0,0,0,.25); border-radius: 8px; height: 22px; position: relative; overflow: hidden; min-width: 74px; }
.loadbar > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #0d9488, #2dd4bf); border-radius: 8px; }
.loadbar.warn > i { background: linear-gradient(90deg, #d97706, #fbbf24); } .loadbar.fullcap > i { background: linear-gradient(90deg, #e11d48, #fb7185); }
.loadbar span { position: relative; z-index: 1; font-size: 11px; padding-left: 8px; line-height: 22px; font-weight: 700; }

/* feed */
.feed { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.feed-item { display: flex; gap: 10px; align-items: center; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 13px; }
.feed-item img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; cursor: pointer; }
.feed-item .t { color: var(--muted); font-size: 11px; margin-left: auto; white-space: nowrap; }

/* alerts */
.alert-item { border-left: 4px solid var(--blue); padding: 12px 16px; border-radius: 14px; margin-bottom: 8px; font-size: 13px; }
.alert-item.warning { border-left-color: var(--amber); }
.alert-item.critical { border-left-color: var(--red); background: rgba(251,113,133,.07); }
.alert-item .t { color: var(--muted); font-size: 11px; }
.badge { background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; margin-left: auto; font-weight: 700; }

/* modal */
#modal-wrap { position: fixed; inset: 0; background: rgba(2,12,10,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: rgba(10,40,35,.72); border-radius: 22px; padding: 24px; width: 500px; max-width: 100%; max-height: 90vh; overflow-y: auto; }
.modal.wide { width: 920px; }
.modal h3 { margin-bottom: 14px; font-size: 18px; font-weight: 800; }
.field { margin-bottom: 11px; }
.field label, .lbl2 { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.fgrid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
@media (max-width: 640px) { .fgrid, .fgrid3 { grid-template-columns: 1fr; } }

/* toasts — system response messages sit at the TOP centre so they are seen first (v3.2) */
#toast-wrap { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); width: min(620px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 8px; z-index: 120; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 11px; background: rgba(8,46,40,.86); border: 1px solid rgba(45,212,191,.55); border-left: 5px solid var(--teal); border-radius: 16px; padding: 13px 14px 13px 15px; font-size: 14.5px; font-weight: 600; line-height: 1.4; position: relative; overflow: hidden;
  box-shadow: 0 18px 50px -14px rgba(0,0,0,.75), 0 0 0 1px rgba(45,212,191,.12), 0 0 34px -10px rgba(45,212,191,.55), inset 0 1px 0 rgba(255,255,255,.1); animation: toastDrop .38s cubic-bezier(.2,1.2,.3,1) both !important; }
.toast .t-ic { flex-shrink: 0; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgba(45,212,191,.2); color: var(--teal); }
.toast .t-msg { flex: 1; padding-top: 3px; word-break: break-word; }
.toast .t-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 8px; line-height: 0; } .toast .t-x:hover { color: var(--text); background: var(--glass2); }
.toast .t-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: currentColor; opacity: .45; transform-origin: left; animation: toastBar linear forwards; }
.toast.success { border-color: rgba(52,211,153,.6); border-left-color: var(--green); color: #d1fae5; box-shadow: 0 18px 50px -14px rgba(0,0,0,.75), 0 0 34px -10px rgba(52,211,153,.6), inset 0 1px 0 rgba(255,255,255,.1); } .toast.success .t-ic { background: rgba(52,211,153,.2); color: var(--green); }
.toast.warning { background: rgba(52,38,6,.88); border-color: rgba(251,191,36,.6); border-left-color: var(--amber); color: #fef3c7; box-shadow: 0 18px 50px -14px rgba(0,0,0,.75), 0 0 34px -10px rgba(251,191,36,.6), inset 0 1px 0 rgba(255,255,255,.1); } .toast.warning .t-ic { background: rgba(251,191,36,.2); color: var(--amber); }
.toast.critical { background: rgba(60,12,24,.9); border-color: rgba(251,113,133,.7); border-left-color: var(--red); color: #ffe4e6; box-shadow: 0 18px 50px -14px rgba(0,0,0,.75), 0 0 38px -8px rgba(251,113,133,.7), inset 0 1px 0 rgba(255,255,255,.1); } .toast.critical .t-ic { background: rgba(251,113,133,.22); color: var(--red); }
.toast.out { opacity: 0; transform: translateY(-10px) scale(.97); transition: opacity .2s, transform .2s; }
@keyframes toastDrop { from { opacity: 0; transform: translateY(-26px) scale(.94); } }
@keyframes toastBar { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none !important; } .toast .t-bar { display: none; } }

/* reschedule options */
.opt-card { border-radius: 14px; padding: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 14px; }
.opt-card .rank { font-size: 20px; font-weight: 800; color: var(--teal); width: 28px; }
.opt-card .dev { margin-left: auto; text-align: right; } .opt-card .dev b { color: var(--blue); }

.photo-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); }
.photo-full { max-width: 100%; border-radius: 14px; }
.zone-tag { background: rgba(125,211,252,.1); border: 1px solid rgba(125,211,252,.25); border-radius: 6px; padding: 1px 8px; font-size: 11px; color: var(--blue); font-weight: 600; }

.ic { vertical-align: -2px; }
.sidebar nav a .ic { flex-shrink: 0; }
.btn .ic { vertical-align: -2px; margin-right: 3px; }
h3 .ic, h1 .ic { vertical-align: -2px; color: var(--teal); margin-right: 4px; }
.kpi .lbl .ic { vertical-align: -2px; margin-right: 3px; }
.feed-x { width: 42px; display: flex; align-items: center; justify-content: center; color: var(--red); }

/* tabs */
.ptabs { display: flex; gap: 4px; border-radius: 12px; padding: 4px; }
.ptab { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 9px; cursor: pointer; }
.ptab.on { background: linear-gradient(135deg, #14b8a6, #0d9488); color: #fff; }
.ptab:hover:not(.on) { color: var(--text); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 0; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.chartbox { position: relative; height: 240px; }
@media (max-width: 1100px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ── sales: kanban ── */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.lane { border-radius: 18px; padding: 12px; min-height: 280px; }
.lane h4 { font-size: 13px; font-weight: 800; display: flex; justify-content: space-between; margin-bottom: 10px; }
.lane h4 span { color: var(--muted); font-weight: 700; }
.lead-card { background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s; }
.lead-card:hover { border-color: rgba(45,212,191,.5); }
.lead-card b { display: block; font-size: 13.5px; }
.lead-card .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.lead-card .fu { font-size: 11.5px; margin-top: 6px; color: var(--muted); }
.lead-card .fu.late { color: var(--amber); font-weight: 700; }
.lane.drop { box-shadow: inset 0 0 0 2px rgba(45,212,191,.5); }

/* funnel (the memorable piece of the sales dashboard) */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.fstep { display: grid; grid-template-columns: 110px 1fr 70px; align-items: center; gap: 12px; }
.fstep .bar { height: 34px; border-radius: 10px; background: linear-gradient(90deg, rgba(45,212,191,.85), rgba(45,212,191,.25)); display: flex; align-items: center; padding-left: 12px; font-weight: 800; font-size: 14px; min-width: 42px; }
.fstep:nth-child(2) .bar { background: linear-gradient(90deg, rgba(125,211,252,.85), rgba(125,211,252,.25)); }
.fstep:nth-child(3) .bar { background: linear-gradient(90deg, rgba(52,211,153,.9), rgba(52,211,153,.3)); }
.fstep .pc { color: var(--muted); font-size: 12px; text-align: right; font-weight: 700; }

/* quotation builder */
.qb td { padding: 5px 4px; } .qb input, .qb select { padding: 7px 8px; font-size: 13px; }
.qtot { margin-left: auto; width: 300px; } .qtot td { border: 0; padding: 4px 8px; } .qtot .g td { font-size: 17px; font-weight: 800; color: var(--teal); border-top: 1px solid var(--line2); }
.daypick { display: flex; gap: 6px; flex-wrap: wrap; }
.daypick label { display: flex; align-items: center; gap: 4px; background: rgba(0,0,0,.2); border: 1px solid var(--line); padding: 5px 9px; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.site-row { display: grid; grid-template-columns: 1.2fr 1fr .8fr .8fr 1.4fr 32px; gap: 6px; margin-bottom: 6px; }
@media (max-width: 800px) { .site-row { grid-template-columns: 1fr 1fr; } }

/* 360 */
.hero360 { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.risk { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; font-weight: 800; position: relative; }
.risk small { position: absolute; bottom: 14px; font-size: 10px; color: var(--muted); font-weight: 700; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; background: rgba(0,0,0,.2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gallery img { width: 100%; height: 90px; object-fit: cover; display: block; cursor: pointer; }
.gallery figcaption { font-size: 11px; padding: 5px 8px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 10px; font-size: 13px; } .kv span { color: var(--muted); }
.empty { color: var(--muted); padding: 18px 4px; }

@media (max-width: 900px) {
  #app { flex-direction: column; }
  .sidebar { width: auto; margin: 10px; height: auto; position: static; flex-direction: column; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .nav-group { display: none; }
  main { padding: 14px; }
}
html { color-scheme: dark; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.risk span { position: relative; line-height: 1; margin-top: -8px; }
.risk small { bottom: 18px; }

/* ───────── v3.2: fleet tracker dates + capacity moderation ───────── */
.fmt-hint { display: inline-flex; align-items: center; gap: 6px; background: rgba(125,211,252,.1); border: 1px solid rgba(125,211,252,.25); color: var(--blue); border-radius: 8px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.fleet-grid { display: grid; grid-template-columns: repeat(7, minmax(108px, 1fr)); gap: 8px; min-width: 800px; }
.day-cell { background: rgba(0,0,0,.2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 7px; }
.day-cell.today { border-color: rgba(45,212,191,.6); box-shadow: inset 0 0 0 1px rgba(45,212,191,.25); }
.day-cell.moderated { border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.06); }
.day-cell.over { border-color: rgba(251,113,133,.6); background: rgba(251,113,133,.08); }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.day-head .wd { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.day-head .tag { font-size: 10px; font-weight: 800; color: var(--teal); }
.dmy { font-weight: 800; font-size: 14px; letter-spacing: .01em; white-space: nowrap; }
.dmy .sep { color: var(--muted); font-weight: 500; margin: 0 1px; }
.dmy .mm { color: var(--blue); } .dmy .yy { color: var(--muted); font-weight: 700; }
.dmy-long { font-size: 11px; color: var(--muted); margin-top: -4px; }
.cap-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 11.5px; color: var(--muted); }
.cap-row b { color: var(--text); } .cap-row > span { white-space: nowrap; }
.cap-edit { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; border: 1px solid var(--line2); background: transparent; color: var(--text); border-radius: 7px; font: inherit; font-size: 11px; font-weight: 700; padding: 2px 7px; cursor: pointer; } .cap-edit:hover { background: var(--glass2); border-color: var(--teal); }
.cap-note { font-size: 10.5px; color: var(--amber); line-height: 1.3; }
.cap-note.red { color: var(--red); font-weight: 700; }
.stepper-num { display: flex; align-items: center; gap: 8px; } .stepper-num input { text-align: center; font-size: 20px; font-weight: 800; width: 90px; } .stepper-num .btn { width: 42px; padding: 9px 0; font-size: 18px; }

/* quotation → invoice workflow strip */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.flow-step { position: relative; border-radius: 16px; padding: 13px 15px 13px 54px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow); }
.flow-step .n { position: absolute; left: 13px; top: 13px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: linear-gradient(135deg, #14b8a6, #0d9488); color: #fff; }
.flow-step .k { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.flow-step b { display: block; font-size: 14px; } .flow-step small { color: var(--muted); font-size: 12px; }
.flow-step .cnt { position: absolute; right: 13px; top: 13px; font-size: 20px; font-weight: 800; color: var(--text); }
@media (max-width: 900px) { .flow { grid-template-columns: 1fr; } }
.btn.gmail { background: rgba(234,67,53,.16); border-color: rgba(234,67,53,.45); color: #fecaca; } .btn.gmail:hover { background: rgba(234,67,53,.3); }
.banner { border-radius: 14px; padding: 11px 14px; font-size: 13px; margin-bottom: 12px; border: 1px solid rgba(251,191,36,.4); background: rgba(251,191,36,.08); color: #fde68a; display: flex; gap: 10px; align-items: flex-start; }
.banner.ok { border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.08); color: #a7f3d0; }
.banner.red { border-color: rgba(251,113,133,.45); background: rgba(251,113,133,.09); color: #fecdd3; }

/* maintenance */
.pill.open { background: rgba(251,191,36,.15); color: var(--amber); }
.pill.approved, .pill.in_progress { background: rgba(125,211,252,.15); color: var(--blue); }
.pill.resolved { background: rgba(52,211,153,.15); color: var(--green); }
.pill.off_road { background: var(--red); color: #fff; } .pill.high { background: rgba(251,113,133,.15); color: var(--red); }
.pill.normal, .pill.low { background: rgba(255,255,255,.08); color: var(--muted); }
.pill.proof { background: rgba(52,211,153,.15); color: var(--green); } .pill.noproof { background: rgba(251,113,133,.15); color: var(--red); }
.veh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin-bottom: 16px; }
.veh-card { border-radius: 18px; padding: 15px; cursor: pointer; background: var(--glass); border: 1px solid var(--line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.veh-card:hover { border-color: rgba(45,212,191,.5); transform: translateY(-2px); }
.veh-card.offroad { border-color: rgba(251,113,133,.6); }
.veh-card .kv { grid-template-columns: 110px 1fr; font-size: 12.5px; margin-top: 10px; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line2); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item::before { content: ''; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px rgba(45,212,191,.2); }
.tl-item.issue::before { background: var(--amber); box-shadow: 0 0 0 3px rgba(251,191,36,.2); }
.tl-item.expense::before { background: var(--blue); box-shadow: 0 0 0 3px rgba(125,211,252,.2); }
.tl-body { background: rgba(0,0,0,.2); border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; }
.catbars { display: flex; flex-direction: column; gap: 7px; } .catbar { display: grid; grid-template-columns: 170px 1fr 96px; gap: 10px; align-items: center; font-size: 12.5px; }
.catbar i { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, #0d9488, #2dd4bf); min-width: 4px; } .catbar .r { text-align: right; font-weight: 700; }
.r { text-align: right; }
.seg-aud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg-aud label { border: 1px solid var(--line); background: rgba(0,0,0,.2); border-radius: 14px; padding: 12px; cursor: pointer; display: block; }
.seg-aud input { display: none; } .seg-aud label:has(input:checked) { border-color: var(--teal); background: rgba(45,212,191,.12); box-shadow: 0 0 0 3px rgba(45,212,191,.14); }
.seg-aud b { display: block; } .seg-aud small { color: var(--muted); font-size: 12px; }
.phone-prev { border-radius: 18px; padding: 12px 14px; background: rgba(255,255,255,.1); border: 1px solid var(--line2); display: flex; gap: 11px; align-items: flex-start; }
.phone-prev .app-ic { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #14b8a6, #0d9488); display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.phone-prev b { display: block; font-size: 14px; } .phone-prev span { font-size: 13px; color: var(--muted); word-break: break-word; }

/* ───────── v3.3: phone field (country code + number, as in DevX Nexus) ───────── */
.gl-phone { display: grid; grid-template-columns: minmax(118px, 42%) 1fr; gap: 8px; }
.gl-phone select, .gl-phone input { min-width: 0; }
.gl-phone-num { letter-spacing: .02em; }
.dupbox { border: 1px solid rgba(251,191,36,.45); background: rgba(251,191,36,.08); border-radius: 12px; padding: 11px 13px; margin: 0 0 12px; font-size: 13px; color: #fde68a; }
.dupbox p { margin-bottom: 8px; } .dupbox p:last-child { margin-bottom: 0; }

/* ───────── v3.3: frequency control ───────── */
.freq { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fq-num { display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: 10px; background: rgba(0,0,0,.22); overflow: hidden; }
.fq-num button { width: 36px; height: 38px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 18px; cursor: pointer; }
.fq-num button:hover { background: var(--glass2); }
.fq-num output { min-width: 30px; text-align: center; font-weight: 800; font-size: 16px; }
.fq-x { color: var(--muted); font-size: 13px; }
.fq-unit { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; background: rgba(0,0,0,.22); }
.fq-unit button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; padding: 0 13px; height: 38px; cursor: pointer; }
.fq-unit button + button { border-left: 1px solid var(--line); }
.fq-unit button.on { background: var(--teal-d); color: #fff; }

/* ───────── v3.3: quotation builder lines ───────── */
.qline { border-top: 1px solid var(--line); padding: 14px 0; }
.qline:first-child { border-top: 0; padding-top: 2px; }
.ql-what { display: grid; grid-template-columns: 1.1fr 1.6fr 1fr 34px; gap: 8px; margin-bottom: 10px; }
.ql-what input, .ql-what select { padding: 8px 10px; font-size: 13.5px; }
.ql-x { padding: 0; height: 36px; display: grid; place-items: center; }
.ql-price { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.ql-eq { color: var(--muted); font-size: 13px; } .ql-eq b { color: var(--text); font-weight: 800; }
.ql-eq::before { content: '='; margin-right: 8px; color: var(--muted); }
.ql-unit { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ql-unit::before { content: '×'; }
.ql-unit input { width: 104px; padding: 8px 10px; text-align: right; font-weight: 700; }
.ql-total { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); display: flex; flex-direction: column-reverse; }
.ql-total b { font-size: 16px; color: var(--text); font-weight: 800; }
@media (max-width: 720px) { .ql-what { grid-template-columns: 1fr 34px; } .ql-what .qi-svc { grid-column: 1; } .ql-what .ql-x { grid-column: 2; grid-row: 1; } .ql-what .qi-desc, .ql-what .qi-site { grid-column: 1 / -1; }
  .ql-total { margin-left: 0; width: 100%; flex-direction: row; justify-content: space-between; align-items: baseline; padding-top: 4px; } .qtot { width: 100%; } }

/* ───────── v3.3: quotations page ───────── */
.qpipe { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow); overflow: hidden; }
.qpipe button { all: unset; box-sizing: border-box; cursor: pointer; padding: 16px 18px; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: baseline; border-left: 1px solid var(--line); position: relative; }
.qpipe button:first-child { border-left: 0; }
.qpipe .n { grid-row: 1 / 3; font-size: 30px; font-weight: 800; line-height: 1; align-self: center; min-width: 1.2ch; }
.qpipe .l { font-weight: 700; font-size: 14px; } .qpipe .s { font-size: 12px; color: var(--muted); }
.qpipe button:hover { background: var(--glass2); }
.qpipe button.on { background: rgba(45,212,191,.12); } .qpipe button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--teal); }
.qpipe button:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.qlist { padding: 4px 18px; }
.qrow { display: grid; grid-template-columns: 1.3fr 1.4fr 1.1fr auto minmax(120px, auto); gap: 6px 20px; align-items: center; padding: 15px 0; border-top: 1px solid var(--line); cursor: pointer; }
.qrow:first-child { border-top: 0; } .qrow:hover .who b { color: var(--teal); }
.qrow:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 8px; }
.qrow b { font-weight: 700; } .qrow span { display: block; font-size: 12.5px; color: var(--muted); }
.qrow .what span { color: var(--text); font-size: 13px; } .qrow .when { font-size: 13px; }
.qrow .amt { text-align: right; } .qrow .amt b { font-size: 16px; font-weight: 800; white-space: nowrap; }
.qrow .st { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@media (max-width: 1000px) { .qpipe { grid-template-columns: 1fr 1fr; } .qpipe button:nth-child(3) { border-left: 0; } .qpipe button:nth-child(n+3) { border-top: 1px solid var(--line); }
  .qrow { grid-template-columns: 1fr auto; } .qrow .what, .qrow .when { grid-column: 1; } .qrow .amt { grid-column: 2; grid-row: 1; } .qrow .st { grid-column: 2; grid-row: 2 / 4; } }

/* ───────── v3.3: quotation as a document, preview and confirmation ───────── */
.modal.xl { width: 1120px; }
.qdetail { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 22px; align-items: start; }
.paper { background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 18px 40px -18px rgba(0,0,0,.7); }
.paper iframe, .mailframe iframe { display: block; width: 100%; border: 0; height: 620px; background: #fff; }
.rail { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; }
.rail h3 { margin: 0; font-size: 20px; } .rail-st { margin: -4px 0 0; }
.rail-acts { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; } .rail-acts .btn { text-align: left; }
.rail-v { line-height: 1.8; } .rail-close { margin-top: 6px; }
@media (max-width: 900px) { .qdetail { grid-template-columns: 1fr; } .rail { position: static; order: -1; } .rail-acts { flex-direction: row; flex-wrap: wrap; } .rail-acts .btn { flex: 1 1 46%; text-align: center; } .rail-acts .btn.primary { flex-basis: 100%; } .rail-close { display: none; } }
.pv { position: relative; }
.pv-head h3 { margin-bottom: 2px; } .pv-head p { margin-bottom: 14px; }
.pv-to { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-bottom: 14px; }
.pv-to label { font-weight: 700; font-size: 13px; }
.pv-empty { color: var(--muted); padding: 40px 12px; text-align: center; border: 1px dashed var(--line2); border-radius: 12px; }
#pv-body.stale { opacity: .45; }
.pv-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.pv-tabs button { all: unset; cursor: pointer; padding: 8px 0; font-weight: 700; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pv-tabs button.on { color: var(--text); border-bottom-color: var(--teal); } .pv-tabs button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.mailframe { background: #fff; color: #13231f; border-radius: 6px; overflow: hidden; box-shadow: 0 18px 40px -18px rgba(0,0,0,.7); }
.mailframe dl { display: grid; grid-template-columns: 76px 1fr; gap: 4px 10px; margin: 0; padding: 14px 18px; border-bottom: 1px solid #dfe6e3; font-size: 13px; background: #f6f8f7; }
.mailframe dt { color: #55645f; } .mailframe dd { margin: 0; word-break: break-word; }
.mailframe iframe { height: 520px; padding: 0 14px; } .mailtext { margin: 0; padding: 18px; white-space: pre-wrap; word-break: break-word; font: 14px/1.55 'Segoe UI', system-ui, sans-serif; }
.pv-foot { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; position: sticky; bottom: -24px; padding: 12px 0; background: linear-gradient(to top, rgba(9,36,32,.98) 70%, rgba(9,36,32,0)); }
.pv-wa { margin-left: auto; border-color: transparent; color: var(--muted); font-weight: 600; }
.confirm { position: absolute; inset: -24px; background: rgba(3,16,14,.72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; border-radius: 22px; z-index: 3; }
.confirm-card { width: min(440px, 100%); background: #0d2f2a; border: 1px solid var(--line2); border-radius: 16px; padding: 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); position: sticky; top: 20vh; }
.confirm-card h3 { margin-bottom: 12px; }
.confirm-card dl { display: grid; grid-template-columns: 92px 1fr; gap: 6px 10px; margin: 0 0 12px; font-size: 14px; } .confirm-card dt { color: var(--muted); } .confirm-card dd { margin: 0; font-weight: 700; word-break: break-word; }
.confirm-card .row { margin-top: 14px; }
@media (max-width: 640px) { .pv-to { grid-template-columns: 1fr; } .pv-wa { margin-left: 0; } .pv-foot .btn { flex: 1 1 100%; } .mailframe dl { grid-template-columns: 62px 1fr; padding: 12px; } }

/* v3.3: driver shift line on the route ledger */
.shiftline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; margin: -6px 0 12px; }
