body {
    font-family: "Segoe UI", system-ui, sans-serif;
    background-color: #f8f9fa;
}

.tt-navbar {
    background-color: #1a1a2e;
}

.navbar-brand {
    letter-spacing: 0.03em;
}

/* Milestone board blocks */
.ms-block {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 44px;
    border-radius: 4px;
    border: none;
    padding: 2px 4px;
    cursor: default;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    text-align: center;
    text-decoration: none;
}

button.ms-block {
    cursor: pointer;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

button.ms-block:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6);
}

.ms-name {
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.3;
}

.ms-seq {
    font-size: 0.55rem;
    font-weight: 400;
    opacity: 0.85;
    line-height: 1.2;
}

.ms-grey   { background-color: #adb5bd; }
.ms-yellow { background-color: #ffc107; color: #212529; }
.ms-red    { background-color: #dc3545; }
.ms-green  { background-color: #198754; }
.ms-blue   { background-color: #0d6efd; }

/* ── Milestone Board card layout ── */
.board-card-header {
    background-color: #1a1a2e;
}

.board-ms-strip {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.ms-card-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-shrink: 0;
    min-width: 120px;
}

.ms-card {
    display: flex;
    flex-direction: column;
    min-width: 120px;
    min-height: 100px;
    border-radius: 6px;
    padding: 6px 8px;
    color: #fff;
    flex-shrink: 0;
}

.ms-card.ms-card-active {
    min-width: 140px;
    min-height: 112px;
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(0, 0, 0, 0.3);
}

.ms-card-seq {
    font-size: 0.6rem;
    opacity: 0.8;
    line-height: 1.2;
}

.ms-card-name {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.ms-card-kpi {
    font-size: 0.6rem;
    opacity: 0.85;
    margin-top: 2px;
}

.ms-card-time {
    font-size: 0.6rem;
    opacity: 0.8;
    margin-top: 2px;
    flex-grow: 1;
}

.ms-card-badge {
    margin-top: 4px;
}

.ms-card-badge .badge {
    font-size: 0.55rem;
}

.board-complete-btn {
    font-size: 0.7rem;
    border-radius: 4px;
    padding: 2px 6px;
}

/* HTMX loading indicator */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

/* Milestone legend dots */
.ms-legend {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 3px;
    vertical-align: middle;
}

/* ── Compact segment bar (replaces scrolling card strip) ── */
.ms-seg-bar {
    display: flex;
    height: 10px;
    border-radius: 4px;
    overflow: hidden;
    gap: 1px;
    background: #dee2e6;
}

.ms-seg {
    flex: 1;
    min-width: 4px;
    height: 100%;
    cursor: default;
    transition: filter 0.1s;
}

.ms-seg:hover {
    filter: brightness(1.2);
}

.ms-seg.ms-seg-active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(0, 0, 0, 0.45);
    position: relative;
    z-index: 1;
}

/* Milestones the current user's role is responsible for completing */
.ms-seg.ms-seg-mine {
    border-top: 2px solid #111;
    border-bottom: 2px solid #111;
    min-width: 8px;
}

/* ── Workflow panel ── */
.wf-panel {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 8px 12px 10px;
    background: #fafafa;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    align-items: stretch;
    overflow: visible;
}

@media (max-width: 575px) {
    .wf-panel {
        flex-wrap: wrap;
    }
    .wf-panel .wf-card {
        flex: 0 0 calc(50% - 4px);
    }
}

.wf-card {
    flex: 1 1 0;
    min-width: 0;
    border-radius: 6px;
    padding: 7px 9px;
    border-left: 3px solid #dee2e6;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wf-card-current {
    position: relative;
    overflow: visible;
    padding-right: 36px;
    flex: 1.6 1 0;
    min-width: 180px;
}

.wf-card-completed { border-left-color: #198754; background: #f6fef9; }
.wf-card-active    { border-left-color: #ffc107; background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,0.1); }
.wf-card-delayed,
.wf-card-overdue   { border-left-color: #dc3545; background: #fff8f8; box-shadow: 0 1px 5px rgba(220,53,69,0.15); }
.wf-card-pending   { border-left-color: #dee2e6; background: #f8f9fa; opacity: 0.85; }
.wf-card-empty     { border: 1px dashed #dee2e6; background: transparent; opacity: 0.6; }

.wf-card-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-card-name {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-card-meta {
    font-size: 0.65rem;
    color: #6c757d;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-card-delay {
    font-size: 0.65rem;
    color: #dc3545;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-card-remarks {
    font-size: 0.65rem;
    color: #6c757d;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}
