:root {
    --navy: #071a33;
    --navy-soft: #0d2c52;
    --gold: #c99b2e;
    --gold-soft: #f3d98b;
    --text: #172033;
    --muted: #687386;
    --line: #e5e9f0;
    --bg: #f5f7fb;
    --white: #ffffff;
    --danger: #b42318;
    --danger-bg: #fff1f0;
    --shadow: 0 24px 70px rgba(7, 26, 51, 0.14);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--navy-soft);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-panel {
    width: min(100%, 720px);
    display: grid;
    gap: clamp(18px, 3vh, 28px);
    align-content: center;
    min-height: 0;
    padding: clamp(18px, 3vh, 28px);
}

.system-title {
    text-align: center;
}

.system-title h1 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(26px, 3.4vw, 40px);
    line-height: 1.1;
    letter-spacing: 0;
}

.login-card {
    width: min(100%, 430px);
    justify-self: center;
    padding: clamp(24px, 3.2vh, 34px);
    border: 1px solid rgba(229, 233, 240, 0.9);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    margin: 0 auto clamp(16px, 2.6vh, 24px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.logo-wrap img {
    display: block;
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
}

.login-heading {
    margin-bottom: clamp(18px, 3vh, 26px);
    text-align: center;
}

.login-heading h2 {
    margin: 0;
    color: var(--navy);
    font-size: 28px;
    line-height: 1.2;
}

.alert {
    margin-bottom: 18px;
    padding: 13px 14px;
    border: 1px solid rgba(180, 35, 24, 0.22);
    border-radius: 8px;
    color: var(--danger);
    background: var(--danger-bg);
    font-size: 14px;
    line-height: 1.45;
}

.notice {
    margin-bottom: 18px;
    padding: 13px 14px;
    border: 1px solid rgba(13, 44, 82, 0.16);
    border-radius: 8px;
    color: var(--navy-soft);
    background: #eef5ff;
    font-size: 14px;
    line-height: 1.45;
}

.login-form {
    display: grid;
    gap: clamp(14px, 2.2vh, 18px);
}

.field-group {
    display: grid;
    gap: 8px;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 52px;
}

.timecare-auth .password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    transform: translateY(-50%);
}

.timecare-auth .password-toggle:hover {
    color: var(--navy-soft);
    background: rgba(13, 44, 82, 0.07);
}

.timecare-auth .password-toggle:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}

.password-icon {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-icon-hide {
    display: none;
}

.password-toggle[aria-pressed="true"] .password-icon-show {
    display: none;
}

.password-toggle[aria-pressed="true"] .password-icon-hide {
    display: block;
}

.field-group label,
.label-row label {
    color: #2b3445;
    font-size: 14px;
    font-weight: 700;
}

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

.label-row a {
    font-size: 13px;
    font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
    width: 100%;
    height: 48px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    padding: 0 15px;
    color: var(--text);
    background: #fbfcff;
    font-size: 15px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(201, 155, 46, 0.16);
}

textarea {
    min-height: 110px;
    height: auto;
    padding-top: 12px;
    resize: vertical;
}

input[readonly] {
    color: var(--muted);
    background: #f1f4f8;
}

.generated-field input {
    font-weight: 800;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: var(--muted);
    font-size: 13px;
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.check-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--navy-soft);
}

button[type="submit"] {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 8px;
    color: var(--white);
    background: linear-gradient(135deg, var(--navy), var(--navy-soft));
    box-shadow: 0 14px 26px rgba(7, 26, 51, 0.22);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px rgba(7, 26, 51, 0.27);
}

button[type="submit"]:active {
    transform: translateY(0);
}

button[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary-form {
    margin-top: 16px;
    text-align: center;
}

.link-button {
    border: 0;
    color: var(--navy-soft);
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.link-button:hover {
    text-decoration: underline;
}

.dashboard-card {
    text-align: center;
}

.dashboard-text {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
}

.dashboard-link {
    margin-bottom: 12px;
}

.dashboard-shell {
    width: min(1180px, calc(100% - 32px));
}

.dashboard-layout {
    width: min(1380px, calc(100% - 32px));
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 22px;
    padding: 24px 0;
}

.workspace-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 22px;
    width: min(1380px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0;
}

.workspace-page .app-shell {
    width: 100%;
    min-width: 0;
    padding: 0;
}

.workspace-page .narrow-shell {
    max-width: none;
}

.workspace-page.create-user-page .app-shell,
.workspace-page.create-lead-page .app-shell {
    width: 100%;
    min-height: 0;
    display: block;
    padding: 0;
}

.workspace-page.create-user-page,
.workspace-page.create-lead-page {
    overflow: auto;
}

.workspace-page.create-user-page .admin-form,
.workspace-page.create-lead-page .admin-form {
    height: auto;
}

.workspace-sidebar {
    align-self: start;
}

.dashboard-sidebar {
    position: sticky;
    top: 24px;
    height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(229, 233, 240, 0.9);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.sidebar-brand h1 {
    margin: 0;
    color: var(--navy);
    font-size: 30px;
    letter-spacing: 0;
}

.sidebar-user-type {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    overflow-y: auto;
    align-content: start;
}

.sidebar-section-label {
    margin-top: 6px;
    padding: 2px 2px 0;
    color: #6a7790;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-nav a {
    display: grid;
    gap: 4px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: #f8fafd;
    text-decoration: none;
}

.sidebar-nav a:hover {
    border-color: rgba(19, 75, 138, 0.28);
    text-decoration: none;
}

.sidebar-nav a.active {
    border-color: rgba(201, 155, 46, 0.5);
    background: #fff9e8;
    box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-nav strong {
    color: var(--navy);
    font-size: 13px;
    line-height: 1.15;
}

.sidebar-nav span {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
}

.sidebar-logout {
    margin-top: auto;
    color: var(--danger);
    font-size: 13px;
    font-weight: 800;
}

.dashboard-content {
    min-width: 0;
}

.dashboard-header {
    margin-bottom: 18px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(290px, 0.45fr) minmax(0, 1.55fr);
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px 10px;
    border: 1px solid rgba(229, 233, 240, 0.9);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.dashboard-hero h2 {
    margin: 0 0 3px;
    color: var(--navy);
    font-size: clamp(18px, 1.5vw, 22px);
    line-height: 1.05;
    white-space: nowrap;
}

.dashboard-hero p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

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

.profile-grid div {
    min-height: 38px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafd;
}

.profile-grid span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.profile-grid strong {
    color: var(--navy);
    font-size: 11px;
    line-height: 1.2;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.module-card {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid rgba(229, 233, 240, 0.9);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 14px 34px rgba(7, 26, 51, 0.08);
}

.module-card h3 {
    margin: 0 0 10px;
    color: var(--navy);
    font-size: 18px;
}

.module-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.module-card a,
.module-card span {
    color: var(--navy-soft);
    font-size: 13px;
    font-weight: 800;
}

.module-disabled {
    opacity: 0.58;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    border-radius: 8px;
    color: var(--white);
    background: linear-gradient(135deg, var(--navy), var(--navy-soft));
    box-shadow: 0 14px 26px rgba(7, 26, 51, 0.22);
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
}

.button-link:hover {
    text-decoration: none;
}

.small-button {
    width: auto;
    min-height: 40px;
    padding: 0 16px;
    box-shadow: none;
}

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

.narrow-shell {
    width: min(900px, calc(100% - 32px));
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.app-kicker {
    margin: 0 0 6px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.app-header h1 {
    margin: 0;
    color: var(--navy);
    font-size: 34px;
    line-height: 1.1;
}

.app-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.data-panel,
.form-panel {
    min-width: 0;
    border: 1px solid rgba(229, 233, 240, 0.9);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.quote-options-panel {
    margin-top: 22px;
}

.broker-workflow-page .app-header {
    margin-bottom: 14px;
}

.broker-workflow-page .broker-client-summary {
    margin-bottom: 12px;
}

.request-details {
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.request-details summary {
    padding: 12px 16px;
    color: var(--navy-soft);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.request-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 0 16px 16px;
}

.request-details-grid p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.workflow-step {
    margin-top: 18px;
    overflow: hidden;
}

.workflow-step-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.workflow-step-heading .app-kicker {
    margin-bottom: 2px;
}

.workflow-step-heading h2 {
    margin: 0;
    color: var(--navy);
    font-size: 21px;
}

.workflow-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--white);
    background: var(--navy-soft);
    font-size: 14px;
    font-weight: 800;
}

.workflow-form {
    gap: 16px;
    padding: 20px;
}

.workflow-form textarea {
    min-height: 72px;
}

.insurer-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.insurer-options small {
    display: block;
    margin-top: 2px;
    color: var(--danger);
    font-size: 11px;
}

.workflow-subsection,
.workflow-history {
    border-top: 1px solid var(--line);
}

.workflow-subsection > h3,
.workflow-history > h3 {
    margin: 0;
    padding: 15px 20px 0;
    color: var(--navy);
    font-size: 16px;
}

.workflow-step-heading + .workflow-subsection {
    border-top: 0;
}

.acceptance-check {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--navy);
    font-size: 14px;
    font-weight: 800;
}

.acceptance-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--navy-soft);
}

.payment-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
}

.payment-summary div {
    display: grid;
    gap: 5px;
    padding: 16px 20px;
    background: var(--white);
}

.payment-summary span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.payment-summary strong {
    color: var(--navy);
    font-size: 16px;
}

.workflow-empty,
.payment-complete {
    margin: 0;
    padding: 18px 20px;
    color: var(--muted);
    font-size: 14px;
}

.payment-complete {
    color: #136c3d;
    font-weight: 800;
}

.installment-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 20px;
    border-top: 1px solid var(--line);
    background: #f8fafd;
    font-size: 13px;
}

.installment-current > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.installment-current span {
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--navy-soft);
    background: var(--white);
    font-weight: 800;
}

.installment-plan > p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 12px;
}

.installment-date-list {
    display: grid;
    gap: 10px;
}

.installment-date-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.installment-add,
.installment-remove {
    width: auto;
    height: 38px;
    border: 1px solid #cbd4e1;
    border-radius: 7px;
    padding: 0 13px;
    color: var(--navy-soft);
    background: var(--white);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.installment-add {
    margin-top: 12px;
}

.installment-remove:disabled {
    opacity: 0.45;
    cursor: default;
}

.account-summary,
.client-profile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.account-summary div,
.client-profile-grid > div {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.account-summary span,
.client-profile-grid span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.account-summary strong,
.client-profile-grid strong {
    color: var(--navy);
    font-size: 19px;
    overflow-wrap: anywhere;
}

.client-profile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.client-profile-grid small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.account-panel {
    margin-top: 18px;
}

.account-work-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.account-inline-form {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 280px);
    align-items: end;
}

.account-manager-page .section-heading {
    padding: 15px 18px;
}

.account-manager-page .section-heading h2 {
    font-size: 20px;
}

.claims-panel,
.claim-step {
    margin-top: 18px;
}

.claim-step {
    overflow: hidden;
}

.claim-upload-form {
    padding-bottom: 18px;
}

.claim-document-list {
    display: grid;
    gap: 1px;
    border-top: 1px solid var(--line);
    background: var(--line);
}

.claim-document-item {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: var(--white);
}

.claim-document-item > div {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.claim-document-item span {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.claim-document-item a {
    width: fit-content;
    font-size: 12px;
    font-weight: 800;
}

.document-assessment-form {
    display: grid;
    grid-template-columns: minmax(110px, 0.35fr) minmax(160px, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.document-assessment-form select,
.document-assessment-form input {
    height: 40px;
    font-size: 13px;
}

.document-assessment-form button[type="submit"] {
    width: auto;
    height: 40px;
    padding: 0 14px;
    font-size: 12px;
}

.finance-summary {
    margin-bottom: 16px;
}

.finance-filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.finance-filter-form .field-group {
    gap: 5px;
}

.finance-filter-form label {
    font-size: 11px;
}

.finance-filter-form input,
.finance-filter-form select {
    height: 38px;
    padding: 0 10px;
    font-size: 12px;
}

.finance-filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    grid-column: 1 / -1;
}

.finance-filter-actions button[type="submit"],
.finance-group-form button[type="submit"],
.finance-rate-form button[type="submit"] {
    width: auto;
    height: 36px;
    padding: 0 15px;
    font-size: 12px;
}

.finance-filter-actions a {
    font-size: 12px;
    font-weight: 800;
}

.finance-panel {
    margin-bottom: 18px;
}

.finance-table th,
.finance-table td {
    padding: 11px 10px;
    font-size: 12px;
}

.finance-pending {
    display: inline-flex;
    width: fit-content;
    margin: 0;
    padding: 5px 8px;
    border-radius: 6px;
    color: #6b4a00;
    background: #fff7db;
    font-weight: 800;
}

.finance-rate-form {
    display: grid;
    grid-template-columns: minmax(70px, 1fr) auto;
    gap: 6px;
    min-width: 0;
}

.finance-rate-form input {
    min-width: 0;
    height: 36px;
    padding: 0 8px;
    font-size: 12px;
}

.finance-allocation-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--line);
}

.finance-allocation-grid > div {
    display: grid;
    gap: 6px;
    padding: 16px;
    background: var(--white);
}

.finance-allocation-grid span,
.finance-allocation-grid small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.finance-allocation-grid strong {
    color: var(--navy);
    font-size: 18px;
}

.finance-remittance-panel {
    margin-bottom: 18px;
}

.finance-remittance-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}

.finance-remittance-form .finance-notes-field {
    grid-column: span 2;
}

.finance-remittance-form button[type="submit"] {
    width: auto;
    align-self: end;
}

.finance-group-form {
    display: flex;
    align-items: end;
    gap: 10px;
    margin: -4px 0 18px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.finance-group-form label {
    align-self: center;
    color: #2b3445;
    font-size: 12px;
    font-weight: 800;
}

.finance-group-form select {
    width: min(260px, 100%);
    height: 36px;
    font-size: 12px;
}

.finance-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.compliance-summary {
    margin-bottom: 16px;
}

.compliance-filter-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.compliance-filter-form .field-group {
    gap: 5px;
}

.compliance-filter-form label {
    font-size: 11px;
}

.compliance-filter-form input,
.compliance-filter-form select {
    height: 38px;
    padding: 0 10px;
    font-size: 12px;
}

.compliance-filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    grid-column: 1 / -1;
}

.compliance-filter-actions button[type="submit"] {
    width: auto;
    height: 36px;
    padding: 0 15px;
    font-size: 12px;
}

.compliance-filter-actions a {
    font-size: 12px;
    font-weight: 800;
}

.compliance-panel {
    margin-bottom: 18px;
}

.compliance-table th,
.compliance-table td {
    padding: 11px 10px;
    font-size: 12px;
}

.compliance-client-phone {
    white-space: nowrap;
}

.kyc-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
}

.kyc-checklist > div {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 13px 16px;
    background: var(--white);
}

.kyc-checklist > div > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 900;
}

.kyc-checklist .complete > span {
    color: #166534;
    background: #dcfce7;
}

.kyc-checklist .missing > span {
    color: var(--danger);
    background: var(--danger-bg);
}

.kyc-checklist strong,
.kyc-checklist small {
    display: block;
}

.kyc-checklist strong {
    color: var(--navy);
    font-size: 13px;
}

.kyc-checklist small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.compliance-profile-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
}

.compliance-profile-form button[type="submit"] {
    grid-column: 1 / -1;
}

.compliance-upload-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 12px;
    padding: 18px;
}

.compliance-upload-form button[type="submit"] {
    width: auto;
}

.compliance-document-list {
    display: grid;
    gap: 1px;
    border-top: 1px solid var(--line);
    background: var(--line);
}

.compliance-document-item {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--white);
}

.compliance-document-item > div {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.compliance-document-item span,
.compliance-document-item a {
    font-size: 11px;
}

.compliance-assessment-form {
    grid-template-columns: 120px minmax(160px, 1fr) auto auto;
}

.white-book-check {
    min-width: 150px;
    font-size: 11px;
}

.compliance-review-form {
    grid-template-columns: minmax(160px, 0.5fr) minmax(240px, 1.5fr) auto;
    align-items: end;
    gap: 12px;
    padding: 18px;
}

.compliance-review-form button[type="submit"] {
    width: auto;
}

.form-help {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.dashboard-leads-panel {
    margin-top: 22px;
}

.section-heading {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.section-heading h2 {
    margin: 4px 0 0;
    color: var(--navy);
    font-size: 22px;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
    table-layout: fixed;
}

.sales-table {
    min-width: 0;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
    overflow-wrap: anywhere;
    word-break: normal;
}

.data-table th {
    color: #2b3445;
    background: #f8fafd;
    font-weight: 800;
}

.data-table td span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.status-pill {
    display: inline-flex;
    width: auto;
    margin: 0;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--navy-soft);
    background: #eef5ff;
    font-size: 12px;
    font-weight: 800;
}

.pep-detail-field[hidden] {
    display: none;
}

.pep-status {
    display: inline-flex !important;
    width: fit-content;
    margin: 0 !important;
    padding: 5px 8px;
    border-radius: 6px;
    color: var(--navy-soft) !important;
    background: #eef5ff;
    font-size: 11px !important;
    font-weight: 800;
    line-height: 1.2;
}

.pep-status.pep-alert {
    color: var(--danger) !important;
    background: var(--danger-bg);
}

.pep-status.pep-unscreened {
    color: #6b4a00 !important;
    background: #fff7db;
}

.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    min-width: 0;
}

.table-actions form {
    margin: 0;
}

button.text-action {
    width: auto;
    height: auto;
    border: 0;
    padding: 0;
    color: var(--navy-soft);
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

button.text-action:hover {
    text-decoration: underline;
    transform: none;
    box-shadow: none;
}

.danger-action {
    color: var(--danger);
}

.protected-note {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    color: #6b4a00;
    background: #fff7db;
    font-size: 12px;
    font-weight: 800;
}

.credential-summary {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafd;
}

.credential-summary strong {
    color: var(--navy);
}

.credential-summary span {
    color: var(--muted);
    font-size: 14px;
}

.inner-form {
    padding: 0;
    box-shadow: none;
}

.admin-form {
    display: grid;
    gap: 22px;
    padding: 26px;
}

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

.role-fieldset {
    margin: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.role-fieldset legend {
    padding: 0 8px;
    color: #2b3445;
    font-size: 14px;
    font-weight: 800;
}

.role-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
}

.create-user-page,
.create-lead-page {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}

.create-user-page .app-shell,
.create-lead-page .app-shell {
    width: min(1180px, calc(100% - 24px));
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: center;
    padding: clamp(10px, 2vh, 22px) 0;
}

.create-user-page .app-header,
.create-lead-page .app-header {
    margin-bottom: clamp(10px, 1.8vh, 18px);
}

.create-user-page .app-kicker,
.create-lead-page .app-kicker {
    margin-bottom: 3px;
    font-size: 11px;
}

.create-user-page .app-header h1,
.create-lead-page .app-header h1 {
    font-size: clamp(26px, 4vh, 32px);
}

.create-user-page .form-panel,
.create-lead-page .form-panel {
    min-height: 0;
    overflow: hidden;
}

.create-user-page .admin-form,
.create-lead-page .admin-form {
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, auto) auto auto;
    gap: clamp(10px, 1.8vh, 18px);
    padding: clamp(14px, 2.4vh, 24px);
}

.create-user-page .form-grid,
.create-lead-page .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(10px, 1.8vh, 16px);
}

.create-user-page .field-group,
.create-lead-page .field-group {
    gap: clamp(4px, 0.8vh, 7px);
}

.create-user-page .field-group label,
.create-lead-page .field-group label {
    font-size: 13px;
}

.create-user-page input[type="text"],
.create-user-page select,
.create-lead-page input[type="text"],
.create-lead-page input[type="date"],
.create-lead-page select {
    height: clamp(38px, 5.8vh, 46px);
    padding: 0 12px;
}

.create-lead-page textarea {
    min-height: clamp(72px, 13vh, 110px);
}

.create-user-page .role-fieldset {
    padding: clamp(10px, 1.7vh, 16px);
}

.create-user-page .role-options {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(8px, 1.4vh, 12px) 14px;
}

.create-user-page .check-row {
    min-width: 0;
}

.create-user-page .check-row span {
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.25;
}

.create-user-page button[type="submit"] {
    height: clamp(42px, 6vh, 50px);
}

@media (max-height: 720px) and (min-width: 760px) {
    .create-user-page .app-shell,
    .create-lead-page .app-shell {
        width: min(1240px, calc(100% - 18px));
        padding: 8px 0;
    }

    .create-user-page .app-header,
    .create-lead-page .app-header {
        margin-bottom: 8px;
    }

    .create-user-page .app-header h1,
    .create-lead-page .app-header h1 {
        font-size: 26px;
    }

    .create-user-page .admin-form,
    .create-lead-page .admin-form {
        gap: 9px;
        padding: 12px;
    }

    .create-user-page .form-grid,
    .create-lead-page .form-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 9px 12px;
    }

    .create-user-page .role-fieldset {
        padding: 8px 10px 10px;
    }

    .create-user-page .role-options {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 7px 12px;
    }

    .create-user-page input[type="text"],
    .create-user-page select,
    .create-lead-page input[type="text"],
    .create-lead-page input[type="date"],
    .create-lead-page select {
        height: 36px;
        font-size: 14px;
    }

    .create-lead-page textarea {
        min-height: 64px;
        font-size: 13px;
    }
}

@media (max-width: 980px) {
    body {
        overflow: auto;
    }

    .dashboard-layout {
        width: min(100% - 20px, 760px);
        display: block;
        padding: 18px 0;
    }

    .workspace-page {
        width: min(100% - 20px, 760px);
        display: block;
        padding: 18px 0;
    }

    .dashboard-sidebar,
    .workspace-sidebar {
        position: static;
        height: auto;
        margin-bottom: 18px;
    }

    .sidebar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    .sidebar-section-label {
        grid-column: 1 / -1;
    }

    .insurer-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-summary,
    .client-profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-work-grid {
        grid-template-columns: 1fr;
    }

    .finance-filter-form,
    .finance-remittance-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-allocation-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-two-column {
        grid-template-columns: 1fr;
    }

    .compliance-filter-form,
    .compliance-profile-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compliance-upload-form,
    .compliance-review-form {
        grid-template-columns: 1fr 1fr;
    }

    .compliance-upload-form button[type="submit"],
    .compliance-review-form button[type="submit"] {
        width: 100%;
    }

    .compliance-document-item {
        grid-template-columns: 1fr;
    }

    .compliance-assessment-form {
        grid-template-columns: 120px minmax(160px, 1fr) auto;
    }

    .claim-document-item {
        grid-template-columns: 1fr;
    }

    .login-page {
        overflow: visible;
    }

    .create-user-page,
    .create-lead-page {
        overflow: auto;
    }

    .create-user-page .app-shell,
    .create-lead-page .app-shell {
        min-height: 100vh;
        min-height: 100dvh;
        display: block;
    }

    .create-user-page .form-grid,
    .create-lead-page .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .create-user-page .role-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px;
    }

    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .login-panel {
        padding: 22px 14px;
    }

    .login-card {
        padding: 24px 18px;
    }

    .form-options {
        align-items: center;
    }

    .app-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-actions {
        flex-wrap: wrap;
    }

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

    .request-details-grid,
    .payment-summary,
    .account-summary,
    .client-profile-grid,
    .account-inline-form {
        grid-template-columns: 1fr;
    }

    .workflow-step-heading {
        align-items: flex-start;
        padding: 14px;
    }

    .workflow-step-heading h2 {
        font-size: 18px;
    }

    .workflow-form {
        padding: 14px;
    }

    .installment-current {
        align-items: flex-start;
        flex-direction: column;
    }

    .installment-current > div {
        justify-content: flex-start;
    }

    .installment-date-row {
        grid-template-columns: 1fr;
    }

    .installment-remove {
        justify-self: start;
    }

    .claim-document-item {
        padding: 14px;
    }

    .document-assessment-form {
        grid-template-columns: 1fr;
    }

    .document-assessment-form button[type="submit"] {
        width: 100%;
    }

    .admin-form {
        padding: 18px;
    }

    .create-user-page .app-shell,
    .create-lead-page .app-shell {
        width: min(100% - 12px, 420px);
        padding: 6px 0;
    }

    .create-user-page .app-header,
    .create-lead-page .app-header {
        gap: 8px;
        margin-bottom: 6px;
    }

    .create-user-page .app-kicker,
    .create-lead-page .app-kicker {
        margin-bottom: 1px;
        font-size: 10px;
    }

    .create-user-page .app-header h1,
    .create-lead-page .app-header h1 {
        font-size: 22px;
    }

    .create-user-page .app-actions,
    .create-lead-page .app-actions {
        gap: 10px;
        font-size: 13px;
    }

    .create-user-page .admin-form,
    .create-lead-page .admin-form {
        gap: 7px;
        padding: 9px;
    }

    .create-user-page .form-grid,
    .create-lead-page .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .create-user-page .field-group,
    .create-lead-page .field-group {
        gap: 3px;
    }

    .create-user-page .field-group label,
    .create-lead-page .field-group label,
    .create-user-page .role-fieldset legend {
        font-size: 11px;
    }

    .create-user-page input[type="text"],
    .create-user-page select,
    .create-lead-page input[type="text"],
    .create-lead-page input[type="date"],
    .create-lead-page select {
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
    }

    .create-lead-page textarea {
        min-height: 58px;
        padding: 8px;
        font-size: 12px;
    }

    .create-user-page .role-fieldset {
        padding: 6px 7px 7px;
    }

    .create-user-page .role-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px 7px;
    }

    .create-user-page .check-row {
        gap: 5px;
    }

    .create-user-page .check-row input {
        width: 13px;
        height: 13px;
    }

    .create-user-page .check-row span {
        font-size: 10px;
        line-height: 1.12;
    }

    .create-user-page button[type="submit"] {
        height: 36px;
        font-size: 13px;
    }

    .dashboard-shell {
        width: min(100% - 20px, 460px);
        padding: 18px 0;
    }

    .dashboard-layout {
        width: min(100% - 20px, 460px);
    }

    .workspace-page {
        width: min(100% - 20px, 460px);
    }

    .dashboard-sidebar,
    .workspace-sidebar {
        max-height: 42vh;
        padding: 18px;
    }

    .sidebar-nav {
        grid-template-columns: 1fr;
        min-height: 0;
        overflow-y: auto;
    }

    .finance-filter-form,
    .finance-remittance-form,
    .finance-allocation-grid {
        grid-template-columns: 1fr;
    }

    .finance-remittance-form .finance-notes-field {
        grid-column: auto;
    }

    .finance-remittance-form button[type="submit"] {
        width: 100%;
    }

    .finance-group-form {
        align-items: stretch;
        flex-direction: column;
    }

    .finance-group-form select,
    .finance-group-form button[type="submit"] {
        width: 100%;
    }

    .compliance-filter-form,
    .compliance-profile-form,
    .compliance-upload-form,
    .compliance-review-form,
    .kyc-checklist {
        grid-template-columns: 1fr;
    }

    .compliance-profile-form button[type="submit"],
    .compliance-filter-actions {
        grid-column: auto;
    }

    .compliance-assessment-form {
        grid-template-columns: 1fr;
    }

    .compliance-assessment-form button[type="submit"] {
        width: 100%;
    }

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

    .data-table,
    .data-table thead,
    .data-table tbody,
    .data-table tr,
    .data-table th,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .data-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .data-table tbody {
        display: grid;
        gap: 12px;
        padding: 12px;
    }

    .data-table tr {
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        overflow: hidden;
    }

    .data-table td {
        display: grid;
        grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        padding: 10px 12px;
        border-bottom: 1px solid var(--line);
    }

    .data-table td:last-child {
        border-bottom: 0;
    }

    .data-table td::before {
        content: attr(data-label);
        color: #2b3445;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .data-table td[colspan] {
        display: block;
        text-align: center;
    }

    .data-table td[colspan]::before {
        content: none;
    }

    .table-actions {
        align-items: flex-start;
    }

    .dashboard-hero {
        padding: 12px;
    }

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

.analyst-filter-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
}

.analyst-filter-form .field-group {
    margin: 0;
}

.analyst-filter-form label {
    font-size: 11px;
}

.analyst-filter-form input,
.analyst-filter-form select {
    height: 38px;
    padding: 0 10px;
    font-size: 12px;
}

.analyst-filter-actions {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 12px;
}

.analyst-filter-actions button {
    width: auto;
    height: 36px;
    padding: 0 16px;
    font-size: 12px;
}

.analyst-filter-actions a {
    font-size: 12px;
    font-weight: 800;
}

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

.analyst-metric {
    min-height: 108px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
    color: var(--navy);
    text-decoration: none;
}

.analyst-metric:hover,
.analyst-report-links a:hover {
    border-color: #8ea1b8;
    background: #f8fafc;
}

.analyst-metric span,
.analyst-metric strong,
.analyst-metric small {
    display: block;
}

.analyst-metric span {
    min-height: 28px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.analyst-metric strong {
    margin-top: 7px;
    font-size: 20px;
}

.analyst-metric small {
    margin-top: 8px;
    color: var(--gold);
    font-size: 10px;
    font-weight: 900;
}

.analyst-panel {
    margin-bottom: 16px;
}

.analyst-pipeline {
    padding: 14px 18px 18px;
}

.analyst-pipeline > div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 56px;
    align-items: center;
    gap: 12px;
    min-height: 36px;
}

.analyst-pipeline span,
.analyst-pipeline strong {
    font-size: 12px;
}

.analyst-pipeline > div > div {
    height: 8px;
    overflow: hidden;
    background: #e7edf4;
}

.analyst-pipeline i {
    display: block;
    height: 100%;
    background: var(--navy);
}

.analyst-pipeline strong {
    text-align: right;
}

.analyst-report-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.analyst-report-links a {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
    color: var(--navy);
    text-decoration: none;
}

.analyst-report-links strong,
.analyst-report-links span {
    display: block;
}

.analyst-report-links strong {
    font-size: 13px;
}

.analyst-report-links span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
}

.analyst-detail-header nav {
    display: flex;
    gap: 8px;
}

.analyst-detail-header nav a {
    min-width: 72px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--white);
    color: var(--navy);
    font-size: 11px;
    font-weight: 900;
    text-align: center;
    text-decoration: none;
}

.analyst-detail-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analyst-table th,
.analyst-table td {
    padding: 10px 8px;
    font-size: 11px;
}

@media (max-width: 980px) {
    .analyst-metric-grid,
    .analyst-report-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .analyst-filter-form,
    .analyst-metric-grid,
    .analyst-report-links,
    .analyst-detail-summary {
        grid-template-columns: 1fr;
    }

    .analyst-filter-actions {
        grid-column: auto;
    }

    .analyst-filter-actions button {
        flex: 1;
    }

    .analyst-detail-header {
        align-items: flex-start;
    }

    .analyst-detail-header nav {
        width: 100%;
    }

    .analyst-detail-header nav a {
        flex: 1;
    }

    .analyst-pipeline > div {
        grid-template-columns: 82px minmax(0, 1fr) 42px;
        gap: 8px;
    }
}

.workspace-page.create-user-page .app-shell,
.workspace-page.create-lead-page .app-shell {
    width: 100%;
    min-height: 0;
    display: block;
    padding: 0;
}

.workspace-page.create-user-page,
.workspace-page.create-lead-page {
    overflow: auto;
}

.workspace-page.create-user-page .admin-form,
.workspace-page.create-lead-page .admin-form {
    height: auto;
}
