/*
 * SQDCP Dashboard Specific Styles
 * Leveraging benchKIT industrial dark theme components.
 *
 * Why: the shared theme uses aqua for --warning across all apps. Inside SQDCP,
 * "at risk" is semantically orange (traffic-light convention), so we scope a
 * local orange palette to the `data-status="aqua"` state. Storage key stays
 * 'aqua' to avoid migrating history records.
 */

.container-wide {
    max-width: 1400px;
    /* Wider for dashboard view on large screens */
}

.sqdcp-grid,
.history-view,
#bench-modal-body .status-picker {
    --sqdcp-atrisk: #ff9f1c;
    --sqdcp-atrisk-subtle: rgba(255, 159, 28, 0.12);
    --sqdcp-atrisk-glow: 0 0 20px rgba(255, 159, 28, 0.45);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Date Header
   ───────────────────────────────────────────────────────────────────────────── */
.date-display h2 {
    font-size: var(--font-xl);
    color: var(--text-primary);
    margin: 0;
    font-family: var(--font-family-mono);
    letter-spacing: var(--tracking-wider);
}

.date-display .shift-info {
    color: var(--text-muted);
    font-size: var(--font-sm);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

/* ─────────────────────────────────────────────────────────────────────────────
   SQDCP Grid Layout
   ───────────────────────────────────────────────────────────────────────────── */
.sqdcp-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-4);
    width: 100%;
}

@media (max-width: 1024px) {
    .sqdcp-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .sqdcp-grid {
        grid-template-columns: 1fr;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Pillar Cards
   ───────────────────────────────────────────────────────────────────────────── */
.pillar-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.pillar-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Pillar Status Colors */
.pillar-card[data-status="green"] {
    border-top: 4px solid var(--success);
    box-shadow: 0 4px 12px var(--success-subtle);
}

.pillar-card[data-status="aqua"] {
    border-top: 4px solid var(--sqdcp-atrisk);
    box-shadow: 0 4px 12px var(--sqdcp-atrisk-subtle);
}

.pillar-card[data-status="red"] {
    border-top: 4px solid var(--danger);
    box-shadow: 0 4px 12px var(--danger-subtle);
}

.pillar-card[data-status="none"] {
    border-top: 4px solid var(--text-muted);
}

/* Header within Pillar */
.pillar-header {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
    transition: background var(--transition-short);
    position: relative;
}

.pillar-card:hover .pillar-header {
    background: rgba(255, 255, 255, 0.05);
}

/* Quick-cycle status dot in the corner of each pillar header */
.status-cycle-dot {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    cursor: pointer;
    padding: 0;
    transition: transform var(--transition-short), box-shadow var(--transition-short);
}

.status-cycle-dot:hover {
    transform: scale(1.25);
}

.status-cycle-dot:focus-visible {
    outline: 2px solid var(--accent, #5ac8fa);
    outline-offset: 2px;
}

.status-cycle-dot[data-status="green"] {
    background: var(--success);
    border-color: var(--success);
    box-shadow: var(--glow-success);
}

.status-cycle-dot[data-status="aqua"] {
    background: var(--sqdcp-atrisk);
    border-color: var(--sqdcp-atrisk);
    box-shadow: var(--sqdcp-atrisk-glow);
}

.status-cycle-dot[data-status="red"] {
    background: var(--danger);
    border-color: var(--danger);
    box-shadow: var(--glow-danger);
}

.pillar-card:focus-visible {
    outline: 2px solid var(--accent, #5ac8fa);
    outline-offset: 2px;
}

.pillar-letter {
    font-size: 3rem;
    font-weight: var(--font-weight-xbold);
    line-height: 1;
    margin-bottom: var(--space-2);
}

/* Letter Colors */
.pillar-card[data-status="green"] .pillar-letter {
    color: var(--success);
    text-shadow: var(--glow-success);
}

.pillar-card[data-status="aqua"] .pillar-letter {
    color: var(--sqdcp-atrisk);
    text-shadow: var(--sqdcp-atrisk-glow);
}

.pillar-card[data-status="red"] .pillar-letter {
    color: var(--danger);
    text-shadow: var(--glow-danger);
}

.pillar-card[data-status="none"] .pillar-letter {
    color: var(--text-muted);
}

.pillar-title {
    font-size: var(--font-sm);
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--text-secondary);
}

/* Content within Pillar */
.pillar-content {
    padding: var(--space-4);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.pillar-metric {
    font-size: var(--font-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    text-align: center;
    min-height: 2em;
}

.pillar-notes {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    background: var(--bg-input);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    flex-grow: 1;
    font-style: italic;
}

/* Historic Indicator Strip */
.pillar-history {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-3);
    margin-top: auto;
    border-top: 1px solid var(--border-subtle);
}

.history-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.history-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
}

.history-dot[data-status="green"] {
    background: var(--success);
    border-color: var(--success);
    box-shadow: var(--glow-success);
}

.history-dot[data-status="aqua"] {
    background: var(--sqdcp-atrisk);
    border-color: var(--sqdcp-atrisk);
    box-shadow: var(--sqdcp-atrisk-glow);
}

.history-dot[data-status="red"] {
    background: var(--danger);
    border-color: var(--danger);
    box-shadow: var(--glow-danger);
}

.history-label {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-family-mono);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Action Items
   ───────────────────────────────────────────────────────────────────────────── */
.action-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.action-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.action-item:hover {
    border-color: var(--border-strong);
    background: var(--bg-hover);
}

.action-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.action-status-indicator.open {
    background: var(--danger);
    box-shadow: var(--glow-danger);
}

.action-status-indicator.progress {
    background: var(--sqdcp-atrisk);
    box-shadow: var(--sqdcp-atrisk-glow);
}

.action-status-indicator.closed {
    background: var(--success);
    box-shadow: var(--glow-success);
}

.action-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.action-title {
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    font-size: var(--font-base);
}

.action-meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
    display: flex;
    gap: var(--space-4);
}

.empty-state {
    padding: var(--space-8);
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-md);
    font-style: italic;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Status Picker (chip-style radio group inside modal)
   ───────────────────────────────────────────────────────────────────────────── */
.status-picker {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.status-chip {
    flex: 1 1 auto;
    min-width: 120px;
    padding: var(--space-2) var(--space-3);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    cursor: pointer;
    transition: all var(--transition-short);
}

.status-chip:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.status-chip.selected[data-status="green"] {
    border-color: var(--success);
    color: var(--success);
    background: var(--success-subtle);
}

.status-chip.selected[data-status="aqua"] {
    border-color: var(--sqdcp-atrisk);
    color: var(--sqdcp-atrisk);
    background: var(--sqdcp-atrisk-subtle);
}

.status-chip.selected[data-status="red"] {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-subtle);
}

/* ─────────────────────────────────────────────────────────────────────────────
   History Modal Table
   ───────────────────────────────────────────────────────────────────────────── */
.history-view {
    max-height: 60vh;
    overflow: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-sm);
}

.history-table th,
.history-table td {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
    vertical-align: top;
}

.history-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    font-size: var(--font-xs);
    z-index: 1;
}

.history-table tbody tr:hover {
    background: var(--bg-hover);
}

.history-date {
    font-family: var(--font-family-mono);
    color: var(--text-muted);
    white-space: nowrap;
}

.history-cell-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: var(--space-2);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    vertical-align: middle;
}

.history-cell-dot[data-status="green"] {
    background: var(--success);
    border-color: var(--success);
}

.history-cell-dot[data-status="aqua"] {
    background: var(--sqdcp-atrisk);
    border-color: var(--sqdcp-atrisk);
}

.history-cell-dot[data-status="red"] {
    background: var(--danger);
    border-color: var(--danger);
}

.history-cell-text {
    color: var(--text-secondary);
    font-size: var(--font-xs);
}

.history-actions-count {
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-family-mono);
}