/* ==========================================================================
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)
  73        HYDROSEEDING: "HOW BIG IS YOUR TANK?" (zone Materials pop-up, asked the first time)
  63        MASONRY WALL SIZE (zone form: length × height; Materials pop-up summary)
  75        "WHAT ARE YOU BUILDING?" (zone types: measurement boxes, ft or courses, live result)
  76        PIER ROWS (piers / pier footings: one row per size, + Add another size)
========================================================================== */

/* ==========================================================================
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;
    }

    /* The site's lighter-slate title bar (base.css 1b), with a thin line under it */
    .cs-zones .cs-table-header-bar {
        background: var(--cs-table-bar-bg);
        border-bottom: 1px solid var(--cs-border);
    }

    /* 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);
    }
}


/* ==========================================================================
75. "WHAT ARE YOU BUILDING?" (zone form, trades with zone types; Services/ZoneMeasure)
The type's measurement boxes in a row (they stack on phones), height in ft OR courses side by side,
then the live "= 320 sq ft" / "= 1.32 cu yd" line (.cs-wall-area, section 63). site.js "Zone measurements".
========================================================================== */
.cs-zone-measure {
    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-zone-measure-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

    /* A hidden box (another type's) takes no room in the grid */
    .cs-zone-measure-grid > [hidden] {
        display: none;
    }

/* Height: [ 8 ] ft  or  [ 12 ] courses */
.cs-height-pair {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

    .cs-height-pair .form-control {
        min-width: 0;
    }

.cs-height-unit,
.cs-height-or {
    font-size: 0.85rem;
    color: var(--cs-muted);
    white-space: nowrap;
}

/* Materials pop-up: "+ about 9 gal water" under a mortar / grout / bagged concrete line, and the zone's total */
.cs-line-water,
.cs-line-water-total {
    color: var(--cs-info);
}

.cs-line-water-total {
    font-size: 0.85rem;
    font-weight: 400;
}

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


/* ==========================================================================
76. PIER ROWS (zone form: piers / pier footings, one row per size; Models/ZonePiece)
[ How many ] [ Length (in) ] [ Width (in) ] [ Height: ft or courses / Depth ] [ ✕ ], then "+ Add another size".
Every box keeps its label, so a row still reads when it wraps (narrow pop-up, phone). site.js "Zone measurements".
========================================================================== */
/* A wrapping row, not a grid: How many / Length / Width keep a set width, and the height (two boxes + "ft or
   courses") takes the rest, dropping to its own line when the pop-up is narrow, so its boxes never get squeezed */
.cs-piece-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: flex-end;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--cs-border);
}

.cs-piece-cell {
    flex: 0 0 5.5rem;
    min-width: 0;
}

    .cs-piece-cell.cs-piece-height {
        flex: 1 1 14rem;
    }

    /* Height: the ft and courses boxes share the room, each wide enough for "7.33" / "11" */
    .cs-piece-height .cs-height-pair .form-control {
        flex: 1 1 3.75rem;
        min-width: 3.75rem;
    }

    .cs-piece-row:first-child {
        padding-top: 0;
    }

    /* Height or depth: only one shows, and it takes no room when hidden */
    .cs-piece-row > [hidden] {
        display: none;
    }

/* The ✕ lines up with the boxes, not their labels */
.cs-piece-remove {
    flex: 0 0 auto;
    margin-bottom: 0.2rem;
}

.cs-piece-error {
    flex-basis: 100%;
    font-size: 0.875rem;
}

.cs-piece-add {
    padding-left: 0;
    padding-right: 0;
}


/* ==========================================================================
73. HYDROSEEDING: "HOW BIG IS YOUR TANK?"
Top of the zone Materials pop-up, the first time a tank-mix job gets materials (Setup doesn't ask any more).
ZonesController.SetTank saves it to the trade profile. Stacks on phones.
========================================================================== */
.cs-ask-tank {
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    background: var(--cs-warning-bg);
    border: 1px solid var(--cs-gold-soft);
    border-left: 4px solid var(--cs-gold);
    border-radius: var(--cs-radius-md);
}

.cs-ask-tank-title {
    font-weight: 800;
    color: var(--cs-heading);
}

.cs-ask-tank-text {
    margin: 0.15rem 0 0.6rem;
    font-size: 0.88rem;
    color: var(--cs-muted);
}

.cs-ask-tank-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.6rem;
}

    .cs-ask-tank-fields > div {
        flex: 1 1 11rem;
    }

    .cs-ask-tank-fields .form-label {
        margin-bottom: 0.2rem;
        font-size: 0.85rem;
        font-weight: 600;
    }

@media (max-width: 575.98px) {
    .cs-ask-tank-fields .btn {
        flex: 1 1 100%;
    }
}