/* AutoClient: first dashboard styles.
   Tokens first, then base, then layout, then components. One accent (hi-vis yellow) for the
   main action; green, blue and red are reserved for status. */

@font-face { font-family: "Schibsted Grotesk"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin-700-normal.woff2") format("woff2"); }


:root{--paper:#f4f3fb;--surface:#fff;--line:#e6e4f2;--ink:#1b1830;--muted:#6b6884;--accent:#6c4cf1;--accent-2:#8f78ff;--accent-tint:#efeaff;
--good:#1f8a5b;--good-tint:#e2f4ea;--active:#2563eb;--active-tint:#e3edff;--bad:#d1432f;--bad-tint:#fde8e4;--warn:#b7791f;--warn-tint:#fcf0d6;--plan:#8b88a3;--plan-tint:#eeedf6;
--radius:14px;--font:"Schibsted Grotesk",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;--sidebar:16rem}
*,*::before,*::after{box-sizing:border-box}
body{margin:0;background:var(--paper);color:var(--ink);font:400 .94rem/1.45 var(--font)}
h1,h2,h3,p,ul{margin:0;padding:0}ul{list-style:none}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.skip-link{position:absolute;left:-99rem}.skip-link:focus{left:1rem;top:1rem;background:#fff;padding:.5rem;z-index:9}
.shell{display:grid;grid-template-columns:var(--sidebar) 1fr;min-height:100vh}
.sidebar{background:#fff;border-right:1px solid var(--line);padding:1.1rem .9rem;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;overflow:auto}
.brand{display:flex;align-items:center;gap:.6rem;padding:.2rem .5rem 1rem;font-weight:700;font-size:1.1rem}
.brand small{color:var(--accent);font-weight:700}
.brand-mark{width:1.7rem;height:1.7rem;border-radius:.55rem;background:linear-gradient(135deg,var(--accent),var(--accent-2))}
.nav-toggle summary{list-style:none;display:none;cursor:pointer}
.nav-group{font-size:.7rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:1rem .6rem .3rem;font-weight:600}
.nav-link{display:flex;align-items:center;gap:.65rem;padding:.5rem .6rem;border-radius:.6rem;color:var(--ink);text-decoration:none;font-weight:500}
.nav-link:hover{background:var(--paper)}.nav-link span{flex:1}
.nav-link[aria-current=page]{background:var(--accent-tint);color:var(--accent);font-weight:600}
.nav-link.is-planned{color:#58556f}.nav-list-end{margin-top:1rem;border-top:1px solid var(--line);padding-top:.5rem}
.badge{background:var(--accent);color:#fff;border-radius:99px;font-size:.7rem;padding:.05rem .45rem;font-weight:600}
.business{margin-top:auto;display:flex;gap:.6rem;align-items:center;padding:.8rem .5rem 0;border-top:1px solid var(--line)}
.business-avatar{width:2.1rem;height:2.1rem;border-radius:50%;background:var(--accent-tint);color:var(--accent);display:grid;place-items:center;font-weight:700}
.business-text{display:flex;flex-direction:column;min-width:0}.business-name{font-weight:600;font-size:.82rem;line-height:1.2}.business-role{font-size:.75rem;color:var(--muted)}
.main{padding:1.4rem 1.8rem 3rem;min-width:0;display:flex;flex-direction:column;gap:1.1rem}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap}
.topbar h1{font-size:1.5rem;line-height:1.2}.sub{color:var(--muted)}
.topbar-actions{display:flex;gap:.6rem;align-items:center}
.search{display:flex;align-items:center;gap:.4rem;background:#fff;border:1px solid var(--line);border-radius:.7rem;padding:0 .7rem;color:var(--muted)}
.search input{border:0;outline:0;padding:.55rem 0;font:inherit;width:15rem;background:none;color:var(--ink)}
.icon-btn{position:relative;background:#fff;border:1px solid var(--line);border-radius:.7rem;width:2.4rem;height:2.4rem;display:grid;place-items:center;color:var(--ink);cursor:pointer}
.icon-btn .dot{position:absolute;top:.5rem;right:.55rem;width:.45rem;height:.45rem;background:var(--bad);border-radius:50%}
.btn{display:inline-flex;align-items:center;gap:.4rem;background:var(--accent);color:#fff;border:0;border-radius:.7rem;padding:.55rem .95rem;font:600 .9rem var(--font);cursor:pointer}
.btn:hover{background:#5a3de0}.btn.ghost{background:#fff;color:var(--ink);border:1px solid var(--line)}
.btn svg{width:1rem;height:1rem}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.demo-note{font-size:.8rem;color:var(--muted);background:var(--warn-tint);border-radius:.6rem;padding:.35rem .7rem;align-self:flex-start}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:1.1rem;box-shadow:0 1px 2px rgba(40,30,90,.04)}
.card-head{display:flex;justify-content:space-between;align-items:center;gap:.8rem;margin-bottom:.9rem}
.card-head h2{font-size:1rem}.card h3{font-size:.82rem;color:var(--muted);margin:1.1rem 0 .4rem;text-transform:uppercase;letter-spacing:.05em}
.chip{font-size:.75rem;font-weight:600;background:var(--plan-tint);color:var(--muted);padding:.2rem .6rem;border-radius:99px;white-space:nowrap}
.chip.live{background:var(--good-tint);color:var(--good)}.chip.bad{background:var(--bad-tint);color:var(--bad)}
.grid{display:grid;gap:1.1rem}.g-2-1{grid-template-columns:1.6fr 1fr}.g-3{grid-template-columns:repeat(3,1fr)}
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:1.1rem}
.kpi{position:relative;overflow:hidden}.kpi-label{color:var(--muted);font-size:.82rem;font-weight:500}
.kpi-value{font-size:1.7rem;font-weight:700;margin:.2rem 0;letter-spacing:-.01em}
.trend{font-size:.78rem;color:var(--muted)}.trend.up{color:var(--good)}.trend.down{color:var(--bad)}
.spark{position:absolute;right:1rem;top:1.1rem;width:4.4rem;height:1.6rem;fill:#d9d1ff}.spark rect:last-child{fill:var(--accent)}
.kpi-hero{background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#fff;border:0}
.kpi-hero .kpi-label,.kpi-hero .trend{color:#ece7ff}.kpi-hero .trend.up,.kpi-hero .trend.down{color:#fff}
.kpi-hero .spark{fill:rgba(255,255,255,.35)}.kpi-hero .spark rect:last-child{fill:#fff}
.meter{height:.5rem;background:rgba(255,255,255,.3);border-radius:9px;margin:.6rem 0}.meter i{display:block;height:100%;background:#fff;border-radius:9px}
.bars{display:flex;align-items:flex-end;gap:.5rem;height:13rem}
.bar-col{flex:1;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:.25rem}
.bar{display:block;width:100%;background:#d9d1ff;border-radius:.5rem .5rem .2rem .2rem;min-height:4px}.bar.is-now{background:var(--accent)}
.bar-val{font-size:.7rem;color:var(--muted)}.bar-x{font-size:.72rem;color:var(--muted)}
.rows li{display:flex;justify-content:space-between;align-items:center;gap:.8rem;padding:.55rem 0;border-top:1px solid var(--line)}
.rows li:first-child{border-top:0}.rows li>div{display:flex;flex-direction:column;min-width:0}.rows .r{align-items:flex-end}
.rows.tight li{padding:.35rem 0}.rows.tight li span{font-weight:600}
.muted{color:var(--muted);font-size:.78rem}
.pill{display:inline-block;font-size:.72rem;font-weight:600;padding:.12rem .55rem;border-radius:99px;background:var(--plan-tint);color:var(--muted);text-transform:capitalize}
.pill.good{background:var(--good-tint);color:var(--good)}.pill.active{background:var(--active-tint);color:var(--active)}
.pill.bad{background:var(--bad-tint);color:var(--bad)}.pill.warn{background:var(--warn-tint);color:var(--warn)}
.funnel{display:grid;grid-template-columns:repeat(4,1fr);gap:.4rem;margin-top:.8rem}
.funnel div{background:var(--paper);border-radius:.6rem;padding:.4rem .6rem;display:flex;flex-direction:column;font-size:.75rem;color:var(--muted)}.funnel b{font-size:1.05rem;color:var(--ink)}
.dispatch{overflow-x:auto}.ruler,.lane{display:grid;grid-template-columns:9.5rem minmax(34rem,1fr);gap:.6rem;align-items:stretch}
.lane{margin-top:.5rem}.who{display:flex;flex-direction:column;justify-content:center}.who small{color:var(--muted)}
.track{position:relative;background:var(--paper);border-radius:.7rem;height:3.4rem}
.ruler-track{background:none;height:auto;display:flex;justify-content:space-between;font-size:.7rem;color:var(--muted)}
.now{position:absolute;top:-.3rem;bottom:-.3rem;width:2px;background:var(--bad);z-index:2}
.job{position:absolute;top:.3rem;bottom:.3rem;border-radius:.55rem;padding:.2rem .5rem;overflow:hidden;font-size:.75rem;line-height:1.2;border-left:4px solid var(--plan);background:var(--plan-tint)}
.job b{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.job span{color:var(--muted)}
.job.done{background:var(--good-tint);border-color:var(--good)}.job.active{background:var(--active-tint);border-color:var(--active)}
.job.scheduled{background:var(--accent-tint);border-color:var(--accent)}
.map{width:100%;height:13rem;border-radius:.8rem;display:block}.m-land{fill:#ece9fa}.m-water{fill:#cfe0f7}
.m-road{stroke:#fff;stroke-width:2.2;fill:none}.m-pin{fill:var(--accent);stroke:#fff;stroke-width:1.2}.map text{font-size:4px;fill:var(--ink);font-weight:600}
.stack{display:flex;height:.7rem;border-radius:9px;overflow:hidden;gap:2px}
.stack i,.dot{background:var(--plan)}.stack .active,.dot.active{background:var(--active)}.stack .good,.dot.good{background:var(--good)}
.stack .warn,.dot.warn{background:var(--warn)}.stack .bad,.dot.bad{background:var(--bad)}.stack .plan,.dot.plan{background:var(--accent)}
i.dot{display:inline-block;width:.55rem;height:.55rem;border-radius:50%;flex:none}
.legend{display:grid;grid-template-columns:1fr 1fr;gap:.3rem .8rem;margin-top:.7rem;font-size:.82rem}.legend li{display:flex;align-items:center;gap:.4rem}.legend b{margin-left:auto}
.feed li{display:flex;gap:.6rem;padding:.4rem 0;align-items:flex-start;font-size:.84rem}.feed i.dot{margin-top:.4rem}
.feed li>div{flex:1;display:flex;flex-direction:column}.feed time{font-size:.72rem;color:var(--muted)}
.tabs{display:flex;background:var(--paper);border-radius:.7rem;padding:.2rem}.tab{padding:.3rem .9rem;border-radius:.55rem;font-weight:500;font-size:.85rem;color:var(--muted)}
.tab.is-on{background:#fff;color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.table-wrap{overflow-x:auto}.table{width:100%;border-collapse:collapse;min-width:42rem}
.table th{text-align:left;font-size:.75rem;color:var(--muted);font-weight:600;padding:.6rem .5rem;background:var(--paper)}
.table th:first-child{border-radius:.6rem 0 0 .6rem}.table th:last-child{border-radius:0 .6rem .6rem 0}
.table td{padding:.7rem .5rem;border-bottom:1px solid var(--line)}.table .r{text-align:right}
.table td:nth-child(2){display:flex;align-items:center;gap:.6rem}.who-cell{display:flex;flex-direction:column}.who-cell small{color:var(--muted)}
.avatar{width:2rem;height:2rem;border-radius:50%;background:var(--accent-tint);color:var(--accent);display:grid;place-items:center;font-weight:700;flex:none}
@media (max-width:75rem){.kpis{grid-template-columns:repeat(2,1fr)}.g-3{grid-template-columns:1fr 1fr}}
@media (max-width:52rem){.shell{grid-template-columns:1fr}.sidebar{position:static;height:auto}.nav-toggle summary{display:block;position:absolute;right:1rem;top:1.1rem}
.sidebar{position:relative}.g-2-1,.g-3{grid-template-columns:1fr}.main{padding:1rem}.search input{width:9rem}.business{display:none}}
@media (prefers-reduced-motion:no-preference){.btn,.nav-link{transition:background .15s}}

/* Forms, login, flash messages, empty states */
.form{display:flex;flex-direction:column;gap:.9rem}.form label{display:flex;flex-direction:column;gap:.3rem;font-weight:600;font-size:.85rem}
.form input,.form textarea{font:inherit;padding:.6rem .7rem;border:1px solid var(--line);border-radius:.7rem;background:#fff;color:var(--ink)}
.form input:focus,.form textarea:focus{outline:2px solid var(--accent);border-color:transparent}.form small{font-weight:400;color:var(--muted)}
.two{display:grid;grid-template-columns:1fr 1fr;gap:.9rem}.form-card{max-width:40rem}
.flash{background:var(--accent-tint);color:var(--accent);padding:.55rem .8rem;border-radius:.7rem;font-weight:500}
.empty{text-align:center;padding:2.5rem 1rem}a{color:var(--accent)}.btn{text-decoration:none}a.btn{color:#fff}
.link-btn{background:none;border:0;color:var(--muted);font:inherit;font-size:.78rem;cursor:pointer;padding:0;text-decoration:underline}
.business form{margin-left:auto}.search form,form.search{margin:0}
.auth-page{display:grid;place-items:center;min-height:100vh;padding:1rem}.auth-card{width:min(24rem,100%);display:flex;flex-direction:column;gap:1rem}
.auth-card h1{font-size:1.4rem}@media (max-width:52rem){.two{grid-template-columns:1fr}}

select{font:inherit;padding:.6rem .7rem;border:1px solid var(--line);border-radius:.7rem;background:#fff;color:var(--ink)}
.tab{text-decoration:none}a.plain{color:inherit;text-decoration:none}a.plain:hover{color:var(--accent)}
.facts{display:grid;grid-template-columns:5rem 1fr;gap:.5rem .8rem;margin:0 0 1rem}.facts dt{color:var(--muted);font-size:.82rem}.facts dd{margin:0;overflow-wrap:anywhere}
.link-btn.danger{color:var(--bad)}.on-hero{color:#fff}

/* Welcome / login page: brand panel + form panel */
.auth-page{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);place-items:stretch;min-height:100vh;padding:0}
.auth-hero{background:linear-gradient(150deg,#4b2fd0,#6c4cf1 55%,#8f78ff);color:#fff;padding:3rem clamp(1.5rem,5vw,4.5rem);display:flex;flex-direction:column;justify-content:center;gap:1.2rem}
.brand-lg{padding:0 0 1.5rem;font-size:1.5rem}.auth-hero .brand small{color:#d9d1ff}
.auth-hero h2{font-size:clamp(1.8rem,3.4vw,2.7rem);line-height:1.12;max-width:20ch;letter-spacing:-.02em}
.hero-sub{color:#e4defe;max-width:40ch;font-size:1.02rem}
.hero-list{display:grid;gap:.7rem;margin-top:.8rem;max-width:30rem}
.hero-list li{display:flex;gap:.8rem;align-items:center;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.2);border-radius:.9rem;padding:.7rem .9rem}
.hero-list svg{flex:none;width:1.4rem;height:1.4rem}.hero-list div{display:flex;flex-direction:column;line-height:1.3}.hero-list span{color:#e4defe;font-size:.84rem}
.auth-panel{display:grid;place-items:center;padding:2rem 1.2rem;background:var(--paper)}
.auth-card{width:min(26rem,100%);background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:1.6rem;display:flex;flex-direction:column;gap:.9rem;box-shadow:0 8px 30px rgba(60,40,140,.08)}
.auth-card h1{font-size:1.5rem;line-height:1.2}
.auth-tabs{display:flex;background:var(--paper);border-radius:.8rem;padding:.2rem}
.auth-tab{flex:1;text-align:center;padding:.45rem;border-radius:.6rem;font-weight:600;font-size:.88rem;color:var(--muted);text-decoration:none}
.auth-tab.is-on{background:#fff;color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.1)}
.btn-wide{justify-content:center;width:100%;padding:.7rem}
@media (max-width:52rem){.auth-page{grid-template-columns:1fr}.auth-hero{padding:1.6rem 1.2rem;gap:.8rem}.hero-list{display:none}.auth-hero h2{font-size:1.5rem}.brand-lg{padding-bottom:.4rem}}

/* Table cells: keep real table layout so row borders line up */
.table td:nth-child(n){display:table-cell}
.table .avatar{display:inline-grid;vertical-align:middle;margin-right:.6rem}
.table .who-cell{display:inline-flex;flex-direction:column;vertical-align:middle}

/* Schedule board */
.sched .ruler,.sched .lane{grid-template-columns:9.5rem minmax(46rem,1fr)}
.sched .job{bottom:auto;height:2.6rem;text-decoration:none;color:inherit}.sched .job:hover{filter:brightness(.97)}
.lane-note{grid-column:2;font-size:.78rem;color:var(--muted);margin:-.2rem 0 0}.sched-note{margin-top:.8rem}
.daynav{display:flex;gap:.5rem;flex-wrap:wrap}.btn.small{padding:.3rem .7rem;font-size:.8rem}
.inline{display:flex;gap:.4rem;align-items:center;margin:0}.inline select{padding:.3rem .5rem;font-size:.8rem;max-width:9rem}

/* Schedule board: stop the red "now" line from adding a scroll bar */
.sched{overflow-y:hidden;padding-block:.4rem}

/* Quotes */
.g-1-2{grid-template-columns:1fr 2fr;align-items:start}.actions{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center;margin-top:.4rem}.actions form{margin:0}
.totals{margin:1rem 0 0 auto;width:min(18rem,100%)}.totals div{display:flex;justify-content:space-between;padding:.3rem 0}
.totals .grand{font-weight:700;font-size:1.1rem;border-top:1px solid var(--line);margin-top:.2rem;padding-top:.5rem}
.lines input{width:100%;font:inherit;padding:.45rem .6rem;border:1px solid var(--line);border-radius:.6rem;background:#fff;color:var(--ink)}
.lines td{padding:.35rem .4rem}.lines th:nth-child(2),.lines td:nth-child(2){width:6rem}.lines th:nth-child(3),.lines td:nth-child(3){width:9rem}
.form label.check{flex-direction:row;align-items:center;gap:.5rem;font-weight:500}.form label.check input{width:auto}
@media (max-width:75rem){.g-1-2{grid-template-columns:1fr}}

/* Invoices */
.stack-col{display:flex;flex-direction:column;gap:1.1rem}

/* Dashboard board: no stray scroll bar from the red now line */
.dispatch{overflow-y:hidden;padding-block:.3rem}

/* Wider label column so "Account holder" and "Account number" stay on one line */
.facts{grid-template-columns:7.5rem 1fr}


/* Weekly schedule calendar */
.schedule-header {
    flex-wrap: wrap;
    gap: 1rem;
}

.schedule-views {
    margin-left: auto;
}

.week-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .65rem;
    align-items: stretch;
}

.week-day {
    min-width: 0;
    min-height: 15rem;
    padding: .65rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: .8rem;
}

.week-day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .4rem;
    padding-bottom: .65rem;
    border-bottom: 1px solid var(--line);
}

.week-day-head div {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.week-day-head div span {
    color: var(--muted);
    font-size: .75rem;
}

.week-day-jobs {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding-top: .65rem;
}

.week-job {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .55rem;
    border-radius: .55rem;
    border-left: 3px solid var(--accent);
    background: var(--accent-tint);
    color: var(--ink);
    text-decoration: none;
    font-size: .75rem;
    overflow-wrap: anywhere;
}

.week-job.done {
    background: var(--good-tint);
    border-color: var(--good);
}

.week-job.active {
    background: var(--active-tint);
    border-color: var(--active);
}

.week-job b {
    font-size: .8rem;
}

.week-job span,
.week-job small {
    color: var(--muted);
}

.week-empty {
    color: var(--muted);
    font-size: .75rem;
    text-align: center;
    padding: 1rem .2rem;
}

@media (max-width: 65rem) {
    .week-calendar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 35rem) {
    .week-calendar {
        grid-template-columns: 1fr;
    }

    .schedule-views {
        margin-left: 0;
    }
}

/* Today page */
.job-row{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;padding:.7rem 0;border-top:1px solid var(--line)}
.job-row:first-child{border-top:0}.job-main{display:flex;flex-direction:column;gap:.15rem;min-width:0}
.job-links{font-size:.8rem;display:flex;gap:.6rem;flex-wrap:wrap}.job-side{display:flex;flex-direction:column;align-items:flex-end;gap:.35rem;flex:none}
.job-time{font-weight:600;font-size:.85rem}.job-actions{display:flex;gap:.4rem}.job-actions form{margin:0}
.group-title{display:flex;justify-content:space-between;align-items:baseline;margin:.9rem 0 .1rem;font-weight:700}.group-title:first-of-type{margin-top:0}
.group-title small{font-weight:500;color:var(--muted)}.attention{color:var(--bad)}
.chat-list{list-style:none;margin:0;padding:0}.chat-row{display:flex;justify-content:space-between;gap:1rem;padding:.75rem .5rem;border-bottom:1px solid var(--line);color:var(--ink)}
.chat-row.is-unread .chat-last{color:var(--ink);font-weight:600}.chat-main{display:flex;flex-direction:column;min-width:0}.chat-last{color:var(--muted);font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-meta{font-size:.78rem;color:var(--muted);white-space:nowrap}
.chat-thread{display:flex;flex-direction:column;gap:.6rem;max-height:60vh;overflow-y:auto;padding:.5rem 0 1rem}.msg{max-width:75%;align-self:flex-start;background:var(--paper);border-radius:.8rem;padding:.5rem .8rem}.msg.mine{align-self:flex-end;background:var(--accent-tint)}
.msg p{margin:.15rem 0 0;white-space:pre-wrap;overflow-wrap:anywhere}.msg-who{font-size:.72rem;color:var(--muted)}.chat-form{flex-direction:row;align-items:flex-end}.chat-form textarea{flex:1}
