/* ==========================================================================
CrewSheet styles: pages/zones.css
==========================================================================
Zones page, the shared pop-up + zone Materials pop-up, "Different size or rate?".

Part of the CrewSheet stylesheet set, loaded in this order by Views/Shared/_Layout.cshtml:
  base.css > components.css > pages/home.css > pages/jobs.css > pages/zones.css > pages/documents.css > pages/worklist.css > pages/reports.css > pages/settings.css
Section numbers are the same as in the old single site.css, so view comments like
"components.css 23" still point at the right place. New sections: next free number, in the file for that area.

SECTIONS IN THIS FILE
  16        ZONES PAGE
  27        SHARED POP-UP + ZONE SUMMARY
  33        "DIFFERENT SIZE OR RATE?" + FORM NOTES
  61        "FINISH THIS MATERIAL" (a material missing its price or coverage, before it goes on a zone)
  63        MASONRY WALL SIZE (zone form: length × height; Materials pop-up summary)
========================================================================== */

/* ==========================================================================
16. ZONES PAGE
========================================================================== */
/* Title + count badge side by side (no Bootstrap dependency) */
.cs-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Wrapper: gap controls all vertical spacing */
.cs-zones {
    display: flex;
    flex-direction: column;
    gap: var(--cs-gap);
}

    .cs-zones > * {
        margin-bottom: 0 !important;
    }

    /* Soft blue header bar instead of gold */
    .cs-zones .cs-table-header-bar {
        background: var(--cs-blue-100);
        border-bottom: 1px solid var(--cs-blue-200);
    }

    /* Show the dropdown at every width; margin-left:0 keeps it next to Materials
       (the base rule's margin-left:auto was pushing it to the far edge) */
    .cs-zones .cs-actions-narrow {
        display: block !important;
        margin-left: 0;
        min-width: 6.5rem;
    }


/* ==========================================================================
27. SHARED POP-UP + ZONE SUMMARY
Pop-up markup: dialog#csModal in _Layout; behavior: site.js (data-cs-modal).
Zone pages: Views/Zones/Index, _ZoneForm, _ZoneMaterials.
========================================================================== */

/* ---------- 27a. Pop-up sizes and loading text ---------- */
.cs-dialog.cs-dialog-wide {
    width: min(56rem, 96vw); /* room for the materials table */
}

.cs-dialog-loading {
    padding: 1.5rem 0;
    text-align: center;
    color: var(--cs-muted);
}

/* ---------- 27b. Jobs Dashboard: badges are links ---------- */
.cs-flag-link {
    text-decoration: none !important;
    transition: box-shadow var(--cs-transition), transform var(--cs-transition);
}

    .cs-flag-link:hover,
    .cs-flag-link:focus-visible {
        box-shadow: 0 0 0 2px var(--cs-gold);
        transform: translateY(-1px);
    }

/* ---------- 27c. Materials pop-up ---------- */
.cs-zone-materials-sub {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--cs-muted);
}

/* Add row: material picker fills the space, Add button on the right */
.cs-material-add {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

    .cs-material-add .form-select {
        flex: 1 1 auto;
        min-width: 0;
    }

/* Side padding so text doesn't touch the pop-up edges */
.cs-zone-materials-table th,
.cs-zone-materials-table td {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

@media (max-width: 575.98px) {
    .cs-material-add {
        flex-direction: column;
    }
}

/* ---------- 27d. Delete button: red box with a red X (fills red on hover) ---------- */
.cs-btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    color: var(--cs-danger);
    background: var(--cs-danger-bg);
    border: 1px solid var(--cs-danger);
    border-radius: var(--cs-radius-sm);
    cursor: pointer;
    transition: background var(--cs-transition), color var(--cs-transition);
}

    .cs-btn-delete:hover,
    .cs-btn-delete:focus-visible {
        color: var(--cs-on-dark);
        background: var(--cs-danger);
    }

/* A form that only wraps one button, sitting in a row of buttons */
.cs-inline-form {
    display: inline-flex;
    margin: 0;
}



/* ==========================================================================
33. "DIFFERENT SIZE OR RATE?" + FORM NOTES
A copy of a material with new numbers, used on one zone only (zone Materials pop-up, job wizard).
========================================================================== */

/* Short explanation at the top of the material form (copy note / "used on X zones" warning) */
.cs-form-note {
    font-size: 0.88rem;
}

/* Quiet grey button (Clear in the wizard) */
.cs-btn-reset {
    color: var(--cs-muted) !important;
    background: var(--cs-surface) !important;
    border: 1px solid var(--cs-border) !important;
}

    .cs-btn-reset:hover {
        color: var(--cs-text) !important;
        border-color: var(--cs-muted) !important;
    }

/* Wizard checklist: small text button on each material row */
.cs-pick-copy {
    flex: 0 0 auto;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--cs-heading);
    background: transparent;
    border: 1px solid var(--cs-blue-300);
    border-radius: var(--cs-radius-pill);
    cursor: pointer;
}

    .cs-pick-copy:hover,
    .cs-pick-copy:focus-visible {
        color: var(--cs-on-dark);
        background: var(--cs-navy);
        border-color: var(--cs-navy);
    }

@media (max-width: 575.98px) {
    .cs-pick-copy {
        white-space: normal;
        text-align: center;
    }
}



/* ==========================================================================
61. "FINISH THIS MATERIAL" (Views/Zones/_FinishMaterial; ZonesController.FinishMaterial)
Adding a material that has no price or coverage: the pop-up asks for just that, then adds it to the zone.
========================================================================== */
.cs-finish-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cs-heading);
}

.cs-finish-intro {
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
}

/* The trade's own tip (e.g. masonry: "use an assembly instead") */
.cs-finish-tip {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
    background: var(--cs-warning-alert-bg);
    border-left: 4px solid var(--cs-gold);
    border-radius: var(--cs-radius-sm);
}

/* Each question in its own light box */
.cs-finish-part {
    margin-bottom: 0.75rem;
    padding: 0.7rem 0.9rem;
    background: var(--cs-blue-50);
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius-md);
}

    .cs-finish-part legend {
        float: none;
        width: auto;
        margin-bottom: 0.4rem;
        font-size: 0.92rem;
        font-weight: 700;
        color: var(--cs-heading);
    }

/* Box + what it's for, on one line */
.cs-finish-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.cs-finish-box {
    width: 9rem;
}

.cs-finish-per {
    font-size: 0.85rem;
    color: var(--cs-muted);
}

/* Measure choices: radio, words, small hint */
.cs-finish-choice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0;
    cursor: pointer;
}

    .cs-finish-choice .form-check-input {
        margin: 0;
    }

    .cs-finish-choice small {
        color: var(--cs-muted);
    }

.cs-finish-page {
    max-width: 40rem;
}

/* ---------- 61b. Zone Materials: Cancel (puts the zone back) only works inside the pop-up (site.js data-cs-restore) ---------- */
.cs-zone-cancel {
    display: none;
}

#csModal .cs-zone-cancel {
    display: inline-block;
}



/* ==========================================================================
63. MASONRY WALL SIZE (Views/Zones/_ZoneForm and _ZoneMaterials)
Walls are entered as length × height (+ corners); the sq ft is worked out and shown in plain words.
========================================================================== */
/* Zone form: length | height | corners in a row (stacks on phones), then the live "= ... sq ft of wall" line */
.cs-wall-size {
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    background: var(--cs-blue-50);
    border: 1px solid var(--cs-border);
    border-left: 4px solid var(--cs-gold);
    border-radius: var(--cs-radius-md);
}

.cs-wall-size-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.cs-wall-area {
    margin: 0.6rem 0 0;
    font-size: 0.95rem;
    color: var(--cs-text);
}

    .cs-wall-area strong {
        color: var(--cs-heading);
    }

/* Materials pop-up: "Garage: 125 ft of wall × 12 ft high = 1,500 sq ft · 2 corners   [Change size]" */
.cs-wall-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.9rem;
    font-size: 1rem;
    background: var(--cs-blue-50);
    border: 1px solid var(--cs-border);
    border-left: 4px solid var(--cs-navy);
    border-radius: var(--cs-radius-md);
}

.cs-wall-summary-ask {
    display: block;
    font-size: 0.85rem;
    color: var(--cs-warning);
}

.cs-wall-summary-client {
    font-size: 0.85rem;
    color: var(--cs-muted);
}

@media (max-width: 575.98px) {
    .cs-wall-size-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
