/* =====================================================================
   GLASS THEME – Live dashboard only (body.glass is set on the dashboard page)
   ===================================================================== */
body.glass {
  --g-brd: rgba(255,255,255,.13); --g-txt: #f2f5fb; --g-mut: rgba(226,233,250,.62);
  /* re-point the app's base colours so every page goes dark (reset for printed reports below) */
  --ink: #f2f5fb; --muted: rgba(226,233,250,.62); --line: rgba(255,255,255,.09); --bg: #090d15; --brand-lt: rgba(127,176,255,.12);
  color: var(--g-txt);
  background:
    radial-gradient(55% 45% at 82% 18%, rgba(200,40,80,.38), transparent 70%),
    radial-gradient(50% 45% at 8% 6%, rgba(39,83,163,.55), transparent 70%),
    radial-gradient(40% 40% at 25% 100%, rgba(16,150,120,.25), transparent 70%),
    radial-gradient(35% 35% at 95% 95%, rgba(120,70,255,.25), transparent 70%),
    #090d15;
  background-attachment: fixed;
  min-height: 100vh;
}
html:has(body.glass) { background: #090d15; }
body.glass .top { background: rgba(9,13,21,.55); border-bottom: 1px solid var(--g-brd); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
body.glass .logo { border-radius: 8px; }
body.glass .who { color: #fff; }
body.glass .who small { color: var(--g-mut); }
body.glass nav.tabs { background: rgba(9,13,21,.72); border-top: 1px solid var(--g-brd); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
body.glass h1, body.glass h2 { color: #fff; letter-spacing: -.01em; }
body.glass .meta, body.glass .empty { color: var(--g-mut); }
body.glass a { color: #a9c6ff; }
body.glass .gl {
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.035));
  border: 1px solid var(--g-brd); border-radius: 22px; padding: 18px;
  backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 24px 48px -24px rgba(0,0,0,.7);
  margin-bottom: 16px; min-width: 0;
}
body.glass .lift { transition: transform .25s ease, box-shadow .25s ease; }
body.glass .lift:hover { transform: translateY(-4px); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 30px 50px -22px rgba(0,0,0,.8); }
@media (prefers-reduced-motion: reduce) { body.glass .lift, body.glass .lift:hover { transition: none; transform: none; } }

body.glass .btn { background: rgba(255,255,255,.08); border-color: var(--g-brd); color: #fff; border-radius: 999px; }
body.glass .btn:hover { background: rgba(255,255,255,.16); }
body.glass .btn.white { background: #fff; color: #10131a; border-color: #fff; }
body.glass .btn.round, body.glass .round { width: 44px; height: 44px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center;
  background: rgba(255,255,255,.08); border: 1px solid var(--g-brd); color: #fff; font-size: 20px; cursor: pointer; }
body.glass .pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.1); border: 1px solid var(--g-brd); color: #fff; text-decoration: none; white-space: nowrap; }
body.glass .pill.sm { padding: 3px 10px; font-size: 12px; }
body.glass .badge { background: rgba(255,255,255,.12); color: #fff; }
body.glass .badge.active, body.glass .badge.approved { background: rgba(52,211,153,.18); color: #7af0c1; }
body.glass .badge.pending, body.glass .badge.quoted { background: rgba(251,191,36,.18); color: #fdd46a; }
body.glass .badge.on-hold { background: rgba(248,113,113,.2); color: #ffaaaa; }
body.glass .neg { color: #ff9d9d; }
body.glass .pos { color: #7af0c1; }
body.glass .progress { background: rgba(255,255,255,.12); }

.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }

/* stat tiles */
.gstats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .gstats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1150px) { .gstats { grid-template-columns: repeat(6, 1fr); } }
body.glass .gstat { padding: 14px 16px; margin: 0; }
.gstat-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--g-mut); }
.gstat-val { font-size: 30px; font-weight: 800; color: #fff; margin: 8px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.gstat-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 28px; }
.gstat-foot .meta { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spark { width: 90px; height: 28px; flex: none; }
.chip-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgba(127,176,255,.18); color: #9cc0ff; }
.chip-ico svg { width: 16px; height: 16px; }
.chip-ico.green { background: rgba(52,211,153,.18); color: #7af0c1; }
.chip-ico.purple { background: rgba(167,139,250,.2); color: #c4b5fd; }
.chip-ico.amber { background: rgba(251,191,36,.18); color: #fdd46a; }
.chip-ico.red { background: rgba(248,113,113,.22); color: #ffaaaa; }

/* rows */
.dash-row1, .dash-row2 { display: grid; gap: 0 16px; margin-top: 16px; }
@media (min-width: 980px) { .dash-row1 { grid-template-columns: minmax(300px, 1fr) 2fr; } .dash-row2 { grid-template-columns: 3fr 2fr; } }
body.glass .scroll { max-height: 380px; overflow: auto; margin-top: 6px; scrollbar-width: thin; }
body.glass .alert, body.glass .ev, body.glass .list .item { border-bottom-color: rgba(255,255,255,.08); }
body.glass .dot-bad { background: #ff6b6b; box-shadow: 0 0 10px #ff6b6b; }
body.glass .dot-warn { background: #fbbf24; box-shadow: 0 0 10px #fbbf24; }
body.glass .dot-info { background: #7fb0ff; box-shadow: 0 0 10px #7fb0ff; }

/* job in focus */
body.glass .hero { display: grid; gap: 18px; padding: 22px; min-height: 320px; overflow: hidden;
  background: radial-gradient(90% 120% at 100% 0%, rgba(232,62,104,.55), transparent 62%), linear-gradient(135deg, rgba(70,16,36,.75), rgba(18,10,22,.75)); }
@media (min-width: 760px) { body.glass .hero { grid-template-columns: minmax(240px, 1fr) 1.5fr; } }
.hero-left { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.hero-title { font-size: 30px; line-height: 1.1; margin: 4px 0 0; }
.hero-left .meta { font-size: 13px; }
.hero-right { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.area { width: 100%; height: 190px; display: block; }
.area .glow { filter: drop-shadow(0 0 6px rgba(255,143,168,.8)); }
.area-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--g-mut); margin-top: 4px; }
.hero-nav { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; }

/* job tiles */
.jtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.jtile { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; min-height: 170px; padding: 14px; border-radius: 22px;
  color: #fff !important; text-decoration: none; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 24px 40px -24px rgba(0,0,0,.8); }
.jtile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.22), transparent 45%); pointer-events: none; }
.jtile.t0 { background: linear-gradient(160deg, #e0902f, #6e360c); }
.jtile.t1 { background: linear-gradient(160deg, #4a78f5, #152c70); }
.jtile.t2 { background: linear-gradient(160deg, #3fae5e, #0f4723); }
.jtile.t3 { background: linear-gradient(160deg, #8456ff, #2a1670); }
.jtile .pill { background: rgba(0,0,0,.22); border-color: rgba(255,255,255,.22); }
.jtile-name { font-size: 17px; line-height: 1.2; }
.jtile-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.jtile-foot .meta { color: rgba(255,255,255,.82) !important; text-align: right; font-size: 12px; }
.donut { width: 72px; height: 72px; flex: none; }
.donut .track { fill: none; stroke: rgba(255,255,255,.22); stroke-width: 7; }
.donut .val { fill: none; stroke: #fff; stroke-width: 7; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(255,255,255,.6)); }
.donut text { fill: #fff; font-size: 14px; font-weight: 800; }
.donut text.sub { font-size: 8px; font-weight: 500; opacity: .8; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 60px; }
.bars span { width: 10px; background: rgba(255,255,255,.85); border-radius: 4px 4px 2px 2px; }

/* team + activity */
body.glass .tm { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-left-width: 4px; border-radius: 16px; color: var(--g-txt); }
body.glass .tm-ok { border-left-color: #34d399; }
body.glass .tm-ok .tm-status { color: #7af0c1; }
body.glass .tm-warn { border-left-color: #fbbf24; }
body.glass .tm-warn .tm-status { color: #fdd46a; }
body.glass .tm-bad { border-left-color: #ff6b6b; background: rgba(255,90,90,.1); }
body.glass .tm-bad .tm-status { color: #ffaaaa; }
body.glass .tm-done { border-left-color: rgba(255,255,255,.35); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #3f6fe0, #8456ff); box-shadow: 0 0 0 2px rgba(255,255,255,.15); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.glass .ev-ico { background: rgba(255,255,255,.1); color: #cfe0ff; }
body.glass .ev-ok .ev-ico { background: rgba(52,211,153,.18); color: #7af0c1; }
body.glass .ev-warn .ev-ico { background: rgba(251,191,36,.18); color: #fdd46a; }
body.glass .ev-bad .ev-ico { background: rgba(248,113,113,.22); color: #ffaaaa; }
body.glass .ev-bad .ev-body > div:first-child { color: #ffb4b4; }
body.glass .ev-thumbs img { background: rgba(255,255,255,.1); }
body.glass .pulse { background: #4ade80; box-shadow: 0 0 8px #4ade80; }

/* ---------- shared pieces on Feed + Planner ---------- */
body.glass main .card {
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.035));
  border: 1px solid var(--g-brd); border-radius: 22px; color: var(--g-txt);
  backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 24px 48px -24px rgba(0,0,0,.7);
}
body.glass main .btn.primary { background: #fff; color: #10131a; border-color: #fff; }
body.glass main .chips a, body.glass main .chips button { background: rgba(255,255,255,.08); border-color: var(--g-brd); color: #fff;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
body.glass main .chips .on { background: #fff; border-color: #fff; color: #10131a; }
body.glass main label { color: var(--g-mut); }
body.glass main input, body.glass main select, body.glass main textarea { background-color: rgba(255,255,255,.07); border-color: var(--g-brd); color: #fff; }
body.glass main input.job-search { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9d6f2' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E"); }
body.glass main input::placeholder { color: rgba(255,255,255,.45); }
body.glass main select option { background: #fff; color: #10131a; }
body.glass .day-head { color: var(--g-mut); }
body.glass .swatch { box-shadow: 0 0 10px currentColor; }

/* ---------- planner grid ---------- */
body.glass table.plan th, body.glass table.plan td { border-color: rgba(255,255,255,.08); }
body.glass table.plan tr:first-child th { background: rgba(255,255,255,.05); color: var(--g-mut); }
body.glass table.plan tr:first-child th b { color: #fff; }
body.glass table.plan tr > th:first-child, body.glass table.plan tr:first-child th.corner { background: rgba(17,21,32,.94); color: #fff; }
body.glass table.plan td:hover { background: rgba(255,255,255,.06); }
body.glass table.plan .today { background: rgba(127,176,255,.08); }
body.glass table.plan tr:first-child th.today { background: linear-gradient(180deg, #4a78f5, #2753a3); color: #fff; }
.pchip { background-image: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 70%); }
body.glass .pchip { border: 1px solid rgba(255,255,255,.22); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 10px 18px -10px rgba(0,0,0,.9); transition: transform .2s; }
body.glass .pchip:hover { transform: translateY(-2px); }

/* ---------- Home (management) ---------- */
body.glass main .btn.ok { background: linear-gradient(180deg, #3ccf7f, #1f8a4c); border-color: rgba(255,255,255,.2); color: #fff; box-shadow: 0 10px 24px -10px rgba(52,211,153,.7); }
body.glass main .btn.stop { background: linear-gradient(180deg, #ff6b6b, #c0392b); border-color: rgba(255,255,255,.2); color: #fff; box-shadow: 0 10px 24px -10px rgba(255,107,107,.7); }
body.glass main .btn.danger { color: #ffaaaa; border-color: rgba(255,120,120,.35); }
body.glass main .btn.big { border-radius: 16px; }
body.glass .office-links a {
  background: linear-gradient(135deg, rgba(74,120,245,.35), rgba(132,86,255,.22)); border: 1px solid var(--g-brd); border-radius: 20px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 20px 40px -24px rgba(0,0,0,.8);
  transition: transform .25s;
}
body.glass .office-links a:nth-child(2) { background: linear-gradient(135deg, rgba(232,62,104,.35), rgba(132,86,255,.2)); }
body.glass .office-links a:hover { transform: translateY(-3px); }
body.glass main .clock-card {
  background: radial-gradient(80% 120% at 100% 0%, rgba(74,120,245,.45), transparent 60%), linear-gradient(135deg, rgba(39,83,163,.45), rgba(20,26,46,.6));
}
body.glass main .clock-card label { color: #fff; }
body.glass main .quick button {
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.035)); border: 1px solid var(--g-brd); border-radius: 18px; color: #fff;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 16px 32px -20px rgba(0,0,0,.7);
  transition: transform .25s, background .25s;
}
body.glass main .quick button:hover { transform: translateY(-3px); background: rgba(255,255,255,.14); }
body.glass main .quick button svg { color: #9cc0ff; filter: drop-shadow(0 0 6px rgba(127,176,255,.6)); }
body.glass main .stat {
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.035)); border: 1px solid var(--g-brd); border-radius: 18px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}
body.glass main .stat b { color: #fff; }
body.glass main .stat span { color: var(--g-mut); }
body.glass main .task { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: var(--g-txt); }
body.glass main .task.late { background: rgba(255,90,90,.1); }
body.glass main .task.urgent { border-left-color: #ff6b6b; }
body.glass main .task.done .task-title { color: var(--g-mut); }
body.glass main .card[style*="border-left"] { border-left-width: 4px; }
@media (prefers-reduced-motion: reduce) { body.glass .office-links a, body.glass main .quick button { transition: none; transform: none !important; } }

/* ---------- every other page (jobs, time, stock, more…) ---------- */
body.glass main .btn.ghost { background: transparent; border-color: transparent; }
body.glass main label.check { color: var(--g-txt); }
body.glass main h3 { color: #fff; }
body.glass table.t th { color: var(--g-mut); }
body.glass table.t tr.total td { color: #fff; }
body.glass .badge.complete, body.glass .badge.idle { background: rgba(255,255,255,.12); color: #d5dcea; }
body.glass .badge.invoiced { background: rgba(167,139,250,.22); color: #cdbdff; }
body.glass .badge.fixed { background: rgba(52,211,153,.18); color: #7af0c1; }
body.glass .badge.open { background: rgba(251,191,36,.18); color: #fdd46a; }
body.glass .badge.declined, body.glass .badge.incident { background: rgba(248,113,113,.2); color: #ffaaaa; }
body.glass .photos img, body.glass .thumb { background: rgba(255,255,255,.08); }
body.glass main .chk label { color: var(--g-txt); }
body.glass main .chk .del { color: rgba(255,255,255,.35); }
body.glass main .card.order.late, body.glass main .task.late { border-left-color: #ff6b6b; }
body.glass main input[type=checkbox] { accent-color: #4a78f5; }
body.glass main input[type=date], body.glass main input[type=time] { color-scheme: dark; }

/* ---------- pop-up forms: dark glass to match (management only) ---------- */
body.glass .modal-bg { background: rgba(4,7,13,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
body.glass .modal {
  color: var(--g-txt);
  background: radial-gradient(90% 60% at 100% 0%, rgba(74,120,245,.22), transparent 60%), linear-gradient(180deg, rgba(32,38,58,.92), rgba(15,19,31,.94));
  border: 1px solid var(--g-brd);
  backdrop-filter: blur(26px) saturate(150%); -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 40px 80px -20px rgba(0,0,0,.8);
}
@media (min-width: 640px) { body.glass .modal { border-radius: 24px; } }
body.glass .modal h2 { color: #fff; }
body.glass .modal label { color: var(--g-mut); }
body.glass .modal label.check { color: var(--g-txt); }
body.glass .modal input, body.glass .modal select, body.glass .modal textarea { background-color: rgba(255,255,255,.07); border-color: var(--g-brd); color: #fff; }
body.glass .modal input:focus, body.glass .modal select:focus, body.glass .modal textarea:focus { outline: 2px solid rgba(127,176,255,.6); outline-offset: 1px; border-color: transparent; }
body.glass .modal input::placeholder, body.glass .modal textarea::placeholder { color: rgba(255,255,255,.42); }
body.glass .modal select option, body.glass .modal select optgroup { background: #fff; color: #10131a; }
body.glass .modal input[type=date], body.glass .modal input[type=time] { color-scheme: dark; }
body.glass .modal input[type=checkbox] { accent-color: #4a78f5; }
body.glass .modal input[type=file] { color: var(--g-mut); }
body.glass .modal input.job-search { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9d6f2' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E"); }
body.glass .modal .btn { border-radius: 12px; }
body.glass .modal .btn.primary { background: linear-gradient(180deg, #5a86f7, #2753a3); border-color: rgba(255,255,255,.2); color: #fff; box-shadow: 0 10px 24px -10px rgba(74,120,245,.8); }
body.glass .modal .btn.ok { background: linear-gradient(180deg, #3ccf7f, #1f8a4c); border-color: rgba(255,255,255,.2); color: #fff; box-shadow: 0 10px 24px -10px rgba(52,211,153,.7); }
body.glass .modal .btn.stop { background: linear-gradient(180deg, #ff6b6b, #c0392b); border-color: rgba(255,255,255,.2); color: #fff; }
body.glass .modal .btn.danger { color: #ffaaaa; border-color: rgba(255,120,120,.35); }
body.glass .modal .btn.ghost { background: transparent; border-color: transparent; }
body.glass .modal .photos img, body.glass .modal .thumb, body.glass .modal .viewer img { background: rgba(255,255,255,.08); }

/* ---------- printed job reports stay black on white ---------- */
body.glass #print-root { --ink: #000; --muted: #555; --line: #bbb; color: #000; }
@media print {
  body.glass { background: #fff !important; --ink: #000; --muted: #555; --line: #bbb; }
  html:has(body.glass) { background: #fff; }
  body.glass #print-root h1, body.glass #print-root h2 { color: #000; }
  body.glass #print-root table.t th { color: #555; }
}

body.glass .form-heading { color: var(--g-mut); }
