/* ============================================================
   Fincoat v2 — omat tyylit
   ============================================================ */

:root {
    --fc-work:      #0d6efd;
    --fc-transport: #9ec5fe;
    --fc-conflict:  #dc3545;
    --fc-border:    #dee2e6;
    --fc-weekend:   #f4f6f8;
}

body {
    background: #f8f9fa;
}

.card {
    border-color: var(--fc-border);
}

.stat-card .display-6 {
    font-weight: 600;
    line-height: 1;
}

.stat-card a {
    text-decoration: none;
}

/* Kaasumerkintä */
.gas-marker {
    background: #fff3cd;
    border-left: 4px solid #fd7e14;
}

.badge-gas {
    background: #fd7e14;
    color: #fff;
}

/* Konfliktirivi */
.row-conflict {
    background: #fdf2f2 !important;
}

.conflict-box {
    border-left: 4px solid var(--fc-conflict);
    background: #fdf2f2;
}

/* Puuttuva tullitieto */
.customs-missing {
    background: #fdf2f2;
    color: var(--fc-conflict);
    font-weight: 600;
}

/* ---------- Gantt ---------- */

.gantt-scroll {
    overflow-x: auto;
    border: 1px solid var(--fc-border);
    border-radius: .375rem;
    background: #fff;
}

.gantt {
    display: grid;
    position: relative;
    align-items: center;
    row-gap: 4px;
    padding-bottom: 6px;
}

.gantt-corner,
.gantt-label {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #fff;
    border-right: 1px solid var(--fc-border);
    padding: 4px 8px;
    font-size: .85rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gantt-corner {
    font-weight: 600;
    color: #6c757d;
    border-bottom: 1px solid var(--fc-border);
}

.gantt-label a {
    text-decoration: none;
    font-weight: 500;
}

.gantt-label-sub {
    font-size: .72rem;
    color: #6c757d;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gantt-label-conflict a {
    color: var(--fc-conflict);
}

.gantt-head {
    font-size: .68rem;
    color: #6c757d;
    text-align: center;
    border-bottom: 1px solid var(--fc-border);
    padding: 4px 0;
    z-index: 2;
    position: relative;
}

.gantt-head-month {
    border-left: 1px solid var(--fc-border);
}

.gantt-month {
    font-weight: 700;
    color: #212529;
    font-size: .62rem;
    letter-spacing: .04em;
}

.gantt-weekend {
    background: var(--fc-weekend);
    z-index: 0;
}

.gantt-today {
    background: rgba(13, 110, 253, .12);
    border-left: 2px solid var(--fc-work);
    z-index: 1;
}

.gantt-bar,
.gantt-transport,
.gantt-chain {
    z-index: 2;
    position: relative;
}

.gantt-bar {
    height: 22px;
    border-radius: 4px;
    background: var(--fc-work);
    color: #fff;
    font-size: .72rem;
    line-height: 22px;
    padding: 0 6px;
    overflow: hidden;
    white-space: nowrap;
}

.gantt-bar-checked_out { background: #6610f2; }
.gantt-bar-checked_in  { background: #198754; }
.gantt-bar-conflict    { background: var(--fc-conflict); }

.gantt-transport {
    height: 10px;
    background: var(--fc-transport);
    border-radius: 3px;
}

.gantt-chain {
    text-align: center;
    color: var(--fc-work);
    font-size: .8rem;
}

.gantt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: .5rem;
    font-size: .8rem;
    color: #6c757d;
}

.legend-box {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 2px;
    vertical-align: middle;
}

.legend-box.bar-work      { background: var(--fc-work); }
.legend-box.bar-transport { background: var(--fc-transport); }
.legend-box.bar-conflict  { background: var(--fc-conflict); }

/* Työn kollitaulukon avattava rivi */
.detail-row td {
    background: transparent;
}

.bi-chevron-down {
    display: inline-block;
    transition: transform .15s ease;
}

[data-bs-toggle="collapse"][aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* Lähtöpaikan otsikko raporteissa */
.location-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    background: #eef2f7;
    border-left: 4px solid var(--fc-work);
    padding: .5rem .75rem;
    margin: 1.25rem 0 .75rem;
    border-radius: .25rem;
}

.location-header .small {
    color: #495057;
}

/* Kuljetusyhteenvedon ryhmäotsikkorivi */
tr.group-row td {
    background: #eef2f7 !important;
    font-weight: 600;
}

tr.group-total td {
    border-top: 2px solid var(--fc-border);
    font-style: italic;
}

/* ---------- Sekalaiset ---------- */

.table-sm td, .table-sm th {
    vertical-align: middle;
}

.device-row td {
    font-size: .875rem;
}

.subtable {
    background: #fcfcfd;
}
