.service-main-actions {
    display: flex;
    gap: 8px;
}

.service-block {
    margin-top: 22px;
}

.service-block h3 {
    margin: 0 0 10px;
}


/* =========================================================
   STAV SERVISU
   ========================================================= */

.service-status-list {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.service-status-card {
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
}

.service-status-card.ok {
    border-color: #86efac;
    background: #f0fdf4;
}

.service-status-card.approaching {
    border-color: #fcd34d;
    background: #fffbeb;
}

.service-status-card.overdue {
    border-color: #fca5a5;
    background: #fef2f2;
}

.service-status-card.never {
    border-color: #d1d5db;
    background: #f9fafb;
}

.service-status-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    line-height: 1.25;
}

.service-status-summary {
    margin-top: 4px;
    color: #4b5563;
    font-size: 0.8rem;
    line-height: 1.25;
}

.service-status-card.ok
.service-status-summary {
    color: #166534;
}

.service-status-card.approaching
.service-status-summary {
    color: #92400e;
}

.service-status-card.overdue
.service-status-summary {
    color: #991b1b;
}


/* =========================================================
   SERVISNÍ PLÁN - DIALOG
   ========================================================= */

.service-plan-dialog {
    width: min(94vw, 980px);
    max-width: none;
    max-height: 90vh;
    padding: 0;
    overflow-y: auto;

    border: 0;
    border-radius: 14px;

    background: #ffffff;

    box-shadow:
        0 20px 55px
        rgba(15, 23, 42, 0.25);
}

.service-plan-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
}


/* HLAVIČKA */

.service-plan-dialog
.dialog-header {
    position: sticky;
    top: 0;
    z-index: 5;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding: 20px 22px 16px;

    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.service-plan-dialog
.dialog-header h2 {
    margin: 0;
}

.service-plan-description {
    max-width: 600px;
    margin: 5px 0 0;

    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.4;
}


/* TLAČÍTKO PŘIDAT */

.service-plan-actions {
    display: flex;
    justify-content: flex-end;

    margin: 0;
    padding: 16px 22px 2px;
}


/* SEZNAM */

.service-plan-dialog
.service-task-list {
    display: grid;
    gap: 16px;

    padding: 14px 22px 24px;
}


/* KARTA ÚKONU */

.service-task-card {
    padding: 17px 18px;

    border: 1px solid #dbe1e8;
    border-radius: 11px;

    background: #ffffff;

    box-shadow:
        0 1px 3px
        rgba(15, 23, 42, 0.06);
}

.service-task-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;

    padding-bottom: 11px;
    border-bottom: 1px solid #edf0f3;
}

.service-task-name {
    display: block;

    color: #111827;
    font-size: 1.05rem;
    line-height: 1.25;
}

.service-task-type {
    margin-top: 3px;

    color: #64748b;
    font-size: 0.79rem;
}


/* AKTIVNÍ / NEAKTIVNÍ */

.service-active-badge,
.service-inactive-badge {
    flex: 0 0 auto;

    padding: 4px 9px;

    border-radius: 999px;

    font-size: 0.73rem;
    font-weight: 650;
    white-space: nowrap;
}

.service-active-badge {
    background: #dcfce7;
    color: #166534;
}

.service-inactive-badge {
    background: #f1f5f9;
    color: #475569;
}


/* INTERVALY */

.service-task-details {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;

    padding: 12px 0 0;
    margin: 0;

    border-top: 0;
}

.service-task-details > div {
    min-width: 0;

    padding: 10px 12px;

    border: 1px solid #e8edf2;
    border-radius: 8px;

    background: #f8fafc;
}

.service-task-label {
    display: block;

    margin-bottom: 4px;

    color: #64748b;
    font-size: 0.73rem;
    font-weight: 500;
}

.service-task-details strong {
    display: block;

    color: #111827;
    font-size: 0.92rem;
    line-height: 1.3;
}


/* POZNÁMKA */

.service-task-notes {
    margin-top: 12px;
    padding: 11px 13px;

    border: 1px solid #e5e7eb;
    border-left: 4px solid #cbd5e1;
    border-radius: 8px;

    background: #f8fafc;

    text-align: left;
}

.service-task-notes
.service-task-label {
    margin-bottom: 5px;
}

.service-task-notes-text {
    color: #334155;

    font-size: 0.87rem;
    line-height: 1.45;

    white-space: pre-line;
}


/* AKCE KARTY */

.service-task-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;

    margin-top: 13px;
    padding-top: 12px;

    border-top: 1px solid #edf0f3;
}


/* =========================================================
   EDITACE SERVISNÍHO ÚKONU
   ========================================================= */

.service-manufacturer-fields {
    padding: 10px;

    border: 1px solid #d1d5db;
    border-radius: 8px;

    background: #f9fafb;
}

.service-subgrid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}

.form-grid select,
.service-item-grid select {
    width: 100%;

    padding: 8px;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    background: white;

    font: inherit;
}


/* =========================================================
   HISTORIE SERVISU
   ========================================================= */

.service-event-list {
    display: grid;
    gap: 10px;
}

.service-event-card {
    padding: 14px;

    border: 1px solid #d1d5db;
    border-radius: 10px;

    background: white;
}

.service-event-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.service-event-dialog {
    width: min(95vw, 850px);
}

.service-event-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-top: 18px;
    margin-bottom: 10px;
}

.service-event-items-header h3 {
    margin: 0;
}

.service-event-items {
    display: grid;
    gap: 10px;
}

.service-event-item {
    padding: 12px;

    border: 1px solid #d1d5db;
    border-radius: 9px;

    background: #f9fafb;
}

.service-item-grid {
    display: grid;
    grid-template-columns:
        1.3fr 1.3fr 0.7fr 1fr;

    gap: 10px;

    align-items: end;
}

.service-item-grid label {
    display: flex;
    flex-direction: column;
    gap: 5px;

    font-size: 0.85rem;
    font-weight: 600;
}

.service-item-grid input {
    width: 100%;

    padding: 8px;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    background: white;

    font: inherit;
}

.service-item-notes-label {
    grid-column: 1 / -2;
}

.service-item-remove {
    align-self: end;
}

.service-event-total {
    margin-top: 14px;

    text-align: right;
    font-size: 1.05rem;
}

.service-event-price {
    font-size: 1.15rem;
}

.service-event-date {
    color: #6b7280;
    font-size: 0.85rem;
}

.service-event-odometer {
    display: block;

    margin-top: 2px;

    font-size: 1.05rem;
}

.service-event-item-list {
    display: grid;
    gap: 8px;

    padding-top: 12px;
    margin-top: 12px;

    border-top: 1px solid #e5e7eb;
}

.service-history-item {
    padding: 8px 0;
}

.service-history-item
+ .service-history-item {
    border-top: 1px solid #f3f4f6;
}

.service-history-item-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.service-history-detail {
    margin-top: 3px;

    color: #6b7280;
    font-size: 0.85rem;
}

.service-event-notes {
    margin-top: 12px;
    padding: 9px;

    border-radius: 8px;

    background: #f9fafb;

    text-align: left;
    white-space: pre-wrap;
}

.service-event-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;

    margin-top: 12px;
}

.service-item-description-label {
    grid-column: 1 / -1;
}

.service-item-description {
    width: 100%;
}


/* =========================================================
   MOBIL
   ========================================================= */

@media (max-width: 700px) {
    .service-main-actions {
        gap: 5px;
    }

    .service-main-actions
    .action-button {
        padding-inline: 8px;
        font-size: 0.82rem;
    }

    .service-block {
        margin-top: 16px;
    }

    .service-status-list {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .service-status-card {
        padding: 9px 11px;
    }


    /* SERVISNÍ PLÁN */

    .service-plan-dialog {
        width: 96vw;
        max-height: 92vh;
        border-radius: 12px;
    }

    .service-plan-dialog
    .dialog-header {
        padding: 16px 15px 13px;
    }

    .service-plan-actions {
        padding: 13px 15px 0;
    }

    .service-plan-dialog
    .service-task-list {
        gap: 11px;
        padding: 12px 15px 17px;
    }

    .service-task-card {
        padding: 13px;
    }

    .service-task-details {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .service-task-details > div {
        padding: 9px;
    }

    .service-task-notes {
        padding: 10px;
    }

    .service-task-actions {
        margin-top: 10px;
        padding-top: 10px;
    }


    /* SERVISNÍ UDÁLOST */

    .service-event-card {
        padding: 11px;
    }

    .service-event-actions {
        margin-top: 9px;
    }

    .service-subgrid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .service-item-grid {
        grid-template-columns: 1fr 1fr;
    }

    .service-item-notes-label {
        grid-column: auto;
    }

    .service-item-remove {
        grid-column: 1 / -1;
    }
}

@media (max-width: 450px) {
    .service-main-actions {
        flex-direction: row;
    }

    .service-main-actions
    .action-button {
        flex: 1;
    }

    .service-task-details {
        grid-template-columns: 1fr;
    }

    .service-item-grid {
        grid-template-columns: 1fr;
    }

    .service-item-remove {
        grid-column: auto;
    }
}

/* Poznámka servisního plánu */
.service-task-notes-text {
    text-align: left;
}

/* === SERVICE COLOR SYSTEM START === */
/*
   Servisní historie používá jantarovou.
   Servisní plán zůstává neutrální.
   Stav servisu používá výhradně semafor.
*/

.service-event-card {
    border-left:
        5px solid
        var(--color-service);

    background:
        linear-gradient(
            90deg,
            var(--color-service-soft) 0,
            #ffffff 44px
        );
}

.service-event-price {
    color:
        var(--color-service-dark);
}

.service-event-notes {
    border-left:
        3px solid
        var(--color-service-border);

    background:
        var(--color-service-soft);
}


/* Semafor používá centrální stavové barvy */

.service-status-card.ok {
    border-color:
        var(--status-ok-border);

    background:
        var(--status-ok-soft);
}

.service-status-card.approaching {
    border-color:
        var(--status-warning-border);

    background:
        var(--status-warning-soft);
}

.service-status-card.overdue {
    border-color:
        var(--status-danger-border);

    background:
        var(--status-danger-soft);
}

.service-status-card.never {
    border-color:
        var(--status-unknown-border);

    background:
        var(--status-unknown-soft);
}

.service-status-card.ok
.service-status-summary {
    color: #166534;
}

.service-status-card.approaching
.service-status-summary {
    color: #92400e;
}

.service-status-card.overdue
.service-status-summary {
    color: #991b1b;
}
/* === SERVICE COLOR SYSTEM END === */

/* 0.25.0 - přílohy servisních událostí */

.service-attachment-add-block {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.service-attachment-add-block label {
    flex: 1 1 auto;
    margin: 0;
}

.service-attachment-add-block > .action-button {
    flex: 0 0 auto;
    margin-bottom: 1px;
}

.service-event-attachments {
    min-width: 0;
}

.service-attachment-list {
    display: grid;
    gap: 4px;
}

.service-attachment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 7px;
    border: 1px solid var(--color-service-border);
    border-radius: 6px;
    background: var(--color-service-soft);
}

.service-attachment-info {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.service-attachment-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.service-attachment-link:hover {
    text-decoration: underline;
}

.service-attachment-size {
    color: #64748b;
    font-size: 0.72rem;
    white-space: nowrap;
}

.service-attachment-remove {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.service-attachment-remove:hover {
    background: var(--color-service-border);
}

.service-no-attachments {
    color: #94a3b8;
    font-size: 0.76rem;
    font-style: italic;
}

@media (max-width: 700px) {
    .service-attachment-add-block {
        align-items: stretch;
        flex-direction: column;
    }
}

/* 0.25.0 - indikace příloh v historii servisu */

.service-event-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.service-event-attachment-count {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 500;
}
