:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #18202a;
    --muted: #667085;
    --line: #d9dee7;
    --primary: #1f5eff;
    --primary-dark: #1749c7;
    --danger: #b42318;
    --warning: #b54708;
    --success: #067647;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #111827;
    color: white;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 12px 18px;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.brand { font-weight: 800; letter-spacing: .2px; }
.topbar nav { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a { opacity: .9; }
.topbar nav a:hover { opacity: 1; }
.container { width: min(1120px, calc(100% - 24px)); margin: 22px auto 70px; }
.footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(255,255,255,.96);
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}
.hero, .form-card, .detail-card, .info-card, .empty {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
.hero h1, .page-head h1 { margin: 0 0 8px; }
.hero p, .page-head p { margin: 0; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
}
.btn:hover { border-color: #9aa4b2; }
.btn.primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 32px; padding: 6px 10px; border-radius: 9px; font-size: 13px; }
.btn.full { width: 100%; margin-top: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.info-card h3 { margin: 0 0 8px; }
.info-card p { margin: 0; color: var(--muted); }
.page-head { margin-bottom: 16px; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.vehicle-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.vehicle-card {
    background: white;
    border: 1px solid var(--line);
    border-left-width: 7px;
    border-radius: 16px;
    padding: 16px;
    display: block;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .05);
}
.vehicle-card.status-FREE { border-left-color: var(--success); }
.vehicle-card.status-IN_USE { border-left-color: var(--warning); }
.vehicle-card.status-OUT_OF_SERVICE { border-left-color: var(--danger); }
.vehicle-main { display: flex; flex-direction: column; gap: 4px; }
.vehicle-main strong { font-size: 24px; }
.vehicle-main span { color: var(--muted); }
.vehicle-meta { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    background: #eef2ff;
    color: #3538cd;
}
.badge.free { background: #ecfdf3; color: var(--success); }
.badge.in_use, .badge.active { background: #fffaeb; color: var(--warning); }
.badge.out_of_service, .badge.cancelled { background: #fef3f2; color: var(--danger); }
.badge.closed { background: #f2f4f7; color: #344054; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.detail-card { margin-bottom: 14px; }
.detail-card .row { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px dashed var(--line); padding: 10px 0; }
.detail-card .row:last-child { border-bottom: none; }
.warning-box { border-color: #fedf89; }
.form-card { max-width: 720px; }
.form-card.narrow { max-width: 430px; }
.form-card section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.form-card section:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.form-card h3 { margin: 0 0 10px; }
label { display: block; font-weight: 800; margin: 14px 0 6px; }
input, textarea, select {
    width: 100%;
    border: 1px solid #c8d0dc;
    border-radius: 12px;
    padding: 12px;
    font: inherit;
    background: white;
    margin-top: 6px;
}
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(31,94,255,.18); border-color: var(--primary); }
.required { color: var(--danger); }
.hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.scan-section { background: #f8fafc; border-radius: 14px; padding: 14px !important; }
.scan-result {
    margin-top: 12px;
    border: 1px dashed #98a2b3;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    min-height: 46px;
    color: var(--muted);
    font-weight: 700;
}
.scan-result.ok { border-color: var(--success); color: var(--success); background: #ecfdf3; }
.scan-result.error { border-color: var(--danger); color: var(--danger); background: #fef3f2; }
.scan-result.pending { border-color: var(--warning); color: var(--warning); background: #fffaeb; }
.messages { margin-bottom: 16px; display: grid; gap: 8px; }
.alert { border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); background: white; }
.alert-success { color: var(--success); background: #ecfdf3; border-color: #abefc6; }
.alert-danger { color: var(--danger); background: #fef3f2; border-color: #fecdca; }
.alert-warning { color: var(--warning); background: #fffaeb; border-color: #fedf89; }
.alert-info { color: #175cd3; background: #eff8ff; border-color: #b2ddff; }
.inline { display: inline; }
.link-button { background: none; color: white; border: none; padding: 0; cursor: pointer; font: inherit; opacity: .9; }
.link-button:hover { opacity: 1; }
.table-wrap { background: white; border: 1px solid var(--line); border-radius: 16px; overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8fafc; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.admin-tabs a { padding: 9px 12px; border-radius: 999px; border: 1px solid var(--line); background: white; font-weight: 700; }
.admin-tabs a.active { background: #111827; color: white; border-color: #111827; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters select { width: auto; min-width: 190px; margin-top: 0; }
.checkbox-line { display: flex; gap: 10px; align-items: center; }
.checkbox-line input { width: auto; margin: 0; }
.prebox { background: #101828; color: #e5e7eb; border-radius: 14px; padding: 14px; overflow: auto; min-height: 120px; }
.empty { color: var(--muted); }
@media (max-width: 760px) {
    .topbar { align-items: flex-start; flex-direction: column; }
    .container { width: min(100% - 18px, 1120px); margin-top: 14px; }
    .footer { position: static; flex-direction: column; }
    .cards-grid, .vehicle-list { grid-template-columns: 1fr; }
    .vehicle-main strong { font-size: 22px; }
    .row-head { flex-direction: column; align-items: stretch; }
    .filters select, .filters button { width: 100%; }
}

.hero-kicker {
    display: inline-block;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 700;
}

.employee-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #1f2937;
    font-weight: 700;
    white-space: nowrap;
}

.employee-status {
    border-left: 4px solid #2563eb;
}

.reader-input {
    width: 100%;
    margin: 0.5rem 0;
    letter-spacing: 0.15em;
    -webkit-text-security: disc;
}

.reader-section {
    margin-top: 1.2rem;
}

/* Kontron-style landing page / corporate shell */
:root {
    --kontron-navy: #003865;
    --kontron-blue: #005aa9;
    --kontron-cyan: #00a3e0;
    --kontron-green: #6abf4b;
}
body {
    background:
        radial-gradient(circle at top left, rgba(0, 163, 224, .14), transparent 30%),
        linear-gradient(180deg, #eef6fb 0%, #f4f6f8 45%, #f7f9fc 100%);
}
.topbar {
    background: linear-gradient(90deg, var(--kontron-navy), #061a2f 68%, #0b2f4f);
    border-bottom: 3px solid var(--kontron-cyan);
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--kontron-cyan), var(--kontron-green));
    color: #fff;
    font-weight: 900;
}
.lang-switch { display: inline-flex; gap: 4px; align-items: center; }
.lang-switch a {
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
}
.lang-switch a.active { background: #fff; color: var(--kontron-navy); opacity: 1; }
.company-hero {
    min-height: 320px;
    border: none;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(0,56,101,.96), rgba(0,90,169,.9)),
        radial-gradient(circle at right, rgba(0,163,224,.35), transparent 38%);
    box-shadow: 0 18px 45px rgba(0,56,101,.23);
    overflow: hidden;
    position: relative;
}
.company-hero::after {
    content: "";
    position: absolute;
    right: -90px;
    top: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 38px solid rgba(255,255,255,.08);
}
.company-hero .hero-kicker {
    color: #b9efff;
}
.company-hero h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1.05; max-width: 820px; }
.company-hero p { color: rgba(255,255,255,.88); max-width: 760px; font-size: 17px; }
.company-hero .home-note { margin-top: 10px; color: rgba(255,255,255,.74); }
.home-actions { margin-top: 28px; }
.app-tile {
    display: flex;
    gap: 16px;
    align-items: center;
    width: min(100%, 460px);
    padding: 18px;
    border-radius: 20px;
    background: rgba(255,255,255,.98);
    color: var(--kontron-navy);
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
    border: 2px solid rgba(255,255,255,.75);
}
.app-tile:hover { transform: translateY(-1px); border-color: var(--kontron-cyan); }
.app-tile-icon {
    font-size: 34px;
    width: 62px;
    height: 62px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8f7fd;
}
.app-tile-text { display: grid; gap: 3px; }
.app-tile-text strong { font-size: 22px; }
.app-tile-text small { color: #475467; line-height: 1.35; }
.module-preview .muted-card { opacity: .62; }
.btn.primary { background: var(--kontron-blue); border-color: var(--kontron-blue); }
.btn.primary:hover { background: var(--kontron-navy); }
.employee-status { border-left-color: var(--kontron-cyan); }
.auto-km-box {
    display: grid;
    gap: 5px;
    border: 1px solid #b9e7f8;
    background: #effaff;
    border-radius: 14px;
    padding: 14px;
    margin: 12px 0 16px;
}
.auto-km-box span { color: var(--muted); font-weight: 800; }
.auto-km-box strong { color: var(--kontron-navy); font-size: 24px; }
.auto-km-box small { color: var(--muted); }
.compact-actions { margin-top: 0; }
@media (max-width: 760px) {
    .company-hero { min-height: auto; padding: 22px; }
    .app-tile { width: 100%; }
}
