html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    background: #0f172a;
    color: #e2e8f0;
}

    body.noscroll {
        overflow: hidden;
    }

.page {
    height: 100%;
}

main {
    min-height: 0;
    overflow-y: auto;
}

article,
.content {
    min-height: 0;
}

.dashboard-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

button {
    background: #1d4ed8;
    color: #fff;
    border: 0;
    border-radius: 0.4rem;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
}

.latest-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

    .latest-grid article,
    .chart-card {
        background: #111827;
        border: 1px solid #1f2937;
        border-radius: 0.5rem;
        padding: 0.75rem;
    }

        .latest-grid h2,
        .chart-card h2 {
            margin: 0;
            font-size: 0.95rem;
            color: #93c5fd;
        }

    .latest-grid p {
        margin: 0.4rem 0 0;
        font-size: 1.4rem;
        font-weight: 700;
    }

.chart-card {
    margin-top: 0.9rem;
}

#reload-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg-color, #fff);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

    #reload-overlay.active {
        opacity: 1;
        pointer-events: all;
    }

.proc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.proc-modal {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 0.5rem;
    width: min(40rem, 90vw);
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    color: #e2e8f0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.proc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #1f2937;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.proc-modal-close {
    background: none;
    border: 0;
    color: #9ca3af;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.25rem;
}

.proc-modal-close:hover,
.proc-modal-close:focus-visible {
    color: #e2e8f0;
}

.proc-modal-body {
    padding: 0.75rem 1rem 1rem 1rem;
    overflow-y: auto;
    flex: 1;
}

.proc-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #1f2937;
}

.proc-modal-footer .col-icon-btn {
    min-width: 72px;
    width: auto;
    padding: 0 0.875rem;
    min-height: 25px;
}

.proc-modal-close-btn {
    background: #374151;
    color: #e2e8f0;
    border: 1px solid #4b5563;
    border-radius: 0.3rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.proc-modal-close-btn:hover:not(:disabled),
.proc-modal-close-btn:focus-visible:not(:disabled) {
    background: #4b5563;
    border-color: #60a5fa;
}

.proc-modal-close-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.proc-modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.proc-modal-table th {
    text-align: left;
    color: #6b7280;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid #1f2937;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.65rem;
}

.proc-modal-table td {
    padding: 0.4rem 0.5rem;
    vertical-align: top;
}

.btn-save {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: #374151;
    color: #22c55e;
    border: 1px solid #4b5563;
    border-radius: 0.3rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.btn-save:hover:not(:disabled),
.btn-save:focus-visible:not(:disabled) {
    background: #4b5563;
    border-color: #22c55e;
}

.btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.field-error {
    color: #ff6b6b;
    font-size: 0.75rem;
}

/* Shared editor-modal layout primitives. These rules are byte-identical across
   ActionsEditorModal, ColumnsEditorModal, RowColorRulesEditorModal and WriteDefaultsEditorModal.
   Rules that differ between those modals (e.g. .col-icon-btn, .col-icon-btn-primary, .col-input,
   .col-bulk-btn, .modal-footer-message) stay local to each component so their overrides win. */
.col-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.col-header-strip {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.5rem;
    background: #0b1220;
    border: 1px solid #1f2937;
    border-radius: 6px;
}

.col-header-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.col-header-row--meta {
    justify-content: space-between;
}

.col-bulk-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}

.col-counts {
    color: #9ca3af;
    font-size: 0.75rem;
}

.col-input:focus {
    border-color: #2563eb;
    outline: none;
}

.col-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
