/* web.avtorulo.com — orange #F28C00, navy #1F2430 (same as avtorulo.com and the app) */
:root {
	--orange: #F28C00; --orange-d: #d97c00; --orange-l: #fff3e0; --navy: #1F2430; --navy-2: #2a3142; --text: #1d2230; --muted: #6b7280;
	--bg: #f4f5f8; --card: #fff; --line: #e5e7eb; --radius: 16px; --ok: #1d7a45; --warn: #b86500; --bad: #c0392b;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--orange-d); text-decoration: none; }
h1, h2 { line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.err { background: #fdecea; color: #a4251c; border-radius: 10px; padding: 9px 14px; margin: 0 0 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--orange); color: #fff; font: inherit; font-weight: 700;
	padding: 10px 18px; border-radius: 999px; border: 2px solid var(--orange); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--orange-d); border-color: var(--orange-d); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { padding: 6px 14px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--orange-d); }
.btn.ghost:hover { background: var(--orange-l); }
.btn.danger.ghost { color: var(--bad); border-color: #f1c4bf; }
.btn.danger.ghost:hover { background: #fdecea; }
.btn.light { background: #fff; color: var(--navy); border-color: #fff; }
.btn.ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.pick { position: relative; }
.pick > summary { list-style: none; cursor: pointer; padding: 7px 12px; border-radius: 10px; font-weight: 700; color: #fff; }
.pick > summary::-webkit-details-marker { display: none; }
.pick-list { position: absolute; top: 42px; right: 0; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 6px; min-width: 180px; z-index: 50; }
.pick-list a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); }
.pick-list a:hover, .pick-list a.on { background: var(--orange-l); }
@media (max-width: 600px) { .hide-s { display: none !important; } }

/* ---------- presentation page ---------- */
.l-wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.l-top { background: var(--navy); color: #fff; }
.l-top-in { display: flex; align-items: center; gap: 10px; height: 62px; }
.l-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 21px; }
.l-brand img { border-radius: 9px; }
.l-link { color: #fff; font-weight: 600; padding: 7px 12px; border-radius: 10px; }
.l-link:hover { background: rgba(255, 255, 255, .1); }
.l-hero { background: radial-gradient(1200px 500px at 85% 10%, #3a4560 0%, var(--navy) 60%); color: #fff; padding: 56px 0 70px; overflow: hidden; }
.l-hero-in { display: grid; grid-template-columns: 1.05fr 1fr; gap: 46px; align-items: center; }
.l-hero h1 { font-size: clamp(30px, 4.6vw, 50px); margin: 0 0 16px; letter-spacing: -.02em; }
.l-sub { font-size: 18px; color: #c9cfdb; margin: 0 0 26px; max-width: 560px; }
.l-signin { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); border-radius: 18px; padding: 20px; display: inline-flex; flex-direction: column; gap: 12px; max-width: 420px; }
.l-signin small { color: #aab2c2; }
.l-signin .g_id_signin { min-height: 44px; }
.l-mock { background: #fff; border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); overflow: hidden; transform: perspective(1400px) rotateY(-8deg) rotateX(3deg); color: var(--text); }
.mock-bar { display: flex; align-items: center; gap: 6px; background: #eef0f4; padding: 9px 12px; }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #d4d8e0; }
.mock-bar span { margin-left: 10px; background: #fff; border-radius: 6px; padding: 2px 12px; font-size: 12px; color: var(--muted); }
.mock-body { display: flex; min-height: 280px; }
.mock-side { width: 128px; background: var(--navy); color: #fff; padding: 14px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.mock-side span { padding: 6px 8px; border-radius: 8px; opacity: .8; }
.mock-side span.on { background: var(--orange); opacity: 1; }
.mock-main { flex: 1; padding: 16px; background: var(--bg); display: flex; flex-direction: column; gap: 12px; }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mock-stats div { background: #fff; border-radius: 10px; padding: 8px 10px; }
.mock-stats small { display: block; color: var(--muted); font-size: 10px; }
.mock-stats b { font-size: 17px; }
.mock-chart { background: #fff; border-radius: 10px; height: 110px; padding: 12px; display: flex; align-items: flex-end; gap: 10px; }
.mock-chart span { flex: 1; background: linear-gradient(180deg, #ffb341, var(--orange)); border-radius: 6px 6px 2px 2px; }
.mock-rem { background: var(--orange-l); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; }
.l-feats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: -34px; position: relative; padding-bottom: 50px; }
.l-feat { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: 0 8px 26px rgba(31, 36, 48, .08); }
.l-feat h2 { font-size: 18px; margin: 10px 0 6px; }
.l-feat p { margin: 0; color: var(--muted); }
.l-ico { display: inline-flex; width: 48px; height: 48px; border-radius: 14px; background: var(--orange-l); align-items: center; justify-content: center; font-size: 24px; }
.l-band { background: linear-gradient(120deg, #F28C00, #ffb341); color: #fff; padding: 34px 0; }
.l-band-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.l-band h2 { margin: 0 0 4px; font-size: 24px; }
.l-band p { margin: 0; opacity: .92; }
.l-band-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.l-foot { padding: 22px 0; color: var(--muted); font-size: 14px; }
@media (max-width: 900px) {
	.l-hero-in { grid-template-columns: 1fr; }
	.l-mock { transform: none; }
	.l-feats { grid-template-columns: 1fr 1fr; margin-top: 24px; }
}
@media (max-width: 560px) {
	.l-hero { padding: 34px 0 40px; }
	.l-feats { grid-template-columns: 1fr; }
	.mock-side { width: 54px; } .mock-side b { display: none; }
	.l-signin { display: flex; }
}

/* ---------- app frame ---------- */
body.app { min-height: 100vh; }
#app.loading { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--orange); animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.side { position: fixed; left: 0; top: 0; bottom: 0; width: 248px; background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 16px 12px; overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 20px; padding: 4px 8px 14px; }
.brand img { border-radius: 8px; }
.vpick { display: block; background: var(--navy-2); border-radius: 12px; padding: 8px 10px; margin-bottom: 12px; }
.vpick span { display: block; font-size: 11px; color: #9aa3b5; text-transform: uppercase; letter-spacing: .05em; }
.vpick select { width: 100%; background: transparent; color: #fff; border: 0; font: inherit; font-weight: 700; font-size: 15px; padding: 2px 0; cursor: pointer; }
.vpick option { color: var(--text); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; color: #d6dae3; padding: 9px 10px; border-radius: 10px; font-weight: 600; }
.nav a span { width: 22px; text-align: center; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.on { background: var(--orange); color: #fff; }
.nav.sub { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
.who { font-size: 12px; color: #8a93a6; padding: 10px 10px 0; overflow: hidden; text-overflow: ellipsis; }
.main { margin-left: 248px; min-height: 100vh; }
.mtop { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(244, 245, 248, .92); backdrop-filter: blur(8px); }
.mtop h1 { font-size: 24px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.burger { display: none; border: 0; background: #fff; width: 40px; height: 40px; border-radius: 12px; font-size: 20px; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.view { padding: 6px 28px 40px; max-width: 1180px; }
.tabbar { display: none; }
.scrim { display: none; }

/* cards, stats, charts */
.card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 1px 3px rgba(31, 36, 48, .06); }
.card h2 { font-size: 16px; margin: 0 0 14px; }
.card.narrow { max-width: 520px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { align-content: center; background: #fff; border-radius: var(--radius); padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; box-shadow: 0 1px 3px rgba(31, 36, 48, .06); }
.stat .si { grid-row: span 2; width: 42px; height: 42px; border-radius: 12px; background: var(--orange-l); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.stat small { color: var(--muted); font-size: 13px; }
.stat b { font-size: 18px; line-height: 1.25; }
.stat b:only-of-type { overflow-wrap: anywhere; }
.stat.warn .si { background: #fff1d6; } .stat.warn b { color: var(--warn); }
.stat.bad .si { background: #fdecea; } .stat.bad b { color: var(--bad); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.hbar { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 14px; }
.hl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht { height: 12px; background: #f0f1f4; border-radius: 99px; overflow: hidden; }
.ht i { display: block; height: 100%; background: linear-gradient(90deg, #ffb341, var(--orange)); border-radius: 99px; }
.vbars { display: flex; align-items: flex-end; gap: 10px; height: 190px; }
.vb { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.vv { font-size: 11px; color: var(--muted); height: 16px; white-space: nowrap; }
.vt { flex: 1; width: 100%; max-width: 44px; display: flex; align-items: flex-end; }
.vt i { display: block; width: 100%; background: linear-gradient(180deg, #ffb341, var(--orange)); border-radius: 8px 8px 3px 3px; min-height: 2px; }
.vl { font-size: 12px; color: var(--muted); margin-top: 6px; text-transform: capitalize; }
.rlist, .recent { list-style: none; margin: 0; padding: 0; }
.rlist li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rlist li:last-child { border-bottom: 0; }
.rlist li > div:nth-child(2) { flex: 1; min-width: 0; }
.rlist small, .recent small { display: block; color: var(--muted); font-size: 13px; }
.rlist .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.rlist li.warn .dot { background: var(--orange); } .rlist li.warn b { color: var(--warn); }
.rlist li.bad .dot { background: var(--bad); } .rlist li.bad b { color: var(--bad); }
.rlist.big li { padding: 14px 0; }
.racts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.recent li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.recent li > div { flex: 1; min-width: 0; }
.recent small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ri { width: 36px; height: 36px; border-radius: 10px; background: var(--bg); display: flex; align-items: center; justify-content: center; flex: none; }
.ra { white-space: nowrap; }
.more { display: inline-block; margin-top: 12px; font-weight: 600; font-size: 14px; }
.empty { background: #fff; border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); }
.empty.big { padding: 50px 20px; }
.big-ico { font-size: 46px; margin-bottom: 6px; }

/* tables */
.sumline { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 10px; color: var(--muted); }
.sumline b { color: var(--text); }
.table { background: #fff; border-radius: var(--radius); overflow: auto; box-shadow: 0 1px 3px rgba(31, 36, 48, .06); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-i] { cursor: pointer; }
tbody tr[data-i]:hover { background: #fffaf2; }
.r { text-align: right; }
.nw { white-space: nowrap; }
.tag { display: inline-block; border-radius: 6px; padding: 1px 8px; font-weight: 700; }
.tag.warn { background: #fff1d6; color: var(--warn); }
.tag.bad { background: #fdecea; color: var(--bad); }

/* vehicles */
.vcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.vcard { background: #fff; border-radius: var(--radius); padding: 16px; display: grid; grid-template-columns: auto 1fr; gap: 12px; box-shadow: 0 1px 3px rgba(31, 36, 48, .06); border: 2px solid transparent; }
.vcard.on { border-color: var(--orange); }
.vc-ico { width: 54px; height: 54px; border-radius: 14px; background: var(--orange-l); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.vc-body b { display: block; font-size: 17px; }
.vc-body small { display: block; color: var(--muted); }
.vc-acts { grid-column: 1 / -1; display: flex; gap: 8px; }

/* report */
.report-head { margin-bottom: 14px; }
.report-head h2 { font-size: 20px; margin: 0 0 4px; }
.totals { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 6px; }
.totals .tt { font-size: 16px; }

/* modal + forms */
.modal { position: fixed; inset: 0; background: rgba(20, 24, 33, .55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.mbox { background: #fff; border-radius: 18px; width: 100%; max-width: 640px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.mhead { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 6px; }
.mhead h2 { margin: 0; font-size: 19px; }
.x { border: 0; background: none; font-size: 28px; color: var(--muted); cursor: pointer; line-height: 1; }
.mbody { padding: 10px 20px; }
.mfoot { display: flex; gap: 8px; padding: 12px 20px 18px; flex-wrap: wrap; }
body.noscroll { overflow: hidden; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fgrid.one { grid-template-columns: 1fr; }
.fgrid label, .flabel { display: block; font-size: 13px; font-weight: 700; color: #3d4352; }
.fgrid .full { grid-column: 1 / -1; }
.fgrid input, .fgrid select, .fgrid textarea { display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 16px; padding: 9px 11px; border: 1px solid #d7dbe2; border-radius: 10px; background: #fff; color: var(--text); }
.fgrid input:focus, .fgrid select:focus, .fgrid textarea:focus { outline: 2px solid var(--orange); border-color: transparent; }
.fgrid .miss { border-color: var(--bad); background: #fff7f6; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ck { display: inline-flex !important; align-items: center; gap: 6px; font-weight: 500 !important; background: var(--bg); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.ck input { width: auto !important; margin: 0 !important; accent-color: var(--orange); }
.addgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding-bottom: 12px; }
.addgrid button { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 16px 10px; font: inherit; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.addgrid button span { font-size: 26px; }
.addgrid button:hover { border-color: var(--orange); background: var(--orange-l); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; opacity: 0;
	transition: .25s; z-index: 200; pointer-events: none; font-weight: 600; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); }

/* phone */
@media (max-width: 900px) {
	.side { transform: translateX(-100%); transition: transform .25s; box-shadow: 10px 0 30px rgba(0, 0, 0, .3); }
	.side.open { transform: none; }
	.scrim.on { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 35; }
	.main { margin-left: 0; padding-bottom: 76px; }
	.burger { display: block; }
	.mtop { padding: 10px 14px; }
	.mtop h1 { font-size: 20px; }
	.view { padding: 4px 14px 30px; }
	.grid2 { grid-template-columns: 1fr; }
	.tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 30; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
	.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; color: var(--muted); padding: 4px 2px; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.tabbar a span { font-size: 20px; }
	.tabbar a.on { color: var(--orange-d); font-weight: 700; }
	.tabbar a.plus span { width: 50px; height: 50px; margin-top: -18px; border-radius: 50%; background: var(--orange); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px;
		box-shadow: 0 6px 16px rgba(242, 140, 0, .45); }
	#toast { bottom: 90px; }
}
@media (max-width: 560px) {
	.stats { grid-template-columns: 1fr 1fr; gap: 10px; }
	.stat { padding: 12px; column-gap: 8px; }
	.stat .si { width: 34px; height: 34px; font-size: 17px; }
	.stat b { font-size: 16px; }
	.hbar { grid-template-columns: 96px 1fr auto; font-size: 13px; }
	.fgrid { grid-template-columns: 1fr; }
	.modal { padding: 0; align-items: flex-end; }
	.mbox { border-radius: 18px 18px 0 0; max-height: 92vh; overflow-y: auto; }
	td, th { padding: 10px; }
	.racts .btn { padding: 5px 10px; font-size: 13px; }
}

/* print: the report only */
@media print {
	.side, .tabbar, .mtop .acts, .burger, .scrim, #toast { display: none !important; }
	.main { margin: 0; padding: 0; }
	.mtop { position: static; padding: 0 0 10px; background: none; }
	.view { padding: 0; max-width: none; }
	body { background: #fff; }
	.card, .table, .stat { box-shadow: none; border: 1px solid #ddd; }
	tr { break-inside: avoid; }
}

/* v2 fixes: nothing may be wider than the phone screen */
.main { min-width: 0; overflow-x: clip; }
.grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.card, .grid2 > * { min-width: 0; }
@media (max-width: 900px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
	.mtop .btn.sm { padding: 8px 12px; font-size: 16px; }
	.recent small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
	/* report: each record as a small card instead of a wide table */
	.table.stack thead { display: none; }
	.table.stack tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
	.table.stack td { padding: 0; border: 0; }
	.table.stack .c-date { grid-column: 1; color: var(--muted); font-size: 13px; }
	.table.stack .c-sum { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 700; }
	.table.stack .c-cat { grid-column: 1; font-weight: 700; }
	.table.stack .c-info { grid-column: 1 / -1; color: #3d4352; font-size: 14px; }
	.table.stack .c-km { grid-column: 1 / -1; text-align: left; color: var(--muted); font-size: 13px; }
	.table.stack .c-km:empty, .table.stack .c-info:empty { display: none; }
	.tabbar a { font-size: 10px; }
}
/* v3: columns may shrink below their longest word (long translations on phones) */
.stats { grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); }
.stat > * { min-width: 0; }
.stat b { overflow-wrap: anywhere; }
@media (max-width: 560px) {
	.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.stat { grid-template-columns: auto minmax(0, 1fr); }
	.stat b { font-size: 15px; }
	.hbar { grid-template-columns: minmax(0, 96px) minmax(0, 1fr) auto; }
	.mtop h1 { font-size: 18px; }
}
@media (max-width: 900px) { .side { box-shadow: none; } .side.open { box-shadow: 10px 0 30px rgba(0, 0, 0, .3); } }
.danger-zone { margin-top: 16px; }
.danger-zone h2 { color: var(--bad); }
