/* CrewDesk-specific styles */
:root { --accent: #0d9488; --accent-600: #0f766e; --accent-50: #f0fdfa; --accent-100: #ccfbf1; }
.mobile-city { display: none; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--text-3); }

/* Booking page */
.book-hero { display: flex; align-items: center; gap: 16px; padding: 22px 24px; background: linear-gradient(120deg, #0f766e, #0d9488 55%, #14b8a6); color: #fff; border: 0; flex-wrap: wrap; }
.book-hero h2 { font-size: 22px; }
.book-hero .trust { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; opacity: .92; margin-top: 6px; }
.book-hero .tenant-logo { width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.book-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.step { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.step:last-child { border-bottom: 0; }
.step-t { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 12px; }
.step-n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; display: grid; place-items: center; }
.svc-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.svc { border: 1.5px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; background: #fff; text-align: left; display: flex; flex-direction: column; gap: 6px; transition: border-color .12s, box-shadow .12s; }
.svc:hover { border-color: var(--border-strong); }
.svc.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-50); }
.svc .s-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.svc b { font-size: 13.5px; }
.svc span { font-size: 12px; color: var(--text-3); line-height: 1.35; }
.svc .from { color: var(--text-2); font-weight: 600; }
.opt { height: 36px; padding: 0 14px; border-radius: 9px; border: 1.5px solid var(--border); background: #fff; font-weight: 550; font-size: 13px; cursor: pointer; }
.opt:hover { border-color: var(--border-strong); }
.opt.sel { border-color: var(--accent); background: var(--accent-50); color: var(--accent-600); }
.opt:disabled { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.opt .o-sub { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-3); }
.date-opt { height: auto; padding: 7px 12px; text-align: center; min-width: 64px; }
.addon { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.addon input { accent-color: var(--accent); width: 16px; height: 16px; }
.addon .a-p { margin-left: auto; font-weight: 600; font-size: 13px; color: var(--text-2); }
.summary { position: sticky; top: 90px; }
.sum-line { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; gap: 10px; }
.sum-line.total { font-size: 18px; font-weight: 700; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }
.price-pop { animation: flash .6s ease; }

/* Dispatch board */
.board-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.board { min-width: 980px; }
.board-head, .board-row { display: grid; grid-template-columns: 190px 1fr; }
.board-head { border-bottom: 1px solid var(--border); background: var(--surface-2); }
.board-hours { position: relative; height: 32px; }
.board-hours span { position: absolute; top: 9px; font-size: 11px; color: var(--text-3); transform: translateX(-50%); }
.board-row { border-bottom: 1px solid var(--border); min-height: 66px; }
.board-row:last-child { border-bottom: 0; }
.tech-cell { padding: 10px 14px; display: flex; align-items: center; gap: 10px; border-right: 1px solid var(--border); background: var(--surface); position: sticky; left: 0; z-index: 3; }
.tech-cell .t-name { font-weight: 600; font-size: 13px; line-height: 1.25; }
.tech-cell .t-sub { font-size: 11.5px; color: var(--text-3); }
.lane { position: relative; background-image: linear-gradient(to right, #f1f3f6 1px, transparent 1px); background-size: calc(100% / 12) 100%; }
.lane.drop-hover { background-color: var(--accent-50); }
.job-block { position: absolute; top: 8px; bottom: 8px; border-radius: 8px; padding: 6px 8px; font-size: 11.5px; overflow: hidden; cursor: grab; border-left: 3px solid; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; justify-content: center; line-height: 1.25; transition: box-shadow .12s, transform .12s; user-select: none; }
.job-block:hover { box-shadow: var(--shadow); transform: translateY(-1px); z-index: 2; }
.job-block b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-block span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.job-block.done { opacity: .6; }
.job-block.live { box-shadow: 0 0 0 2px currentColor; }
.job-block.live::after { content: "LIVE"; position: absolute; right: 6px; top: 6px; font-size: 9px; font-weight: 700; background: currentColor; color: #fff; padding: 1px 5px; border-radius: 4px; }
.job-block.live::after { color: #fff; background: #0f172a; }
.job-block.flash { animation: blockIn 1.2s ease; }
@keyframes blockIn { 0% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(13,148,136,.35); } }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; z-index: 4; pointer-events: none; }
.now-line::before { content: ""; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }
.tray { display: flex; gap: 10px; overflow-x: auto; padding: 14px 18px; }
.tray-card { min-width: 220px; border: 1.5px dashed #f59e0b; background: #fffbeb; border-radius: 10px; padding: 10px 12px; cursor: grab; font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; }
.tray-card:hover { border-style: solid; }
.tray-card.is-new { animation: blockIn 1.4s ease 2; }
.week { display: grid; grid-template-columns: 190px repeat(7, minmax(110px, 1fr)); min-width: 980px; }
.week > div { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 8px; min-height: 70px; }
.week .wh { background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--text-2); min-height: 0; text-align: center; }
.week .wh.today { color: var(--accent-600); }
.pill { display: block; font-size: 11px; padding: 3px 6px; border-radius: 6px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-weight: 550; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }

/* Pipeline */
.pipe { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); }
.pipe > div { padding: 16px 18px; position: relative; }
.pipe > div + div { border-left: 1px solid var(--border); }
.pipe .p-l { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.pipe .p-v { font-size: 22px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pipe .p-s { font-size: 12px; color: var(--text-3); }
.line-row { display: grid; grid-template-columns: minmax(0,1fr) 70px 110px 32px; gap: 8px; align-items: center; }

/* Invoice */
.invoice { background: #fff; color: #0f172a; padding: 34px 38px; font-size: 13px; }
.invoice h2 { font-size: 26px; letter-spacing: -0.02em; }
.inv-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.inv-table { width: 100%; border-collapse: collapse; margin-top: 22px; }
.inv-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; border-bottom: 2px solid #0f172a; padding: 8px 6px; }
.inv-table td { padding: 10px 6px; border-bottom: 1px solid #e5e7eb; }
.inv-table .r { text-align: right; }
.inv-tot { margin-left: auto; width: 260px; margin-top: 14px; }
.inv-tot div { display: flex; justify-content: space-between; padding: 4px 0; }
.inv-tot .grand { font-size: 17px; font-weight: 700; border-top: 2px solid #0f172a; margin-top: 6px; padding-top: 8px; }
.paid-stamp { border: 3px solid #059669; color: #059669; font-weight: 800; padding: 4px 12px; border-radius: 8px; transform: rotate(-8deg); display: inline-block; letter-spacing: .1em; }
.modal.wide { width: 820px; }
#printArea { display: none; }
@media print {
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing #printArea { display: block !important; }
  body.printing { background: #fff; }
  .invoice { padding: 0; }
}

/* WhatsApp preview */
.wa { background: #efeae2; border-radius: 0; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.wa-head { background: #075e54; color: #fff; display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.wa-head .avatar { background: rgba(255,255,255,.2); color: #fff; }
.wa-body { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 14px 14px; }
.bubble { max-width: 86%; background: #fff; border-radius: 10px; padding: 8px 10px 6px; font-size: 13px; line-height: 1.4; box-shadow: 0 1px 1px rgba(0,0,0,.08); align-self: flex-start; white-space: pre-line; animation: toastIn .3s ease; }
.bubble.out { background: #d9fdd3; align-self: flex-end; }
.bubble .b-meta { font-size: 10.5px; color: #667781; text-align: right; margin-top: 2px; }
.bubble .b-btns { display: flex; flex-direction: column; margin: 8px -10px -6px; border-top: 1px solid #eef0f1; }
.bubble .b-btns span { text-align: center; color: #027eb5; font-weight: 550; padding: 7px; font-size: 13px; }
.bubble .b-btns span + span { border-top: 1px solid #eef0f1; }
.wa-day { align-self: center; background: #fff; font-size: 11px; padding: 3px 10px; border-radius: 6px; color: #54656f; }
.tpl { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: flex-start; }
.tpl:last-child { border-bottom: 0; }
.tpl:hover { background: var(--surface-2); }
.tpl.sel { background: var(--accent-50); }
.tpl .t-main { flex: 1; min-width: 0; }
.tpl .t-title { font-weight: 600; font-size: 13.5px; }
.tpl .t-sub { font-size: 12px; color: var(--text-3); }
.switch { width: 34px; height: 20px; border-radius: 999px; background: #cbd5e1; position: relative; border: 0; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(14px); }

/* Tech app */
.tech-hero { background: linear-gradient(160deg, #0f766e, #0d9488); color: #fff; padding: 6px 18px 18px; }
.tech-hero h2 { font-size: 19px; }
.tech-job { display: flex; gap: 12px; cursor: pointer; align-items: flex-start; }
.tech-job .tj-time { width: 48px; flex-shrink: 0; font-weight: 700; font-size: 13px; }
.tech-job .tj-time span { display: block; font-weight: 500; font-size: 11px; color: var(--text-3); }
.tech-job .tj-main { flex: 1; min-width: 0; border-left: 3px solid; padding-left: 10px; }
.tech-job.done { opacity: .55; }
.check { display: flex; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid #f0f1f4; font-size: 13.5px; cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check .cb { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-strong); display: grid; place-items: center; flex-shrink: 0; color: #fff; transition: all .12s; }
.check.on .cb { background: var(--accent); border-color: var(--accent); }
.check.on span { color: var(--text-3); text-decoration: line-through; }
.photo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.success-big { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 26px 20px 8px; }
.success-big .s-ring { width: 64px; height: 64px; border-radius: 50%; background: var(--green-50); color: var(--green); display: grid; place-items: center; animation: pop .4s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* Reports */
.hbar { display: grid; grid-template-columns: 150px 1fr 90px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.hbar .track { height: 10px; background: var(--slate-50); border-radius: 999px; overflow: hidden; }
.hbar .track span { display: block; height: 100%; border-radius: 999px; transition: width .5s; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.donut-legend div { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }

@media (max-width: 1180px) {
  .book-grid { grid-template-columns: minmax(0,1fr); }
  .summary { position: static; }
}
@media (max-width: 900px) {
  .mobile-city { display: block; height: 30px; font-size: 12.5px; }
  .top-new { display: none; }
  .svc-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pipe { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pipe > div:nth-child(3) { border-left: 0; }
  .pipe > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .board-head, .board-row { grid-template-columns: 140px 1fr; }
  .week { grid-template-columns: 140px repeat(7, minmax(100px, 1fr)); }
  .tech-cell .avatar { display: none; }
}
@media (max-width: 560px) {
  .svc-grid { grid-template-columns: minmax(0,1fr); }
  .hbar { grid-template-columns: 96px 1fr 76px; font-size: 12px; }
  .invoice { padding: 20px 16px; }
  .line-row { grid-template-columns: minmax(0,1fr) 54px 84px 28px; }
  .step { padding: 16px 14px; }
}
