/* ─────────────────────────────────────────────────────────────────────────
   KaiserTerminal – Dashboard Calendar
   Vizuální specifikace: Plan vyroby.html prototype
   ───────────────────────────────────────────────────────────────────────── */

:root {
    --lw: 244px;
    --lane-h: 48px;
    --lane-gap: 6px;
    --pad-y: 12px;
    --cal-head-h: 76px;
    --legend-h: 56px;
    --color-today: #FFD14A;
    --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
}

@media (max-width: 1280px) {
    :root { --lw: 208px; }
}

/* ── Typography ─────────────────────────────────────────────────────────── */
.kt-dashboard-wrap {
    font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100%;
    color: #d6e2ee;
    /* override kt-content background to match spec */
    background: radial-gradient(1200px 800px at 20% 0%,
        #102338 0%, #0c1a2a 40%, #07111c 100%) fixed;
}

/* ── Info bar (window range + clock) ────────────────────────────────────── */
.dash-info-bar {
    flex-shrink: 0;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
    padding: 0 20px;
    font-size: .75rem;
    color: #64748b;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.015);
}

.dash-info-window {
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.dash-info-clock {
    font-family: var(--font-mono);
    font-size: .88rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #d6e2ee;
    min-width: 70px;
    text-align: right;
}

/* ── Calendar container ─────────────────────────────────────────────────── */
.calendar {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Cal-head ───────────────────────────────────────────────────────────── */
.cal-head {
    flex-shrink: 0;
    height: var(--cal-head-h);
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.025);
}

.cal-head-spacer {
    width: var(--lw);
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.08);
}

.cal-head-track {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Month row */
.month-row {
    position: relative;
    height: 32px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.month-cell {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: .68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-right: 1px solid rgba(255,255,255,0.06);
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
}

/* Week row */
.week-row {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.week-cell {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 0 7px;
    font-size: .68rem;
    color: #4e627a;
    border-right: 1px solid rgba(255,255,255,0.06);
    box-sizing: border-box;
    overflow: hidden;
    transition: background .15s;
}

.week-cell.is-current {
    background: rgba(255,209,74,0.07);
}

.week-num {
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 700;
    color: #6b8097;
    line-height: 1;
}

.week-cell.is-current .week-num {
    color: var(--color-today);
}

.week-dates {
    font-size: .95rem;
    font-weight: 700;
    color: #6b8097;
    margin-top: 3px;
    white-space: nowrap;
}

/* Today tooth in header */
.today-marker-head {
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid var(--color-today);
    transform: translateX(-50%);
    z-index: 10;
}

/* ── Cal-body ───────────────────────────────────────────────────────────── */
.cal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.cal-body::-webkit-scrollbar { width: 5px; }
.cal-body::-webkit-scrollbar-track { background: transparent; }
.cal-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}
.cal-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ── Cal-rows ───────────────────────────────────────────────────────────── */
.cal-rows {
    position: relative;
    min-height: 100%;
}

/* Background grid – positioned inside the track area (offset by --lw) */
.bg-grid {
    position: absolute;
    left: var(--lw);
    top: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.grid-weekend {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(255,255,255,0.022);
}

.grid-week-sep {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255,255,255,0.06);
}

.grid-current-week {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(255,209,74,0.035);
}

/* Today vertical dashed line spanning all rows */
.today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    /* CSS repeating-linear-gradient for dashed appearance */
    background: repeating-linear-gradient(
        to bottom,
        var(--color-today) 0,
        var(--color-today) 6px,
        transparent 6px,
        transparent 12px
    );
    z-index: 10;
    pointer-events: none;
}

/* ── Project rows ───────────────────────────────────────────────────────── */
.prow {
    display: flex;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.prow:hover {
    background: rgba(255,255,255,0.012);
}

.prow-label {
    width: var(--lw);
    flex-shrink: 0;
    padding: 10px 14px;
    border-right: 1px solid rgba(255,255,255,0.06);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    background: rgba(7,17,28,0.5);
}

.prow-code {
    font-family: var(--font-mono);
    font-size: .75rem;
    font-weight: 700;
    color: #c8d8e8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prow-name {
    font-size: .7rem;
    color: #4e627a;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prow-track {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* ── Activity bars ──────────────────────────────────────────────────────── */
.bar {
    position: absolute;
    border-radius: 6px;
    padding: 3px 8px;
    box-sizing: border-box;
    overflow: hidden;
    cursor: default;
    box-shadow:
        0 1px 0 rgba(255,255,255,.18) inset,
        0 -1px 0 rgba(0,0,0,.12) inset,
        0 2px 8px rgba(0,0,0,.28);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.bar.clip-l {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.bar.clip-r {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* An inset frame remains visible above the progress fill and inside clipped bars. */
.bar.is-over-plan::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 3px solid #ff3b30;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.9);
    border-radius: inherit;
    pointer-events: none;
    z-index: 3;
}

.bar-working-marker {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    max-width: calc(100% - 6px);
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    background: #14293f;
    color: #ffe08a;
    box-shadow: 0 0 0 1px #fff;
    font-size: 13px;
    line-height: 1;
    z-index: 4;
}

.bar.is-working .bar-content {
    padding-right: 18px;
}

/* Progress fill (darker tint from left) */
.bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--type-fill);
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
}

.bar-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.bar-label {
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.bar-dates {
    font-family: var(--font-mono);
    font-size: .6rem;
    opacity: .82;
    white-space: nowrap;
    line-height: 1.2;
}

.bar-hours {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: .66rem;
    line-height: 1.2;
}

.bar-h-vals {
    font-weight: 700;
    white-space: nowrap;
}

.bar-h-pct {
    flex-shrink: 0;
    padding: 0 4px;
    border-radius: 3px;
    background: #14293f;
    color: #ffe36d;
    font-size: .8rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

/* ── Empty state ────────────────────────────────────────────────────────── */
.dash-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    color: #2e3e50;
    font-style: italic;
    font-size: .9rem;
}

/* ── Legend ─────────────────────────────────────────────────────────────── */
.dashboard-legend {
    flex-shrink: 0;
    height: var(--legend-h);
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0 18px;
    padding: 0 20px;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: .74rem;
    color: #64748b;
    overflow: hidden;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.legend-swatch {
    width: 20px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.legend-sep {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
    margin: 0 4px;
}

.legend-fill-example {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.legend-fill-bar {
    width: 46px;
    height: 10px;
    border-radius: 3px;
    background: #5DE1E6;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.legend-fill-bar-inner {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 38%;
    background: #2F9DA1;
    border-radius: inherit;
}
