/* ===== Autá (src/pages/cars.php) =====
 * Rovnaký vzhľad ako Plánovanie: svetlé karty, oranžová ako akcent.
 */
.cars {
    --cars-accent: rgb(255, 136, 0);
    --cars-accent-dark: rgb(205, 105, 0);
    --cars-text: #222;
    --cars-muted: #666;
    --cars-line: rgba(0, 0, 0, 0.08);
    --cars-card: rgba(255, 255, 255, 0.9);
    font-family: Arial, Helvetica, sans-serif;
    color: var(--cars-text);
    margin: 0 2% 30px 2%;
}
.cars [hidden] {
    display: none !important;
}

/* --- Nadpis --- */
.cars-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.cars-title {
    margin: 0 0 6px 0;
}
.cars-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    margin-top: 6px;
    border-radius: 2px;
    background: var(--cars-accent);
}
.cars-desc {
    margin: 0;
}

/* --- Tlačidlá --- */
.cars-button {
    font-family: inherit;
    font-size: 15px;
    padding: 10px 22px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    background: white;
    color: var(--cars-text);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.cars-button:hover {
    border-color: var(--cars-accent);
    color: var(--cars-accent-dark);
}
.cars-button.primary {
    background: var(--cars-accent);
    border-color: var(--cars-accent);
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.cars-button.primary:hover {
    background: var(--cars-accent-dark);
    border-color: var(--cars-accent-dark);
    color: white;
}

/* --- Hlásenia --- */
.cars-flash,
.cars-errors {
    margin-bottom: 14px;
    padding: 10px 16px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.cars-flash  { border-left: 5px solid #2e7d32; font-weight: bold; }
.cars-errors { border-left: 5px solid rgb(220, 0, 0); color: rgb(150, 0, 0); }
.cars-errors ul { margin: 5px 0 0 0; padding-left: 20px; }

/* --- Panel (karta) --- */
.cars-panel {
    margin-bottom: 20px;
    border-radius: 14px;
    background: var(--cars-card);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(6px);
}
.cars-panel-header {
    padding: 12px 16px 12px 20px;
    border-bottom: 1px solid var(--cars-line);
    border-radius: 14px 14px 0 0;
    box-shadow: inset 5px 0 0 var(--cars-accent);
}
.cars-panel-title {
    font-size: 18px;
    font-weight: bold;
}
.cars-panel-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--cars-line);
    border-radius: 0 0 14px 14px;
    background: rgba(0, 0, 0, 0.02);
}
.cars-note {
    margin-right: auto;
    font-size: 13px;
    color: var(--cars-muted);
}
.cars-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--cars-muted);
}

/* --- Editor --- */
.cars-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    padding: 16px;
}
.cars-form fieldset {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-content: start;
    margin: 0;
    padding: 14px 16px 16px 16px;
    border: 1px solid var(--cars-line);
    border-radius: 12px;
    background: white;
}
.cars-form legend {
    padding: 0 6px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--cars-muted);
}
.cars-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: bold;
    color: var(--cars-muted);
}
.cars-form label.wide {
    grid-column: 1 / -1;
}
.cars-form input,
.cars-form select {
    height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    background: white;
    color: var(--cars-text);
    font-family: inherit;
    font-size: 15px;
    font-weight: normal;
    box-sizing: border-box;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.cars-form input:focus,
.cars-form select:focus {
    outline: none;
    border-color: var(--cars-accent);
    box-shadow: 0 0 0 3px rgba(255, 136, 0, 0.2);
}
.cars-form input:invalid:not(:placeholder-shown) {
    border-color: rgb(220, 0, 0);
}
.cars-form input.upper {
    text-transform: uppercase;
}
.cars-form input.upper::placeholder {
    text-transform: none;
}
.cars-form .mono,
.cars-table .mono {
    font-family: Consolas, "Courier New", monospace;
    letter-spacing: 1px;
}
.cars-field-hint {
    min-height: 14px;
    font-size: 11px;
    font-weight: normal;
    color: var(--cars-muted);
}
.cars-field-hint.bad {
    color: rgb(200, 0, 0);
}

/* --- Súhrn --- */
.cars-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.cars-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    font-weight: bold;
}
.cars-card .value { font-size: 24px; }
.cars-card .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cars-muted);
}
.cars-card.bad  { box-shadow: inset 4px 0 0 rgb(220, 0, 0), 0 4px 14px rgba(0, 0, 0, 0.15); }
.cars-card.bad .value  { color: rgb(200, 0, 0); }
.cars-card.warn { box-shadow: inset 4px 0 0 var(--cars-accent), 0 4px 14px rgba(0, 0, 0, 0.15); }
.cars-card.warn .value { color: var(--cars-accent-dark); }

/* --- Tabuľka --- */
.cars-table-wrap {
    /* relative: skrytý text .sr-only v hlavičke ostane vnútri posúvania (inak roztiahne celú stránku na mobile) */
    position: relative;
    overflow-x: auto;
    padding: 6px 10px;
}
.cars-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.cars-table th {
    padding: 10px 10px;
    border-bottom: 2px solid var(--cars-line);
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cars-muted);
    white-space: nowrap;
}
.cars-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--cars-line);
    vertical-align: middle;
}
.cars-table tbody tr:last-child td {
    border-bottom: none;
}
.cars-table tbody tr:hover td {
    background: rgba(255, 136, 0, 0.06);
}
.cars-table tr.editing td {
    background: rgba(255, 136, 0, 0.12);
}
.cars-table .num {
    text-align: right;
    white-space: nowrap;
}
.cars-name {
    display: block;
    font-weight: bold;
    font-size: 15px;
}
/* ŠPZ ako tabuľka s modrým pruhom */
.cars-plate {
    display: inline-block;
    margin-top: 4px;
    padding: 1px 8px 1px 14px;
    border: 1px solid #333;
    border-radius: 4px;
    background: linear-gradient(to right, #1f4fb5 8px, white 8px);
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}
.cars-none {
    color: #aaa;
}
.cars-date {
    display: block;
    white-space: nowrap;
}
.cars-check {
    display: inline-block;
    margin-top: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
}
.cars-check.ok      { background: rgba(46, 125, 50, 0.12); color: #1e7a32; }
.cars-check.soon    { background: rgba(255, 136, 0, 0.15); color: var(--cars-accent-dark); }
.cars-check.expired { background: rgba(220, 0, 0, 0.12);  color: rgb(190, 0, 0); }
.cars-check.none    { background: rgba(0, 0, 0, 0.05);    color: var(--cars-muted); font-weight: normal; }

/* Akcie */
.cars-table .actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}
.cars-table .actions form {
    display: inline-flex;
    gap: 2px;
}
.cars-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--cars-muted);
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.cars-icon.edit:hover   { background: rgba(255, 136, 0, 0.12); color: var(--cars-accent-dark); }
.cars-icon.delete:hover { background: rgba(220, 0, 0, 0.1);    color: rgb(200, 0, 0); }

/* --- Fotka --- */
.cars-form .cars-photo-field {
    grid-template-columns: 1fr;
}
.cars-photo-drop {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 2;
    border: 2px dashed rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.03);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}
.cars-photo-drop:hover,
.cars-photo-drop.over {
    border-color: var(--cars-accent);
    background: rgba(255, 136, 0, 0.06);
}
.cars-photo-drop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* označené na odstránenie */
.cars-photo-drop.removed img {
    opacity: 0.3;
    filter: grayscale(1);
}
.cars-photo-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    height: 100%;
}
.cars-photo-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    text-align: center;
    font-weight: normal;
    color: var(--cars-muted);
}
.cars-photo-empty svg {
    width: 48px;
    height: 48px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.6;
}
.cars-photo-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.cars-form .cars-check-label {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    color: rgb(180, 0, 0);
    cursor: pointer;
}
.cars-form .cars-check-label input {
    width: 16px;
    height: 16px;
    accent-color: rgb(200, 0, 0);
}

/* Miniatúra v zozname */
.cars-car {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cars-thumb {
    width: 72px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.cars-thumb.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    color: #aaa;
    box-shadow: none;
}

/* --- Diaľničné známky --- */
.cars-empty.small {
    padding: 18px 20px;
}
.cars-note.pad {
    margin: 0;
    padding: 0 16px 14px 16px;
}
.cars-vignette-list {
    list-style: none;
    margin: 0;
    padding: 12px 16px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cars-vignette {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--cars-line);
    border-radius: 10px;
    background: white;
}
.cars-vignette.expired {
    opacity: 0.6;
}
.cars-vignette form {
    margin-left: 4px;
}
/* Kód krajiny ako nálepka */
.cars-country {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 6px;
    background: #1f4fb5;
    color: white;
    font-weight: bold;
    letter-spacing: 1px;
}
.cars-vignette-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 180px;
    font-size: 14px;
}
.cars-vignette-text span {
    font-size: 13px;
    color: var(--cars-muted);
}
.cars-vignette-price {
    font-weight: bold;
    white-space: nowrap;
}
.cars-vignette-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin: 14px 16px 10px 16px;
    padding: 14px;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    background: rgba(255, 136, 0, 0.04);
}
.cars-vignette-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: bold;
    color: var(--cars-muted);
}
.cars-vignette-form label.grow {
    flex: 1;
    min-width: 160px;
}
.cars-vignette-form input,
.cars-vignette-form select {
    height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    background: white;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}
.cars-vignette-form input[type="number"] {
    width: 110px;
}
.cars-vignette-form input:focus,
.cars-vignette-form select:focus {
    outline: none;
    border-color: var(--cars-accent);
    box-shadow: 0 0 0 3px rgba(255, 136, 0, 0.2);
}
.cars-vignette-form .cars-button {
    height: 36px;
    padding: 0 18px;
}

/* Známky v zozname áut */
.cars-vignette-chip {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    white-space: nowrap;
}
.cars-vignette-chip.active { background: rgba(46, 125, 50, 0.12); color: #1e7a32; }
.cars-vignette-chip.soon   { background: rgba(255, 136, 0, 0.15); color: var(--cars-accent-dark); }
.cars-vignette-chip.future { background: rgba(0, 0, 0, 0.05);    color: var(--cars-muted); }

@media (max-width: 600px) {
    .cars-form fieldset {
        grid-template-columns: 1fr;
    }
}
