/* ===================== FURA — РЕЙСИ ===================== */

.trips-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.trips-filters .search-input {
    flex: 1 1 260px;
    max-width: 420px;
}

.trip-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.trip-chip {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.trip-chip[aria-pressed="true"] {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}
.trip-chip .n {
    opacity: 0.75;
    margin-left: 4px;
}

/* Дві колонки: список і деталі */
.trips-layout {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.trips-list {
    flex: 1 1 340px;
    max-width: 440px;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}
.trip-detail {
    flex: 999 1 520px;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}
.trips-empty,
.trip-detail-empty {
    color: #64748b;
    font-size: 14px;
    padding: 24px;
    text-align: center;
}
.trip-detail-empty i {
    font-size: 40px;
    color: #94a3b8;
    display: block;
    margin-bottom: 8px;
}

/* Картка рейсу в списку */
.trip-card {
    display: block;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    font-family: inherit;
    color: #0f172a;
}
.trip-card:hover {
    border-color: #93c5fd;
}
.trip-card[aria-current="true"] {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px #bfdbfe;
}
.trip-card-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}
.trip-no {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #475569;
    font-size: 13px;
}
.trip-route {
    font-weight: 700;
    font-size: 15px;
    margin-top: 2px;
}
.trip-meta {
    font-size: 13px;
    color: #475569;
    margin-top: 2px;
}
.trip-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

/* Бейджі */
.tbadge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.tb-grey { background: #e2e8f0; color: #334155; }
.tb-blue { background: #dbeafe; color: #1d4ed8; }
.tb-amber { background: #fef3c7; color: #92400e; }
.tb-red { background: #fee2e2; color: #b91c1c; }
.tb-green { background: #dcfce7; color: #166534; }

/* Деталі рейсу */
.td-head {
    padding: 18px 20px 12px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: flex-start;
}
.td-title {
    font-size: 22px;
    font-weight: 700;
    margin: 2px 0 0;
}
.td-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.td-actions .btn {
    padding: 8px 12px;
    font-size: 13px;
}
.td-body {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.td-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px 16px;
}
.td-field .l {
    font-size: 12px;
    color: #64748b;
}
.td-field .v {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
}
.td-field .v.mono {
    font-variant-numeric: tabular-nums;
}
.td-field .s {
    font-size: 12px;
    color: #475569;
}

.td-map {
    height: 380px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #eef2f6;
    position: relative;
}
.td-map-note {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    color: #334155;
    z-index: 2;
    text-align: center;
}
.td-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: #475569;
    margin-top: 6px;
}
.td-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.td-legend i.sw {
    display: inline-block;
    width: 18px;
    height: 4px;
    border-radius: 2px;
}

.td-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.td-alert {
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
}
.td-alert b {
    display: block;
}
.td-alert.red { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.td-alert.amber { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }

/* Етапи */
.tl {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tl li {
    display: flex;
    gap: 12px;
    padding: 0 0 10px;
    position: relative;
}
.tl li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 16px;
    bottom: -2px;
    width: 2px;
    background: #e2e8f0;
}
.tl li:last-child::before {
    display: none;
}
.tl .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-top: 3px;
    flex-shrink: 0;
    border: 3px solid #2563eb;
    background: #2563eb;
    position: relative;
    z-index: 1;
}
.tl .dot.todo {
    background: #fff;
    border-color: #cbd5e1;
}
.tl .dot.problem {
    background: #dc2626;
    border-color: #dc2626;
}
.tl .tl-main {
    flex: 1;
    min-width: 0;
}
.tl .tl-label {
    font-size: 14px;
    font-weight: 600;
}
.tl .tl-note {
    font-size: 12px;
    color: #475569;
}
.tl .tl-time {
    text-align: right;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.tl .tl-time .plan {
    font-size: 11px;
    color: #64748b;
}

/* Документи */
.td-docs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.td-docs a {
    display: block;
    width: 120px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}
.td-docs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Маркери карти */
.map-truck {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #2563eb;
    border: 3px solid #fff;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.35);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.map-truck.stale {
    background: #64748b;
}
.map-pin {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #fff;
    font: 700 13px/26px sans-serif;
    text-align: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.map-border {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #0f172a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    border: 2px solid #fff;
}

/* Форма */
.trip-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.trip-form-grid .span-2 {
    grid-column: span 2;
}
.form-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}
.invite-code {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 8px;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e3a8a;
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}
.invite-text {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    resize: vertical;
}

@media (max-width: 900px) {
    .trips-page {
        height: auto;
        overflow: visible;
    }
    .trips-list {
        max-width: none;
        max-height: 50vh;
    }
    .trip-form-grid {
        grid-template-columns: 1fr;
    }
    .trip-form-grid .span-2 {
        grid-column: span 1;
    }
}

.td-deal-link {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1d5bd8;
    text-decoration: none;
}
.td-deal-link:hover {
    text-decoration: underline;
}

/* Усередині угоди модальне вікно займає всю вкладку */
html.fura-embed body {
    background: #fff;
}
