/* CNC Dashboard — Customer Detail View Styles */

/* ── Hours Breakdown premium styles ── */
@keyframes hbShimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes hbFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hbGaugePulse {

    0%,
    100% {
        filter: drop-shadow(0 0 6px var(--hb-gauge-color, #89E18540));
    }

    50% {
        filter: drop-shadow(0 0 14px var(--hb-gauge-color, #89E18560));
    }
}

.hb-shimmer {
    background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: hbShimmer 1.5s infinite;
    border-radius: 8px;
}

.hb-content {
    animation: hbFadeIn 0.4s ease-out;
}

.hb-stat-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.hb-stat-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(91, 139, 239, 0.1);
}

.hb-person-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.3rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: default;
}

.hb-person-row:hover {
    background: var(--bg-secondary);
    transform: translateX(3px);
}

.hb-person-bar {
    height: 14px;
    border-radius: 7px;
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.hb-person-row:hover .hb-person-bar {
    filter: brightness(1.15);
    box-shadow: 0 0 8px currentColor;
}

.hb-type-segment {
    transition: all 0.3s ease;
    opacity: 0.92;
}

.hb-type-segment:hover {
    opacity: 1;
    filter: brightness(1.1);
    transform: scaleY(1.08);
}

.hb-trend-bar-wrap {
    transition: all 0.2s ease;
}

.hb-trend-bar-wrap:hover {
    transform: scaleY(1.05);
    filter: brightness(1.15);
}

/* Hours gauge */
.hours-gauge {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.hours-gauge-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.hours-gauge-ring svg {
    transform: rotate(-90deg);
    width: 120px;
    height: 120px;
}

.hours-gauge-ring .gauge-bg {
    fill: none;
    stroke: var(--bg-secondary);
    stroke-width: 10;
}

.hours-gauge-ring .gauge-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hours-gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.hours-gauge-text .value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.hours-gauge-text .label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

.hours-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hours-info-row {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    font-size: 0.88rem;
}

.hours-info-row .info-label {
    color: var(--text-secondary);
}

.hours-info-row .info-value {
    font-weight: 600;
}

/* Task list */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.task-item {
    display: grid;
    grid-template-columns: 24px 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    font-size: 0.82rem;
}

.task-icon {
    font-size: 1rem;
}

.task-name {
    font-weight: 500;
}

.task-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.task-status-badge {
    padding: 0.15rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.task-status-badge.completed {
    background: var(--green-bg);
    color: var(--green);
}

.task-status-badge.pending {
    background: var(--orange-bg);
    color: var(--orange);
}

/* Hours log */
.hours-log {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 300px;
    overflow-y: auto;
}

.hours-entry {
    display: grid;
    grid-template-columns: 90px 100px 60px 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 0.4rem;
    font-size: 0.8rem;
}

.hours-entry-date {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.hours-entry-name {
    font-weight: 500;
}

.hours-entry-amount {
    font-weight: 700;
    color: var(--accent);
    text-align: right;
}

.hours-entry-desc {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Scan scores — 2-column flex: gauges left, bars right */
.scan-scores {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    align-items: flex-start;
}

/* Left: donut gauges + warnings — 40% */
.scan-gauges-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 0 0 40%;
    min-width: 0;
    align-items: center;
}

/* Right: category breakdown bars — 60% */
.scan-breakdown-col {
    flex: 0 0 60%;
    min-width: 0;
    padding-right: 2rem;
}

.scan-breakdown-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.scan-category-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.scan-category-name {
    width: 130px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.scan-category-bar {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-secondary);
    display: flex;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.scan-category-pct {
    width: 36px;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: right;
    flex-shrink: 0;
}

/* Summary pills */
.scan-summary-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.scan-pill {
    padding: 0.15rem 0.55rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.scan-card {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
}

.scan-card .scan-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.scan-card .scan-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 0.35rem;
}

.scan-card a {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: var(--accent);
    text-decoration: none;
}

.scan-card a:hover {
    text-decoration: underline;
}

.scan-card .no-data {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Action tracker empty state — dashed circle matching Stitch mockup */
.action-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    gap: 0.75rem;
    text-align: center;
}

.action-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px dashed rgba(99, 102, 241, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.04);
}

.action-empty-icon .material-symbols-outlined {
    font-size: 1.75rem;
    color: var(--text-muted);
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.action-empty-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.action-empty-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Light theme scan scores */
.light-theme .scan-category-bar {
    background: #e2e8f0;
}


/* Jira tickets */
.jira-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem 0;
    flex-wrap: wrap;
    align-items: center;
}

.jira-count {
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.jira-count.open {
    background: var(--accent-glow);
    color: var(--accent);
}

.jira-count.progress {
    background: var(--orange-bg);
    color: var(--orange);
}

.jira-count.done {
    background: var(--green-bg);
    color: var(--green);
}

.jira-tickets-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 0 1rem 0.5rem;
}

.jira-ticket {
    display: grid;
    grid-template-columns: 140px 1fr 120px 120px 90px 90px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.65rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 0.4rem;
    font-size: 0.82rem;
}

.jira-ticket-header {
    display: grid;
    grid-template-columns: 140px 1fr 120px 120px 90px 90px;
    gap: 0.5rem;
    padding: 0.3rem 1.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.jira-person {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jira-key {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.78rem;
    text-decoration: none;
}

.jira-key:hover {
    text-decoration: underline;
}

.jira-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.jira-ticket-summary {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jira-status {
    padding: 0.15rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.jira-status.new {
    background: var(--accent-glow);
    color: var(--accent);
}

.jira-status.indeterminate {
    background: var(--orange-bg);
    color: var(--orange);
}

.jira-status.done {
    background: var(--green-bg);
    color: var(--green);
}