:root {
    --bg: #f2f5f9;
    --panel: #ffffff;
    --ink: #102030;
    --muted: #5a6b7b;
    --line: #d8e0ea;
    --accent: #0f6a57;
    --accent-dark: #0a4f41;
    --nav-bg: #0f2236;
    --nav-bg-2: #16324f;
    --nav-text: #e8f0f8;
    --danger: #b42318;
    --ok: #027a48;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Segoe UI", "Noto Sans", "Noto Sans Georgian", "DejaVu Sans", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at 0 0, #eaf1f9 0%, #f5f8fb 60%, #eef5f2 100%);
    line-height: 1.45;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.mobile-topbar {
    display: none;
}

.mobile-menu {
    display: none;
}

.sidebar {
    width: 272px;
    background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%);
    color: var(--nav-text);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    overflow-wrap: anywhere;
}

.sidebar-user {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 10px;
    display: grid;
    gap: 2px;
}

.sidebar-user strong {
    font-size: 14px;
}

.sidebar-user span {
    font-size: 12px;
    opacity: 0.9;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    overflow-y: auto;
    padding-right: 2px;
}

.sidebar-nav a {
    text-decoration: none;
    color: var(--nav-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9px;
    padding: 8px 10px;
    font-size: 13px;
    word-break: break-word;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 10px;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
}

.lang-switch a {
    color: var(--nav-text);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 2px 7px;
    font-weight: 600;
}

.lang-switch a.active {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.55);
}

.logout-form {
    margin: 0;
}

.logout-btn {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 9px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.content {
    flex: 1;
    margin-left: 272px;
    padding: 18px;
    max-width: calc(100% - 272px);
}

.public-shell {
    min-height: 100vh;
}

.public-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #10263b;
    color: #fff;
}

.public-brand {
    font-weight: 700;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 6px 18px rgba(15, 34, 54, 0.05);
}

.card.narrow {
    max-width: 460px;
    margin: 24px auto;
}

.alert {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.alert-error {
    background: #ffefee;
    border: 1px solid #ffd1cd;
    color: var(--danger);
}

.alert-success {
    background: #ecfdf3;
    border: 1px solid #b8f0cc;
    color: var(--ok);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.form-grid.two-col {
    grid-template-columns: minmax(170px, 240px) minmax(320px, 760px);
    gap: 10px 12px;
    justify-content: start;
    align-items: center;
    max-width: 1040px;
}

.form-grid.two-col .full {
    grid-column: 1 / -1;
}

.compact-form-grid {
    margin-top: 2px;
}

.callcenter-assignment-fields {
    padding: 12px;
    margin: 4px 0;
    border: 1px solid #b7d5ea;
    border-left: 4px solid #2f7da8;
    border-radius: 10px;
    background: #f0f8ff;
    box-shadow: 0 4px 14px rgba(47, 125, 168, 0.08);
}

.callcenter-assignment-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    color: #174462;
}

.callcenter-assignment-heading strong {
    font-size: 14px;
}

.callcenter-assignment-fields select {
    border-color: #9cc3dc;
    background: #ffffff;
}

@media (min-width: 1600px) {
    .content {
        padding: 24px 28px;
    }

    .form-grid.two-col {
        grid-template-columns: minmax(190px, 250px) minmax(360px, 820px);
        max-width: 1120px;
    }
}

@media (max-width: 1280px) and (min-width: 981px) {
    .form-grid.two-col {
        grid-template-columns: minmax(150px, 220px) minmax(260px, 1fr);
        max-width: 940px;
    }
}

label {
    font-size: 13px;
    color: var(--muted);
}

input,
select,
textarea,
button {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 14px;
    font-family: inherit;
}

button {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form input,
.inline-form select,
.inline-form button {
    width: auto;
}

.form-actions {
    margin-top: 8px;
}

.form-actions .secondary-link {
    margin-left: 8px;
}

.lookup-rule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.lookup-rule-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
    color: var(--ink);
}

.lookup-rule-option input {
    width: auto;
    flex: 0 0 auto;
}

.lookup-rule-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}


.form-actions-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.form-actions-row button {
    width: auto;
    min-width: 140px;
}

.form-actions-row .secondary-link {
    margin-left: 0;
    min-width: 120px;
    text-align: center;
    padding: 9px 12px;
    background: #ffffff;
    border-color: #cfd8e3;
}

.form-actions-row .secondary-link:hover {
    background: #edf3fa;
    border-color: #c0cedd;
}

.customer-select-card {
    border-color: #c9d9ec;
    background: linear-gradient(180deg, #fcfdff 0%, #f5f9ff 100%);
}

.customer-select-card h2 {
    margin-top: 0;
    margin-bottom: 8px;
}

.customer-selected-summary {
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 600;
    color: #1f3650;
}

.customer-required-note {
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 600;
    color: #8a3c12;
}

.customer-switch-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.customer-switch-actions .customer-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    text-align: center;
    border-width: 1px;
    box-shadow: 0 1px 0 rgba(16, 32, 48, 0.04);
    transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

.customer-switch-actions .customer-switch-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 34, 54, 0.12);
}

.customer-switch-actions .customer-switch-search {
    background: #f4f8ff;
    border-color: #b9cae2;
    color: #1c3657;
}

.customer-switch-actions .customer-switch-create {
    background: #eefaf4;
    border-color: #b8ddc8;
    color: #184f35;
}

.customer-switch-actions .customer-switch-edit {
    background: #fff7ec;
    border-color: #e8ceb0;
    color: #6c3f16;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.custom-file-input {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.file-input-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.file-input-btn {
    width: auto;
    min-width: 140px;
    text-align: center;
    cursor: pointer;
}

.file-input-name {
    font-size: 13px;
    color: var(--muted);
    word-break: break-word;
}

.reports-filter-actions {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.reports-filter-actions button,
.reports-filter-actions .secondary-link {
    width: auto;
    min-width: 190px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    text-align: center;
}

.reports-filter-actions .reports-secondary-btn {
    background: #ffffff;
    border-color: #c7d4e2;
    color: #1d3954;
}

.reports-filter-actions .reports-secondary-btn:hover {
    background: #edf3fa;
    border-color: #b7c9dc;
    color: #17344f;
}

.reports-stat-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 168px;
}

.reports-code {
    margin: 0;
    color: #5a6e82;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.reports-card-btn {
    margin-top: auto;
    width: auto;
    min-width: 140px;
    text-align: center;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
}

.stat-card h2 {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

.stat-card p {
    margin: 8px 0 0;
    font-size: 24px;
    font-weight: 700;
    color: #0c4c7d;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border: 1px solid var(--line);
    padding: 8px;
    text-align: left;
    vertical-align: top;
    font-size: 13px;
    overflow-wrap: anywhere;
}

th {
    background: #f3f7fc;
    color: #22384d;
}

.work-age-row.work-age-level-1 td {
    background: #fffdf7;
}

.work-age-row.work-age-level-2 td {
    background: #fff3d8;
}

.work-age-row.work-age-level-3 td {
    background: #ffe1df;
}

.work-age-row.work-age-level-4 td {
    background: #ffc9c4;
}

.work-age-row-completed td {
    background: #f3fbf7;
}

.work-cancel-form {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 220px;
}

.work-cancel-form select {
    min-width: 148px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 12px;
}

.work-cancel-btn {
    padding: 6px 10px;
    border-color: rgba(180, 35, 24, 0.28);
    background: #fff3f1;
    color: var(--danger);
    font-size: 12px;
    white-space: nowrap;
}

.work-cancel-btn:hover {
    background: #ffe4e0;
}

.work-age-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(180, 35, 24, 0.18);
    background: rgba(255, 255, 255, 0.68);
    color: #7a271a;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.work-referral-card {
    border-color: #bfd7ee;
    background: #f8fbff;
}

.work-referral-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 10px;
}

.work-referral-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 10px;
}

.work-referral-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.work-referral-item strong {
    display: inline-block;
    font-size: 14px;
}

.work-referral-item .work-age-badge {
    display: inline-flex;
    margin-top: 6px;
    margin-left: 0;
}

.muted-note {
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
}

.audit-json {
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
    max-width: 360px;
    max-height: 180px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.audit-pager {
    margin-top: 12px;
    justify-content: space-between;
}

.pager-link,
.secondary-link {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #f3f7fc;
    color: #1f3650;
    text-decoration: none;
    font-weight: 600;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.role-item {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    background: #f9fbff;
}

.role-item input,
.flag-item input {
    width: auto;
}

.flag-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 980px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .mobile-topbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%);
        color: var(--nav-text);
        border-bottom: 1px solid rgba(255, 255, 255, 0.18);
        position: sticky;
        top: 0;
        z-index: 20;
    }

    .mobile-topbar-left {
        min-width: 0;
    }

    .mobile-brand {
        font-size: 14px;
        font-weight: 700;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .mobile-user-mini {
        font-size: 12px;
        opacity: 0.9;
        margin-top: 2px;
    }

    .mobile-menu {
        display: block;
        position: relative;
    }

    .mobile-menu > summary {
        list-style: none;
        cursor: pointer;
        border: 1px solid rgba(255, 255, 255, 0.45);
        border-radius: 8px;
        width: 42px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .mobile-menu > summary::-webkit-details-marker {
        display: none;
    }

    .hamburger-icon {
        width: 18px;
        display: inline-flex;
        flex-direction: column;
        gap: 4px;
    }

    .hamburger-icon span {
        display: block;
        width: 100%;
        height: 2px;
        border-radius: 2px;
        background: #fff;
    }

    .mobile-menu-panel {
        position: absolute;
        right: 0;
        margin-top: 8px;
        width: min(340px, calc(100vw - 24px));
        max-height: calc(100vh - 90px);
        overflow-y: auto;
        background: #0f2236;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 12px;
        padding: 10px;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
    }

    .mobile-user-card {
        display: grid;
        gap: 2px;
        padding: 8px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 10px;
        color: #fff;
        margin-bottom: 10px;
    }

    .mobile-user-card strong {
        font-size: 13px;
    }

    .mobile-user-card span {
        font-size: 12px;
        opacity: 0.9;
    }

    .mobile-nav {
        display: grid;
        gap: 7px;
    }

    .mobile-nav a {
        text-decoration: none;
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.25);
        border-radius: 8px;
        padding: 8px 10px;
        font-size: 13px;
    }

    .mobile-nav a.active {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.45);
    }

    .mobile-lang-switch {
        margin-top: 10px;
        display: flex;
        gap: 7px;
        align-items: center;
        flex-wrap: wrap;
        color: #fff;
        font-size: 12px;
    }

    .mobile-lang-switch a {
        color: #fff;
        text-decoration: none;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        padding: 2px 8px;
        font-weight: 600;
    }

    .mobile-lang-switch a.active {
        background: rgba(255, 255, 255, 0.24);
        border-color: rgba(255, 255, 255, 0.52);
    }

    .mobile-logout-form {
        margin-top: 10px;
    }

    .content {
        margin-left: 0;
        max-width: 100%;
        padding: 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .reports-filter-actions {
        justify-content: stretch;
    }

    .reports-filter-actions button,
    .reports-filter-actions .secondary-link,
    .reports-card-btn {
        width: 100%;
        min-width: 0;
    }

    .role-grid {
        grid-template-columns: 1fr;
    }


    .form-actions-row {
        justify-content: stretch;
    }

    .form-actions-row button,
    .form-actions-row .secondary-link {
        width: 100%;
        min-width: 0;
    }

    .customer-switch-actions {
        grid-template-columns: 1fr;
    }

    .customer-switch-actions .customer-switch-btn {
        width: 100%;
    }
}

@media (max-width: 880px) {
    .form-grid.two-col {
        grid-template-columns: 1fr;
    }
}

.work-indicator {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.work-indicator.compact {
    margin-top: 4px;
}

.work-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.work-pill strong {
    min-width: 18px;
    text-align: center;
    border-radius: 999px;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.26);
    font-size: 11px;
}

.work-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0f2236;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 12px;
    padding: 10px;
    max-width: min(92vw, 420px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.work-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.work-toast .secondary-link {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.24);
    color: #fff;
    padding: 6px 10px;
    white-space: nowrap;
}

.work-notifier-data {
    display: none;
}

@media (max-width: 980px) {
    .work-toast {
        right: 12px;
        left: 12px;
        bottom: 12px;
        max-width: none;
    }

    .work-indicator.compact .work-pill {
        font-size: 10px;
        padding: 2px 7px;
    }
}

.table-action-btn {
    width: auto;
    min-width: 0;
}

.customer-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 25, 40, 0.55);
    padding: 14px;
}

.customer-picker-modal.is-open {
    display: flex;
}

.customer-picker-dialog {
    width: min(1180px, 100%);
    height: min(88vh, 860px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
    display: grid;
    grid-template-rows: auto 1fr;
}

.customer-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: #f6f9fd;
}

.customer-picker-close {
    width: auto;
    min-width: 96px;
}

.customer-picker-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 980px) {
    .customer-picker-dialog {
        width: 100%;
        height: min(92vh, 920px);
    }
}
.picker-shell {
    min-height: 100vh;
    padding: 10px;
    background: #eef3f9;
}

.picker-content {
    max-width: 1200px;
    margin: 0 auto;
}

.picker-shell .card {
    margin-bottom: 12px;
}
/* Picker window layout and button refinements for customer search/create/edit */
.customer-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.customer-form-actions button,
.customer-form-actions .secondary-link {
    width: auto;
    min-width: 130px;
}

.customer-detail-actions {
    justify-content: flex-end;
}
.customer-delete-form {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed #d7e2ef;
    display: flex;
    justify-content: flex-end;
}

.customer-delete-btn {
    width: auto;
    min-width: 130px;
    background: #fff3f2;
    border-color: #efb8b3;
    color: #8b1a12;
    font-weight: 700;
}

.customer-delete-btn:hover {
    background: #ffe8e6;
    border-color: #e49790;
    color: #74130e;
}

.customers-duplicate-card {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid #ead4ac;
    border-radius: 10px;
    background: #fff9ef;
}

.customers-duplicate-card h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.customers-duplicate-actions {
    margin-top: 10px;
}

.customers-duplicate-actions .inline-form {
    gap: 10px;
}

.customers-duplicate-actions button {
    width: auto;
    min-width: 170px;
}
.customer-row-actions {
    display: inline-flex;
    align-items: stretch;
    gap: 6px;
    flex-wrap: wrap;
}

.customer-row-actions .secondary-link,
.customer-row-actions .table-action-btn {
    margin: 0;
    width: auto;
    min-width: 0;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid #c9d8e8;
    background: #f7fbff;
    color: #1d3d5a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.customer-row-actions .table-action-btn {
    cursor: pointer;
}

.customer-row-actions .customer-use-btn {
    min-width: 156px;
    max-width: 100%;
    min-height: 36px;
    padding: 7px 12px;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
}

.customer-row-actions .secondary-link:hover,
.customer-row-actions .table-action-btn:hover {
    background: #edf4fc;
    border-color: #b6cbdf;
    color: #17344f;
    transform: translateY(-1px);
}

.picker-shell {
    min-height: 100vh;
    padding: 16px;
    background: linear-gradient(180deg, #edf3fb 0%, #e6eff8 100%);
}

.picker-content {
    max-width: 1200px;
    margin: 0 auto;
}

.picker-shell h1 {
    margin: 0 0 12px;
    font-size: 22px;
    letter-spacing: 0.1px;
}

.picker-shell .card {
    margin-bottom: 14px;
    border-color: #c8d6e7;
    box-shadow: 0 8px 22px rgba(16, 38, 60, 0.08);
}

.picker-shell .form-grid.two-col {
    grid-template-columns: minmax(150px, 220px) minmax(280px, 1fr);
    max-width: none;
}

.picker-shell .form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.picker-shell .form-actions button,
.picker-shell .form-actions .secondary-link {
    width: auto;
    min-width: 128px;
}

.picker-shell .secondary-link,
.picker-shell button.secondary-link {
    background: #f4f8fd;
    border-color: #c4d2e2;
    color: #20374f;
}

.picker-shell .secondary-link:hover,
.picker-shell button.secondary-link:hover {
    background: #e9f1fb;
    border-color: #b5c7dc;
    color: #17304a;
}

.picker-shell .customer-row-actions {
    width: 100%;
}

@media (max-width: 980px) {
    .customer-form-actions button,
    .customer-form-actions .secondary-link,
    .customer-delete-btn,
    .picker-shell .form-actions button,
    .picker-shell .form-actions .secondary-link {
        width: 100%;
        min-width: 0;
    }

    .customer-delete-form {
        justify-content: stretch;
    }

    .picker-shell {
        padding: 10px;
    }

    .picker-shell h1 {
        font-size: 20px;
    }

    .picker-shell .card {
        padding: 12px;
    }

    .picker-shell .form-grid.two-col {
        grid-template-columns: 1fr;
    }
}
.entry-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
    display: contents;
}

.entry-locked .entry-fieldset {
    opacity: 0.72;
}

.customer-required-inline {
    margin: 2px 0 0;
    color: #8a3c12;
    font-size: 13px;
    font-weight: 700;
}

.customer-selected-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 0;
    margin-bottom: 10px;
}

.customer-selected-item {
    margin: 0;
    padding: 8px 10px;
    border: 1px solid #c9d9ec;
    border-radius: 8px;
    background: #ffffff;
    color: #1f3650;
}

.customer-required-banner {
    margin-top: 0;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #f5c2a9;
    background: #fff3eb;
    color: #8a3c12;
    font-weight: 700;
}

@media (max-width: 980px) {
    .customer-selected-grid {
        grid-template-columns: 1fr;
    }
}

.customer-profile-card {
    border: 1px solid #c9d9ec;
    border-radius: 12px;
    background: #ffffff;
    padding: 12px;
    box-shadow: 0 3px 12px rgba(16, 38, 60, 0.06);
    margin-bottom: 10px;
}

.customer-profile-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.customer-profile-identity {
    min-width: 0;
}

.customer-profile-name {
    margin: 0;
    font-size: 17px;
    line-height: 1.2;
    font-weight: 700;
    color: #12314f;
    overflow-wrap: anywhere;
}

.customer-profile-id {
    margin: 4px 0 0;
    color: #55697f;
    font-size: 12px;
    font-weight: 600;
}

.customer-inline-edit-btn {
    min-height: 32px;
    padding: 6px 10px;
    width: auto;
}

.customer-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
}

.customer-profile-item {
    border: 1px solid #d6e1ee;
    border-radius: 9px;
    background: #f9fbfe;
    padding: 8px 9px;
    display: grid;
    gap: 3px;
}

.customer-profile-item span {
    color: #5a6f84;
    font-size: 12px;
}

.customer-profile-item strong,
.customer-profile-item a {
    color: #183955;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.customer-profile-item a:hover {
    text-decoration: underline;
}

.customer-profile-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.customer-inline-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 18px;
}

.customer-inline-edit-modal[hidden] {
    display: none;
}

.customer-inline-edit-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 22, 36, 0.42);
}

.customer-inline-edit-panel {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    border-radius: 10px;
    border: 1px solid #c7d8ea;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(16, 38, 60, 0.22);
    padding: 16px;
}

.customer-inline-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.customer-inline-edit-header h3 {
    margin: 0;
    font-size: 18px;
    color: #12314f;
}

.customer-inline-edit-close {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #c7d8ea;
    background: #f7fafd;
    color: #334b62;
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.customer-inline-edit-close:hover {
    background: #eef5fc;
}

.customer-inline-edit-form {
    margin: 0;
}

.customer-inline-edit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.customer-inline-edit-actions button,
.customer-inline-edit-actions .secondary-link {
    width: auto;
    min-width: 112px;
}

.customer-inline-edit-form .form-error {
    margin: 0;
    color: #9f1d1d;
    font-weight: 700;
}

.users-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.users-toolbar h2 {
    margin: 0 0 4px;
}

.users-toolbar .muted-note {
    margin: 0;
}

.users-create-open {
    min-width: 132px;
    width: auto;
    text-align: center;
}

.users-create-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 18px;
}

.users-create-modal[hidden] {
    display: none;
}

.users-create-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 22, 36, 0.42);
}

.users-create-panel {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    border-radius: 10px;
    border: 1px solid #c7d8ea;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(16, 38, 60, 0.22);
    padding: 16px;
}

.users-create-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.users-create-header h2 {
    margin: 0;
    font-size: 18px;
    color: #12314f;
}

.users-create-close {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #c7d8ea;
    background: #f7fafd;
    color: #334b62;
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.users-create-close:hover {
    background: #eef5fc;
}

.users-create-form {
    margin: 0;
}

.users-create-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.users-create-actions button,
.users-create-actions .secondary-link {
    width: auto;
    min-width: 112px;
    flex: 0 0 auto;
    text-align: center;
}

@media (max-width: 980px) {
    .customer-profile-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .customer-profile-grid {
        grid-template-columns: 1fr;
    }

    .customer-profile-footer {
        justify-content: stretch;
    }

    .customer-profile-footer .customer-inline-edit-btn {
        width: 100%;
    }

    .customer-inline-edit-panel {
        padding: 14px;
    }

    .customer-inline-edit-header {
        align-items: center;
        flex-direction: row;
    }

    .customer-inline-edit-actions {
        justify-content: stretch;
        flex-direction: column;
    }

    .customer-inline-edit-actions button,
    .customer-inline-edit-actions .secondary-link {
        width: 100%;
    }

    .users-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .users-create-open {
        width: 100%;
    }

    .users-create-panel {
        padding: 14px;
    }

    .users-create-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .users-create-actions button,
    .users-create-actions .secondary-link {
        width: 100%;
    }
}

.activity-detail-open-btn {
    min-width: 88px;
    width: auto;
}

.activity-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 85;
    display: none;
}

.activity-detail-modal:not([hidden]) {
    display: block;
}

.activity-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 20, 34, 0.58);
}

.activity-detail-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(700px, 100%);
    background: #ffffff;
    border-left: 1px solid #d7e1ec;
    box-shadow: -10px 0 28px rgba(0, 0, 0, 0.22);
    display: grid;
    grid-template-rows: auto 1fr;
}

.activity-detail-header {
    padding: 12px 14px;
    border-bottom: 1px solid #d7e1ec;
    background: #f4f8fd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.activity-detail-header h3 {
    margin: 0;
    color: #16344f;
    font-size: 16px;
}

.activity-detail-header .secondary-link {
    width: auto;
    min-width: 96px;
    text-align: center;
}

.activity-detail-content {
    overflow-y: auto;
    padding: 14px;
    display: grid;
    gap: 14px;
}

.activity-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.activity-detail-item {
    border: 1px solid #d7e2ee;
    border-radius: 9px;
    padding: 8px 9px;
    background: #f8fbff;
    display: grid;
    gap: 3px;
}

.activity-detail-item span {
    color: #5a6f84;
    font-size: 12px;
}

.activity-detail-item strong {
    color: #1c3c59;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.activity-detail-notes {
    display: grid;
    gap: 8px;
}

.activity-detail-note-item {
    border: 1px solid #d7e2ee;
    border-radius: 9px;
    padding: 9px;
    background: #ffffff;
}

.activity-detail-note-item span {
    color: #5a6f84;
    font-size: 12px;
    display: block;
    margin-bottom: 4px;
}

.activity-detail-note-item p {
    margin: 0;
    color: #1d3c58;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .activity-detail-panel {
        width: 100%;
        border-left: 0;
    }

    .activity-detail-grid {
        grid-template-columns: 1fr;
    }
}

.customers-search-form {
    row-gap: 12px;
}

.customers-search-actions .secondary-link {
    text-align: center;
}

.customers-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.customers-list-header h2 {
    margin: 0;
}

.customers-list-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.customers-export-link {
    white-space: nowrap;
}

.customers-list-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #d0dceb;
    background: #f5f9ff;
    color: #1f3f5d;
    font-size: 12px;
    font-weight: 700;
}

.customers-list-chip--focus {
    border-color: #c9e4d1;
    background: #edf9f1;
    color: #1f5a2f;
}

.customers-empty {
    border: 1px dashed #c6d6e8;
    border-radius: 10px;
    padding: 14px;
    background: #f8fbff;
    color: #35506d;
    font-weight: 600;
}

.customers-empty--hint {
    border-color: #b7cee6;
    background: linear-gradient(180deg, #f4f9ff 0%, #eef5ff 100%);
}

.customers-table-wrap {
    border: 1px solid #d8e3ef;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #fff;
}

.customers-list-table {
    table-layout: fixed;
    min-width: 980px;
}

.customers-list-table th,
.customers-list-table td {
    vertical-align: middle;
}

.customers-list-table th:nth-child(1),
.customers-list-table td:nth-child(1) {
    width: 64px;
}

.customers-list-table th:nth-child(2),
.customers-list-table td:nth-child(2) {
    width: 26%;
}

.customers-list-table th:nth-child(3),
.customers-list-table td:nth-child(3) {
    width: 18%;
}

.customers-list-table th:nth-child(4),
.customers-list-table td:nth-child(4) {
    width: 26%;
}

.customers-list-table th:nth-child(5),
.customers-list-table td:nth-child(5) {
    width: 14%;
}

.customers-list-table .customer-clip-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customers-list-table .customer-name-cell {
    font-weight: 700;
    color: #17324c;
}

.customers-list-table .customer-actions-cell {
    width: 190px;
    min-width: 190px;
}

.customer-main-row td {
    border-bottom-color: #eef3f8;
}

.customer-assignment-row td {
    padding: 8px 12px 12px;
    background: #f8fbff;
    border-top: none;
    border-bottom: 1px solid #d8e3ef;
}

.customer-assignment-form {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(260px, 1fr) auto;
    gap: 8px;
    align-items: center;
    max-width: 760px;
    margin-left: auto;
}

.customer-assignment-form select {
    width: 100%;
    min-width: 0;
}

.customer-assignment-form .table-action-btn {
    min-width: 130px;
    text-align: center;
}

.customers-mobile-list {
    display: none;
}

.customer-row-highlight td {
    background: #f0f7ff;
}

.customer-row-highlight td:first-child {
    box-shadow: inset 3px 0 0 #2d6aa6;
}

@media (max-width: 980px) {
    .customers-list-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .customers-list-meta {
        width: 100%;
    }

    .customers-search-actions .secondary-link {
        width: 100%;
    }

    .customers-table-wrap {
        display: none;
    }

    .customers-mobile-list {
        display: grid;
        gap: 12px;
    }

    .customer-mobile-card {
        border: 1px solid #d8e3ef;
        border-radius: 12px;
        background: #ffffff;
        overflow: hidden;
        box-shadow: 0 6px 18px rgba(15, 34, 54, 0.05);
    }

    .customer-mobile-card--selected {
        border-color: #94bae0;
        box-shadow: 0 0 0 2px rgba(45, 106, 166, 0.12), 0 6px 18px rgba(15, 34, 54, 0.05);
    }

    .customer-mobile-card-header {
        display: grid;
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        padding: 12px;
        background: #f8fbff;
        border-bottom: 1px solid #eef3f8;
    }

    .customer-mobile-id {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 42px;
        border-radius: 10px;
        background: #eaf3fc;
        color: #244761;
        font-weight: 800;
        font-size: 13px;
    }

    .customer-mobile-identity {
        min-width: 0;
        display: grid;
        gap: 3px;
    }

    .customer-mobile-identity strong {
        color: #17324c;
        font-size: 16px;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .customer-mobile-identity span {
        color: #526a82;
        font-size: 13px;
        font-weight: 700;
    }

    .customer-mobile-fields {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }

    .customer-mobile-fields div {
        display: grid;
        gap: 3px;
        min-width: 0;
    }

    .customer-mobile-fields span {
        color: #5e748b;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }

    .customer-mobile-fields strong {
        color: #203f5c;
        font-size: 13px;
        overflow-wrap: anywhere;
    }

    .customer-mobile-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 0 12px 12px;
    }

    .customer-mobile-actions .secondary-link,
    .customer-mobile-actions .table-action-btn {
        flex: 1 1 130px;
        min-width: 0;
        text-align: center;
    }

    .customer-mobile-actions .customer-use-btn {
        flex-basis: 100%;
    }

    .customer-mobile-assignment-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
        background: #f8fbff;
        border-top: 1px solid #eef3f8;
    }

    .customer-mobile-assignment-form select,
    .customer-mobile-assignment-form button {
        width: 100%;
        min-width: 0;
    }

    .customers-list-table,
    .customers-list-table tbody,
    .customers-list-table td {
        display: block;
        width: 100%;
    }

    .customers-list-table .customer-main-row {
        display: grid;
        grid-template-columns: 72px minmax(0, 1fr);
        border: 1px solid #d8e3ef;
        border-radius: 12px 12px 0 0;
        background: #fff;
        overflow: hidden;
        box-shadow: 0 6px 18px rgba(15, 34, 54, 0.05);
    }

    .customers-list-table .customer-assignment-row {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #d8e3ef;
        border-top: none;
        border-radius: 0 0 12px 12px;
        background: #f8fbff;
        overflow: hidden;
        box-shadow: 0 6px 18px rgba(15, 34, 54, 0.05);
    }

    .customers-list-table {
        min-width: 0;
        border-collapse: separate;
        table-layout: auto;
    }

    .customers-list-table thead {
        display: none;
    }

    .customers-list-table td {
        border: none;
        border-bottom: 1px solid #eef3f8;
        padding: 10px 12px;
        width: 100%;
    }

    .customers-list-table .customer-clip-cell {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .customers-list-table td:last-child {
        border-bottom: none;
    }

    .customers-list-table .customer-main-row td:first-child {
        grid-row: 1 / span 5;
        display: flex;
        align-items: center;
        justify-content: center;
        border-right: 1px solid #eef3f8;
        border-bottom: none;
        background: #f8fbff;
        font-weight: 800;
        color: #244761;
    }

    .customers-list-table .customer-main-row td:first-child::before {
        content: none;
    }

    .customers-list-table .customer-main-row td:not(:first-child) {
        grid-column: 2;
    }

    .customers-list-table .customer-assignment-row td {
        padding: 10px 12px 12px;
        background: #f8fbff;
        border-bottom: none;
    }

    .customers-list-table .customer-assignment-row td::before {
        content: none;
    }

    .customers-list-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        color: #5e748b;
    }

    .customers-list-table .customer-name-cell {
        font-size: 16px;
    }

    .customers-list-table .customer-actions-cell {
        min-width: 0;
    }

    .customers-list-table .customer-actions-cell::before {
        margin-bottom: 8px;
    }

    .customers-list-table .customer-row-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .customers-list-table .customer-row-actions .secondary-link,
    .customers-list-table .customer-row-actions .table-action-btn {
        width: auto;
        min-width: 120px;
        flex: 1 1 140px;
    }

    .customers-list-table .customer-row-actions .customer-use-btn {
        flex-basis: 100%;
        min-width: 0;
    }

    .customers-list-table .customer-row-actions .inline-form,
    .customers-list-table .customer-row-actions .inline-form select,
    .customers-list-table .customer-row-actions .inline-form button {
        width: 100%;
    }

    .customers-list-table .customer-assignment-form {
        max-width: none;
        margin-left: 0;
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.customers-mode-card {
    padding: 12px 14px;
    border: 1px solid #d8e3ef;
    background: #f8fbff;
}

.customers-mode-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.customers-mode-actions .secondary-link {
    width: auto;
    min-width: 170px;
    text-align: center;
}

@media (max-width: 980px) {
    .customers-mode-actions {
        justify-content: stretch;
    }

    .customers-mode-actions .secondary-link {
        width: 100%;
        min-width: 0;
    }
}

.customers-selected-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.customers-selected-summary-text {
    display: grid;
    gap: 4px;
}

.customers-selected-summary-text strong {
    color: #173a59;
}

.customers-selected-summary-text span {
    color: #556f87;
    font-size: 13px;
}

.customers-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.customers-detail-header h2 {
    margin: 0;
}

.customers-detail-header .secondary-link,
.customers-selected-summary .secondary-link {
    width: auto;
    min-width: 140px;
    text-align: center;
}

@media (max-width: 980px) {
    .customers-selected-summary,
    .customers-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .customers-detail-header .secondary-link,
    .customers-selected-summary .secondary-link {
        width: 100%;
        min-width: 0;
    }
}

.dashboard-action-col,
.dashboard-action-cell {
    width: 148px;
    min-width: 148px;
    text-align: center;
    vertical-align: middle;
}

.dashboard-work-action-form {
    margin: 0;
    display: flex;
    justify-content: center;
}

.dashboard-work-action-btn {
    min-width: 116px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 820px) {
    .dashboard-action-col,
    .dashboard-action-cell {
        width: 132px;
        min-width: 132px;
    }

    .dashboard-work-action-btn {
        min-width: 102px;
    }
}


.record-manage-action-col,
.record-manage-action-cell {
    width: 190px;
    min-width: 190px;
    text-align: center;
    vertical-align: middle;
}

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

.record-manage-action-btn {
    min-width: 84px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

.record-manage-delete-form {
    margin: 0;
    display: inline-flex;
}

.record-manage-delete-btn {
    background: #fff3f2;
    border-color: #efb8b3;
    color: #8b1a12;
}

.record-manage-delete-btn:hover {
    background: #ffe8e6;
    border-color: #e49790;
    color: #74130e;
}

@media (max-width: 980px) {
    .record-manage-action-col,
    .record-manage-action-cell {
        width: 160px;
        min-width: 160px;
    }

    .record-manage-action-btn {
        min-width: 76px;
        height: 30px;
    }
}
.my-records-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.my-records-toolbar-left,
.my-records-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.my-records-scope-note {
    margin: 0;
}

.my-records-toolbar-right .secondary-link.is-active {
    background: #dceafe;
    border-color: #aac2df;
    color: #143553;
}

.my-records-search-grid {
    row-gap: 10px;
}

.my-records-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.my-records-actions button,
.my-records-actions .secondary-link {
    width: auto;
    min-width: 140px;
}

.my-records-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.my-records-result-header h2 {
    margin: 0;
}

.my-records-result-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 980px) {
    .my-records-toolbar,
    .my-records-result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .my-records-actions {
        justify-content: stretch;
    }

    .my-records-actions button,
    .my-records-actions .secondary-link {
        width: 100%;
        min-width: 0;
    }
}

/* Meta import duplicate review */
.meta-row-action-col,
.meta-row-action-cell {
    width: 220px;
    min-width: 220px;
}

.meta-row-action-cell {
    text-align: center;
    vertical-align: top;
}

.meta-row-action-cell .inline-form {
    justify-content: center;
}

.meta-row-action-cell .dashboard-work-action-btn,
.meta-row-action-cell .small-btn {
    min-width: 160px;
}

.meta-review-top-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.meta-compare-cell {
    display: grid;
    gap: 2px;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid var(--line);
}

.meta-compare-cell small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
}

.meta-compare-cell strong {
    font-size: 13px;
    line-height: 1.3;
    color: var(--text);
    word-break: break-word;
}

.meta-compare-match {
    border-color: #b8dfc7;
    background: #f3fbf6;
}

.meta-compare-diff {
    border-color: #efc0ba;
    background: #fff5f3;
}

@media (max-width: 980px) {
    .meta-row-action-col,
    .meta-row-action-cell {
        width: 170px;
        min-width: 170px;
    }

    .meta-row-action-cell .dashboard-work-action-btn,
    .meta-row-action-cell .small-btn {
        min-width: 130px;
    }
}

.meta-dup-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 23, 42, 0.52);
    padding: 22px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
}

.meta-dup-modal[hidden] {
    display: none;
}

.meta-dup-modal-dialog {
    width: min(1080px, 100%);
    margin-top: 12px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--line);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.26);
    padding: 16px;
}

.meta-dup-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.meta-dup-modal-header h3 {
    margin: 0;
}

.meta-dup-modal-close {
    white-space: nowrap;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 980px) {
    .meta-dup-modal {
        padding: 12px;
    }

    .meta-dup-modal-dialog {
        margin-top: 0;
        border-radius: 12px;
        padding: 12px;
    }
}


.meta-dup-modal-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
}

.meta-dup-modal-cancel {
    min-width: 180px;
    font-weight: 600;
}

@media (max-width: 980px) {
    .meta-dup-modal-footer {
        justify-content: stretch;
    }

    .meta-dup-modal-cancel {
        width: 100%;
        min-width: 0;
    }
}

@media screen and (max-width: 980px) {
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap table:not(.customers-list-table),
    .card table:not(.customers-list-table) {
        min-width: 760px;
        width: max-content;
    }

    .table-wrap table:not(.customers-list-table) th,
    .card table:not(.customers-list-table) th {
        white-space: nowrap;
    }
}

.lookup-admin-shell {
    display: grid;
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.lookup-admin-sidebar,
.lookup-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.lookup-admin-sidebar {
    position: sticky;
    top: 12px;
    padding: 12px;
}

.lookup-admin-sidebar-title {
    color: var(--muted);
    font-size: 13px;
    margin: 2px 0 10px;
}

.lookup-group-nav {
    display: grid;
    gap: 6px;
}

.lookup-group-section {
    margin: 10px 4px 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.lookup-group-nav a {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 7px 9px 7px 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
}

.lookup-group-nav a:hover,
.lookup-group-nav a.is-active {
    background: #f1f7fb;
    border-color: #d7e5ee;
}

.lookup-group-nav a.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: #0f766e;
}

.lookup-group-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #e8f3f2;
    color: #0f766e;
    font-size: 11px;
    font-weight: 800;
}

.lookup-group-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.lookup-group-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 650;
}

.lookup-group-nav code {
    color: var(--muted);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lookup-group-count {
    min-width: 24px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #eef2f7;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    overflow-wrap: anywhere;
}

.lookup-admin-main {
    min-width: 0;
}

.lookup-admin-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.lookup-admin-header h2,
.lookup-panel h3 {
    margin: 0;
}

.lookup-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.lookup-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
}

.lookup-tabs a.is-active,
.lookup-tabs a:hover {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

.lookup-panel {
    padding: 16px;
    margin-bottom: 14px;
}

.lookup-panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.lookup-add-inline-btn {
    width: auto;
    min-width: 0;
    padding: 8px 12px;
    white-space: nowrap;
}

.lookup-values-table-wrap {
    max-height: 68vh;
    overflow: auto;
}

.lookup-values-table {
    min-width: 920px;
}

.lookup-values-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fbfd;
}

.lookup-values-table td {
    vertical-align: middle;
}

.lookup-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.lookup-status-pill.is-active {
    background: #e7f7ef;
    color: #12633d;
}

.lookup-status-pill.is-inactive {
    background: #f3f4f6;
    color: #64748b;
}

.lookup-maintenance-panel {
    border-color: #f0d3b1;
    background: #fffaf3;
}

.lookup-modal[hidden] {
    display: none;
}

.lookup-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 18px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
}

.lookup-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
}

.lookup-modal-panel {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    margin-top: 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.26);
    padding: 16px;
}

.lookup-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.lookup-modal-header h2 {
    margin: 0;
}

.lookup-modal-close {
    width: 42px;
    min-width: 42px;
    padding: 9px 0;
    background: #fff;
    border-color: #cfd8e3;
    color: var(--ink);
}

.lookup-modal-close:hover {
    background: #edf3fa;
    border-color: #cfd8e3;
    color: var(--ink);
}

@media (max-width: 980px) {
    .lookup-admin-shell {
        grid-template-columns: 1fr;
    }

    .lookup-admin-sidebar {
        position: static;
    }

    .lookup-group-nav {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .lookup-admin-header {
        align-items: stretch;
        flex-direction: column;
    }

    .lookup-admin-header button {
        width: 100%;
    }

    .lookup-panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .lookup-add-inline-btn {
        width: 100%;
    }

    .lookup-modal {
        padding: 12px;
    }

    .lookup-modal-panel {
        margin-top: 0;
    }
}
