:root {
  /* farby a písmo podľa www.autoneus.sk */
  color-scheme: dark;
  --bg: #171922; --surface: #1f2129; --surface-2: #2a2c35; --input: #14161d;
  --text: #ede5df; --muted: #a39c96; --line: rgba(237, 229, 223, .12);
  --brand: #962626; --brand-dark: #7d1f1f; --brand-text: #e58a82;
  --danger: #ef7b7b; --success: #6fcf97; --warn: #f0b060;
  --radius: 6px; --shadow: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* horná lišta */
.topbar { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; padding: .6rem 1.5rem;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--text); letter-spacing: .02em; }
.mainnav { display: flex; gap: .25rem; flex-wrap: wrap; }
.mainnav a { padding: .4rem .75rem; border-radius: 8px; color: var(--muted); font-weight: 500; }
.mainnav a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.mainnav a.active { background: var(--brand); color: #fff; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.username { font-weight: 600; }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand-text); font: inherit; cursor: pointer; }
.branch-switch select { padding: .3rem .5rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1rem; }
.pagehead h1 { margin: 0; }

/* karty a mriežky */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem;
  box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; margin-top: .2rem; }
.stat .sub { font-size: .9rem; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem 1.25rem; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

/* tabuľky */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.done td { color: var(--muted); }
tr.done .title { text-decoration: line-through; }

/* formuláre */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .9rem; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; font: inherit;
  color: var(--text); background: var(--input); border: 1px solid var(--line); border-radius: 4px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
label.check input { width: auto; margin: 0; }
.filters { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters label { margin: 0; font-weight: 500; }
.filters input, .filters select { width: auto; min-width: 150px; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }

.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .95rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--danger); }
.btn.small { padding: .25rem .6rem; font-size: .85rem; }

.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  background: var(--surface); font-size: .9rem; }
.tabs a.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.tabs a:hover { text-decoration: none; }

/* štítky */
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.SK { background: #e8efff; color: #1f4bb8; border-color: #c9d8ff; }
.badge.CZ { background: #ffecec; color: #b42323; border-color: #ffd0d0; }
.badge.nova { background: #eef2ff; color: #3949ab; border-color: #d4dbff; }
.badge.rozpracovana { background: #fff6e5; color: #9a5b00; border-color: #ffe2a8; }
.badge.vyhrata { background: #e7f7ee; color: #157040; border-color: #bfe8cf; }
.badge.prehrata { background: #f1f1f1; color: #6b6b6b; border-color: #ddd; }
.badge.online { background: #e7f7ee; color: #157040; border-color: #bfe8cf; }
.badge.overdue { background: #fdeaea; color: var(--danger); border-color: #f6c7c7; }
.badge.SK { background: #1d2a4a; color: #9bb8ff; border-color: #2c3d66; }
  .badge.CZ { background: #4a1d1d; color: #ffadad; border-color: #663030; }
  .badge.nova { background: #232a4d; color: #aab4ff; border-color: #343d6b; }
  .badge.rozpracovana { background: #47361a; color: #ffcf7a; border-color: #614a22; }
  .badge.vyhrata, .badge.online { background: #183a28; color: #7fe0a8; border-color: #245437; }
  .badge.prehrata { background: #2a2a2a; color: #aaa; border-color: #3a3a3a; }
  .badge.overdue { background: #4a1d1d; color: #ff9c9c; border-color: #663030; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); margin-right: .35rem; }

/* hlásenia */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid var(--line); background: var(--surface); }
.flash.error { border-color: var(--danger); color: var(--danger); }
.flash.success { border-color: var(--success); color: var(--success); }

/* zoznamy */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .65rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.timeline li { display: grid; grid-template-columns: auto 1fr; gap: .75rem; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: .4rem 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-line; }
.empty { color: var(--muted); padding: .5rem 0; }

/* prihlásenie */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { text-align: center; }
.login-card .btn { width: 100%; justify-content: center; margin-top: .5rem; }

@media (max-width: 640px) {
  .container { padding: 1rem; }
  .topbar { padding: .6rem 1rem; gap: .75rem; }
  .userbox { margin-left: 0; }
  .kv { grid-template-columns: 1fr; }
}

/* vozidlá */
a.stat { color: inherit; display: block; }
a.stat:hover { text-decoration: none; border-color: var(--brand); }
.steps { display: flex; gap: .35rem; flex-wrap: wrap; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.steps li { flex: 1 1 120px; padding: .5rem .6rem; border-radius: 8px; background: var(--surface);
  border: 1px solid var(--line); font-size: .82rem; color: var(--muted); text-align: center; }
.steps li.done { border-color: var(--success); color: var(--success); }
.steps li.current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.steps form { margin: 0; }
.steps button { all: unset; cursor: pointer; display: block; width: 100%; }
.badge.objednane, .badge.preprava, .badge.homologacia { background: #fff6e5; color: #9a5b00; border-color: #ffe2a8; }
.badge.na_sklade { background: #e8efff; color: #1f4bb8; border-color: #c9d8ff; }
.badge.rezervovane { background: #f3e8ff; color: #6b21a8; border-color: #e2c9ff; }
.badge.predane { background: #e7f7ee; color: #157040; border-color: #bfe8cf; }
.badge.odovzdane { background: #f1f1f1; color: #6b6b6b; border-color: #ddd; }
.badge.objednane, .badge.preprava, .badge.homologacia { background: #47361a; color: #ffcf7a; border-color: #614a22; }
  .badge.na_sklade { background: #1d2a4a; color: #9bb8ff; border-color: #2c3d66; }
  .badge.rezervovane { background: #35204a; color: #d6b4ff; border-color: #4b2d66; }
  .badge.predane { background: #183a28; color: #7fe0a8; border-color: #245437; }
  .badge.odovzdane { background: #2a2a2a; color: #aaa; border-color: #3a3a3a; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; letter-spacing: .03em; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1rem .25rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .4rem; }

/* dopyty */
.count { display: inline-block; min-width: 1.25rem; padding: 0 .35rem; margin-left: .2rem; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.25rem; }
.mainnav a.active .count { background: #fff; color: var(--brand-text); }
.checks { display: flex; gap: .5rem 1.5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.checks .check { margin: 0; }
.notice { padding: .75rem 1rem; border-radius: 8px; background: var(--bg); margin-bottom: 1rem; }
.notice .check { margin: 0; }
.badge.lead-nova { background: #fdeaea; color: var(--danger); border-color: #f6c7c7; }
.badge.lead-kontaktovany, .badge.lead-ponuka { background: #fff6e5; color: #9a5b00; border-color: #ffe2a8; }
.badge.lead-vyhrata { background: #e7f7ee; color: #157040; border-color: #bfe8cf; }
.badge.lead-prehrata { background: #f1f1f1; color: #6b6b6b; border-color: #ddd; }
.badge.lead-nova { background: #4a1d1d; color: #ff9c9c; border-color: #663030; }
  .badge.lead-kontaktovany, .badge.lead-ponuka { background: #47361a; color: #ffcf7a; border-color: #614a22; }
  .badge.lead-vyhrata { background: #183a28; color: #7fe0a8; border-color: #245437; }
  .badge.lead-prehrata { background: #2a2a2a; color: #aaa; border-color: #3a3a3a; }


/* kalendár a hlas */
.voice label { margin-bottom: .5rem; }
.voice-row { display: flex; gap: .5rem; align-items: stretch; }
.voice-row input { margin: 0; flex: 1; font-size: 1rem; }
.voice-row .btn { flex: none; }
.voice p { margin: .5rem 0 0; }
.mic.recording { background: var(--danger); border-color: var(--danger); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .65; } }
@media (max-width: 640px) { .voice-row { flex-wrap: wrap; } .voice-row input { flex-basis: 100%; order: -1; } }
.recognized { border-color: var(--brand); }
.recognized .quote { font-size: 1.1rem; font-style: italic; margin: .25rem 0 .5rem; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
@media (max-width: 1000px) { .week { grid-template-columns: 1fr; } }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem;
  min-height: 160px; display: flex; flex-direction: column; gap: .4rem; }
.day.weekend { background: transparent; }
.day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.day header { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .85rem;
  color: var(--muted); padding: 0 .2rem .2rem; }
.day.today header { color: var(--brand-text); }
.day .add { font-size: 1.1rem; line-height: 1; padding: 0 .3rem; border-radius: 6px; }
.day .add:hover { background: var(--bg); text-decoration: none; }
.meeting { display: flex; flex-direction: column; gap: .1rem; padding: .45rem .55rem; border-radius: 8px;
  background: #eef2ff; border-left: 3px solid var(--brand); color: var(--text); font-size: .88rem; line-height: 1.3; }
.meeting:hover { text-decoration: none; filter: brightness(.97); }
.meeting .time { font-size: .78rem; color: var(--brand-text); font-weight: 700; }
.event { display: block; padding: .3rem .5rem; border-radius: 6px; font-size: .78rem; color: var(--text); }
.event.prichod { background: #fff6e5; }
.event.odovzdanie { background: #e7f7ee; }
.event:hover { text-decoration: none; filter: brightness(.97); }
.meeting { background: #1d2a4a; }
  .event.prichod { background: #47361a; }
  .event.odovzdanie { background: #183a28; }


/* práva */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .25rem 1rem; }
.check.perm { align-items: flex-start; font-weight: 400; margin-bottom: .6rem; }
.check.perm input { margin-top: .25rem; }

/* financovanie */
.badge.fin-priprava, .badge.fin-podane { background: #fff6e5; color: #9a5b00; border-color: #ffe2a8; }
.badge.fin-schvalene { background: #e8efff; color: #1f4bb8; border-color: #c9d8ff; }
.badge.fin-podpisane, .badge.fin-vyplatene { background: #e7f7ee; color: #157040; border-color: #bfe8cf; }
.badge.fin-zamietnute, .badge.fin-zrusene { background: #fdeaea; color: var(--danger); border-color: #f6c7c7; }
.badge.fin-priprava, .badge.fin-podane { background: #47361a; color: #ffcf7a; border-color: #614a22; }
  .badge.fin-schvalene { background: #1d2a4a; color: #9bb8ff; border-color: #2c3d66; }
  .badge.fin-podpisane, .badge.fin-vyplatene { background: #183a28; color: #7fe0a8; border-color: #245437; }
  .badge.fin-zamietnute, .badge.fin-zrusene { background: #4a1d1d; color: #ff9c9c; border-color: #663030; }


/* import */
.import-table select { min-width: 150px; margin: 0; font-size: .85rem; padding: .35rem .4rem; }
.import-table td { font-size: .88rem; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.import-table .header-row td { color: var(--muted); }

/* newsletter */
.vehicle-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: .1rem 1rem; }
.vehicle-pick .check { font-weight: 400; align-items: flex-start; }
.vehicle-pick .check input { margin-top: .3rem; }
.mail-preview { white-space: pre-wrap; font: inherit; background: var(--bg); padding: 1rem; border-radius: 8px; margin: .5rem 0 0; }

/* reporty */
.stat .value.value-sm { font-size: 1.15rem; }
@media print {
  .topbar, .no-print, .tabs, .filters, .pagehead .btn { display: none !important; }
  body { background: #fff; }
  .card, .stat { box-shadow: none; break-inside: avoid; }
}

/* kompaktnejšie menu pri mnohých položkách */
.topbar { gap: 1rem; }
.mainnav { gap: .1rem; }
.mainnav a { padding: .35rem .55rem; font-size: .92rem; }
@media (max-width: 1450px) { .userbox .username { display: none; } }

/* chat */
.chat { display: grid; grid-template-columns: 260px 1fr; gap: 1.25rem; height: calc(100vh - 150px); min-height: 480px; }
.chat-side { overflow-y: auto; }
.chat-side h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 .5rem; }
.chat-rooms, .chat-people { display: flex; flex-direction: column; gap: .15rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.chat-rooms a, .chat-people a { display: flex; align-items: center; gap: .45rem; padding: .45rem .6rem; border-radius: 8px;
  color: var(--text); }
.chat-rooms a:hover, .chat-people a:hover { background: var(--surface); text-decoration: none; }
.chat-rooms a.active, .chat-people a.active { background: var(--brand); color: #fff; }
.chat-rooms a span:first-child, .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presence { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.presence.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.chat-main { display: flex; flex-direction: column; padding: 0; margin: 0; overflow: hidden; }
.chat-head { padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); display: flex; gap: .6rem; align-items: baseline; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; }
.chat-day { align-self: center; font-size: .75rem; color: var(--muted); background: var(--bg); padding: .15rem .7rem;
  border-radius: 999px; margin: .6rem 0 .3rem; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 75%; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg-who { font-size: .78rem; font-weight: 600; color: var(--muted); margin: .35rem 0 .15rem .3rem; display: flex; gap: .35rem; align-items: center; }
.msg-who .badge { font-size: .65rem; padding: 0 .4rem; }
.msg-bubble { background: var(--bg); padding: .5rem .75rem; border-radius: 14px 14px 14px 4px; white-space: pre-wrap;
  overflow-wrap: anywhere; line-height: 1.4; }
.msg.mine .msg-bubble { background: var(--brand); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg-time { font-size: .7rem; opacity: .6; margin-left: .6rem; float: right; margin-top: .3rem; }
.chat-form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { margin: 0; resize: none; max-height: 160px; }
@media (max-width: 800px) {
  .chat { grid-template-columns: 1fr; height: auto; }
  .chat-side { order: 2; }
  .chat-main { height: 70vh; }
  .msg { max-width: 90%; }
}
[hidden] { display: none !important; }

/* prepínač jazyka */
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-switch a { padding: .15rem .5rem; font-size: .78rem; font-weight: 700; color: var(--muted); }
.lang-switch a.active { background: var(--text); color: var(--surface); }
.lang-switch a:hover { text-decoration: none; }

/* žiadosť o financovanie */
.request-card { border-color: var(--brand); }
.stat-alert { border-color: var(--danger); }
.badge.fin-ziadost { background: #fdeaea; color: var(--danger); border-color: #f6c7c7; }
.badge.fin-ziadost { background: #4a1d1d; color: #ff9c9c; border-color: #663030; }


/* grafický newsletter */
.upload-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.upload-row label { margin: 0; }
@media (max-width: 800px) { .upload-row { grid-template-columns: 1fr; } }
.image-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.image-list li { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: start; padding: .75rem;
  border: 1px solid var(--line); border-radius: var(--radius); }
.image-list img { width: 100%; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
@media (max-width: 640px) { .image-list li { grid-template-columns: 1fr; } }
.mail-frame { background: #fff; color: #1d2330; border: 1px solid var(--line); border-radius: 8px; padding: 1.25rem;
  margin-top: .75rem; overflow-x: auto; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* e-maily pri klientovi */
.send-mail { margin-bottom: 1rem; }
.send-mail summary { list-style: none; display: inline-flex; margin-bottom: .75rem; }
.send-mail summary::-webkit-details-marker { display: none; }
.mails details summary { cursor: pointer; list-style: none; }
.mails details summary::-webkit-details-marker { display: none; }
.mail-body { white-space: pre-wrap; background: var(--bg); padding: .75rem; border-radius: 8px; margin-top: .5rem;
  max-height: 420px; overflow-y: auto; font-size: .92rem; }

/* prihlásenie: registrácia a inštalácia */
.login-alt { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; text-align: center; margin: .5rem 0 1rem; }
.login-alt .btn { justify-content: center; }

/* inštalácia do telefónu */
.install { max-width: 640px; margin: 0 auto; }
.install-icon { width: 88px; height: 88px; border-radius: 20px; display: block; margin: 0 auto 1rem; box-shadow: var(--shadow); }
.install h1 { text-align: center; }
.install > p.muted { text-align: center; }
.install-steps { padding-left: 1.2rem; line-height: 1.8; }
.ios-share { display: inline-block; border: 1px solid var(--line); border-radius: 6px; padding: 0 .35rem; }

/* mobil: menu pod tlačidlom ☰, bezpečné okraje iPhonu */
.menu-toggle { display: none; margin-left: auto; font-size: 1.4rem; background: none; border: 1px solid var(--line);
  border-radius: 8px; padding: .15rem .6rem; color: var(--text); cursor: pointer; }
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.topbar { padding-top: max(.6rem, env(safe-area-inset-top)); }
@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .topbar .mainnav, .topbar .userbox { display: none; width: 100%; }
  .topbar.open .mainnav { display: flex; flex-direction: column; gap: .1rem; }
  .topbar.open .mainnav a { padding: .6rem .75rem; font-size: 1rem; }
  .topbar.open .userbox { display: flex; flex-wrap: wrap; gap: .75rem; padding: .5rem .75rem 0;
    border-top: 1px solid var(--line); margin-left: 0; }
  .userbox .username { display: inline; }
  .container { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.35rem; }
  .pagehead .actions .btn { padding: .45rem .7rem; }
}
.standalone .install-link { display: none; }

/* ---------------------------------------------------------------- dizajn Autoneus */
h1, h2 { font-weight: 500; letter-spacing: .01em; }
h1 { font-size: 1.75rem; }
.topbar { background: #12141b; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { height: 15px; width: auto; display: block; }
.brand span { font-size: .68rem; font-weight: 600; letter-spacing: .18em; color: var(--muted);
  border-left: 1px solid var(--line); padding-left: .6rem; }
.mainnav a { color: var(--muted); border-radius: 3px; }
.mainnav a:hover { background: var(--surface-2); color: var(--text); }
.mainnav a.active { background: transparent; color: var(--text); box-shadow: inset 0 -2px 0 var(--brand); border-radius: 0; }
.mainnav a.active .count { background: var(--brand); color: #fff; }
.card, .stat, .day { background: var(--surface); }
.stat .value { font-weight: 500; }
a.stat:hover { border-color: var(--brand); }
.btn { border-radius: 3px; background: var(--surface-2); border-color: var(--line); font-weight: 500; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #a92c2c; border-color: #a92c2c; }
.tabs a { border-radius: 3px; background: var(--surface); }
.tabs a.active { background: var(--text); color: #171922; border-color: var(--text); }
.lang-switch a.active { background: var(--text); color: #171922; }
input:focus, select:focus, textarea:focus { outline-color: var(--brand); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
.flash { background: var(--surface); }
.flash.success { border-color: var(--success); color: var(--success); }
.notice, .chat-day, .msg-bubble, .mail-preview, .mail-body { background: var(--surface-2); }
.msg.mine .msg-bubble { background: var(--brand); color: #fff; }
.chat-rooms a.active, .chat-people a.active { background: var(--brand); }
.chat-rooms a:hover, .chat-people a:hover { background: var(--surface-2); }
.steps li.current { background: var(--brand); border-color: var(--brand); }
.day.weekend { background: rgba(31, 33, 41, .5); }
.day .add:hover { background: var(--surface-2); }
.menu-toggle { border-radius: 3px; }

/* prihlásenie a registrácia */
.login-wrap { background: radial-gradient(1200px 600px at 50% -10%, #2a2c35 0%, #171922 60%); }
.login-logo { text-align: center; margin: 0 0 1.5rem; }
.login-logo img { width: 230px; max-width: 80%; height: auto; }
.login-logo span { display: block; margin-top: .7rem; font-size: .72rem; letter-spacing: .32em; color: var(--muted); }
.login-card .card { padding: 1.5rem; }
.login-card h1 { font-size: 1.2rem; text-align: center; color: var(--muted); font-weight: 400; }
@media print { body { background: #fff; color: #000; } }
.userbox a, .userbox .linkbtn { color: var(--muted); }
.userbox a:hover, .userbox .linkbtn:hover { color: var(--text); }
.userbox .lang-switch a.active { color: #171922; }

/* prehľad: karty v mriežke, ktoré si každý usporiada */
.dash-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
.dash-panels > [data-key] { margin: 0; min-width: 0; position: relative; }
.dash-panels > [data-key] > .card { margin: 0; }
.dash-panels > .wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .dash-panels { grid-template-columns: 1fr; } }
.layout-bar { position: sticky; top: 0; z-index: 20; display: flex; gap: .75rem 1rem; align-items: center; flex-wrap: wrap;
  justify-content: space-between; padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid var(--brand);
  border-radius: var(--radius); background: #2a1719; }
body.layout-edit #mainnav > a, body.layout-edit .sortable > [data-key] {
  outline: 1px dashed rgba(237, 229, 223, .35); outline-offset: 2px; cursor: grab; touch-action: none; user-select: none;
  -webkit-user-select: none; }
body.layout-edit .sortable > [data-key] * { pointer-events: none; }
body.layout-edit .sortable > [data-key] .wide-toggle { pointer-events: auto; }
body.layout-edit .dragging { opacity: .55; outline: 2px solid var(--brand) !important; cursor: grabbing; }
.wide-toggle { position: absolute; top: .5rem; right: .5rem; z-index: 2; background: var(--brand); color: #fff; border: 0;
  border-radius: 3px; padding: .2rem .55rem; font: inherit; font-weight: 700; cursor: pointer; }

/* chat ako bočný panel */
.chat-fab { position: fixed; right: calc(1.25rem + env(safe-area-inset-right)); bottom: calc(1.25rem + env(safe-area-inset-bottom));
  z-index: 40; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--brand); color: #fff;
  font-size: 1.5rem; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .45); }
.chat-fab:hover { background: #a92c2c; }
.chat-fab .count { position: absolute; top: -2px; right: -2px; background: #fff; color: var(--brand); margin: 0; }
.chat-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: 400px; max-width: 100vw; display: flex;
  flex-direction: column; background: var(--bg); border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(0, 0, 0, .4);
  padding-top: env(safe-area-inset-top); }
.chat-drawer-head { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line);
  background: #12141b; }
.chat-drawer-head strong { flex: 1; letter-spacing: .04em; }
.chat-drawer iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }
body.chat-open .chat-fab { right: calc(400px + 1.25rem); }
@media (min-width: 1300px) { body.chat-open { padding-right: 400px; } body.chat-open .chat-fab { display: none; } }
@media (max-width: 860px) { .chat-drawer { width: 100vw; } body.chat-open .chat-fab { display: none; } }

/* chat vo vnútri panela */
.chat-panel-main { padding: 0; }
.chat.in-panel { display: flex; flex-direction: column; height: 100vh; min-height: 0; gap: 0; }
.chat.in-panel .chat-side { order: 0; flex: none; max-height: 32vh; padding: .6rem .75rem .2rem; border-bottom: 1px solid var(--line); }
.chat.in-panel .chat-side h2 { margin-bottom: .3rem; font-size: .7rem; }
.chat.in-panel .chat-rooms, .chat.in-panel .chat-people { flex-direction: row; flex-wrap: wrap; gap: .3rem; margin-bottom: .6rem; }
.chat.in-panel .chat-rooms a, .chat.in-panel .chat-people a { padding: .25rem .55rem; border: 1px solid var(--line); font-size: .85rem; }
.chat.in-panel .chat-people .pname { max-width: 9rem; }
.chat.in-panel .chat-main { flex: 1; height: auto; min-height: 0; border: 0; border-radius: 0; }
.chat.in-panel .chat-head { display: none; }
.chat.in-panel .msg { max-width: 88%; }

/* zvonček s upozorneniami */
.bell { position: relative; background: none; border: 1px solid var(--line); border-radius: 3px; color: var(--text);
  font-size: 1.05rem; padding: .2rem .55rem; cursor: pointer; order: 20; }
.bell .count { position: absolute; top: -7px; right: -9px; margin: 0; }
.bell.has-new { border-color: var(--danger); }
.notif-panel { position: fixed; top: 64px; right: 1rem; z-index: 60; width: 380px; max-width: calc(100vw - 2rem);
  max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.notif-panel header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .75rem 1rem;
  border-bottom: 1px solid var(--line); }
.notif-panel ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.notif-panel li { border-bottom: 1px solid var(--line); }
.notif-panel li.empty { padding: 1rem; }
.notif-panel li a { display: flex; gap: .7rem; padding: .7rem 1rem; color: var(--text); border-left: 3px solid transparent; }
.notif-panel li a:hover { background: var(--surface-2); text-decoration: none; }
.notif-panel li.unread a { border-left-color: var(--danger); background: rgba(150, 38, 38, .12); }
.notif-panel li.unread strong::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); margin-left: .4rem; vertical-align: middle; }
.notif-panel .ico { font-size: 1.15rem; line-height: 1.3; }
.notif-panel .txt { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.notif-panel .time { font-size: .75rem; }
.notif-settings { padding: .6rem 1rem; border-top: 1px solid var(--line); color: var(--muted); }
.pulse { animation: crm-pulse .9s ease-out 2; }
@keyframes crm-pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 123, 123, .7); } 100% { box-shadow: 0 0 0 16px rgba(239, 123, 123, 0); } }
@media (min-width: 861px) { .topbar .userbox { order: 10; } }
@media (max-width: 860px) {
  .bell { order: 1; margin-left: auto; }
  .menu-toggle { order: 2; margin-left: .5rem; }
  .topbar .mainnav { order: 3; } .topbar .userbox { order: 4; }
  .notif-panel { top: 60px; right: .5rem; left: .5rem; width: auto; max-width: none; }
}

/* editor newslettera */
.rte { margin-bottom: .9rem; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rte-head { padding: .6rem .8rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; padding: .45rem .5rem; background: var(--surface-2);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.rte-toolbar button, .rte-toolbar select { width: auto; margin: 0; padding: .3rem .55rem; font: inherit; font-size: .85rem;
  color: var(--text); background: var(--input); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }
.rte-toolbar button:hover { border-color: var(--muted); }
.rte-toolbar button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.rte-toolbar .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 .2rem; }
.rte.source-mode .rte-toolbar button:not([data-action=source]), .rte.source-mode .rte-toolbar select[data-color] { opacity: .4; }
.rte-area { background: #ffffff; color: #1d2330; min-height: 320px; max-height: 70vh; overflow-y: auto; padding: 28px;
  font: 15px/1.6 Arial, Helvetica, sans-serif; outline: none; }
.rte-area h1 { font-size: 26px; line-height: 1.25; margin: 0 0 14px; color: #171922; }
.rte-area h2 { font-size: 20px; margin: 22px 0 10px; color: #171922; }
.rte-area p { margin: 0 0 14px; }
.rte-area a { color: #962626; }
.rte-area hr { border: 0; border-top: 1px solid #e3ddd7; margin: 22px 0; }
.rte-source { display: block; width: 100%; min-height: 320px; margin: 0; border: 0; border-radius: 0; resize: vertical;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: #0f1016; color: #ede5df; padding: 1rem; }
.mail-frame { padding: 0; background: #f3f1ee; }

/* príbehy na Instagram / Facebook */
.story-tool { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 1.25rem; align-items: start; }
.story-controls .card { margin-bottom: 1rem; }
.story-templates { display: flex; flex-wrap: wrap; gap: .4rem; }
.story-templates .btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.st-sliders { gap: 0 1rem; }
.st-sliders input[type=range] { padding: 0; accent-color: var(--brand); }
.story-preview { position: sticky; top: 1rem; }
.story-frame { background: #000; border: 1px solid var(--line); border-radius: 18px; padding: 10px; }
.story-frame canvas { display: block; width: 100%; height: auto; border-radius: 10px; touch-action: none; cursor: grab; }
.story-actions { margin-top: .75rem; }
.story-actions .btn { flex: 1; justify-content: center; }
@media (max-width: 900px) {
  .story-tool { grid-template-columns: 1fr; }
  .story-preview { position: static; order: -1; max-width: 360px; margin: 0 auto; width: 100%; }
}

/* cena a prieskum trhu */
.market-alert { border-color: var(--danger); }
.market-rec { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: .5rem 0 1rem; }
.market-rec > div { background: var(--surface-2); border-radius: var(--radius); padding: .8rem 1rem; }
.market-rec .label { color: var(--muted); font-size: .82rem; }
.market-rec .value { font-size: 1.4rem; font-weight: 600; }
.market-rec .sub { color: var(--muted); font-size: .82rem; }
.market-rec .rec { border: 1px solid var(--brand); background: rgba(150, 38, 38, .14); }
.market-sub { font-size: .95rem; margin: 1.25rem 0 .5rem; }
.market-history { margin-top: 1rem; }
@media (max-width: 700px) { .market-rec { grid-template-columns: 1fr; } }
.review-card h2 { color: var(--text); }
.review-row { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.review-row:last-child { border-bottom: 0; }
.review-row .actions { margin-top: .4rem; }

/* fotky vozidiel */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-head h2 { margin: 0; }
.photo-upload label.btn { margin: 0; display: inline-flex; font-weight: 600; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.gallery figure { margin: 0; position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery figure.main { border-color: var(--brand); }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery figcaption { display: flex; gap: .25rem; padding: .35rem; justify-content: flex-end; }
.gallery .main-badge { position: absolute; top: .4rem; left: .4rem; background: var(--brand); color: #fff; border: 0; }
.veh-cell { display: flex; gap: .7rem; align-items: center; }
.veh-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; flex: none; border: 1px solid var(--line); }

/* dokumenty */
.doc-actions { margin-bottom: .75rem; }
.doc-list li { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.doc-upload { margin-top: 1rem; display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.doc-upload label { margin: 0; flex: 1 1 200px; }
.danger-text { color: var(--danger); }
.sig-preview { background: #fff; border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; display: inline-block; }
.sig-preview img { display: block; max-width: 480px; width: 100%; height: auto; }
.story-pics { display: flex; gap: .4rem; flex-wrap: wrap; margin: -.4rem 0 .9rem; }
.story-pic { padding: 0; border: 2px solid transparent; border-radius: 4px; background: none; cursor: pointer; }
.story-pic.active { border-color: var(--brand); }
.story-pic img { display: block; width: 72px; height: 54px; object-fit: cover; border-radius: 2px; }

/* Pošta */
.mail-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.mail-folders { display: flex; flex-direction: column; gap: .15rem; position: sticky; top: 1rem; }
.mail-folders a { padding: .5rem .7rem; border-radius: 3px; color: var(--muted); }
.mail-folders a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.mail-folders a.active { background: var(--brand); color: #fff; }
.mail-list { padding: 0; overflow: hidden; }
.mail-search { display: flex; gap: .5rem; padding: .75rem; border-bottom: 1px solid var(--line); }
.mail-search input { margin: 0; flex: 1; }
.mail-rows { list-style: none; margin: 0; padding: 0; }
.mail-rows li { border-bottom: 1px solid var(--line); }
.mail-rows a { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto; gap: 1rem; padding: .6rem .9rem;
  color: var(--muted); align-items: baseline; }
.mail-rows a:hover { background: var(--surface-2); text-decoration: none; }
.mail-rows .who, .mail-rows .subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-rows .when { font-size: .82rem; white-space: nowrap; }
.mail-rows li.unread a { color: var(--text); font-weight: 600; border-left: 3px solid var(--brand); }
.mail-rows .badge { font-size: .65rem; margin-left: .3rem; }
.mail-pager { display: flex; gap: .75rem; align-items: center; justify-content: flex-end; padding: .75rem; }
.mail-pager .muted { margin-right: auto; }
.mail-view { padding: 0; overflow: hidden; }
.mail-subject { font-size: 1.35rem; margin: 0; padding: 1rem 1.25rem .4rem; }
.mail-meta { padding: 0 1.25rem .9rem; border-bottom: 1px solid var(--line); }
.mail-meta .badge { margin-left: .4rem; }
.mail-attachments { display: flex; gap: .4rem; flex-wrap: wrap; padding: .75rem 1.25rem; border-bottom: 1px solid var(--line); }
.mail-frame-view { display: block; width: 100%; min-height: 420px; border: 0; background: #fff; }
.mail-text { white-space: pre-wrap; font: 15px/1.55 "Archivo", Arial, sans-serif; margin: 0; padding: 1.25rem; }
@media (max-width: 860px) {
  .mail-layout { grid-template-columns: 1fr; }
  .mail-folders { flex-direction: row; flex-wrap: wrap; position: static; }
  .mail-rows a { grid-template-columns: minmax(0, 1fr) auto; }
  .mail-rows .subj { grid-column: 1 / -1; grid-row: 2; }
}

/* Facebook leady */
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .35rem 0; }
.copy-row code { background: var(--surface-2); padding: .2rem .45rem; border-radius: 6px; word-break: break-all; }
ol.fb-steps li { margin-bottom: .6rem; line-height: 1.5; }
details.card > summary { cursor: pointer; list-style-position: inside; }
details.card[open] > summary { margin-bottom: .6rem; }
