:root {
  --brand: #c80073;
  --brand-dark: #970055;
  --brand-soft: #fff0f7;
  --ink: #172033;
  --muted: #6f7888;
  --line: #e7eaf0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --green: #109b59;
  --green-soft: #eaf8f1;
  --orange: #d77700;
  --orange-soft: #fff5e7;
  --blue: #286be6;
  --blue-soft: #edf3ff;
  --red: #d64040;
  --red-soft: #fff0f0;
  --gray-soft: #eff2f6;
  --shadow: 0 12px 34px rgba(20, 28, 45, .08);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--line); padding: 24px 18px; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg,var(--brand),#ff3da4); display: grid; place-items: center; color: #fff; font-weight: 900; box-shadow: 0 8px 22px rgba(200,0,115,.22); }
.brand-title { font-size: 21px; font-weight: 900; line-height: 1; letter-spacing: -.5px; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.nav { display: grid; gap: 8px; margin-top: 8px; }
.nav-btn { width: 100%; border: 0; background: transparent; color: #4d586b; border-radius: 12px; padding: 12px 13px; display: flex; align-items: center; gap: 12px; text-align: left; font-weight: 700; }
.nav-btn:hover { background: #f8f9fc; color: var(--ink); }
.nav-btn.active { background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(200,0,115,.18); }
.nav-icon { width: 22px; text-align: center; font-size: 17px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 16px 8px 0; }
.user-row { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #edf0f5; display: grid; place-items: center; font-weight: 800; }
.user-meta strong { display: block; font-size: 13px; }
.user-meta span { font-size: 11px; color: var(--muted); }
.main { min-width: 0; padding: 28px 34px 90px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-title { margin: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.8px; }
.page-subtitle { color: var(--muted); margin: 5px 0 0; font-size: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 15px; font-weight: 800; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(25,35,55,.07); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.danger { color: var(--red); background: var(--red-soft); border-color: #ffd1d1; }
.btn.soft { background: #f8f9fc; }
.btn.small { padding: 8px 11px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px; box-shadow: var(--shadow); }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.metric-value { margin-top: 7px; font-size: 27px; line-height: 1; font-weight: 900; letter-spacing: -.8px; }
.metric-note { margin-top: 8px; color: var(--muted); font-size: 11px; }
.toolbar { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 14px; box-shadow: var(--shadow); }
.search-wrap { flex: 1; position: relative; min-width: 180px; }
.search-wrap input { width: 100%; border: 0; outline: 0; padding: 10px 12px 10px 35px; background: #f8f9fc; border-radius: 10px; color: var(--ink); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: .5; }
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 1px solid var(--line); background: #fff; color: #657084; border-radius: 999px; padding: 8px 12px; font-weight: 800; white-space: nowrap; font-size: 12px; }
.tab.active { background: var(--brand-soft); border-color: #f4b7d9; color: var(--brand-dark); }
.content-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: 13px 16px; border-bottom: 1px solid #edf0f4; text-align: left; font-size: 13px; vertical-align: middle; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; background: #fbfcfe; }
tr:hover td { background: #fcfcfd; }
.car-name { font-weight: 900; }
.car-vin { font-size: 11px; color: var(--muted); margin-top: 4px; font-family: ui-monospace,SFMono-Regular,Menlo,monospace; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 9px; font-size: 11px; font-weight: 900; white-space: nowrap; }
.badge.waiting { color: var(--orange); background: var(--orange-soft); }
.badge.active { color: var(--green); background: var(--green-soft); }
.badge.sold { color: #667085; background: var(--gray-soft); }
.badge.auto1 { color: var(--blue); background: var(--blue-soft); }
.badge.local { color: #7448a6; background: #f3ecfb; }
.money { font-variant-numeric: tabular-nums; font-weight: 800; }
.cards-mobile { display: none; gap: 10px; }
.car-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 14px; box-shadow: 0 8px 22px rgba(20,28,45,.06); }
.car-card-top { display: flex; justify-content: space-between; gap: 10px; }
.car-card .car-name { font-size: 16px; }
.car-card-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.mini-label { color: var(--muted); font-size: 10px; }
.mini-value { font-size: 13px; font-weight: 900; margin-top: 3px; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; }
.card-actions .btn { flex: 1; }
.detail-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; }
.info-card { padding: 18px; }
.summary-line { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 8px; }
.finance-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 16px; }
.finance-box { background: #f8f9fc; border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.finance-box span { display: block; color: var(--muted); font-size: 11px; }
.finance-box strong { display: block; margin-top: 5px; font-size: 18px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 22px 0 10px; }
.kv { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px 20px; }
.kv div { padding: 9px 0; border-bottom: 1px dashed #e8ebf0; }
.kv span { color: var(--muted); font-size: 11px; display: block; }
.kv strong { display: block; margin-top: 4px; font-size: 14px; }
.expense-list { display: grid; gap: 8px; }
.expense-row { display: grid; grid-template-columns: 100px 110px 1fr 90px; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 12px; }
.status-stack { display: grid; gap: 9px; }
.pub-row { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; }
.pub-left { display: flex; align-items: center; gap: 9px; font-weight: 800; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #adb5c2; }
.dot.ok { background: var(--green); }
.dot.wait { background: var(--orange); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.report-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.report-card h3 { margin: 0 0 14px; }
.bar-chart { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 75px; align-items: center; gap: 10px; font-size: 12px; }
.bar-track { background: #eef1f5; border-radius: 999px; height: 9px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg,var(--brand),#f05cab); }
.report-kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.report-kpi { border: 1px solid var(--line); border-radius: 14px; padding: 15px; }
.report-kpi span { color: var(--muted); font-size: 11px; }
.report-kpi strong { display: block; margin-top: 7px; font-size: 22px; }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(12,18,30,.48); display: grid; place-items: center; z-index: 100; padding: 20px; backdrop-filter: blur(4px); }
.modal { width: min(680px,100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 22px; box-shadow: 0 28px 70px rgba(0,0,0,.22); }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 13px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #dfe3e9; border-radius: 11px; padding: 11px 12px; outline: none; background: #fff; color: var(--ink); }
.field textarea { min-height: 105px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #e085bb; box-shadow: 0 0 0 3px #fff0f7; }
.photo-drop { border: 2px dashed #d8dde6; border-radius: 16px; padding: 24px; text-align: center; background: #fbfcfe; }
.photo-drop.drag { border-color: var(--brand); background: var(--brand-soft); }
.photo-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; margin-top: 12px; }
.photo-tile { position: relative; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: #edf0f4; border: 1px solid var(--line); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile button { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(10,15,25,.72); color: #fff; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 15% 20%, rgba(200,0,115,.08), transparent 32%), var(--bg); }
.login-card { width: min(440px,100%); background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.login-card .brand { padding: 0 0 24px; }
.login-note { background: #f8f9fc; border: 1px solid var(--line); border-radius: 12px; padding: 12px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); z-index: 50; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); backdrop-filter: blur(12px); }
.bottom-nav-inner { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; }
.bottom-nav button { border: 0; background: transparent; color: #6b7484; padding: 7px 3px; border-radius: 10px; font-size: 10px; font-weight: 800; display: grid; gap: 3px; place-items: center; }
.bottom-nav button.active { color: var(--brand); background: var(--brand-soft); }
.toast { position: fixed; right: 24px; bottom: 24px; background: #172033; color: #fff; padding: 12px 15px; border-radius: 12px; box-shadow: 0 12px 28px rgba(0,0,0,.18); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; z-index: 200; max-width: 340px; font-size: 13px; }
.toast.show { opacity: 1; transform: translateY(0); }
.install-banner { display: none; align-items: center; justify-content: space-between; gap: 10px; background: #171d2a; color: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.install-banner.show { display: flex; }
.install-banner small { color: #c5cbd6; display: block; margin-top: 3px; }
.mobile-top { display: none; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mobile-logo { display: flex; align-items: center; gap: 9px; font-weight: 900; font-size: 18px; }

@media (max-width: 1050px) {
  .metrics { grid-template-columns: repeat(2,1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main { padding: 16px 14px 90px; }
  .mobile-top { display: flex; }
  .topbar { align-items: flex-start; }
  .topbar .actions .btn:not(.primary) { display: none; }
  .metrics { grid-template-columns: repeat(2,1fr); gap: 9px; }
  .metric { padding: 14px; border-radius: 15px; box-shadow: none; }
  .metric-value { font-size: 23px; }
  .toolbar { flex-direction: column; align-items: stretch; box-shadow: none; }
  .table-wrap { display: none; }
  .cards-mobile { display: grid; }
  .panel { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .panel-head { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
  .finance-grid { grid-template-columns: repeat(2,1fr); }
  .kv { grid-template-columns: 1fr 1fr; }
  .expense-row { grid-template-columns: 1fr auto; }
  .expense-row .hide-mobile { display: none; }
  .report-kpis { grid-template-columns: 1fr 1fr; }
  .bottom-nav { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .photo-grid { grid-template-columns: repeat(3,1fr); }
  .toast { right: 14px; left: 14px; bottom: 84px; max-width: none; }
}
@media (max-width: 460px) {
  .main { padding-left: 11px; padding-right: 11px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-label { font-size: 10px; }
  .metric-value { font-size: 21px; }
  .topbar { margin-bottom: 14px; }
  .page-title { font-size: 25px; }
  .page-subtitle { font-size: 12px; }
  .finance-grid { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2,1fr); }
}

/* V1.1 – nuosavybės atskyrimas */
.badge.owner { background:#f3f4f7; color:#3b4351; }
.badge.owner.eamotors { background:#fff0f7; color:var(--brand); }
.badge.owner.edgaras { background:#eef6ff; color:#2166a5; }
.badge.owner.adomas { background:#f3ecfb; color:#7448a6; }
.owner-select-wrap { min-width:150px; }
.owner-select { width:100%; border:1px solid #dfe3e9; border-radius:11px; padding:10px 12px; background:#fff; color:var(--ink); font-weight:700; outline:none; }
.report-scope { display:flex; align-items:center; justify-content:space-between; gap:14px; background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:14px 16px; margin-bottom:14px; box-shadow:var(--shadow); }
.report-scope > div:first-child { display:grid; gap:3px; }
.report-scope span { color:var(--muted); font-size:12px; }
.adam-joke { margin-top:12px; background:#fff9e8; border:1px solid #f1dfab; border-radius:12px; padding:12px; font-size:12px; color:#5f4d13; }
.easter-egg { margin-top:16px; text-align:center; font-size:10px; color:#b9bec8; user-select:none; }
@media (max-width:780px) {
  .owner-select-wrap { width:100%; }
  .report-scope { align-items:stretch; flex-direction:column; }
  .report-scope .tabs { width:100%; overflow:auto; }
}

/* V1.2 – galutinė PWA logika */
.inline-select { margin-top:4px; border:1px solid #dfe3e9; border-radius:9px; padding:7px 9px; background:#fff; color:var(--ink); font-weight:800; max-width:220px; }
.retention-note { margin-top:12px; padding:10px 12px; border:1px solid #e5e8ee; border-radius:12px; background:#fafbfc; color:var(--muted); font-size:12px; }
.dot.off { background:#7f8794; }
.publish-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.publish-summary > div, .sale-preview > div { border:1px solid var(--line); border-radius:12px; padding:12px; background:#fafbfc; }
.publish-summary span, .sale-preview span { display:block; color:var(--muted); font-size:11px; }
.publish-summary strong, .sale-preview b { display:block; margin-top:5px; font-size:16px; }
.sale-preview { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:14px; }
.photo-badge { position:absolute; left:6px; bottom:6px; background:rgba(10,15,25,.72); color:#fff; border-radius:999px; padding:4px 7px; font-size:9px; font-weight:800; }
.photo-tools { position:absolute; top:6px; right:6px; display:flex; gap:4px; }
.photo-tools button { position:static; width:25px; height:25px; border:0; border-radius:50%; background:rgba(10,15,25,.72); color:#fff; cursor:pointer; }
.mini-month-chart { min-height:165px; display:grid; grid-template-columns:repeat(12,minmax(36px,1fr)); gap:7px; align-items:end; overflow-x:auto; padding-top:8px; }
.month-col { min-width:36px; display:grid; grid-template-rows:auto 100px auto auto; gap:4px; align-items:end; text-align:center; }
.month-value { font-size:9px; color:var(--muted); white-space:nowrap; transform:rotate(-18deg); transform-origin:center; min-height:25px; }
.month-bar-wrap { height:100px; display:flex; align-items:flex-end; justify-content:center; }
.month-bar { width:16px; min-height:4px; background:linear-gradient(180deg,#43c978,#1ba859); border-radius:6px 6px 2px 2px; }
.month-bar.negative { background:linear-gradient(180deg,#ff8e9e,#e4465b); }
.month-label { font-size:10px; font-weight:800; }
.month-count { font-size:9px; color:var(--muted); }
.user-access { display:grid; gap:10px; margin-top:12px; }
.user-access > div { display:flex; align-items:center; gap:10px; border:1px solid var(--line); border-radius:12px; padding:10px; }
.user-access b, .user-access small { display:block; }
.user-access small { color:var(--muted); margin-top:2px; }
.install-steps { display:grid; gap:10px; }
.install-steps > div { border:1px solid var(--line); border-radius:12px; padding:12px; background:#fafbfc; }
.install-steps b, .install-steps span { display:block; }
.install-steps span { color:var(--muted); font-size:12px; margin-top:5px; }
.modal.wide { width:min(850px,100%); }
@media (max-width:780px) {
  .publish-summary, .sale-preview { grid-template-columns:1fr; }
  .mini-month-chart { grid-template-columns:repeat(12,42px); }
}
