.account-card,
.account-card:link,
.account-card:visited {
    position: relative;
    display: block;
    min-height: 118px;
    padding: 24px;
    border-color: var(--line);
    background: linear-gradient(145deg, #fff, #fffefa);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.history-view-tabs { display:flex; gap:8px; margin:0 0 12px; }
.history-view-tabs a { padding:10px 16px; border:1px solid var(--line); border-radius:999px; background:#fff; color:var(--green); font-weight:800; text-decoration:none; }
.history-view-tabs a[aria-current="page"] { border-color:var(--green); background:var(--green); color:#fff; }
.mix-history-table { min-width:0; }
.mix-history-table .mix-col-color { width:14%; }
.mix-history-table .mix-col-number { width:10%; }
.mix-history-table .mix-col-item { width:10%; }
.mix-history-table .mix-col-qty { width:6%; }
.mix-history-table .mix-col-comment { width:21%; }
.mix-history-table .mix-col-job { width:15%; }
.mix-history-table .mix-col-date { width:12%; }
.mix-history-table .mix-col-action { width:12%; }
.mix-history-table .job-cell { overflow:visible; text-overflow:clip; white-space:normal; overflow-wrap:anywhere; }
.mix-label-lines { display:block; margin-top:5px; color:var(--muted); line-height:1.45; }
@media(max-width:900px) {
    .mix-history-table,.mix-history-table tbody { display:block; width:100%; min-width:0; }
    .mix-history-table colgroup,.mix-history-table thead { display:none; }
    .mix-history-table tbody { display:grid; gap:12px; }
    .mix-history-table tbody tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:14px; border:1px solid var(--line); border-radius:14px; background:#fff; }
    .mix-history-table tbody td,.mix-history-table tbody td:first-child,.mix-history-table tbody td:last-child { min-width:0; padding:8px; border:0; background:transparent; text-align:left; overflow-wrap:anywhere; white-space:normal; }
    .mix-history-table tbody td::before { content:attr(data-label); display:block; margin-bottom:2px; color:var(--muted); font-size:10px; font-weight:850; text-transform:uppercase; letter-spacing:.08em; }
    .mix-history-table tbody td:nth-child(5)::before { content:"Use / Comment"; }
    .mix-history-table .action-cell { grid-column:1/-1; }
}
.live-filter-fields { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:17px; }
.live-filter-fields label { margin:0; color:var(--muted); font-size:11px; font-weight:850; text-transform:uppercase; letter-spacing:.08em; }
.live-filter-fields input { margin-top:6px; padding:10px 11px; color:var(--green); font-size:14px; font-weight:700; text-transform:none; letter-spacing:normal; }
[data-live-results][aria-busy="true"] { opacity:.55; transition:opacity .15s ease; }

.account-card h3,
.account-card span {
    color: inherit;
    text-decoration: none;
}

.account-card > span {
    color: var(--muted);
}

.account-card:hover {
    transform: translateY(-5px);
    border-color: #9ebbaa;
    background: linear-gradient(145deg, #fffefa, #edf6f0);
    box-shadow: 0 18px 34px #173c2d22;
}

.account-card:hover h3 {
    color: var(--green);
}

.account-card:focus-visible {
    outline: 4px solid #23725233;
    outline-offset: 3px;
}

.filter-actions {
    position: relative;
}

.date-filter {
    position: relative;
}

.date-filter > summary {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 220px;
    padding: 11px 14px;
    border: 1px solid #bfd0c4;
    border-radius: 14px;
    background: linear-gradient(145deg, #f7faf7, #e7f0e9);
    color: var(--green);
    cursor: pointer;
    list-style: none;
    box-shadow: 0 5px 14px #173c2d14;
    transition: transform .15s ease, box-shadow .15s ease;
}

.date-filter > summary::marker {
    content: "";
}

.date-filter > summary::-webkit-details-marker {
    display: none;
}

.date-filter > summary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px #173c2d20;
}

.date-filter > summary small,
.date-filter > summary strong {
    display: block;
}

.date-filter > summary small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.date-filter > summary strong {
    margin-top: 2px;
    font-size: 15px;
}

.calendar-icon {
    position: relative;
    flex: 0 0 auto;
    width: 22px;
    height: 20px;
    border: 2px solid var(--green2);
    border-radius: 5px;
    background: #fff;
}

.calendar-icon::before {
    content: "";
    position: absolute;
    left: -2px;
    right: -2px;
    top: 4px;
    border-top: 2px solid var(--green2);
}

.calendar-icon::after {
    content: "";
    position: absolute;
    left: 4px;
    top: -4px;
    width: 10px;
    height: 5px;
    border-left: 2px solid var(--green2);
    border-right: 2px solid var(--green2);
}

.chevron {
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid var(--green);
    border-bottom: 2px solid var(--green);
    transform: rotate(45deg) translateY(-2px);
    transition: transform .15s ease;
}

.date-filter[open] .chevron {
    transform: rotate(225deg) translate(-2px, -2px);
}

.calendar-panel {
    position: absolute;
    z-index: 20;
    right: 0;
    top: calc(100% + 10px);
    width: 360px;
    padding: 20px;
    border: 1px solid #cbd7ce;
    border-radius: 18px;
    background: #fffefa;
    box-shadow: 0 24px 60px #173c2d30;
}

.job-filter-field {
    margin-bottom: 17px;
}

.job-filter-field label {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .11em;
}

.job-filter-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #abc0b2;
    border-radius: 10px;
    background: #fff;
    color: var(--green);
    font: inherit;
    font-weight: 750;
}

.job-filter-field select:focus {
    outline: 4px solid #23725222;
    border-color: var(--green2);
}

.calendar-panel .calendar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 17px;
}

.calendar-panel .calendar-heading label,
.calendar-panel fieldset legend {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .11em;
}

.calendar-panel .calendar-heading select {
    min-width: 124px;
    padding: 9px 34px 9px 12px;
    border: 1.5px solid #abc0b2;
    border-radius: 10px;
    background: #fff;
    color: var(--green);
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.calendar-panel .calendar-heading select:focus {
    outline: 4px solid #23725222;
    border-color: var(--green2);
}

.calendar-panel fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.calendar-panel fieldset legend {
    margin-bottom: 9px;
}

.calendar-panel .month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.calendar-panel .month-choice {
    display: block;
    margin: 0;
}

.calendar-panel .month-choice input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

.calendar-panel .month-choice span {
    display: block;
    padding: 9px 5px;
    border: 1px solid #d6ded8;
    border-radius: 9px;
    background: #fafbf8;
    color: var(--ink);
    font-size: 13px;
    font-weight: 750;
    text-align: center;
    cursor: pointer;
    transition: background .12s ease, color .12s ease, border-color .12s ease, transform .12s ease;
}

.calendar-panel .month-choice span:hover {
    transform: translateY(-1px);
    border-color: #8fb19b;
    background: #edf5ef;
}

.calendar-panel .month-choice input:focus-visible + span {
    outline: 3px solid #23725233;
    outline-offset: 1px;
}

.calendar-panel .month-choice input:checked + span {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
    box-shadow: 0 4px 9px #1759402b;
}

.calendar-panel .all-months {
    grid-column: 1 / -1;
}

.calendar-panel .calendar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 17px;
    padding-top: 15px;
    border-top: 1px solid var(--line);
}

.calendar-panel .calendar-footer button {
    padding: 10px 14px;
}

.calendar-panel .calendar-footer a {
    color: var(--green2);
    font-size: 13px;
    font-weight: 800;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.history-tools {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.export-button {
    white-space: nowrap;
}

.invoice-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.invoice-hero {
    position: relative;
    z-index: 40;
    overflow: visible;
}

.email-invoice {
    position: relative;
    text-align: left;
}

.email-invoice > summary {
    list-style: none;
    white-space: nowrap;
}

.email-invoice > summary::-webkit-details-marker {
    display: none;
}

.email-invoice form {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    right: 0;
    width: min(350px, calc(100vw - 48px));
    padding: 18px;
    border: 1px solid #cbd7ce;
    border-radius: 14px;
    background: #fffefa;
    box-shadow: 0 20px 45px #173c2d2e;
    white-space: normal;
}

.email-invoice form > strong {
    display:block;
    margin-bottom:12px;
    color:var(--green);
    font:700 18px/1.3 system-ui,-apple-system,"Segoe UI",sans-serif;
    overflow-wrap:anywhere;
}
.email-invoice form > p { margin:8px 0 0; color:var(--muted); }
.email-recipient-list { display:grid; gap:8px; max-height:260px; margin-bottom:14px; overflow:auto; }
.email-recipient-list label { display:flex; grid-template-columns:none; align-items:flex-start; gap:9px; margin:0; padding:8px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.email-recipient-list input { width:auto; margin-top:3px; }
.email-recipient-list span,.email-recipient-list small { display:block; min-width:0; overflow-wrap:anywhere; }
.email-recipient-list small { color:var(--muted); font-weight:500; }

@media (max-width: 760px) {
    .history-tools {
        width: 100%;
        justify-items: stretch;
    }

    .filter-actions,
    .date-filter {
        width: 100%;
    }

    .date-filter > summary {
        width: 100%;
    }

    .calendar-panel {
        right: auto;
        left: 0;
        width: min(360px, calc(100vw - 76px));
    }

    .invoice-actions { width:100%; justify-content:flex-start; flex-wrap:wrap; }
    .email-invoice form {
        position:fixed;
        top:50%;
        right:auto;
        left:50%;
        width:min(350px,calc(100vw - 32px));
        max-height:calc(100vh - 32px);
        overflow:auto;
        transform:translate(-50%,-50%);
    }
}
.select-column{width:2.5rem;text-align:center!important}.select-column input{width:1.1rem;height:1.1rem}.batch-email-form{max-width:42rem}.batch-email-form button{margin-top:1rem}
.batch-print-frame{position:fixed;right:0;bottom:0;width:1px;height:1px;border:0;opacity:0;pointer-events:none}
.page-shell,.invoice-page-shell{max-width:1440px}
@media(min-width:761px){.site-header{padding-left:max(24px,calc((100vw - 1440px)/2));padding-right:max(24px,calc((100vw - 1440px)/2))}}
.table-wrap thead th{position:sticky;top:0;z-index:5;background:#f2f5f1;box-shadow:0 1px 0 var(--line)}
@media(min-width:1200px){.table-wrap{overflow:visible}}
