:root {
  --bg: #f4f6f8;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --line: #e4e8ee;
  --text: #161a22;
  --muted: #667085;
  --accent: #1d4ed8;
  --accent-2: #3b82f6;
  --danger: #d62828;
  --ok: #2a9d8f;
  --warn: #e9a825;
  --input: #ffffff;
  --head: #f8fafc;
  --shadow: 0 18px 50px rgba(22, 26, 34, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: Manrope, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(29, 78, 216, 0.15);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

#app {
  min-height: 100vh;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(900px 500px at 10% 10%, rgba(29, 78, 216, 0.12), transparent 50%),
    radial-gradient(700px 400px at 80% 80%, rgba(59, 130, 246, 0.1), transparent 45%),
    #ffffff;
}

.brand-mark {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.06em;
  font-size: 26px;
  line-height: 1.05;
  color: var(--accent);
  margin-bottom: 12px;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
}

.login-card {
  width: min(420px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.login-card h2 {
  font-size: 24px;
  margin-bottom: 6px;
}

.login-card .sub {
  color: var(--muted);
  margin-bottom: 28px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.field {
  margin-bottom: 16px;
  min-width: 0;
  max-width: 100%;
}

.field-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.field-follow {
  margin-top: 8px;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--input);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 84px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(29, 78, 216, 0.55);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
}

input[type="date"],
input[type="number"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-date-and-time-value {
  min-width: 0;
  max-width: 100%;
  padding: 0;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  margin-left: 4px;
  padding: 0;
  flex-shrink: 0;
}

.grid-2 .field:has(input[type="date"]) {
  grid-column: 1 / -1;
  overflow: hidden;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  margin-top: 8px;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-danger {
  background: #ffe8e8;
  color: #9b1c1c;
}

.btn-ok {
  background: #e4f7f3;
  color: #1b6b61;
}

.btn-scrap {
  background: #e8eef6;
  color: #1e3a5f;
}

.btn-reg {
  background: #e0ebff;
  color: #1d4ed8;
}

.btn-print-all {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: #ffffff;
}

.btn-print-selected {
  background: linear-gradient(180deg, #14b8a6, #0f766e);
  color: #ffffff;
}

.btn-call {
  background: linear-gradient(180deg, #22c55e, #15803d);
  color: #ffffff;
}

.hint {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
}

.error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 10px;
  min-height: 18px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.sidebar-brand strong {
  display: block;
  font-size: 15px;
  line-height: 1.15;
}

.sidebar-brand span:last-child,
.sidebar-brand div span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-title {
  margin: 0 0 8px;
  padding: 0 12px 8px;
  border-bottom: 2px solid #1d4ed8;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-title + .nav-item + .nav-item + .nav-title {
  margin-top: 18px;
}

.nav-item {
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 11px 12px;
  font-weight: 700;
  color: var(--text);
}

.nav-item:hover {
  background: #eef4ff;
}

.nav-item.active {
  background: #e0ebff;
  color: var(--accent);
}

.sidebar-userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.user-hello {
  flex: 1;
  min-width: 0;
}

.user-hello span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.user-hello strong {
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-userbar .btn {
  width: auto;
  margin: 0;
  padding: 8px 12px;
  font-size: 12px;
}

.logo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
  flex-shrink: 0;
}

.content {
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.content:has(.trip-map-wrap) {
  overflow: visible;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}

.page-head h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 48px;
  letter-spacing: 0.04em;
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar .btn {
  width: auto;
  margin: 0;
  padding: 11px 14px;
  white-space: nowrap;
}

.check-col {
  width: 36px;
  text-align: center;
  vertical-align: middle;
}

.check-col input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.search-bar {
  margin-bottom: 12px;
}

.search-bar .search {
  width: 100%;
}

.search {
  min-width: 0;
  flex: 1;
}

.planned-board {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.trip-list-mobile {
  display: none;
}

.trip-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.trip-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.trip-form h3 {
  margin-bottom: 14px;
  font-size: 18px;
}

.trip-form .btn-primary {
  margin-top: 4px;
}

.trip-map-wrap {
  width: 100%;
  height: 520px;
  position: relative;
  z-index: 1;
}

.trip-map {
  width: 100%;
  height: 100%;
  min-height: 520px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #dbe7f5;
}

.trip-map-wide {
  height: 520px;
  min-height: 520px;
}

.trip-popup {
  min-width: 200px;
  font-family: Manrope, system-ui, sans-serif;
}

.trip-popup-kicker {
  margin: 0 0 4px;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trip-popup strong {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
}

.trip-popup dl {
  margin: 0 0 10px;
}

.trip-popup dl > div {
  margin-bottom: 6px;
}

.trip-popup dt {
  color: #667085;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.trip-popup dd {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.trip-popup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.trip-popup-actions .btn {
  width: 100%;
  margin: 0;
  padding: 8px 8px;
  min-height: 36px;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.leaflet-popup-content {
  margin: 12px 14px;
  width: 280px !important;
}

.leaflet-container a.btn,
.trip-popup-actions a.btn,
.actions a.btn-print-all,
.actions a.btn-nav,
.actions a.btn-call {
  color: #ffffff !important;
}

.trip-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.trip-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}

.trip-card .actions {
  flex: 1 1 220px;
  max-width: 260px;
}

.trip-card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.trip-card span {
  font-size: 13px;
  font-weight: 700;
}

.trip-card .trip-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #ecfdf3;
  color: #166534;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-decoration: none;
  line-height: 1.1;
}

.trip-phone.muted {
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.phone-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.trip-card .trip-price {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.trip-card .trip-when {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.trip-card .trip-when.today {
  color: #d62828;
}

.trip-pin {
  background: none !important;
  border: 0 !important;
}

.trip-pin-mark {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
}

.trip-miss {
  display: block;
  margin-top: 6px;
  color: var(--danger);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.alert-strip {
  margin-bottom: 20px;
}

.alert-strip h2 {
  font-size: 15px;
  margin-bottom: 12px;
  color: #9a3412;
}

.alert-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.alert-tile {
  display: grid;
  gap: 6px;
  text-align: left;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 14px;
  padding: 14px;
  width: 100%;
  color: var(--text);
}

.alert-tile.critical {
  background: #fef2f2;
  border-color: #fca5a5;
}

.alert-tile.pickup {
  background: #eff6ff;
  border-color: #93c5fd;
}

.alert-strip:has(.pickup) h2 {
  color: #1d4ed8;
}

.alert-tile strong {
  font-size: 15px;
}

.alert-reg {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.alert-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  white-space: normal;
  word-break: break-word;
  vertical-align: middle;
}

th:first-child,
td:first-child {
  width: 36px;
  padding-left: 12px;
}

th.num-col,
td.num-col {
  width: 28px;
  max-width: 32px;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
  white-space: nowrap;
}

th.make-col,
td.make-col {
  width: 10%;
}

th.model-col,
td.model-col {
  width: 11%;
}

th.plate-col,
td.plate-col {
  width: 14%;
}

th.date-col,
td.date-col,
.meter-cell {
  width: 14%;
}

th.make-col,
th.model-col,
th.plate-col,
th.date-col {
  white-space: nowrap;
}

td.make-col,
td.model-col {
  font-size: 14px;
}

th.actions-col,
td.actions-col {
  width: 214px;
  min-width: 214px;
  max-width: 220px;
  padding-right: 12px;
}

th.status-col,
td.status-col {
  width: 12%;
  white-space: nowrap;
}

th.sold-col,
td.sold-col {
  width: 11%;
  white-space: nowrap;
}

th.scrap-col,
td.scrap-col {
  width: 10%;
}

.history-table th.actions-col,
.history-table td.actions-col {
  width: 92px;
  min-width: 92px;
  max-width: 96px;
}

.history-table .actions {
  grid-template-columns: 1fr;
}

.fleet-table {
  width: 100%;
}

.plate-col .plate {
  height: 32px;
}

.plate-col .plate-num {
  font-size: 15px;
  padding: 0 10px;
}

.copyable {
  cursor: pointer;
}

.copyable:hover {
  filter: brightness(1.05);
}

.id-card .copyable {
  border-bottom: 1px dashed #93c5fd;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #0b1b4a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  z-index: 80;
  box-shadow: 0 10px 30px rgba(11, 27, 74, 0.35);
}

.plate {
  display: inline-flex;
  align-items: stretch;
  height: 28px;
  border: 2px solid #171717;
  border-radius: 4px;
  overflow: hidden;
  background: #f4f4ee;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  vertical-align: middle;
  max-width: 100%;
}

.plate-eu {
  width: 18px;
  background: #003399;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 7px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.plate-stars {
  color: #ffcc00;
  font-size: 6px;
  letter-spacing: -1px;
}

.plate-num {
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-family: Oswald, Manrope, sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: #111;
  white-space: nowrap;
}

.kv .plate {
  height: 34px;
  margin-top: 4px;
}

.kv .plate-eu {
  width: 22px;
  font-size: 8px;
}

.kv .plate-num {
  font-size: 18px;
  padding: 0 12px;
}

.meter {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.meter-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  flex-wrap: wrap;
}

.meter-track {
  height: 8px;
  background: #e8eef6;
  border-radius: 999px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
}

.meter-fill.ok {
  background: var(--ok);
}

.meter-fill.warn {
  background: #f59e0b;
}

.meter-fill.late {
  background: var(--danger);
}

.meter-meta .ok {
  color: var(--ok);
}

.meter-meta .warn {
  color: #d97706;
}

.meter-meta .late {
  color: var(--danger);
}

th {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--head);
}

.sort-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  font-weight: 800;
  text-align: left;
  white-space: normal;
}

.sort-btn:hover,
.sort-btn.sorted {
  color: var(--accent);
}

tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: rgba(29, 78, 216, 0.06);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.ok {
  background: rgba(61, 214, 140, 0.12);
  color: var(--ok);
}

.warn {
  background: rgba(255, 176, 32, 0.12);
  color: var(--warn);
}

.late {
  background: rgba(255, 92, 108, 0.14);
  color: var(--danger);
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
}

.actions .btn {
  padding: 7px 6px;
  font-size: 11px;
  line-height: 1.1;
  width: 100%;
  margin: 0;
  min-height: 32px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  border-radius: 9px;
}

.actions .btn-ghost {
  background: #fff;
}

.actions:has(.btn:only-child) {
  grid-template-columns: 1fr;
}

.btn-nav {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: #ffffff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 26, 34, 0.35);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  overflow-x: hidden;
  overflow-y: auto;
}

.modal {
  width: min(640px, 100%);
  max-width: 100%;
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  max-height: 90vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.modal h3 {
  margin-bottom: 18px;
  font-size: 22px;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.date-row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.date-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.date-row .btn {
  width: auto;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.profile {
  display: grid;
  gap: 16px;
}

.back {
  color: var(--muted);
  background: none;
  border: 0;
  font-weight: 700;
  margin-bottom: 4px;
  width: fit-content;
}

.profile-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 24px;
  color: #fff;
  background:
    radial-gradient(700px 240px at 90% -20%, rgba(59, 130, 246, 0.55), transparent 55%),
    linear-gradient(135deg, #0b1b4a 0%, #1d4ed8 58%, #2563eb 100%);
  box-shadow: 0 18px 40px rgba(29, 78, 216, 0.28);
}

.hero-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%);
  pointer-events: none;
}

.hero-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.profile-actions {
  position: relative;
  display: grid;
  margin-top: 16px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.profile-actions .btn {
  width: 100%;
}

.profile-hero .profile-actions .btn {
  min-height: 44px;
  font-size: 13px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-kicker {
  position: relative;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.75;
  font-weight: 700;
}

.profile-title {
  position: relative;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 0.9;
  margin: 6px 0 14px;
}

.profile-title span {
  opacity: 0.82;
}

.profile-plate {
  position: relative;
  margin-bottom: 14px;
}

.profile-plate .plate {
  height: 40px;
  border-width: 3px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.profile-plate .plate-eu {
  width: 24px;
  font-size: 8px;
}

.profile-plate .plate-num {
  font-size: 20px;
  padding: 0 14px;
}

.hero-pills {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-pills span {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.profile-hero .actions .btn {
  background: rgba(255, 255, 255, 0.92);
}

.profile-hero .actions .btn-print-card {
  background: #ffffff;
  color: #0b1b4a;
  border: 2px solid #fbbf24;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  font-weight: 800;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--ok);
}

.stat-card.ok,
.stat-card.warn,
.stat-card.late {
  background: #fff;
  color: var(--text);
}

.stat-card.warn {
  border-top-color: #f59e0b;
}

.stat-card.late {
  border-top-color: var(--danger);
}

.stat-card p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-card > strong {
  display: block;
  font-size: 18px;
}

.id-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.id-card > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}

.id-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.id-card code {
  font-family: Oswald, Manrope, monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.note-box {
  border: 1px dashed #93c5fd;
  border-radius: 14px;
  padding: 14px 16px;
  background: #eff6ff;
}

.note-box span {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.note-box p {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.5;
}

.profile-card,
.history-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.history-title {
  font-size: 18px;
  margin-bottom: 16px;
}

.timeline {
  list-style: none;
  display: grid;
  gap: 0;
  position: relative;
  padding-left: 8px;
}

.timeline li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  padding: 0 0 16px;
  position: relative;
}

.timeline li:not(.empty-history)::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 12px;
  bottom: 0;
  width: 2px;
  background: #dbeafe;
}

.tl-dot {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px #dbeafe;
  z-index: 1;
}

.timeline time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.timeline p {
  font-weight: 600;
  margin-top: 2px;
}

.empty-history {
  grid-template-columns: 1fr;
  border: 0;
  color: var(--muted);
  font-weight: 600;
  padding: 4px 0;
}

.empty-history::before {
  display: none;
}

.kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.kv div {
  background: var(--head);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.kv span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.placeholder {
  margin-top: 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 16px;
}

.empty {
  padding: 48px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: auto;
    z-index: 30;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  }

  .sidebar-brand {
    display: none;
  }

  .sidebar-userbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
    background: #fff;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    gap: 6px;
  }

  .nav-title {
    display: none;
  }

  .nav-item {
    flex: 1;
    text-align: center;
    font-size: 12px;
    padding: 12px 8px;
    min-height: 44px;
  }

  .content {
    padding: 16px 14px calc(160px + env(safe-area-inset-bottom, 0px));
    padding-top: calc(76px + env(safe-area-inset-top, 0px));
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
  }

  .page-head,
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .page-head h1 {
    font-size: 34px;
  }

  .trip-layout {
    grid-template-columns: 1fr;
  }

  .trip-list-desktop {
    display: none !important;
  }

  .trip-list-mobile {
    display: grid;
    gap: 12px;
    padding-bottom: 12px;
  }

  .trip-map-wrap,
  .trip-map,
  .trip-map-wide {
    height: 360px;
    min-height: 360px;
  }

  .trip-card {
    flex-direction: column;
  }

  .trip-card .actions {
    max-width: none;
  }

  .back {
    min-height: 48px;
    padding: 12px 16px;
    font-size: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    margin-bottom: 12px;
  }

  .stat-row,
  .id-card {
    grid-template-columns: 1fr;
  }

  .login-card,
  .modal {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 16px;
    max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }

  .modal-backdrop {
    padding: 12px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    align-items: end;
    justify-items: stretch;
  }

  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .date-row {
    flex-wrap: wrap;
  }

  .date-row .btn {
    width: 100%;
  }

  .modal-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  input,
  select,
  textarea,
  .btn {
    font-size: 16px;
  }

  .actions .btn {
    min-height: 40px;
    font-size: 13px;
  }

  .toolbar .btn {
    width: 100%;
  }

  .table-wrap {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  table,
  tbody {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody tr {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 8px 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
  }

  tbody tr:hover {
    background: #fff;
  }

  th,
  td {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 4px;
    width: auto !important;
    border: 0;
    padding: 4px 0;
    white-space: normal;
    text-align: left;
  }

  td[data-label="#"] {
    display: none;
  }

  td:not(.check-col) {
    grid-column: 2;
  }

  td.check-col {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 2px 0 0;
  }

  td.check-col::before {
    display: none;
  }

  td.check-col input {
    width: 22px;
    height: 22px;
    margin: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex: none;
    width: auto;
    text-align: left;
  }

  .fleet-table {
    min-width: 0;
  }

  th.make-col,
  td.make-col,
  th.model-col,
  td.model-col,
  th.plate-col,
  td.plate-col,
  th.date-col,
  td.date-col,
  th.status-col,
  td.status-col,
  th.sold-col,
  td.sold-col,
  th.scrap-col,
  td.scrap-col,
  th.actions-col,
  td.actions-col,
  .meter-cell {
    width: auto;
    min-width: 0;
    max-width: none;
  }

  .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  td[data-label="Akcje"] {
    display: block;
    padding-top: 8px;
  }

  td[data-label="Akcje"]::before {
    display: none;
  }

  .meter-cell,
  .meter {
    min-width: 0;
    width: 100%;
  }

  .empty {
    display: block;
    padding: 24px;
  }

  .empty::before {
    display: none;
  }
}

#print-root {
  display: none;
}

html.print-mode,
html.print-mode body {
  background: #fff !important;
  margin: 0;
  padding: 12px;
  overflow: visible !important;
}

@media print {
  @page {
    size: A4;
    margin: 10mm 10mm 12mm;
  }

  html,
  body {
    background: #fff !important;
    overflow: visible !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.is-printing #app,
  body.is-printing .toast,
  body.is-printing .modal-backdrop {
    display: none !important;
  }

  body.is-printing #print-root {
    display: block !important;
    color: #152033;
    font-family: Manrope, system-ui, sans-serif;
  }

  .print-sheet {
    width: 100%;
  }

  .print-head {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 16px;
    border-bottom: 4px solid #1d4ed8;
    padding-bottom: 14px;
    margin-bottom: 16px;
  }

  .print-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .print-mark {
    width: 14px;
    height: 42px;
    background: #1d4ed8;
    border-radius: 3px;
  }

  .print-brand strong {
    display: block;
    font-family: "Bebas Neue", sans-serif;
    font-size: 38px;
    letter-spacing: 0.1em;
    color: #1d4ed8;
    line-height: 0.9;
  }

  .print-brand span {
    color: #667085;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .print-doc {
    text-align: right;
  }

  .print-badge {
    display: inline-block;
    border: 1px solid #1d4ed8;
    color: #1d4ed8;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    margin-bottom: 6px;
  }

  .print-head h1 {
    font-family: "Bebas Neue", sans-serif;
    font-size: 30px;
    letter-spacing: 0.04em;
    margin: 0;
    line-height: 1;
  }

  .print-head p {
    margin: 4px 0 0;
    color: #667085;
    font-size: 12px;
  }

  .print-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }

  .print-summary > div {
    border: 1px solid #d7dee8;
    border-top: 3px solid #1d4ed8;
    padding: 8px 10px;
  }

  .print-summary span {
    display: block;
    color: #667085;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 2px;
  }

  .print-summary strong {
    font-size: 14px;
  }

  .print-inventory {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .print-inventory > li {
    display: flex;
    gap: 0;
    margin-bottom: 8px;
    border: 1px solid #c5d0e0;
    background: #fff;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .print-idx {
    width: 46px;
    flex-shrink: 0;
    background: #1d4ed8 !important;
    color: #fff !important;
    font-family: "Bebas Neue", sans-serif;
    font-size: 22px;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .print-body {
    flex: 1;
    min-width: 0;
    padding: 8px 12px 10px;
  }

  .print-row1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }

  .print-inventory h2 {
    font-family: "Bebas Neue", sans-serif;
    font-size: 26px;
    letter-spacing: 0.04em;
    margin: 0;
    line-height: 0.95;
  }

  .print-inventory h2 span {
    color: #2563eb;
  }

  .print-meta {
    margin: 4px 0 0;
    color: #5b677a;
    font-size: 10px;
    font-family: ui-monospace, Consolas, monospace;
  }

  .print-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
  }

  .print-m {
    border: 1px solid #d7dee8;
    padding: 5px 8px;
    background: #f8fafc;
  }

  .print-m span {
    display: block;
    color: #667085;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1px;
  }

  .print-m b {
    display: block;
    font-size: 12px;
  }

  .print-m i {
    display: block;
    font-style: normal;
    font-size: 10px;
    font-weight: 800;
    margin-top: 1px;
  }

  .print-m.ok {
    border-left: 4px solid #2a9d8f;
  }

  .print-m.ok i {
    color: #157a6e;
  }

  .print-m.warn {
    border-left: 4px solid #e9a825;
  }

  .print-m.warn i {
    color: #b45309;
  }

  .print-m.late {
    border-left: 4px solid #d62828;
  }

  .print-m.late i {
    color: #b42318;
  }

  .print-inventory .print-plate {
    height: 34px;
    flex-shrink: 0;
  }

  .print-inventory .print-plate .plate-eu {
    width: 22px;
    font-size: 7px;
  }

  .print-inventory .print-plate .plate-stars {
    font-size: 7px;
  }

  .print-inventory .print-plate .plate-num {
    font-size: 16px;
    padding: 0 10px;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10.5px;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #cfd8e6;
    padding: 8px 7px;
    text-align: left;
    vertical-align: top;
  }

  .print-table th {
    background: #1d4ed8;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .print-table tbody tr:nth-child(even) {
    background: #f4f7fb;
  }

  .print-lp {
    width: 28px;
    text-align: center;
    color: #667085;
    font-weight: 800;
  }

  .print-car {
    display: block;
    font-size: 12px;
  }

  .print-model {
    display: block;
    color: #667085;
    font-size: 10px;
    margin-top: 1px;
  }

  .print-vin {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 9px;
    word-break: break-all;
  }

  .print-plate {
    display: inline-flex !important;
    align-items: stretch;
    height: 24px;
    border: 2px solid #111 !important;
    border-radius: 3px;
    overflow: hidden;
    background: #f4f4ee !important;
    box-shadow: none;
    vertical-align: middle;
    max-width: 100%;
  }

  .print-plate .plate-eu {
    width: 16px;
    background: #003399 !important;
    color: #fff !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    font-size: 6px;
    font-weight: 800;
    line-height: 1;
  }

  .print-plate .plate-stars {
    color: #ffcc00 !important;
    font-size: 5px;
    letter-spacing: -1px;
  }

  .print-plate .plate-num {
    display: flex;
    align-items: center;
    padding: 0 7px;
    font-family: Oswald, sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: #111 !important;
    background: #f4f4ee !important;
    white-space: nowrap;
  }

  .print-date {
    display: block;
    font-weight: 700;
  }

  .print-days {
    display: block;
    font-size: 9px;
    font-weight: 800;
    margin-top: 2px;
  }

  .print-days.ok,
  .print-chip.ok {
    color: #157a6e;
  }

  .print-days.warn {
    color: #b45309;
  }

  .print-days.late {
    color: #b42318;
  }

  .print-chip {
    display: inline-block;
    border: 1px solid #1d4ed8;
    color: #1d4ed8;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 999px;
  }

  .print-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    border: 1px solid #d7dee8;
    border-left: 8px solid #1d4ed8;
    padding: 16px 18px;
    margin-bottom: 14px;
    background: #f8fafc;
  }

  .print-kicker {
    margin: 0 0 4px;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .print-hero h2 {
    font-family: "Bebas Neue", sans-serif;
    font-size: 42px;
    letter-spacing: 0.04em;
    margin: 0;
    line-height: 0.95;
  }

  .print-hero h2 em {
    font-style: normal;
    color: #3b82f6;
  }

  .print-year {
    margin: 6px 0 0;
    color: #667085;
    font-size: 12px;
  }

  .print-hero-side {
    text-align: right;
  }

  .print-hero-side .print-plate {
    height: 48px;
    border-width: 3px !important;
    margin-bottom: 8px;
  }

  .print-hero-side .print-plate .plate-eu {
    width: 30px;
    font-size: 9px;
  }

  .print-hero-side .print-plate .plate-stars {
    font-size: 8px;
  }

  .print-hero-side .print-plate .plate-num {
    font-size: 24px;
    padding: 0 16px;
  }

  .print-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }

  .print-metrics > div {
    border: 1px solid #d7dee8;
    padding: 10px 12px;
  }

  .print-metrics span {
    display: block;
    color: #667085;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .print-metrics strong {
    display: block;
    font-size: 16px;
  }

  .print-metrics em {
    display: block;
    font-style: normal;
    font-size: 11px;
    font-weight: 800;
    margin-top: 3px;
  }

  .print-metrics .ok {
    border-top: 4px solid #2a9d8f;
  }

  .print-metrics .ok em {
    color: #157a6e;
  }

  .print-metrics .warn {
    border-top: 4px solid #e9a825;
  }

  .print-metrics .warn em {
    color: #b45309;
  }

  .print-metrics .late {
    border-top: 4px solid #d62828;
  }

  .print-metrics .late em {
    color: #b42318;
  }

  .print-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 14px;
    border: 1px solid #d7dee8;
  }

  .print-grid > div {
    padding: 10px 12px;
    border-right: 1px solid #d7dee8;
    border-bottom: 1px solid #d7dee8;
  }

  .print-grid span {
    display: block;
    color: #667085;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 3px;
  }

  .print-grid strong {
    font-size: 13px;
    word-break: break-all;
  }

  .print-note {
    border: 1px solid #d7dee8;
    padding: 12px 14px;
    margin-bottom: 14px;
    background: #f8fafc;
  }

  .print-note span,
  .print-history h3 {
    display: block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1d4ed8;
    margin-bottom: 6px;
  }

  .print-note p {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
  }

  .print-history ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid #d7dee8;
  }

  .print-history li {
    position: relative;
    padding: 0 0 12px 16px;
  }

  .print-dot {
    position: absolute;
    left: -5px;
    top: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1d4ed8;
  }

  .print-history time {
    display: block;
    color: #667085;
    font-size: 10px;
    font-weight: 700;
  }

  .print-history p {
    margin: 2px 0 0;
    font-size: 12px;
  }

  .print-empty {
    color: #667085;
    padding-left: 16px;
  }

  .print-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    border-top: 2px solid #1d4ed8;
    padding-top: 8px;
    color: #667085;
    font-size: 10px;
  }
}
