﻿/* Appia Reports - selector page
   Design direction: a working tool for city engineers, not a marketing page.
   Blueprint navy + construction-amber accent, IBM Plex for a technical/engineering feel.
   Restrained: no motion beyond simple transitions, one accent color used sparingly. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --color-bg: #f5f6f8;
    --color-panel: #ffffff;
    --color-navy-900: #10233f;
    --color-navy-700: #1e3a5f;
    --color-navy-500: #2c567f;
    --color-amber-500: #e3a008;
    --color-amber-600: #c98700;
    --color-amber-100: #fdf3da;
    --color-text: #1b2430;
    --color-text-muted: #6b7280;
    --color-border: #e2e5ea;
    --color-border-strong: #c7ccd4;
    --color-danger: #b3261e;
    --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
    --radius: 6px;
    --shadow-panel: 0 1px 2px rgba(16, 35, 63, 0.06), 0 1px 12px rgba(16, 35, 63, 0.04);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.45;
}

/* ---------- Top bar ---------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: var(--color-navy-900);
    border-bottom: 3px solid var(--color-amber-500);
}

.topbar__seal {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
}

.topbar__title {
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.01em;
}

.topbar__subtitle {
    color: #b7c3d6;
    font-size: 12px;
    margin-top: 1px;
}

/* ---------- App shell: two-pane layout ---------- */

.app-shell {
    display: grid;
    grid-template-columns: 400px 1fr;
    height: calc(100vh - 63px);
}

.form-pane {
    background: var(--color-panel);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.preview-pane {
    position: relative;
    background: var(--color-bg);
}

/* ---------- Form pane content ---------- */

.form-pane__scroll {
    padding: 20px 20px 0 20px;
    flex: 1;
    overflow-y: auto;
}

.field-group {
    margin-bottom: 18px;
}

.field-label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.field-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--color-text);
    background: #fff;
}

    .field-input:focus {
        outline: none;
        border-color: var(--color-navy-500);
        box-shadow: 0 0 0 3px rgba(44, 86, 127, 0.15);
    }

.field-row {
    display: flex;
    gap: 12px;
}

    .field-row > .field-group {
        flex: 1;
    }

/* Segmented control for report type */

.segmented {
    display: flex;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    overflow: hidden;
}

.segmented__option {
    flex: 1;
    text-align: center;
    padding: 9px 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    background: #fff;
    border: none;
    border-right: 1px solid var(--color-border-strong);
    transition: background 0.12s ease, color 0.12s ease;
}

    .segmented__option:last-child {
        border-right: none;
    }

    .segmented__option:hover {
        background: var(--color-amber-100);
    }

    .segmented__option.is-active {
        background: var(--color-navy-700);
        color: #fff;
    }

/* Work schedule - compact single-row day toggles */

.weekday-toggle-group {
    display: flex;
    gap: 6px;
}

.weekday-toggle {
    flex: 1;
    padding: 8px 0;
    text-align: center;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    background: #fff;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

    .weekday-toggle:hover {
        border-color: var(--color-navy-500);
    }

    .weekday-toggle.is-active {
        background: var(--color-navy-700);
        border-color: var(--color-navy-700);
        color: #fff;
    }

/* ---------- Section divider ---------- */

.pane-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 4px 0 18px 0;
}

.section-heading {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-navy-900);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-heading__count {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 11.5px;
    color: var(--color-text-muted);
}

/* ---------- Project search + list ---------- */

.project-search {
    margin-bottom: 10px;
}

.project-list {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    max-height: 260px;
    overflow-y: auto;
}

.project-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.1s ease, border-color 0.1s ease;
}

    .project-row:last-child {
        border-bottom: none;
    }

    .project-row:hover {
        background: #fafbfc;
    }

    .project-row.is-selected {
        background: var(--color-amber-100);
        border-left-color: var(--color-amber-500);
    }

.project-row__radio {
    margin-top: 2px;
    accent-color: var(--color-navy-700);
    flex-shrink: 0;
}

.project-row__name {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 12.5px;
    color: var(--color-navy-900);
}

.project-row__desc {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 1px;
}

.project-list__empty {
    padding: 20px 10px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 12.5px;
}

/* ---------- Generate button (sticky footer of form pane) ---------- */

.form-pane__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--color-panel);
}

.btn-generate {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: var(--radius);
    background: var(--color-navy-700);
    color: #fff;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.12s ease;
}

    .btn-generate:hover {
        background: var(--color-navy-900);
    }

    .btn-generate:disabled {
        background: var(--color-border-strong);
        color: var(--color-text-muted);
        cursor: not-allowed;
    }

.form-error {
    color: var(--color-danger);
    font-size: 12px;
    margin-top: 8px;
    display: none;
}

    .form-error.is-visible {
        display: block;
    }

/* ---------- Preview pane ---------- */

.preview-pane iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.preview-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--color-text-muted);
}

.preview-empty__badge {
    width: 44px;
    height: 44px;
    border: 2px solid var(--color-border-strong);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-navy-500);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 13px;
}

.preview-empty__text {
    font-size: 13px;
    max-width: 260px;
    text-align: center;
}

/* ---------- Loading overlay (shown while a report generates) ---------- */

.preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--color-bg);
    z-index: 1;
}

.preview-loading__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border-strong);
    border-top-color: var(--color-navy-700);
    border-radius: 50%;
    animation: preview-spin 0.8s linear infinite;
}

.preview-loading__text {
    font-size: 13px;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
}

@keyframes preview-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
    }

    .form-pane {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    .preview-pane {
        height: 70vh;
    }
}
