/* ==========================================================================
   Admin Styles - Exilogic
   Jediný štýlový súbor administrácie. Žiadne inline štýly v HTML ani v JS.

   OBSAH
   1.  Premenné (design tokens)
   2.  Reset a základ
   3.  Layout (wrapper, sidebar, top bar, content)
   4.  Komponenty
       4.1  Štatistiky a karty
       4.2  Tabuľky, odznaky, stavy
       4.3  Tlačidlá
       4.4  Filtre, stránkovanie
       4.5  Modály
       4.6  Notifikácie a tooltipy
       4.7  Upozornenia a časová os (dashboard)
   5.  Detail (modal) - sekcie, trasa, financie, prílohy, stavová časová os
   6.  Formuláre (stránky *-add)
   7.  Nastavenia
   8.  Reporty
   9.  Utility
   10. Responzívny dizajn
   ========================================================================== */


/* ==========================================================================
   1. Premenné
   ========================================================================== */

:root {
    --blue-700: #1e3a8a;
    --blue-600: #1e40af;
    --blue-500: #3b82f6;
    --blue-400: #60a5fa;
    --blue-200: #bfdbfe;
    --blue-100: #dbeafe;
    --blue-50: #eff6ff;
    --green-600: #059669;
    --green-500: #10b981;
    --green-100: #d1fae5;
    --orange-600: #ea580c;
    --orange-500: #f59e0b;
    --orange-100: #fed7aa;
    --red-600: #dc2626;
    --red-500: #ef4444;
    --red-100: #fee2e2;
    --purple-600: #9333ea;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
}


/* ==========================================================================
   2. Reset a základ
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
    overflow: hidden;
}

[hidden] {
    display: none !important;
}


/* ==========================================================================
   3. Layout
   ========================================================================== */

/* Admin Wrapper */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 13px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-header span {
    font-size: 20px;
    font-weight: 700;
    color: var(--blue-600);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--gray-50);
    color: var(--blue-600);
}

.nav-item.active {
    background: var(--blue-100);
    color: var(--blue-600);
}

.nav-item svg {
    flex-shrink: 0;
}

.nav-section {
    margin: 20px 0 8px;
}

.nav-section-title {
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
}

.nav-sub {
    padding-left: 32px;
    font-size: 13px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-200);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--blue-600);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-avatar.large {
    width: 56px;
    height: 56px;
    font-size: 18px;
    flex-shrink: 0;
}

.user-avatar.xlarge {
    width: 80px;
    height: 80px;
    font-size: 24px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--gray-500);
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.top-bar {
    height: 64px;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.top-bar-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--gray-600);
}

.mobile-menu-btn:hover {
    color: var(--gray-900);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    position: relative;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--gray-600);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.icon-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--red-500);
    color: white;
    font-size: 10px;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}


/* ==========================================================================
   4. Komponenty
   ========================================================================== */

/* ---------- 4.1 Štatistiky a karty ---------- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--gray-200);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-title {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue {
    background: var(--blue-100);
    color: var(--blue-600);
}

.stat-icon.green {
    background: var(--green-100);
    color: var(--green-600);
}

.stat-icon.orange {
    background: var(--orange-100);
    color: var(--orange-600);
}

.stat-icon.red {
    background: var(--red-100);
    color: var(--red-600);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.stat-value.is-pulse {
    transform: scale(1.05);
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.stat-change.positive {
    color: var(--green-600);
}

.stat-change.negative {
    color: var(--red-600);
}

.stat-change.neutral {
    color: var(--gray-500);
}

/* Karta v detaile vozidla: štatistika v bočnom paneli */
.stat-item {
    padding: 12px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.stat-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.stat-item .stat-value {
    font-size: 20px;
    margin-bottom: 0;
}

.detail-section .stats-grid {
    gap: 12px;
    margin-bottom: 0;
}

/* Card */
.card {
    min-width: 0;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.card-link {
    color: var(--blue-600);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.card-link:hover {
    color: var(--blue-700);
}

.badge-count {
    background: var(--red-500);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.card-large {
    grid-column: span 2;
}

/* Dashboard Row */
.dashboard-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

/* Mapy (Leaflet + OpenStreetMap) */
.map-box {
    height: 340px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--gray-100);
    isolation: isolate;
}

.map-box-route {
    height: 240px;
    margin-top: 16px;
}

.map-box.map-box-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    color: var(--gray-600);
}

.map-card-body {
    padding: 24px;
}

.map-caption {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
}

.map-caption::before {
    content: '';
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green-500);
}

.map-marker {
    background: none;
    border: none;
}

.map-marker span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid white;
    border-radius: 50%;
    background: var(--blue-600);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 13px;
    font-weight: 700;
}

.map-marker-start span {
    background: var(--green-500);
}

.map-marker-end span {
    background: var(--red-500);
}

.map-marker-vehicle span::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
}

.map-route {
    stroke: var(--blue-600);
    stroke-width: 3;
    stroke-dasharray: 8 8;
}

.leaflet-popup-content div {
    margin: 2px 0 0;
    color: var(--gray-600);
}


/* ---------- 4.2 Tabuľky, odznaky, stavy ---------- */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--gray-50);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

.data-table th.sortable {
    cursor: pointer;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table strong {
    color: var(--gray-900);
    font-weight: 600;
}

.data-table .empty-row td {
    padding: 32px 16px;
    text-align: center;
    color: var(--gray-500);
}

.text-success {
    color: var(--green-600);
    font-weight: 600;
}

.text-danger {
    color: var(--red-600);
    font-weight: 600;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.status-active {
    background: var(--green-100);
    color: var(--green-600);
}

.status-badge.status-loading {
    background: var(--blue-100);
    color: var(--blue-600);
}

.status-badge.status-planned {
    background: var(--gray-200);
    color: var(--gray-700);
}

.status-badge.status-completed {
    background: var(--green-100);
    color: var(--green-600);
}

.status-badge.status-maintenance {
    background: var(--orange-100);
    color: var(--orange-600);
}

.status-badge.status-inactive {
    background: var(--gray-200);
    color: var(--gray-600);
}

.status-badge.status-paid {
    background: var(--green-100);
    color: var(--green-600);
}

.status-badge.status-unpaid {
    background: var(--orange-100);
    color: var(--orange-600);
}

.status-badge.status-pending {
    background: var(--orange-100);
    color: var(--orange-600);
}

.status-badge.status-overdue {
    background: var(--red-100);
    color: var(--red-600);
}

.status-badge.large {
    padding: 8px 16px;
    font-size: 14px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: var(--green-100);
    color: var(--green-600);
}

.badge-warning {
    background: var(--orange-100);
    color: var(--orange-600);
}

.badge-danger {
    background: var(--red-100);
    color: var(--red-600);
}

/* Odznak bez hodnoty (napr. dokument, ktorý zamestnanec nemá) */
.badge.is-empty {
    padding: 0;
    font-weight: 400;
}

/* Route Display (tabuľky) */
.route {
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-from,
.route-to {
    font-size: 13px;
    color: var(--gray-700);
}

/* Table Footer */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
}

.table-info {
    color: var(--gray-600);
    font-size: 14px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.pagination-btn.active {
    background: var(--blue-600);
    color: white;
    border-color: var(--blue-600);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ---------- 4.3 Tlačidlá ---------- */

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--gray-500);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--gray-100);
    color: var(--blue-600);
}

.btn-icon.btn-danger:hover {
    background: var(--red-100);
    color: var(--red-600);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--blue-600);
    color: white;
}

.btn-primary:hover {
    background: var(--blue-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn.btn-danger {
    background: var(--red-600);
    color: white;
}

.btn.btn-danger:hover {
    background: var(--red-500);
}

.btn-success {
    background: var(--green-600);
    color: white;
}

.btn-success:hover {
    background: var(--green-500);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--blue-600);
    color: var(--blue-600);
}

.btn-outline:hover {
    background: var(--blue-600);
    color: white;
}

.btn-block {
    width: 100%;
}

.link-primary {
    color: var(--blue-600);
}


/* ---------- 4.4 Filtre ---------- */

.filters-bar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.filters-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filters-group {
    display: flex;
    gap: 16px;
    flex: 1;
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.filter-item label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.filter-item input,
.filter-item select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-700);
    background: white;
}

.filter-item input:focus,
.filter-item select:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}


/* ---------- 4.5 Modály ---------- */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@supports (height: 100dvh) {
    .modal-content {
        max-height: 90dvh;
    }
}

.modal-large {
    max-width: 1200px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}


/* ---------- 4.6 Notifikácie a tooltipy ---------- */

.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    max-width: calc(100vw - 40px);
    padding: 16px 24px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--blue-500);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

.notification-success {
    border-left-color: var(--green-500);
}

.notification-error {
    border-left-color: var(--red-500);
}

.notification-warning {
    border-left-color: var(--orange-500);
}

.notification.is-leaving {
    animation: slideOut 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Pozícia tooltipu (left/top) nastavuje admin-script.js cez konštruovateľný stylesheet */
.tooltip {
    position: absolute;
    left: 0;
    top: 0;
    background: var(--gray-800);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}


/* ---------- 4.7 Upozornenia a časová os (dashboard) ---------- */

.alerts-list {
    padding: 16px;
}

.alert-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.alert-item:last-child {
    margin-bottom: 0;
}

.alert-warning {
    background: var(--orange-100);
}

.alert-danger {
    background: var(--red-100);
}

.alert-info {
    background: var(--blue-100);
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    color: inherit;
}

.alert-warning .alert-icon {
    color: var(--orange-600);
}

.alert-danger .alert-icon {
    color: var(--red-600);
}

.alert-info .alert-icon {
    color: var(--blue-600);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 13px;
}

.alert-warning .alert-title {
    color: var(--orange-600);
}

.alert-danger .alert-title {
    color: var(--red-600);
}

.alert-info .alert-title {
    color: var(--blue-600);
}

.alert-text {
    font-size: 12px;
    color: var(--gray-700);
}

/* Timeline */
.timeline-list {
    padding: 16px;
}

.timeline-item {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-date {
    flex-shrink: 0;
    text-align: center;
}

.timeline-day {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.timeline-month {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
}

.timeline-content {
    flex: 1;
    padding-top: 2px;
}

.timeline-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
    font-size: 14px;
}

.timeline-text {
    font-size: 12px;
    color: var(--gray-600);
}


/* ==========================================================================
   5. Detail (modal)
   ========================================================================== */

/* Order Detail */
.order-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
}

.order-detail-main,
.order-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.detail-section {
    padding: 20px;
    background: var(--gray-50);
    border-radius: 8px;
}

.detail-section.info {
    background: var(--blue-50);
}

.detail-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-900);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.detail-item {
    margin-bottom: 16px;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.detail-item p {
    color: var(--gray-900);
    font-size: 14px;
    overflow-wrap: anywhere;
}

p.detail-text {
    color: var(--gray-700);
    line-height: 1.6;
}

p.detail-text.muted {
    color: var(--gray-600);
}

p.detail-note {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 8px;
}

p.rating-stars {
    font-size: 24px;
    color: var(--orange-500);
}

/* Route Detail */
.route-detail {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
}

.route-point {
    display: flex;
    gap: 16px;
}

.route-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.route-marker.start {
    background: var(--green-500);
    color: white;
}

.route-marker.end {
    background: var(--red-500);
    color: white;
}

.route-info {
    flex: 1;
    padding-bottom: 16px;
}

.route-info strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--gray-900);
}

.route-info p {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 2px;
}

.route-line {
    width: 2px;
    height: 24px;
    background: var(--gray-300);
    margin-left: 15px;
}

/* Finance Grid */
.finance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.finance-item {
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.finance-item.profit {
    border-color: var(--green-500);
}

.finance-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.finance-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}

.finance-value.success {
    color: var(--green-600);
}

.profit-margin {
    display: block;
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 4px;
}

.cost-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cost-breakdown.boxed {
    margin-top: 20px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--gray-700);
}

.cost-row.total {
    padding-top: 8px;
    border-top: 1px solid var(--gray-200);
    margin-top: 4px;
}

/* Attachments */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.attachment-item svg {
    flex-shrink: 0;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-info strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 14px;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.attachment-info span {
    font-size: 12px;
    color: var(--gray-500);
}

/* Status Timeline */
.status-timeline {
    margin-top: 16px;
}

.timeline-step {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
}

.timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 28px;
    bottom: -16px;
    width: 2px;
    background: var(--gray-200);
}

.timeline-step.completed::after {
    background: var(--green-500);
}

.timeline-step.active::after {
    background: var(--blue-500);
}

.timeline-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    z-index: 1;
    background: white;
}

.timeline-step.completed .timeline-icon {
    background: var(--green-500);
    color: white;
}

.timeline-step.active .timeline-icon {
    background: var(--blue-500);
    color: white;
    animation: pulse 2s infinite;
}

.timeline-step:not(.completed):not(.active) .timeline-icon {
    background: white;
    border: 2px solid var(--gray-300);
    color: var(--gray-400);
}

.timeline-text strong {
    display: block;
    font-size: 14px;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.timeline-text span {
    font-size: 12px;
    color: var(--gray-500);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
    }
}

/* Detail vozidla: história údržby a priradený vodič */
.maintenance-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.maintenance-timeline .timeline-item {
    margin-bottom: 0;
}

.maintenance-timeline .timeline-date {
    min-width: 84px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    padding-top: 2px;
}

.maintenance-timeline .timeline-content strong {
    display: block;
    font-size: 14px;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.maintenance-timeline .timeline-content p {
    font-size: 12px;
    color: var(--gray-600);
}

.driver-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.driver-details strong {
    display: block;
    font-size: 14px;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.driver-details p {
    font-size: 13px;
    color: var(--gray-600);
}


/* ==========================================================================
   6. Formuláre (stránky *-add)
   ========================================================================== */

.form-container {
    max-width: 900px;
    margin: 0 auto;
}

.form-container.wide {
    max-width: 1100px;
}

.form-container.wider {
    max-width: 1200px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid-full {
    grid-column: 1 / -1;
}

.form-grid > * {
    min-width: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.form-group label .required {
    color: var(--red-500);
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-700);
    background: white;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input[type="file"] {
    padding: 8px 12px;
}

.is-invalid {
    border-color: var(--red-500) !important;
}

.form-section {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    padding: 24px;
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-100);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 24px;
}

.helper-text {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    cursor: pointer;
    margin: 0;
}

.two-col-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
}

/* Položky faktúry / cenovej ponuky */
.items-table {
    width: 100%;
    margin-top: 16px;
}

.items-table table {
    width: 100%;
    border-collapse: collapse;
}

.items-table th {
    background: var(--gray-50);
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.items-table td {
    padding: 12px;
    border: 1px solid var(--gray-200);
}

.items-table input,
.items-table select,
.items-table textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.items-table select {
    min-width: 84px;
    background: white;
}

.items-table textarea {
    min-height: 60px;
    resize: vertical;
}

.items-table input:focus,
.items-table select:focus,
.items-table textarea:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.1);
}

.items-table .number-input {
    text-align: right;
}

.remove-btn {
    background: var(--red-500);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: var(--red-600);
}

.add-item-btn {
    margin-top: 12px;
    background: var(--blue-600);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.add-item-btn:hover {
    background: var(--blue-500);
}

.summary-section {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}

.summary-row:last-child {
    border-bottom: none;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 2px solid var(--gray-300);
}

.summary-row label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.summary-row.total label {
    font-size: 18px;
    color: var(--gray-900);
}

.summary-row .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.summary-row.total .value {
    font-size: 24px;
    color: var(--blue-600);
}

/* Cenová ponuka: platnosť a trasa */
.validity-info {
    background: var(--orange-100);
    border: 2px solid var(--orange-500);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.validity-info svg {
    color: var(--orange-600);
    flex-shrink: 0;
}

.validity-info p {
    color: var(--gray-800);
    margin: 0;
    font-size: 14px;
}

.route-display {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--blue-50);
    border: 2px solid var(--blue-200);
    border-radius: 12px;
    margin-bottom: 16px;
}

.route-display .location {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.route-display .location input {
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    padding: 0;
}

.route-display .arrow {
    color: var(--blue-600);
    font-size: 24px;
    font-weight: bold;
}

/* Zákazka: trasa, kalkulačka nákladov, stav */
.route-builder {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: 12px;
    margin-bottom: 16px;
}

.route-builder-point {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.route-builder-point input {
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-700);
    background: white;
    transition: all 0.2s ease;
}

.route-builder-point input:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.route-builder-point label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.route-arrow {
    flex-shrink: 0;
    color: var(--blue-600);
    font-size: 24px;
    font-weight: bold;
}

.cost-calculator {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
}

.cost-calculator h4 {
    margin-bottom: 16px;
    color: var(--gray-800);
}

.cost-calculator .cost-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
}

.cost-calculator .cost-row:last-child {
    border-bottom: none;
}

.cost-calculator .cost-row.total {
    padding-top: 16px;
    margin-top: 8px;
    border-top: 2px solid var(--gray-300);
    font-size: 18px;
    font-weight: 700;
}

.cost-calculator .cost-row.profit {
    color: var(--green-600);
}

.cost-calculator .cost-row.profit.is-negative {
    color: var(--red-600);
}

.cost-calculator .cost-row input {
    width: 150px;
    text-align: right;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
}

/* Výberové karty (radio) */
.category-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.category-option {
    padding: 16px 12px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.category-option:hover {
    border-color: var(--blue-600);
    background: var(--blue-50);
}

.category-option.selected {
    border-color: var(--blue-600);
    background: var(--blue-100);
}

.category-option input[type="radio"] {
    display: none;
}

.category-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon svg {
    width: 28px;
    height: 28px;
}

.category-option.fuel .category-icon { color: var(--orange-600); }
.category-option.salary .category-icon { color: var(--blue-600); }
.category-option.maintenance .category-icon { color: var(--green-600); }
.category-option.toll .category-icon { color: var(--red-600); }
.category-option.insurance .category-icon { color: var(--purple-600); }
.category-option.other .category-icon { color: var(--gray-600); }

.payment-type-selector {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.payment-type-option {
    padding: 20px 16px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.payment-type-option:hover {
    border-color: var(--blue-600);
    background: var(--blue-50);
}

.payment-type-option.selected {
    border-color: var(--blue-600);
    background: var(--blue-100);
}

.payment-type-option.incoming.selected {
    border-color: var(--green-600);
    background: var(--green-100);
}

.payment-type-option.outgoing.selected {
    border-color: var(--red-600);
    background: var(--red-100);
}

.payment-type-option input[type="radio"] {
    display: none;
}

.payment-type-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-type-icon svg {
    width: 36px;
    height: 36px;
}

.payment-type-option.incoming .payment-type-icon {
    color: var(--green-600);
}

.payment-type-option.outgoing .payment-type-icon {
    color: var(--red-600);
}

.payment-type-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.payment-type-description {
    font-size: 13px;
    color: var(--gray-600);
}

.status-selector {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.status-option {
    padding: 12px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    background: white;
}

.status-option:hover {
    border-color: var(--blue-600);
}

.status-option.selected {
    border-color: var(--blue-600);
    background: var(--blue-100);
}

.status-option input[type="radio"] {
    display: none;
}

/* Zobrazenie sumy (náklady, platby) */
.amount-display {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.amount-display .label {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.amount-display .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--red-600);
}

.amount-display.large {
    padding: 24px;
    margin-top: 20px;
}

.amount-display.large .value {
    font-size: 36px;
    color: var(--gray-900);
}

.amount-display.incoming .value {
    color: var(--green-600);
}

.amount-display.outgoing .value {
    color: var(--red-600);
}

/* Nahrávanie príloh */
.file-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-area:hover,
.file-upload-area.is-dragover {
    border-color: var(--blue-600);
    background: var(--blue-50);
}

.file-upload-area > svg {
    margin: 0 auto 12px;
}

.file-upload-area input[type="file"] {
    display: none;
}


/* ==========================================================================
   7. Nastavenia
   ========================================================================== */

.settings-container {
    max-width: 1200px;
}

.settings-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 32px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.settings-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.settings-tab:hover {
    color: var(--blue-600);
}

.settings-tab.active {
    color: var(--blue-600);
    border-bottom-color: var(--blue-600);
}

.settings-section {
    display: none;
}

.settings-section.active {
    display: block;
}

.settings-group {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    padding: 24px;
    margin-bottom: 24px;
}

.settings-group-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 20px;
}

.settings-desc {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.settings-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.settings-row:last-child {
    margin-bottom: 0;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-field label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.settings-field input,
.settings-field select,
.settings-field textarea {
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-700);
    background: white;
}

.settings-field input:focus,
.settings-field select:focus,
.settings-field textarea:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.settings-field textarea {
    resize: vertical;
    min-height: 100px;
}

.settings-field-full {
    grid-column: span 2;
}

.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-200);
}

.settings-toggle:last-child {
    border-bottom: none;
}

.settings-toggle-info {
    flex: 1;
}

.settings-toggle-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.settings-toggle-desc {
    font-size: 13px;
    color: var(--gray-600);
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background: var(--gray-300);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toggle-switch.active {
    background: var(--blue-600);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.toggle-switch.active::after {
    transform: translateX(24px);
}

.file-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-upload-preview {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.file-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.file-upload-info {
    flex: 1;
}

.file-upload-title {
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: 4px;
}

.file-upload-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.file-upload-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.file-upload-btn + .file-upload-btn {
    margin-left: 8px;
}

.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 6px;
}

.activity-text {
    font-size: 13px;
    color: var(--gray-700);
}

.activity-time {
    font-size: 12px;
    color: var(--gray-500);
}

/* Úvodný text skupiny nastavení */
.settings-intro {
    margin: -8px 0 20px;
    font-size: 14px;
    color: var(--gray-600);
}

/* Role používateľov: tabuľka oprávnení */
.permission-table .permission-cell {
    width: 96px;
    text-align: center;
}

.permission-table .permission-na {
    color: var(--gray-300);
}

.permission-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    accent-color: var(--blue-600);
    cursor: pointer;
}

.permission-cell input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.toggle-switch.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hlavička skupiny nastavení so stavom (napr. Predplatné) */
.settings-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.settings-group-header .settings-group-title {
    margin-bottom: 0;
}

.settings-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 24px 0 12px;
}

.settings-row-spaced {
    margin-top: 16px;
}

/* Oznámenie v nastaveniach */
.settings-notice {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--blue-50);
    border-left: 4px solid var(--blue-600);
    border-radius: 8px;
    color: var(--gray-700);
    font-size: 13px;
}

.settings-notice p {
    margin-bottom: 4px;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--blue-600);
    cursor: pointer;
    text-decoration: underline;
}

.link-button:hover {
    color: var(--blue-700);
}

/* Výber z veľkých kariet (napr. spôsob tvorby faktúr) */
.choice-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.choice-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.choice-card:hover {
    border-color: var(--blue-600);
    background: var(--blue-50);
}

.choice-card.selected {
    border-color: var(--blue-600);
    background: var(--blue-100);
}

.choice-card input[type="radio"] {
    display: none;
}

.choice-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

.choice-card-desc {
    font-size: 13px;
    color: var(--gray-600);
}

/* Predplatné */
.subscription-plan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: 12px;
}

.subscription-plan-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.subscription-plan-price {
    margin-top: 4px;
    font-size: 14px;
    color: var(--gray-600);
}

.subscription-plan-price strong {
    font-size: 18px;
    color: var(--gray-900);
}

.subscription-plan-meta {
    margin-top: 4px;
    font-size: 13px;
    color: var(--gray-500);
}

.subscription-plan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.usage-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.usage-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 13px;
}

.usage-label {
    color: var(--gray-700);
    font-weight: 500;
}

.usage-value {
    color: var(--gray-600);
}

.usage-bar {
    display: block;
    width: 100%;
    height: 8px;
    border: none;
    border-radius: 4px;
    background: var(--gray-200);
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
}

.usage-bar::-webkit-progress-bar {
    background: var(--gray-200);
}

.usage-bar::-webkit-progress-value {
    background: var(--blue-600);
    border-radius: 4px;
}

.usage-bar::-moz-progress-bar {
    background: var(--blue-600);
    border-radius: 4px;
}

.usage-bar.warning::-webkit-progress-value { background: var(--orange-500); }
.usage-bar.warning::-moz-progress-bar { background: var(--orange-500); }
.usage-bar.danger::-webkit-progress-value { background: var(--red-500); }
.usage-bar.danger::-moz-progress-bar { background: var(--red-500); }

.payment-method {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: 8px;
}

.payment-method-card {
    font-weight: 600;
    color: var(--gray-900);
}

.payment-method-expiry {
    flex: 1;
    color: var(--gray-500);
    font-size: 13px;
}


/* ==========================================================================
   8. Reporty
   ========================================================================== */

.chart-legend {
    display: flex;
    gap: 16px;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-dot.green { background: var(--green-500); }
.legend-dot.red { background: var(--red-500); }
.legend-dot.orange { background: var(--orange-500); }
.legend-dot.blue { background: var(--blue-500); }

.legend-label {
    font-size: 12px;
    color: var(--gray-500);
}

.chart-body {
    padding: 24px;
}

.chart-body.center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-footer {
    padding: 0 24px 24px;
}

.donut-legend {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.donut-legend-label {
    font-size: 13px;
    color: var(--gray-700);
}

.donut-legend-value {
    margin-left: auto;
    font-size: 13px;
}

.metrics-body {
    padding: 20px 24px;
}

.metric-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
}

.metric-label {
    font-size: 14px;
    color: var(--gray-500);
}

.metric-value {
    font-size: 18px;
    color: var(--gray-800);
}

.metric-value.positive {
    color: var(--green-500);
}

/* Grafy (SVG sa vykresľuje z admin-script.js) */
.chart-grid {
    stroke: var(--gray-200);
    stroke-width: 1;
}

.chart-label {
    font-size: 12px;
    fill: var(--gray-500);
}

.chart-label.dark {
    fill: var(--gray-700);
}

.chart-label.bold {
    font-weight: 600;
}

.chart-line {
    fill: none;
    stroke-width: 3;
}

.chart-line.green { stroke: var(--green-500); }
.chart-line.red { stroke: var(--red-500); }

.chart-area.green { fill: url(#greenGradient); }
.chart-area.red { fill: url(#redGradient); }

.chart-point.green { fill: var(--green-500); }
.chart-point.red { fill: var(--red-500); }

.chart-stop.green { stop-color: var(--green-500); }
.chart-stop.red { stop-color: var(--red-500); }

.chart-bar {
    fill: var(--blue-500);
}

.chart-ring {
    fill: none;
    stroke-width: 20;
}

.chart-ring.base { stroke: var(--gray-200); }
.chart-ring.orange { stroke: var(--orange-500); }
.chart-ring.blue { stroke: var(--blue-500); }
.chart-ring.green { stroke: var(--green-500); }
.chart-ring.red { stroke: var(--red-500); }


/* ==========================================================================
   9. Utility
   (!important, aby vždy prebili komponentové štýly)
   ========================================================================== */

.w-5 { width: 5% !important; }
.w-10 { width: 10% !important; }
.w-15 { width: 15% !important; }
.w-40 { width: 40% !important; }
.w-45 { width: 45% !important; }
.w-50 { width: 50% !important; }

.text-center { text-align: center !important; }

.mt-12 { margin-top: 12px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-20 { margin-top: 20px !important; }

.fs-18 { font-size: 18px !important; }
.fs-20 { font-size: 20px !important; }

.color-muted { color: var(--gray-500) !important; }
.color-success { color: var(--green-600) !important; }
.color-danger { color: var(--red-600) !important; }


/* ==========================================================================
   10. Responzívny dizajn
   ========================================================================== */

@media (max-width: 1200px) {
    /* Tabuľky: stĺpce sa nezalamujú, tabuľka sa posúva vodorovne (v modáloch sa text zalamuje) */
    .data-table th,
    .data-table td {
        white-space: nowrap;
    }

    .modal .data-table th,
    .modal .data-table td {
        white-space: normal;
    }

    .dashboard-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .card-large {
        grid-column: span 1;
    }

    .order-detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .finance-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 968px) {
    /* Sidebar sa zasúva zľava, za ním sa stmaví obsah */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 90;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-item {
        min-width: 0;
    }

    .filters-bar .btn {
        justify-content: center;
    }

    .detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Formuláre */
    .form-grid,
    .form-grid-3,
    .two-col-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .items-table {
        overflow-x: auto;
    }

    .items-table table {
        min-width: 720px;
    }

    .route-display,
    .route-builder {
        flex-direction: column;
    }

    .route-display .arrow,
    .route-arrow {
        transform: rotate(90deg);
    }

    .category-selector,
    .status-selector {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payment-type-selector {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Grafy sa prispôsobia šírke, výška vychádza z pomeru strán */
    svg[data-chart] {
        height: auto;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .choice-cards,
    .choice-cards.plan-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .settings-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .settings-field-full {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .map-card-body {
        padding: 16px;
    }

    .map-box {
        height: 280px;
    }

    .content-area {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .stat-value {
        font-size: 28px;
    }

    /* Horná lišta sa môže zalomiť na dva riadky, nič nepreteká */
    .top-bar {
        height: auto;
        min-height: 64px;
        padding: 10px 16px;
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .top-bar-left h1 {
        font-size: 20px;
    }

    .top-bar-right {
        flex-wrap: wrap;
        gap: 8px;
    }

    .top-bar-right .btn {
        padding: 8px 14px;
    }

    /* Vedľajšie tlačidlá v hornej lište (export) ostanú len ako ikony */
    .top-bar-right .btn-secondary span {
        display: none;
    }

    .filters-group {
        grid-template-columns: minmax(0, 1fr);
    }

    .card-header {
        padding: 16px;
    }

    .table-footer {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .pagination-btn {
        padding: 8px 10px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    /* Modály */
    .modal {
        padding: 10px;
    }

    .modal-content {
        max-width: 100%;
        max-height: calc(100vh - 20px);
    }

    .modal-header,
    .modal-footer {
        padding: 14px 16px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .detail-section {
        padding: 16px;
    }

    /* Formuláre: pole s písmom aspoň 16 px, aby iOS nepribližoval stránku */
    .form-section,
    .settings-group,
    .summary-section {
        padding: 16px;
    }

    .form-actions .btn,
    .settings-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    .filter-item input,
    .filter-item select,
    .settings-field input,
    .settings-field select,
    .settings-field textarea,
    .items-table input,
    .items-table select,
    .items-table textarea,
    .route-builder-point input,
    .route-display .location input,
    .cost-calculator .cost-row input {
        font-size: 16px;
    }

    .cost-calculator .cost-row input {
        width: 110px;
    }

    .file-upload {
        flex-direction: column;
        align-items: flex-start;
    }

    .subscription-plan {
        padding: 16px;
    }

    .subscription-plan-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .payment-method .btn {
        width: 100%;
        justify-content: center;
    }

    /* Graf tržieb a nákladov sa posúva vodorovne, aby bol čitateľný */
    .chart-body {
        overflow-x: auto;
    }

    svg[data-chart="revenue"] {
        min-width: 560px;
    }

    .notification {
        left: 12px;
        right: 12px;
        top: 72px;
        max-width: none;
    }
}

/* Dotykové zariadenia: dostatočne veľké ovládacie prvky (aspoň 44 px) */
@media (pointer: coarse) {
    .btn,
    .add-item-btn {
        min-height: 44px;
    }

    .btn-icon,
    .icon-btn,
    .mobile-menu-btn,
    .modal-close {
        min-width: 44px;
        min-height: 44px;
    }

    .btn-icon,
    .icon-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .remove-btn,
    .pagination-btn {
        min-width: 40px;
        min-height: 40px;
    }

    .settings-tab,
    .file-upload-btn {
        min-height: 44px;
    }

    .items-table input,
    .items-table select,
    .items-table textarea,
    .cost-calculator .cost-row input {
        min-height: 44px;
    }

    .card-link {
        display: inline-block;
        padding: 12px 0;
    }

    .nav-item {
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

/* ==========================================================================
   Prihlásenie a registrácia
   ========================================================================== */

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    min-height: 100vh;
}

.auth-aside {
    position: sticky;
    top: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    height: 100vh;
    padding: 48px;
    background: linear-gradient(160deg, var(--blue-600), var(--blue-700));
    color: white;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
}

.auth-pitch h2 {
    font-size: 32px;
    line-height: 1.25;
    margin-bottom: 16px;
}

.auth-pitch p {
    font-size: 16px;
    color: var(--blue-100);
    margin-bottom: 32px;
}

.auth-benefits {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-benefits li {
    position: relative;
    padding-left: 32px;
    font-size: 15px;
}

.auth-benefits li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.auth-benefits li::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 5px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.auth-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 24px 32px 48px;
    background: var(--gray-50);
}

.auth-topbar {
    display: flex;
    justify-content: flex-end;
}

.auth-language {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: white;
    color: var(--gray-700);
    font-family: inherit;
    font-size: 14px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: 32px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
}

.auth-card-wide {
    max-width: 780px;
}

.auth-card h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
}

.auth-subtitle {
    margin: 8px 0 24px;
    color: var(--gray-600);
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form .form-grid {
    margin-bottom: 0;
}

.auth-section-title {
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-100);
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.auth-section-note {
    margin-top: -8px;
    font-size: 13px;
    color: var(--gray-600);
}

.form-section .auth-section-note {
    margin: 0 0 16px;
}

.plan-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-card {
    position: relative;
}

.plan-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--blue-600);
    color: white;
    font-size: 11px;
    font-weight: 600;
}

.plan-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.plan-price-year {
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--gray-500);
}

.auth-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    font-size: 14px;
}

.auth-consent {
    align-items: flex-start;
    font-size: 14px;
    color: var(--gray-700);
}

.auth-consent input {
    flex: none;
    margin-top: 3px;
}

.auth-submit {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
}

.auth-link {
    color: var(--blue-600);
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    color: var(--blue-700);
    text-decoration: underline;
}

.auth-switch {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--gray-600);
}

.auth-demo-note {
    margin-top: 16px;
    padding: 10px 12px;
    background: var(--blue-50);
    border-radius: 8px;
    font-size: 12px;
    color: var(--gray-600);
    text-align: center;
}

/* Režim API (napojenie na server): pozri sekciu "Režim API" v admin-script.js */
.api-mode .auth-demo-note {
    display: none;
}

/* kým sa nenačítajú dáta zo servera, stránka ostáva skrytá */
.api-loading body {
    visibility: hidden;
}

.auth-card [hidden],
.api-form-message[hidden] {
    display: none;
}

/* celostránková správa (nepotvrdený e-mail, server nedostupný, ...) */
.api-blocking {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    background: var(--gray-50);
    text-align: center;
}

.api-blocking h1 {
    margin: 0;
    font-size: 24px;
    color: var(--gray-900);
}

.api-blocking p {
    max-width: 480px;
    margin: 0;
    color: var(--gray-600);
}

.api-blocking-status:empty {
    display: none;
}

.api-blocking-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.api-form-message {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
}

.api-form-message-error {
    background: var(--red-100);
    color: var(--red-600);
}

.api-form-message-success {
    background: var(--green-100);
    color: var(--green-600);
}

.has-error input,
.has-error select,
.has-error textarea {
    border-color: var(--red-500);
}

.field-error {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--red-600);
}

.api-demo-notice {
    margin-bottom: 16px;
    padding: 10px 14px;
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    border-radius: 8px;
    font-size: 13px;
    color: var(--gray-700);
}

.nav-item[hidden],
.nav-section[hidden] {
    display: none;
}

/* prvky, ktoré dávajú zmysel len v režime so serverom (napr. import CSV) */
html:not(.api-mode) [data-api-only] {
    display: none !important;
}

/* prvky, ktoré platia len v ukážke bez servera (údaje, ktoré sa na serveri berú zo zákazníka) */
html.api-mode [data-demo-only],
.doc-mode-off {
    display: none !important;
}

.import-result {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.import-result p {
    margin: 0 0 4px;
}

/* náhľad fotky v zozname nahratých príloh */
.attachment-thumb {
    width: 56px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--gray-100);
    flex: none;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--blue-600);
}

/* Odhlásenie v pätičke bočného panela */
.user-logout {
    display: flex;
    margin-left: auto;
    padding: 8px;
    border-radius: 8px;
    color: var(--gray-500);
    transition: all 0.2s ease;
}

.user-logout:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

@media (max-width: 968px) {
    .auth-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-aside {
        position: static;
        height: auto;
        padding: 24px;
        gap: 16px;
    }

    .auth-pitch h2 {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .auth-pitch p {
        margin-bottom: 0;
    }

    .auth-benefits {
        display: none;
    }
}

@media (max-width: 640px) {
    .auth-main {
        padding: 16px 16px 32px;
    }

    .auth-card {
        padding: 24px 20px;
    }

    .auth-pitch p {
        display: none;
    }
}

/* ==========================================================================
   Rozhranie super administrátora (platforma)
   ========================================================================== */

.platform-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--blue-100);
    color: var(--blue-600);
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
}

.badge-info {
    background: var(--blue-100);
    color: var(--blue-600);
}

.badge-neutral {
    background: var(--gray-100);
    color: var(--gray-700);
}

.dashboard-row-equal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Prehľad balíčkov */
.plan-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.plan-overview-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 0;
    padding: 24px;
}

.plan-overview-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.plan-overview-head h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.plan-overview-price strong {
    font-size: 20px;
    color: var(--gray-900);
}

.plan-overview-year {
    font-size: 12px;
    color: var(--gray-500);
}

.plan-overview-limits {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-700);
}

.plan-overview-summary {
    font-size: 13px;
    color: var(--gray-600);
}

.plan-overview-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: auto;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
}

.plan-overview-stats label {
    display: block;
    font-size: 11px;
    color: var(--gray-500);
}

.plan-overview-stats strong {
    font-size: 15px;
    color: var(--gray-900);
}

.plan-compare td:not(:first-child),
.plan-compare th:not(:first-child) {
    text-align: center;
}

/* Role zamestnancov platformy */
.role-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 24px;
}

.role-legend-item p {
    margin-top: 4px;
    font-size: 13px;
    color: var(--gray-600);
}

/* Úvodná stránka: editor otázok */
/* Detail v okne: sekcia mimo mriežky (napr. história platieb) je oddelená od mriežky nad ňou */
.order-detail-grid + .detail-section {
    margin-top: 24px;
}

.coverage {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 140px;
}

.coverage .usage-bar {
    flex: 1;
}

.radio-input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--blue-600);
    cursor: pointer;
}

.faq-editor {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
}

.faq-item .settings-field {
    width: 100%;
}

@media (max-width: 1200px) {
    .plan-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 968px) {
    .dashboard-row-equal {
        grid-template-columns: minmax(0, 1fr);
    }

    .role-legend {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .plan-overview {
        grid-template-columns: minmax(0, 1fr);
    }

    .role-legend {
        padding: 16px;
    }
}

/* Prehľad e-mailových šablón */
.email-index-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 16px 48px;
}

.email-index-main h1 {
    margin-bottom: 8px;
}

.email-index-intro {
    margin-bottom: 20px;
    color: var(--gray-600);
}

.email-index-help,
.email-index-group {
    margin-bottom: 20px;
}

.email-index-help ul {
    margin: 8px 0 0 20px;
}

.email-index-main code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--gray-100);
    font-size: 12px;
}

@media (max-width: 640px) {
    .email-index-main {
        padding: 20px 12px 32px;
    }
}

/* Stránka údržby, 404 a náhľad e-mailu */
.status-page {
    min-height: 100vh;
}

.status-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 24px 16px 48px;
    background: var(--gray-50);
}

.status-topbar {
    display: flex;
    justify-content: flex-end;
}

.status-card {
    width: 100%;
    max-width: 520px;
    margin: auto;
    padding: 40px 32px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    text-align: center;
}

.status-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--blue-50, #eff6ff);
    color: var(--blue-600);
}

.status-code {
    font-size: 72px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
    color: var(--blue-600);
    margin-bottom: 12px;
}

.status-card h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
    overflow-wrap: anywhere;
}

.status-lead {
    margin: 10px 0 0;
    color: var(--gray-600);
    font-size: 15px;
}

.status-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 32px;
    margin: 20px 0 0;
}

.status-info dt {
    font-size: 12px;
    color: var(--gray-500);
}

.status-info dd {
    margin: 2px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

.status-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.status-help {
    margin-top: 24px;
    font-size: 13px;
    color: var(--gray-500);
    overflow-wrap: anywhere;
}

.modal-medium {
    max-width: 760px;
}

.email-preview-frame {
    display: block;
    width: 100%;
    height: 480px;
    margin-top: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-100);
}

.code-chip {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 12px;
}

@media (max-width: 640px) {
    .status-card {
        padding: 28px 20px;
    }

    .status-code {
        font-size: 56px;
    }

    .status-card h1 {
        font-size: 22px;
    }

    .status-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .email-preview-frame {
        height: 380px;
    }
}

/* Editor textu (WYSIWYG) */
.rte {
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.rte:focus-within {
    border-color: var(--blue-600);
}

.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.rte-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: none;
    color: var(--gray-700);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.rte-btn:hover:not(:disabled) {
    background: var(--gray-200);
}

.rte-btn.active {
    border-color: var(--blue-600);
    background: var(--blue-50);
    color: var(--blue-600);
}

.rte-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.rte-separator {
    width: 1px;
    height: 20px;
    margin: 0 4px;
    background: var(--gray-300);
}

.rte-area {
    min-height: 280px;
    max-height: 560px;
    padding: 16px;
    overflow-y: auto;
    outline: none;
    color: var(--gray-800);
    font-size: 15px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.rte-area > :first-child {
    margin-top: 0;
}

.rte-area p,
.rte-area ul,
.rte-area ol,
.rte-area blockquote {
    margin: 0 0 14px;
}

.rte-area h2 {
    margin: 22px 0 10px;
    font-size: 22px;
    color: var(--gray-900);
}

.rte-area h3 {
    margin: 18px 0 8px;
    font-size: 18px;
    color: var(--gray-900);
}

.rte-area ul,
.rte-area ol {
    padding-left: 24px;
}

.rte-area blockquote {
    padding: 4px 0 4px 16px;
    border-left: 4px solid var(--blue-600);
    color: var(--gray-600);
}

.rte-area a {
    color: var(--blue-600);
    text-decoration: underline;
}

.form-group textarea.rte-source {
    display: block;
    width: 100%;
    min-height: 280px;
    border: none;
    border-radius: 0;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 13px;
}

@media (max-width: 640px) {
    .rte-area {
        padding: 12px;
    }

    .rte-btn {
        min-width: 32px;
        padding: 0 6px;
    }
}

.rte-compact .rte-area {
    min-height: 110px;
    max-height: 260px;
}

.form-group .rte-compact textarea.rte-source {
    min-height: 110px;
}

/* Servis a opravy vozidla */
.section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-heading h3 {
    margin-bottom: 0;
}

.service-summary-section {
    margin-bottom: 20px;
}

.service-empty {
    margin-bottom: 16px;
    color: var(--gray-500);
}

.service-history-link {
    width: 100%;
    margin-top: 16px;
    justify-content: center;
}

/* Údaje o vozidle nad formulárom servisu: karta ako ostatné sekcie formulára */
.service-context {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.service-context h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-100);
}

.finance-price + .finance-price {
    margin-top: 16px;
}

/* Ceny: zobrazenie bez DPH / s DPH / obe (režim v <html data-price-mode>) */
html[data-price-mode="net"] [data-price="gross"],
html[data-price-mode="net"] [data-price="vat"],
html[data-price-mode="gross"] [data-price="net"],
html[data-price-mode="gross"] [data-price="vat"],
html[data-price-mode="single"] [data-price="gross"],
html[data-price-mode="single"] [data-price="vat"],
html[data-price-mode="single"] [data-price-multi],
html[data-price-mode="single"] [data-vat-only],
html:not([data-price-mode="single"]) [data-price-single] {
    display: none !important;
}

.price-tag {
    margin-left: 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
}

.price-note {
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray-500);
}

html[data-price-mode="both"] [data-price="gross"][data-price-chart] {
    display: none !important;
}

html[data-price-mode="both"] .stat-card .stat-value[data-price] {
    margin-bottom: 4px;
    font-size: 22px;
}


/* Výber farby (Nastavenia > Fakturácia: farba dokladov) */
.color-input {
    width: 72px;
    height: 42px;
    padding: 4px;
    cursor: pointer;
}

/* Sadzby DPH: editor zoznamu v Nastaveniach */
.vat-rates-table input[type="text"],
.vat-rates-table input[type="number"] {
    width: 100%;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-700);
    background: white;
}

.vat-rates-table input[type="text"]:focus,
.vat-rates-table input[type="number"]:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.vat-rates-table input:disabled {
    background: var(--gray-50);
    color: var(--gray-500);
}

.vat-rates-table input[type="number"] {
    min-width: 80px;
}

.vat-rates-table td,
.vat-rates-table th {
    vertical-align: middle;
}

.vat-rates-table .vat-rate-flag {
    text-align: center;
}

.vat-rates-table .vat-used-tag {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--gray-500);
}

.vat-rates-add,
.vat-rates-preset {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.vat-rates-add .settings-field,
.vat-rates-preset .settings-field {
    flex: 1 1 180px;
}

.vat-breakdown,
.finance-vat-rows {
    display: contents;
}

/* Galéria fotiek vozidla */
.photo-main {
    margin: 0 0 16px;
}

.photo-main img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
    background: var(--gray-100);
}

.photo-main figcaption {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.photo-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.photo-thumb {
    width: 120px;
    padding: 0;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    background: white;
    overflow: hidden;
    cursor: pointer;
}

.photo-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.photo-thumb:hover {
    border-color: var(--gray-400);
}

.photo-thumb.active {
    border-color: var(--blue-600);
}

/* Obmedzenia jazdy: zoznam, značky, panel vo formulári zákazky */
.restriction-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.restriction-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    border-left-width: 4px;
    background: white;
}

.restriction-item.level-danger {
    background: var(--red-100);
}

.restriction-item.level-warning {
    border-left-color: var(--orange-500);
    background: var(--orange-100);
}

.restriction-item.level-info {
    border-left-color: var(--blue-600);
    background: var(--blue-50);
}

.restriction-badge {
    flex: none;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--gray-100);
    color: var(--gray-700);
}

.restriction-badge.level-danger {
    background: var(--red-500);
    color: white;
}

.restriction-badge.level-warning {
    background: var(--orange-500);
    color: white;
}

.restriction-badge.level-info {
    background: var(--blue-600);
    color: white;
}

.restriction-body {
    min-width: 0;
}

.restriction-body strong {
    display: block;
    color: var(--gray-900);
}

.restriction-meta {
    margin-top: 2px;
    font-size: 13px;
    color: var(--gray-600);
}

.restriction-unverified {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--gray-500);
}

.restriction-clear {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--green-100);
    color: var(--green-600);
    font-size: 14px;
    font-weight: 500;
}

.restriction-flag {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 4px;
}

.restriction-flag.level-danger {
    color: var(--red-500);
}

.restriction-flag.level-warning {
    color: var(--orange-500);
}

.restriction-flag.level-info {
    color: var(--blue-600);
}

.country-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.country-chip {
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--gray-200);
    background: white;
    font-size: 13px;
}

.chip-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
}

.chip-checkbox input {
    margin: 0;
}

.route-builder-point select {
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
}

/* Kalendár obmedzení */
.calendar-card {
    padding: 20px;
}

.calendar-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.calendar-nav,
.calendar-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.calendar-title {
    min-width: 170px;
    margin: 0;
    font-size: 18px;
    text-align: center;
}

.calendar-filters select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.calendar-weekday {
    padding: 6px 0;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
}

.calendar-day {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-height: 74px;
    padding: 6px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: white;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.calendar-day:hover {
    border-color: var(--gray-400);
}

.calendar-day.is-outside {
    background: var(--gray-50);
    color: var(--gray-400);
}

.calendar-day.is-today .calendar-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--blue-600);
    color: white;
}

.calendar-day.is-selected {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.15);
}

.calendar-day-number {
    font-size: 13px;
    font-weight: 600;
}

.calendar-marks {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.calendar-chip {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.4;
    color: white;
}

.calendar-chip.level-danger {
    background: var(--red-500);
}

.calendar-chip.level-warning {
    background: var(--orange-500);
}

.calendar-chip.level-info {
    background: var(--blue-600);
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--gray-600);
}

.calendar-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 600px) {
    .calendar-card {
        padding: 12px;
    }

    .calendar-day {
        min-height: 56px;
        padding: 4px;
    }

    .calendar-chip {
        padding: 0 3px;
        font-size: 9px;
    }

    .calendar-title {
        min-width: 0;
        flex: 1;
    }
}

.form-group-contents {
    display: contents;
}

.form-group-contents[hidden] {
    display: none;
}

.calendar-more {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
}

@media (max-width: 520px) {
    .restriction-item {
        flex-direction: column;
        gap: 6px;
    }
}

/* Odznak bez čísla (napr. upozornenia, ktoré sa načítajú len na prehľade) sa nezobrazí */
.icon-btn .badge:empty {
    display: none;
}

/* Pole nad výberom, ktoré hľadá záznamy na serveri */
.remote-search {
    margin-bottom: 6px;
}

/* Pracovník platformy prezerá účet klienta (len na čítanie): pruh nad stránkou */
.impersonation-banner {
    position: sticky;
    top: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 8px 16px;
    background: #92400e;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.impersonation-banner .btn {
    padding: 4px 12px;
}

/* Správy z kontaktného formulára webu (Platforma > Úvodná stránka) */
.message-text {
    max-width: 420px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ==========================================================================
   Nastavenie dvojfaktorového overenia (two-factor.html)
   ========================================================================== */

.tf-card .modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.tf-card .modal-body > p {
    margin: 0;
}

.tf-card section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tf-card section[hidden] {
    display: none;
}

.tf-card p {
    margin: 0;
}

.tf-error {
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--red-100);
    color: var(--red-600);
    font-size: 14px;
    margin-bottom: 16px;
}

.tf-error.is-info {
    background: var(--blue-100);
    color: var(--blue-700);
}

.tf-required {
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--orange-100);
    color: var(--orange-600);
    font-size: 14px;
}

.tf-success {
    color: var(--green-600);
    font-weight: 600;
}

.tf-steps {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tf-qr {
    display: flex;
    justify-content: center;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
}

.tf-qr img {
    width: 200px;
    height: 200px;
}

.tf-secret code,
.tf-codes li {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 6px;
    word-break: break-all;
}

.tf-codes {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.tf-codes li {
    padding: 8px 12px;
    text-align: center;
    font-size: 15px;
    user-select: all;
}

.tf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tf-saved {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.tf-blocking {
    background: var(--gray-100);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
}

.tf-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tf-wide {
    width: 100%;
    justify-content: center;
}

.tf-logout {
    text-align: center;
}

.tf-logout[hidden] {
    display: none;
}

/* ---------- Zvonček: okno s upozorneniami ---------- */

.top-bar-right {
    position: relative;
}

.notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    max-height: min(560px, 75vh);
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    z-index: 900;
    overflow: hidden;
}

.notif-panel[hidden] {
    display: none;
}

.notif-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-200);
}

.notif-header h3 {
    margin: 0;
    font-size: 15px;
}

.notif-list {
    padding: 12px;
    overflow-y: auto;
}

.notif-empty {
    margin: 0;
    padding: 16px 4px;
    text-align: center;
    color: var(--gray-500);
}

.notif-footer {
    display: block;
    padding: 12px 16px;
    border-top: 1px solid var(--gray-200);
    text-align: center;
    font-weight: 600;
    color: var(--blue-600);
    text-decoration: none;
}

.notif-footer:hover {
    background: var(--gray-50);
}

.icon-btn[aria-expanded="true"] {
    background: var(--gray-100);
    color: var(--gray-900);
}

@media (max-width: 640px) {
    .notif-panel {
        position: fixed;
        top: 64px;
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
    }
}
