﻿/* ========= AppShell.Blue.css (Themeable + tinted rows) =========
   JS updates these vars:
   --blue, --blue2, --blueSoft, --border, --rowAlt
*/

:root {
    --bg: #2f343a; /* dark gray background */
    --surface: #ffffff; /* card/surface */
    --text: #0f172a; /* slate */
    --muted: #475569; /* muted text */
    /* Theme variables (JS will override) */
    --blue: #2563eb; /* primary */
    --blue2: #1d4ed8; /* darker primary */
    --blueSoft: rgba(37,99,235,.14); /* focus/hover tint */
    --border: #d7e3f4; /* border tint */
    --rowAlt: rgba(37,99,235,.06); /* alternating row tint */
    /* Neutrals */
    --shadow: rgba(15,23,42,.08);
    --shadow-strong: rgba(0,0,0,.25);
    --surface2: #f8fbff;
    --danger: #b91c1c;
}

/* ========= Page base ========= */
html, body, form {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ========= Theme panel (floating) ========= */
.themePanel {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
}

.themeBox {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px var(--shadow-strong);
    border: 1px solid var(--border);
}

/* ========= Layout wrapper ========= */
.app {
    width: 100%;
    background: var(--bg);
    padding: 30px 0;
}

.content-wrap {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px; /* small gutter on tiny screens */
    box-sizing: border-box;
}

.content-wrap--wide {
    width: 100%;
    max-width: 100%;
    margin: auto;
    box-sizing: border-box;
}
.content-wrap--xwide {
    width: 100%;
    padding: 0 40px;
    box-sizing: border-box;
}

.page-inner--xwide {
    width: 100%;
    max-width: none; /* no cap unless you want one */
    margin: 0 auto;
}

.page-inner {
    width: 100%;
    display: block;
}

/* ========= Section headers ========= */
.hdr {
    background: linear-gradient(90deg, var(--blue2), var(--blue));
    color: #fff;
}

/* ========= Page chrome ========= */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 12px 28px var(--shadow);
    overflow: hidden;
}

.headerbar {
    background: linear-gradient(90deg, var(--blue2), var(--blue));
    color: #fff;
    padding: 12px 16px;
    font-weight: 700;
    letter-spacing: .2px;
}

.subheader {
    padding: 10px 16px;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}

.content {
    padding: 16px;
    margin-top: -50px;
}

/* ========= Typography helpers ========= */
.msg {
    min-height: 18px;
    font-size: 13px;
    color: var(--danger);
}

.muted {
    color: var(--muted);
}

/* ========= Form elements ========= */
.label {
    display: block;
    margin: 12px 0 6px;
    font-size: 14px;
    color: var(--muted);
}

.textbox {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-size: 15px;
    box-sizing: border-box;
}

    .textbox:focus {
        outline: none;
        border-color: var(--blue);
        box-shadow: 0 0 0 4px var(--blueSoft);
    }

/* ========= Buttons ========= */
.btn {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
    color: var(--text);
    font-size: 14px;
}

.btn-primary {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

    .btn-primary:hover {
        background: var(--blue2);
        border-color: var(--blue2);
    }

/* ========= Helpful spacing utilities ========= */
.row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.col {
    flex: 1;
}

.stack {
    display: grid;
    gap: 10px;
}

/* ========= DayPilot-friendly container (optional) ========= */
.dp-surface {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 10px 22px rgba(15,23,42,.06);
}

/* ========= Optional: tables/grid helpers ========= */
.table-surface {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.table-pad {
    padding: 10px;
}

/* ============================================================
   XGridView + Standard GridView (tinted by theme)
   ============================================================ */

/* ===== XGridView ===== */
.xgv {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--border);
    font-size: 18px, !important;
}

    .xgv th {
        background: linear-gradient(to bottom, var(--blue2), var(--blue));
        color: #fff;
        padding: 8px 6px;
        font-weight: 600;
        text-align: left;
        
    }

    .xgv td {
        padding: 7px 6px;
        border-bottom: 1px solid var(--border);
        font-size:18px;
    }

    /* Alternating rows: tinted from theme */
    .xgv tr:nth-child(even) {
        background-color: var(--rowAlt);
    }

    .xgv tr:nth-child(odd) {
        background-color: #fff;
    }

    .xgv tr:hover {
        background-color: var(--blueSoft) !important;
    }

    .xgv .SelectedRowStyle {
        background-color: var(--blueSoft) !important;
    }

/* ===== Standard GridView ===== */
.gv {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    font-size: 15px;
}

    .gv th {
        background: linear-gradient(to bottom, var(--blue2), var(--blue));
        color: #fff;
        font-weight: 600;
        padding: 8px 6px;
        text-align: left;
    }

    .gv td {
        padding: 7px 6px;
        border-bottom: 1px solid var(--border);
        font-size: 15px;
    }

    .gv tr:nth-child(even) {
        background-color: var(--rowAlt);
    }

    .gv tr:nth-child(odd) {
        background-color: #fff;
    }

    .gv tr:hover {
        background-color: var(--blueSoft) !important;
    }

    .gv .SelectedRowStyle {
        background-color: var(--blueSoft) !important;
    }

.gv-fixed {
    table-layout: fixed; /* important */
    width: 100%;
}

/* ========= GridView theme (matches AppShell.Blue variables) ========= */
/* Use: <asp:GridView CssClass="gv" ...> */

.gv {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #d7e3f4);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(15,23,42,.06);
    font-size: 13px;
    color: var(--text, #0f172a);
}

    /* cells */
    .gv th,
    .gv td {
        padding: 10px 12px;
        border-bottom: 1px solid var(--border, #d7e3f4);
        vertical-align: middle;
    }

    /* header */
    .gv th {
        position: sticky; /* remove if you don't want sticky headers */
        top: 0;
        z-index: 1;
        text-align: left;
        color: #fff;
        font-weight: 700;
        letter-spacing: .2px;
        background: linear-gradient(90deg, var(--blue2, #1d4ed8), var(--blue, #2563eb));
        border-bottom: 1px solid rgba(255,255,255,.18);
    }

        /* header sort links */
        .gv th a {
            color: #fff;
            text-decoration: none;
        }

            .gv th a:hover {
                text-decoration: underline;
            }

    /* rows */
    .gv tr {
        background: var(--surface, #fff);
    }

        .gv tr.gv-alt {
            background: var(--rowAlt, rgba(37,99,235,.06));
        }

        /* hover */
        .gv tr:hover td {
            background: rgba(37,99,235,.10);
        }

        /* selected row (if you set SelectedRowStyle-CssClass="gv-selected") */
        .gv tr.gv-selected td {
            background: rgba(37,99,235,.16);
            font-weight: 600;
        }

        /* footer */
        .gv tfoot td,
        .gv tr.gv-footer td {
            font-weight: 700;
            color: var(--text, #0f172a);
            background: rgba(15,23,42,.03);
            border-bottom: 0;
        }

    /* pager (PagerStyle-CssClass="gv-pager") */
    .gv .gv-pager {
        padding: 10px 12px;
        text-align: center;
        background: rgba(15,23,42,.03);
        border-top: 1px solid var(--border, #d7e3f4);
    }

        .gv .gv-pager a {
            display: inline-block;
            margin: 0 3px;
            padding: 6px 10px;
            border-radius: 10px;
            text-decoration: none;
            color: var(--blue, #2563eb);
            border: 1px solid var(--border, #d7e3f4);
            background: var(--surface, #fff);
        }

            .gv .gv-pager a:hover {
                background: var(--rowAlt, rgba(37,99,235,.06));
            }

        .gv .gv-pager span {
            display: inline-block;
            margin: 0 3px;
            padding: 6px 10px;
            border-radius: 10px;
            background: var(--blueSoft, rgba(37,99,235,.14));
            color: var(--text, #0f172a);
            border: 1px solid var(--border, #d7e3f4);
        }

    /* optional: compact version */
    .gv.gv-compact th,
    .gv.gv-compact td {
        padding: 7px 10px;
        font-size: 12px;
    }



/*Modal Popups -------------------------*/
.mdl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 9998;
}

.mdl {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    /*width: calc(100% + 10px);
    height: calc(100% + 10px);*/
    /*width: 650px;
    max-width: 95vw;
    max-height: 90vh;*/
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    z-index: 9999;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.mdl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0,0,0,.08);
    font-weight: 700;
}

.mdl-x {
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.mdl-body {
    padding: 14px;
}

/*.panRefundCustomerCredit {
    height: auto;
    width: auto;
}*/
/*END Modal Popups -------------------------*/


/* shared: keep tables predictable */
.gv.gv-fixed {
    table-layout: fixed;
    width: 100%;
}

/* header wrapper (non-scroll) */
.grid-head {
    overflow: hidden; /* no scrollbars */
}

/* scrollable body */
.grid-scroll {
    height: 330px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable; /* reserves scrollbar space */
}

/* make header match the body’s reserved scrollbar space */
.grid-head {
    padding-right: 16px; /* typical scrollbar width */
    box-sizing: border-box;
}

/* if you want to be extra safe on Windows, use 17px */
@supports (scrollbar-gutter: stable) {
    .grid-head {
        padding-right: 17px;
    }
}

#paymentsHeader {
    background: yellow;
}

/* ========= RV Service login page ========= */
.login-app {
    min-height: 100%;
    display: flex;
    align-items: flex-start;
    padding: clamp(32px, 8vh, 88px) 0;
    box-sizing: border-box;
}

.login-wrap {
    max-width: 560px;
}

.login-card {
    width: 100%;
}

.login-logo-bar {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 18px 24px;
    background: #e5e7eb;
    box-sizing: border-box;
}

.login-logo {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 130px;
}

.login-header {
    padding: 14px 24px;
    text-align: center;
}

.login-title {
    font-size: 22px;
    line-height: 1.3;
}

.login-content {
    margin-top: 0;
    padding: 24px 28px 30px;
}

.login-message {
    display: block;
    min-height: 20px;
    margin-bottom: 4px;
    font-size: 14px;
}

.login-label {
    font-weight: 600;
}

.login-input {
    min-height: 48px;
    font-size: 17px;
}

.login-button {
    width: 100%;
    min-height: 48px;
    margin-top: 10px;
    font-size: 16px;
    font-weight: 700;
}

.login-button:focus-visible {
    outline: 3px solid var(--blueSoft);
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .login-app {
        padding: 28px 0;
    }

    .login-wrap {
        padding: 0 18px;
    }

    .login-content {
        padding: 22px 24px 28px;
    }
}

@media (max-width: 480px) {
    .login-app {
        padding: 14px 0;
    }

    .login-wrap {
        padding: 0 12px;
    }

    .login-card {
        border-radius: 12px;
    }

    .login-logo-bar {
        min-height: 120px;
        padding: 14px 18px;
    }

    .login-logo {
        max-height: 100px;
    }

    .login-content {
        padding: 20px 18px 24px;
    }
}


/* ========= Work order list page ========= */
.workorder-list-wrap {
    max-width: 1180px;
}

.workorder-list-card {
    width: 100%;
}

.page-logo-bar {
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 18px;
    background: #e5e7eb;
    box-sizing: border-box;
}

.page-logo {
    display: block;
    width: auto;
    max-width: min(65%, 360px);
    max-height: 75px;
}

.page-menu-button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--blue2);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
}

.page-menu-button:hover,
.page-menu-button:focus-visible {
    background: var(--blueSoft);
}

.workorder-list-header {
    padding: 14px 20px;
    font-size: 20px;
}

.workorder-list-subheader {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 18px;
    font-size: 14px;
}

.workorder-list-content {
    margin-top: 0;
    padding: 18px 20px 22px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
}

.page-actions .btn {
    min-height: 44px;
    font-size: 15px;
    font-weight: 600;
}

.workorder-list-message {
    display: block;
    min-height: 18px;
}

.grid-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
}

.workorder-grid {
    min-width: 760px;
}

.workorder-grid .btn {
    min-height: 38px;
    padding: 7px 12px;
}

.workorder-grid tr.hot td {
    font-weight: 700;
    background: #fff7d6;
}

.workorder-grid tr.hot:hover td {
    background: #ffefad;
}

@media (max-width: 900px) {
    .workorder-list-wrap {
        padding: 0 14px;
    }

    .workorder-list-content {
        padding: 16px;
    }

    .page-actions .btn {
        flex: 1 1 210px;
    }
}

@media (max-width: 600px) {
    .page-logo-bar {
        min-height: 82px;
        padding: 8px 12px;
    }

    .page-logo {
        max-height: 62px;
    }

    .page-menu-button {
        padding: 7px 10px;
    }
}


/* Create / edit job */
.create-job-wrap {
    max-width: 1280px;
    padding: 0 20px 32px;
}

.create-job-card {
    overflow: hidden;
}

.create-job-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 20px;
}

.create-job-title {
    display: block;
    font-size: 22px;
    font-weight: 700;
}

.create-job-number {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    opacity: .9;
}

.create-job-content {
    margin-top: 0;
    padding: 20px;
}

.create-job-message {
    display: block;
    margin-bottom: 14px;
    padding: 11px 14px;
    border-radius: 8px;
    font-weight: 600;
}

.create-job-message:empty {
    display: none;
}

.create-job-message.success {
    color: #14532d;
    background: #dcfce7;
    border: 1px solid #86efac;
}

.create-job-message.error {
    color: #7f1d1d;
    background: #fee2e2;
    border: 1px solid #fca5a5;
}

.create-job-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
    gap: 18px;
}

.form-section {
    min-width: 0;
    padding: 18px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.form-section h2 {
    margin: 0 0 15px;
    color: var(--navy);
    font-size: 18px;
}

.span-full {
    grid-column: 1 / -1;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-grid.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .span-two {
    grid-column: 1 / -1;
}

.unit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.selectbox {
    width: 100%;
    min-height: 42px;
}

.field-with-action {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.field-with-action .textbox {
    min-width: 0;
    flex: 1 1 auto;
}

.compact-button {
    flex: 0 0 auto;
    min-height: 42px;
    white-space: nowrap;
}

.inline-add-panel {
    max-width: 620px;
    margin-top: 14px;
    padding: 14px;
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    background: #eaf2ff;
}

.checkbox-field {
    padding-top: 8px;
    font-weight: 600;
}

.checkbox-field input {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

.description-box {
    width: 100%;
    min-height: 210px;
    resize: vertical;
    line-height: 1.45;
}

.create-job-actions {
    margin: 20px 0 0;
}

.create-job-actions .btn {
    min-height: 46px;
    min-width: 180px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 900px) {
    .create-job-wrap {
        padding: 0 14px 24px;
    }

    .create-job-grid {
        grid-template-columns: 1fr;
    }

    .span-full {
        grid-column: auto;
    }

    .unit-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .create-job-header {
        align-items: stretch;
        flex-direction: column;
    }

    .create-job-header .btn {
        width: 100%;
    }

    .create-job-content,
    .form-section {
        padding: 14px;
    }

    .form-grid.two-column,
    .unit-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .span-two {
        grid-column: auto;
    }

    .field-with-action {
        flex-wrap: wrap;
    }

    .field-with-action .compact-button {
        flex: 1 1 auto;
    }

    .create-job-actions .btn {
        width: 100%;
    }
}


/* New / edit client */
.new-client-wrap {
    max-width: 1180px;
    padding: 0 20px 32px;
}

.new-client-card {
    overflow: hidden;
}

.new-client-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 20px;
}

.new-client-title {
    display: block;
    font-size: 22px;
    font-weight: 700;
}

.new-client-number {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    opacity: .9;
}

.new-client-content {
    margin-top: 0;
    padding: 20px;
}

.new-client-message {
    display: block;
    margin-bottom: 14px;
    padding: 11px 14px;
    border-radius: 8px;
    font-weight: 600;
}

.new-client-message:empty {
    display: none;
}

.new-client-message.success {
    color: #14532d;
    background: #dcfce7;
    border: 1px solid #86efac;
}

.new-client-message.error {
    color: #7f1d1d;
    background: #fee2e2;
    border: 1px solid #fca5a5;
}

.customer-search-section {
    margin-bottom: 18px;
}

.customer-search-controls {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto auto auto;
    align-items: center;
    gap: 10px;
}

.search-type-list {
    white-space: nowrap;
}

.search-type-list td {
    padding-right: 10px;
}

.search-type-list input {
    width: 18px;
    height: 18px;
    margin-right: 5px;
    vertical-align: middle;
}

.customer-results {
    margin-top: 16px;
}

.customer-grid {
    min-width: 820px;
}

.customer-grid .btn {
    min-height: 38px;
    padding: 7px 12px;
}

.customer-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-form-grid .span-two {
    grid-column: span 2;
}

.city-choice-panel {
    max-width: 700px;
}

.new-client-actions {
    margin: 20px 0 0;
}

.new-client-actions .btn {
    min-height: 46px;
    min-width: 190px;
}

@media (max-width: 900px) {
    .new-client-wrap {
        padding: 0 14px 24px;
    }

    .customer-search-controls {
        grid-template-columns: 1fr 1fr;
    }

    .customer-search-controls .textbox {
        grid-column: 1 / -1;
    }

    .customer-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .new-client-header {
        align-items: stretch;
        flex-direction: column;
    }

    .new-client-header .btn {
        width: 100%;
    }

    .new-client-content,
    .customer-form-section,
    .customer-search-section {
        padding: 14px;
    }

    .customer-search-controls,
    .customer-form-grid {
        grid-template-columns: 1fr;
    }

    .customer-search-controls .textbox,
    .customer-form-grid .span-two {
        grid-column: auto;
    }

    .new-client-actions .btn {
        width: 100%;
    }
}


/* Employee manager */
.employee-wrap {
    max-width: 1120px;
    padding: 0 20px 32px;
}

.employee-card {
    overflow: hidden;
}

.employee-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 20px;
}

.employee-title {
    font-size: 22px;
    font-weight: 700;
}

.employee-content {
    margin-top: 0;
    padding: 20px;
}

.employee-message {
    display: block;
    margin-bottom: 14px;
    padding: 11px 14px;
    border-radius: 8px;
    font-weight: 600;
}

.employee-message:empty {
    display: none;
}

.employee-message.success {
    color: #14532d;
    background: #dcfce7;
    border: 1px solid #86efac;
}

.employee-message.error {
    color: #7f1d1d;
    background: #fee2e2;
    border: 1px solid #fca5a5;
}

.employee-grid {
    min-width: 720px;
}

.employee-grid .btn {
    min-height: 38px;
    padding: 7px 12px;
}

.employee-editor {
    max-width: 860px;
    margin: 0 auto;
}

.employee-editor-heading {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.employee-editor-title {
    display: block;
    color: var(--blue2);
    font-size: 20px;
    font-weight: 700;
}

.employee-number {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.employee-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 4px;
}

.field-help {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.employee-active-field {
    display: flex;
    align-items: center;
    padding-top: 30px;
    font-weight: 600;
}

.employee-active-field input {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

.employee-editor-actions {
    margin: 20px 0 0;
}

.employee-editor-actions .btn {
    min-height: 46px;
    min-width: 170px;
}

@media (max-width: 900px) {
    .employee-wrap {
        padding: 0 14px 24px;
    }
}

@media (max-width: 600px) {
    .employee-header {
        align-items: stretch;
        flex-direction: column;
    }

    .employee-header .btn {
        width: 100%;
    }

    .employee-content,
    .employee-editor {
        padding: 14px;
    }

    .employee-form-grid {
        grid-template-columns: 1fr;
    }

    .employee-active-field {
        padding-top: 8px;
    }

    .employee-editor-actions .btn {
        width: 100%;
    }
}


/* Portrait tablet workflow */
.tablet-flow-app {
    min-height: 100%;
    padding: 18px 0 28px;
}

.tablet-flow-wrap {
    max-width: 820px;
    padding: 0 14px;
}

.tablet-flow-header {
    padding: 15px 18px;
    font-size: 22px;
}

.tablet-flow-content {
    margin-top: 0;
    padding: 18px;
}

.tablet-flow-hint {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.45;
}

.tablet-flow-message {
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
}

.tablet-search-grid {
    display: grid;
    gap: 10px;
}

.tablet-input,
.tablet-button {
    min-height: 52px;
    font-size: 17px;
}

.tablet-flow-actions {
    margin: 16px 0;
}

.tablet-flow-actions .tablet-button {
    flex: 1 1 190px;
}

.tablet-card-list {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tablet-result-grid {
    min-width: 680px;
}

.tablet-result-grid th,
.tablet-result-grid td {
    padding: 12px 10px;
    font-size: 15px;
}

.tablet-row-button {
    min-height: 44px;
    min-width: 92px;
    font-size: 16px;
}

.tablet-back-button {
    width: 100%;
    margin-top: 16px;
}

@media (max-width: 600px) {
    .tablet-flow-app {
        padding: 8px 0 18px;
    }

    .tablet-flow-wrap {
        padding: 0 8px;
    }

    .tablet-flow-content {
        padding: 14px;
    }

    .tablet-flow-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .tablet-flow-actions .tablet-button {
        width: 100%;
    }
}


/* Work order portrait hub and RV editor */
.tablet-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.tablet-form-grid .span-full { grid-column: 1 / -1; }
.tablet-inline-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 8px;
}
.tablet-inline-add .btn { min-height: 44px; }
.tablet-summary-card {
    display: grid;
    gap: 5px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    font-size: 15px;
    line-height: 1.4;
}
.work-order-card { overflow: hidden; }
.work-order-titlebar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.work-order-number { font-weight: 700; }
.work-order-step {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}
.work-order-step-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.work-order-step-heading > div {
    display: flex;
    align-items: center;
    gap: 10px;
}
.work-order-step h2 {
    margin: 0;
    color: var(--navy);
    font-size: 19px;
}
.step-number {
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
}
.work-order-empty {
    display: block;
    padding: 14px;
    border: 1px dashed #94a3b8;
    border-radius: 12px;
    color: var(--muted);
    background: #f8fafc;
}
.work-order-inline-button {
    justify-self: start;
    margin-top: 6px;
}
.work-order-notes {
    min-height: 110px;
    resize: vertical;
}
.work-order-check {
    display: flex;
    align-items: center;
    min-height: 48px;
    font-weight: 600;
}
.work-order-check input {
    width: 22px;
    height: 22px;
    margin-right: 8px;
}
.work-order-save {
    width: 100%;
    margin-top: 16px;
}
.issue-card {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    overflow: hidden;
}
.issue-card summary {
    display: grid;
    gap: 5px;
    padding: 14px;
    cursor: pointer;
    list-style-position: inside;
}
.issue-counts {
    padding-left: 20px;
    color: var(--muted);
    font-size: 13px;
}
.issue-card-body {
    padding: 0 14px 14px;
}
.issue-card-body p {
    margin: 0 0 12px;
    white-space: pre-wrap;
}
@media (max-width: 600px) {
    .tablet-form-grid { grid-template-columns: 1fr; }
    .tablet-form-grid .span-full { grid-column: auto; }
    .tablet-inline-add { grid-template-columns: 1fr; }
    .work-order-step { padding: 13px; }
    .work-order-step-heading {
        align-items: stretch;
        flex-direction: column;
    }
    .work-order-step-heading .tablet-button { width: 100%; }
}

/* Issue editor */
.issue-editor-card { overflow: hidden; }
.issue-description {
    min-height: 130px;
    resize: vertical;
    line-height: 1.45;
}
.issue-add-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px;
    gap: 12px;
    margin-top: 14px;
}
.issue-add-grid .span-full { grid-column: 1 / -1; }
.issue-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}
.issue-list-row > div {
    display: grid;
    gap: 3px;
}
.issue-list-row span {
    color: var(--muted);
    font-size: 13px;
}
.photo-upload {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}
.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.photo-card {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}
.photo-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 8px;
    background: #e2e8f0;
}
.photo-card figcaption {
    min-height: 20px;
    overflow-wrap: anywhere;
}
@media (max-width: 600px) {
    .issue-add-grid,
    .photo-grid { grid-template-columns: 1fr; }
    .issue-add-grid .span-full { grid-column: auto; }
    .issue-list-row {
        align-items: stretch;
        flex-direction: column;
    }
    .issue-list-row .btn { width: 100%; }
    .photo-card img { height: 240px; }
}