* { box-sizing: border-box; }

:root {
    --navy: #0b3b78;
    --navy-dark: #06294f;
    --blue: #1390e8;
    --text: #1a2635;
    --muted: #667487;
    --white: #fff;
    --light: #f5f8fb;
    --border: #dce4ed;
    --danger: #b42318;
    --danger-dark: #8f1c13;
    --success: #18794e;
    --success-bg: #ecfdf3;
    --danger-bg: #fff1f0;
    --shadow: 0 12px 30px rgba(10, 50, 90, .08);
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--light);
    line-height: 1.5;
}

a { color: inherit; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .98);
    border-bottom: 1px solid rgba(11, 59, 120, .12);
    backdrop-filter: blur(10px);
}

.header-inner {
    width: min(1180px, calc(100% - 32px));
    min-height: 82px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    flex: 0 0 auto;
}

.brand img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-text strong {
    color: var(--navy);
    font-size: 1.7rem;
    letter-spacing: .08em;
}

.brand-text span {
    margin-top: 5px;
    color: var(--navy-dark);
    font-size: .68rem;
    font-weight: 650;
    white-space: nowrap;
}

.topnav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
}

.topnav a {
    color: #30445c;
    text-decoration: none;
    padding: 9px 10px;
    border-radius: 7px;
    font-size: .9rem;
    font-weight: 750;
    white-space: nowrap;
}

.topnav a:hover,
.topnav a:focus-visible {
    color: var(--navy);
    background: #edf6fd;
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 64px;
}

.footer {
    padding: 24px 16px;
    text-align: center;
    color: rgba(255, 255, 255, .68);
    background: #061b36;
}

.hero,
.panel,
.auth-card,
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.hero {
    margin-bottom: 28px;
    padding: 34px;
    color: var(--white);
    border: 0;
    background: linear-gradient(135deg, var(--navy-dark), var(--navy) 72%, #126ab8);
}

.hero h1,
.panel h1,
.auth-card h1 {
    margin: 4px 0 10px;
    line-height: 1.08;
    color: inherit;
}

.panel h1,
.auth-card h1 { color: var(--navy-dark); }

h2, h3 { color: var(--navy-dark); }

.eyebrow {
    margin: 0 0 5px;
    color: var(--blue);
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.hero .eyebrow { color: #75c8ff; }

.muted { color: var(--muted); }

.small-note { font-size: .86rem; }

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin: 24px 0 14px;
}

.section-heading h1,
.section-heading h2 { margin: 3px 0 0; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.card { padding: 22px; }
.card h3 { margin-top: 0; }

.auth-shell {
    min-height: 64vh;
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(470px, 100%);
    padding: 30px;
}

.panel { padding: 26px; }
.narrow { max-width: 680px; margin: 0 auto; }

form { display: grid; gap: 14px; }

label {
    display: grid;
    gap: 6px;
    color: #32465d;
    font-size: .9rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #cbd7e4;
    border-radius: 8px;
    background: var(--white);
    color: var(--text);
    font: inherit;
}

input::placeholder,
textarea::placeholder { color: #8b99a8; }

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(19, 144, 232, .13);
    border-color: var(--blue);
}

button,
.button,
a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    padding: 8px 14px;
    border: 1px solid var(--navy);
    border-radius: 7px;
    background: var(--navy);
    color: var(--white);
    font: inherit;
    font-size: .9rem;
    font-weight: 800;
    line-height: 1.15;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

button:hover,
.button:hover { background: var(--navy-dark); border-color: var(--navy-dark); }

button.secondary,
.button.secondary {
    background: var(--white);
    border-color: #aebfd1;
    color: var(--navy);
}

button.secondary:hover,
.button.secondary:hover { background: #eef6fc; border-color: var(--blue); }

button.danger,
.button.danger {
    background: var(--white);
    border-color: #e7a4a0;
    color: var(--danger);
}

button.danger:hover,
.button.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--white);
}

button.compact,
.button.compact,
.compact-button {
    min-height: 33px;
    padding: 6px 10px;
    font-size: .78rem;
    border-radius: 6px;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    font-size: .9rem;
}

.auth-links a { color: var(--navy); font-weight: 700; }

.alert,
.notice {
    margin: 14px 0;
    padding: 11px 13px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 650;
}

.alert.error,
.notice-error,
.notice.error {
    color: #842029;
    background: var(--danger-bg);
    border-color: #f1b7b4;
}

.alert.success,
.notice-success {
    color: #0f5132;
    background: var(--success-bg);
    border-color: #a8dfbf;
}

.table-wrap {
    margin-top: 18px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 11px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th {
    background: #edf4fa;
    color: var(--navy-dark);
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

tbody tr:hover { background: #f8fbfd; }

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.inline-actions form { display: block; }

.inline-form {
    grid-template-columns: 1fr auto;
    align-items: end;
    margin-top: 18px;
}

.grow { min-width: 0; }

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 850;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge.active {
    background: #eaf8f0;
    color: #176a45;
    border-color: #add9c0;
}

.badge.hidden-status {
    background: #f1f3f5;
    color: #5e6874;
    border-color: #d8dde3;
}

code {
    color: #3c5066;
    background: #f0f4f8;
    padding: 3px 6px;
    border-radius: 5px;
    font-size: .82rem;
}

/* Compact business management */
.business-add-form {
    max-width: 640px;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 8px;
}

.business-add-form input { min-height: 38px; }
.business-add-form button { min-height: 38px; }

.business-list {
    margin-top: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--white);
}

.business-list-head,
.business-row {
    display: grid;
    grid-template-columns: minmax(300px, 1.7fr) minmax(190px, .85fr) 76px minmax(128px, auto);
    gap: 12px;
    align-items: center;
}

.business-list-head {
    padding: 8px 10px;
    color: var(--navy-dark);
    background: #edf4fa;
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.business-row {
    padding: 8px 10px;
    border-top: 1px solid var(--border);
}

.business-row:first-of-type { border-top: 0; }
.business-row:hover { background: #fbfdff; }

.business-name-form {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.business-name-form input {
    min-width: 0;
    min-height: 34px;
    padding: 6px 8px;
    font-size: .84rem;
}

.business-name-form button,
.business-folder-form button,
.business-actions button {
    min-height: 32px;
    padding: 5px 9px;
    font-size: .75rem;
}

.business-slug {
    min-width: 0;
}

.business-actions {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.business-actions form { display: block; }

.archived-folder-name {
    display: inline-block;
    max-width: 180px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #f5f7fa;
    color: var(--muted);
    font-size: .78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Lift tracker, now sharing the backend stylesheet */
.lifttrack-page { width: min(760px, 100%); margin: 0 auto; }
.lifttrack-header,
.edit-header {
    display: flex;
    gap: 14px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.lifttrack-header h1,
.edit-header h1 { margin: 0; color: var(--navy-dark); font-size: clamp(1.55rem, 4vw, 2rem); }
.lifttrack-header p,
.edit-header p { margin: 4px 0 0; color: var(--muted); }

.add-po { flex: 0 0 auto; }
.hidden { display: none !important; }

.add-panel,
.edit-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.form-grid { display: grid; gap: 12px; }
.section-title { margin: 20px 2px 10px; font-size: 1.1rem; }
.inactive-title { color: #796000; }

.po-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 16px;
    padding: 17px;
    box-shadow: 0 3px 10px rgba(0,0,0,.05);
}

.active-card { border-left: 5px solid #198754; }
.waiting-card { border-left: 5px solid #d6a600; }
.po-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.po-heading { flex: 1; min-width: 0; }
.po-number { color: var(--navy-dark); font-size: 1.4rem; font-weight: 850; }
.name-edit-form { margin-top: 3px; }
.po-name-input { min-height: 32px; padding: 2px 4px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 1rem; }
.po-name-input[readonly] { cursor: default; }
.po-name-input.editing { border-color: #aeb7c2; background: #fff; color: var(--text); }
.status-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.status { padding: 5px 8px; border-radius: 999px; font-size: .7rem; font-weight: 850; letter-spacing: .3px; }
.status.waiting { background: #fff3cd; color: #664d03; }
.status.active { background: #d1e7dd; color: #0f5132; }
.inline-edit { min-height: 30px; padding: 5px 8px; font-size: .72rem; background: #edf3f8; border-color: #cad7e3; color: var(--navy); }
.inline-edit.saving { background: var(--blue); border-color: var(--blue); color: #fff; }
.lift-count { margin-top: 18px; font-size: clamp(3rem, 12vw, 4.4rem); line-height: .95; font-weight: 900; color: var(--navy-dark); }
.lift-label { margin-top: 6px; color: var(--muted); }
.po-info { display: grid; gap: 8px; margin: 16px 0; padding: 12px 0; border-top: 1px solid #eceff3; border-bottom: 1px solid #eceff3; }
.po-info div { display: flex; justify-content: space-between; gap: 15px; }
.po-info span { color: var(--muted); }
.adjust-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.adjust-row form, .adjust-row .button { width: 100%; }
.adjust { font-size: .9rem; }
.minus { background: #59636e; border-color: #59636e; }
.plus { background: var(--blue); border-color: var(--blue); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.start { background: #198754; border-color: #198754; }
.delete { background: var(--danger); border-color: var(--danger); }
.save { background: var(--navy); border-color: var(--navy); }
.full-width { width: 100%; }
.buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.buttons form, .buttons .button { width: 100%; }
.full-grid { grid-column: 1 / -1; }
.empty-state { padding: 26px 16px; text-align: center; background: #fff; border: 1px dashed #bcc5d0; border-radius: 12px; color: var(--muted); }
.edit-page { width: min(680px, 100%); margin: 0 auto; }

@media (max-width: 900px) {
    .backend-header-inner {
        min-height: auto;
        padding: 10px 0 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .topnav {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: thin;
        padding-bottom: 9px;
    }

    .topnav a {
        flex: 0 0 auto;
        padding: 7px 9px;
        font-size: .82rem;
        background: #f3f7fb;
    }
}

@media (max-width: 700px) {
    .header-inner,
    .page { width: min(100% - 20px, 1180px); }

    .brand img { width: 46px; height: 46px; }
    .brand-text strong { font-size: 1.4rem; }
    .brand-text span { font-size: .62rem; }
    .page { padding: 20px 0 44px; }
    .panel, .auth-card { padding: 18px; border-radius: 12px; }
    .hero { padding: 22px; border-radius: 12px; }
    .auth-shell { min-height: auto; padding: 14px 0 30px; }

    .business-list-head { display: none; }
    .business-row {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 6px;
        padding: 8px;
    }
    .business-name-form { grid-column: 1 / -1; }
    .business-slug { font-size: .72rem; }
    .business-actions { gap: 4px; }
    .business-actions button { padding: 5px 7px; font-size: .7rem; }

    .business-add-form {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .auth-links { flex-wrap: wrap; }
}

@media (max-width: 520px) {
    .business-row { grid-template-columns: minmax(0, 1fr) auto; }
    .business-status { justify-self: end; }
    .business-actions { grid-column: 1 / -1; justify-content: flex-end; }

    .lifttrack-header,
    .edit-header { align-items: stretch; flex-direction: column; }
    .add-po { width: 100%; }
    .po-card { padding: 14px; }
    .status-actions { flex-direction: column; align-items: flex-end; }
    .buttons { grid-template-columns: 1fr; }
    .full-grid { grid-column: auto; }
    .po-info div { font-size: .9rem; }
}

/* Compact user administration */
.users-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}
.users-heading h1 { margin: 2px 0 0; color: var(--navy-dark); font-size: clamp(1.55rem, 3vw, 2.15rem); }
.users-note { margin: 8px 0 14px; font-size: .82rem; }

.user-search {
    display: grid;
    gap: 5px;
    max-width: 620px;
    margin: 0 0 10px;
}
.user-search > label { font-size: .78rem; }
.user-search-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.user-search-row input {
    flex: 1 1 auto;
    min-width: 120px;
    min-height: 34px;
    padding: 6px 9px;
    font-size: .84rem;
}
.user-search-row .button,
.user-search-row button { flex: 0 0 auto; }

.user-panel {
    margin-bottom: 10px;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(10,50,90,.05);
}
.user-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
}
.user-summary h2 {
    margin: 0 0 1px;
    font-size: 1.08rem;
    line-height: 1.2;
    text-transform: none;
}
.user-email { font-size: .8rem; line-height: 1.3; }
.user-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.user-panel .badge { min-height: 22px; padding: 2px 6px; font-size: .64rem; }
.user-last-login { margin: 4px 0 8px; font-size: .74rem; }
.user-actions { margin-bottom: 8px; }
.user-actions button { min-height: 30px; padding: 5px 9px; font-size: .75rem; }
.user-role-form {
    grid-template-columns: minmax(150px, 300px) auto;
    align-items: end;
    gap: 7px;
    margin: 8px 0;
}
.user-role-form label { font-size: .76rem; gap: 3px; }
.user-role-form select { min-height: 34px; padding: 5px 8px; font-size: .8rem; }
.user-role-form button { min-height: 34px; padding: 5px 9px; font-size: .75rem; }
.user-permissions { gap: 7px; margin-top: 7px; }
.user-permissions > strong { font-size: .8rem; color: var(--navy-dark); }
.user-business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 5px;
    margin: 2px 0 5px;
}
.user-business-option {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 6px;
    min-width: 0;
    min-height: 32px;
    padding: 5px 7px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fbfdff;
    color: var(--text);
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.15;
}
.user-business-option:hover { background: #f3f8fc; border-color: #c5d6e6; }
.user-business-checkbox {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    min-height: 0;
    margin: 0;
    padding: 0;
}
.user-permissions > button { justify-self: start; min-height: 31px; padding: 5px 9px; font-size: .74rem; }
.user-empty { padding: 16px; font-size: .86rem; }

@media (max-width: 700px) {
    .user-panel { padding: 11px; margin-bottom: 8px; }
    .user-summary { gap: 8px; }
    .user-summary h2 { font-size: 1rem; }
    .user-email { font-size: .75rem; }
    .user-role-form { grid-template-columns: minmax(0, 1fr) auto; }
    .user-business-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 430px) {
    .user-search-row { flex-wrap: wrap; }
    .user-search-row input { flex-basis: 100%; }
    .user-summary { flex-direction: column; }
    .user-badges { justify-content: flex-start; }
    .user-business-grid { grid-template-columns: 1fr; }
    .user-role-form { grid-template-columns: 1fr; }
    .user-role-form button { justify-self: start; }
}

/* Front Office employee directory */
.front-office-app-grid { margin-top: 18px; }
.app-card {
    display: block;
    text-decoration: none;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.app-card:hover {
    transform: translateY(-2px);
    border-color: #b9d5e9;
    box-shadow: 0 10px 24px rgba(10, 50, 90, .10);
}
.app-card h3 { margin-bottom: 6px; }
.app-card p { margin: 0; }

.directory-panel { max-width: 820px; margin: 0 auto; }
.directory-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.directory-heading h1 { margin: 2px 0 2px; }
.directory-count { margin: 0; font-size: .8rem; }

.directory-search {
    max-width: 640px;
    gap: 5px;
    margin: 0 0 14px;
}
.directory-search > label { font-size: .78rem; }
.directory-search-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.directory-search-row input {
    flex: 1 1 auto;
    min-width: 130px;
    min-height: 34px;
    padding: 6px 9px;
    font-size: .84rem;
}
.directory-search-row button,
.directory-search-row .button { flex: 0 0 auto; }

.employee-list {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--white);
}
.employee-list-head,
.employee-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(145px, auto);
    gap: 14px;
    align-items: center;
}
.employee-list-head {
    padding: 7px 11px;
    background: #edf4fa;
    color: var(--navy-dark);
    font-size: .69rem;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.employee-row {
    min-height: 42px;
    padding: 8px 11px;
    border-top: 1px solid var(--border);
}
.employee-row:first-of-type { border-top: 0; }
.employee-row:hover { background: #f8fbfd; }
.employee-name {
    min-width: 0;
    font-size: .9rem;
    font-weight: 750;
    color: var(--text);
}
.employee-phone {
    justify-self: end;
    font-size: .86rem;
    white-space: nowrap;
}
.employee-phone a {
    color: var(--navy);
    font-weight: 750;
    text-decoration: none;
}
.employee-phone a:hover { text-decoration: underline; }
.directory-empty { margin-top: 8px; }

@media (max-width: 520px) {
    .directory-panel { padding: 14px; }
    .directory-search-row { flex-wrap: wrap; }
    .directory-search-row input { flex-basis: 100%; }
    .employee-list-head,
    .employee-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
    .employee-list-head { padding: 6px 8px; }
    .employee-row { min-height: 39px; padding: 7px 8px; }
    .employee-name { font-size: .84rem; }
    .employee-phone { font-size: .8rem; }
}

/* Dashboard business cards: clean clickable blue boxes, no link underlines */
.business-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 2px solid rgba(19, 144, 232, .55);
    background: #fff;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}

.business-card-link,
.business-card-link * {
    text-decoration: none !important;
}

.business-card-link h3 {
    color: var(--navy);
}

.business-card-link:hover,
.business-card-link:focus-visible {
    border-color: var(--blue);
    background: #f8fcff;
    box-shadow: 0 10px 24px rgba(11, 59, 120, .12);
    transform: translateY(-1px);
    outline: none;
}

.business-card-link .muted {
    color: var(--blue);
    font-weight: 700;
}


/* Password reveal control */
.password-field {
    position: relative;
    display: block;
    width: 100%;
}

.password-field input[type="password"],
.password-field input[type="text"] {
    width: 100%;
    padding-right: 4.75rem;
}

.password-toggle {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    min-width: 3.7rem;
    margin: 0;
    padding: 0.35rem 0.55rem;
    border: 0;
    border-radius: 0.45rem;
    background: transparent;
    color: var(--navy, #0b3b78);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: rgba(11, 59, 120, 0.08);
    outline: none;
}

/* Business folder rename control */
.business-folder-form {
    display: grid;
    grid-template-columns: minmax(105px, 145px) auto;
    gap: 5px;
    align-items: center;
    margin: 0;
}

.business-folder-form input[type="text"] {
    min-width: 0;
    width: 100%;
    min-height: 34px;
    padding: 5px 7px;
    font-size: .78rem;
}

.business-folder-form button {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .business-list-head,
    .business-row {
        grid-template-columns: minmax(240px, 1.5fr) minmax(180px, .9fr) 72px;
    }

    .business-list-head span:last-child { display: none; }
    .business-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 760px) {
    .business-list-head { display: none; }

    .business-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }

    .business-name-form,
    .business-folder-form {
        grid-template-columns: 1fr auto;
    }

    .business-name-form input,
    .business-folder-form input[type="text"] {
        width: 100%;
    }

    .business-status {
        justify-self: start;
    }

    .business-actions {
        grid-column: auto;
        justify-content: flex-start;
    }
}

/* Employee directory expandable profiles */
.employee-entry {
    display: block;
    border-top: 1px solid var(--border);
    background: var(--white);
}
.employee-entry:first-of-type { border-top: 0; }
.employee-entry > summary {
    list-style: none;
    cursor: pointer;
}
.employee-entry > summary::-webkit-details-marker { display: none; }
.employee-entry > summary::marker { display: none; content: ""; }
.employee-entry[open] > .employee-row { background: #f4f9fd; }
.employee-entry.inactive { border-left: 4px solid #b42318; }
.employee-entry.inactive > .employee-row { background: #fff8f7; }
.employee-inactive-label {
    display: inline-block;
    margin-left: 7px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #fde8e7;
    color: #9f1d16;
    font-size: .65rem;
    font-weight: 850;
    vertical-align: middle;
}
.employee-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border);
    background: #fbfdff;
}
.employee-details > div {
    min-width: 0;
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 8px;
    font-size: .84rem;
}
.employee-details strong { color: var(--navy-dark); }
.employee-details span { overflow-wrap: anywhere; }
.employee-details a { color: var(--navy); font-weight: 700; text-decoration: none; }
.employee-details a:hover { text-decoration: underline; }

@media (max-width: 620px) {
    .employee-details { grid-template-columns: 1fr; }
}

/* Employee directory print controls and address detail */
.directory-print-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}
.employee-address-detail { grid-column: 1 / -1; }

@media (max-width: 720px) {
    .directory-heading { align-items: flex-start; flex-direction: column; }
    .directory-print-actions { justify-content: flex-start; width: 100%; }
}

/* Compact row actions used by Front Office managers. */
.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.actions form,
.sales-delete-form {
    display: block;
    margin: 0;
}
.sales-delete-form button {
    width: auto;
}
