* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f4f6f8;
    color: #17202a;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.brand {
    font-size: 28px;
    font-weight: 800;
    color: #1f4e79;
    margin-bottom: 8px;
}

.brand-small {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
}

h1 {
    margin: 0 0 8px;
    font-size: 24px;
}

h2 {
    margin-top: 0;
}

.subtle {
    color: #607080;
}

label {
    display: block;
    font-weight: 600;
    margin-top: 18px;
    margin-bottom: 6px;
}

input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5df;
    border-radius: 10px;
    font-size: 16px;
}

button {
    margin-top: 22px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-radius: 10px;
    background: #1f4e79;
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}

button:hover {
    background: #173b5c;
}

button.secondary {
    width: auto;
    margin: 0;
    background: #ffffff;
    color: #1f4e79;
}

.alert {
    background: #fdecea;
    color: #9f1d17;
    padding: 12px;
    border-radius: 10px;
    margin: 16px 0;
}

.success {
    color: #137333;
    font-weight: 700;
}

.topbar {
    background: #1f4e79;
    color: #ffffff;
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 14px;
    opacity: 0.9;
}

.container {
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 20px;
}

.panel,
.tile {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 18px;
}

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

    .topbar {
        gap: 16px;
        align-items: flex-start;
        flex-direction: column;
    }
}

a {
    color: #1f4e79;
}

.tile-link {
    color: inherit;
    text-decoration: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
    background: #ffffff;
}

th,
td {
    text-align: left;
    padding: 14px;
    border-bottom: 1px solid #e5eaf0;
    vertical-align: middle;
}

th {
    color: #526170;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

code {
    font-size: 13px;
    background: #eef3f7;
    padding: 4px 7px;
    border-radius: 7px;
}

.pill {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.pill.good {
    background: #e6f4ea;
    color: #137333;
}

.pill.bad {
    background: #fdecea;
    color: #9f1d17;
}

.button-link {
    display: inline-block;
    background: #1f4e79;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 9px;
    text-decoration: none;
    font-weight: 700;
}

.search-form {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.search-form input {
    flex: 1;
}

.search-form button {
    width: auto;
    margin: 0;
}

.pin-form {
    display: grid;
    grid-template-columns: 140px 140px 110px;
    gap: 8px;
    align-items: center;
}

.pin-form input {
    padding: 9px 10px;
}

.pin-form button {
    width: auto;
    margin: 0;
    padding: 10px 12px;
}

.notice {
    padding: 12px;
    border-radius: 10px;
    margin: 14px 0;
    font-weight: 700;
}

.good-bg {
    background: #e6f4ea;
    color: #137333;
}

.bad-bg {
    background: #fdecea;
    color: #9f1d17;
}

@media (max-width: 900px) {
    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        border-bottom: 2px solid #e5eaf0;
        padding: 12px 0;
    }

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

    .search-form {
        flex-direction: column;
    }
}

.table-button {
    width: auto;
    margin: 0;
    padding: 8px 12px;
    font-size: 14px;
}

/* Fixed two-column client action layout */
.clients-table th:nth-child(5),
.clients-table th:nth-child(6),
.clients-table td:nth-child(5),
.clients-table td:nth-child(6) {
    text-align: center;
    width: 120px;
}

.button-cell {
    vertical-align: middle;
    white-space: nowrap;
}

.button-cell form {
    margin: 0;
}

.clients-table .table-button,
.clients-table .button-link {
    width: 112px;
    height: 42px;
    min-width: 112px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.clients-table .button-link {
    width: 72px;
    min-width: 72px;
}


/* Normalize ALL table action buttons */
.clients-table .table-button,
.clients-table .button-link {
    height: 44px;
    min-width: 110px;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 700;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;
    box-sizing: border-box;
}

/* Make Open button visually consistent */
.clients-table .button-link {
    text-decoration: none;
}

/* Ensure vertical centering in cells */
.clients-table td {
    vertical-align: middle;
}


.container.wide {
    max-width: 1350px;
}

.letter-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 18px 0;
}

.letter-filter a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    background: #eef3f7;
    color: #1f4e79;
}

.letter-filter a.active {
    background: #1f4e79;
    color: #ffffff;
}

.results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 14px 0;
    font-weight: 700;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
}

.page-count {
    font-weight: 700;
    color: #526170;
}

.button-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    height: 42px;
    border-radius: 10px;
    background: #d8dee5;
    color: #7a8793;
    font-weight: 700;
}

.clear-link {
    height: 44px;
    min-width: 90px;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
    width: 140px;
}

@media (max-width: 900px) {
    .results-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Center Clear button text in user search */
.search-form .button-link,
.search-form .clear-link {
    height: 44px;
    min-width: 90px;
    padding: 0 16px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
}


/* Make Search + Clear buttons identical */
.search-form button,
.search-form .button-link,
.search-form .clear-link {
    height: 44px;
    min-width: 96px;
    padding: 0 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 15px;
    font-weight: 700;
    line-height: 1;

    border-radius: 10px;
    box-sizing: border-box;
}

/* Remove link-specific quirks */
.search-form .button-link,
.search-form .clear-link {
    text-decoration: none;
    vertical-align: middle;
}

/* Ensure container aligns everything */
.search-form {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-form input {
    flex: 1;
}


/* Search toolbar buttons */
.search-form button,
.search-form .clear-button {
    height: 44px !important;
    min-width: 96px !important;
    margin: 0 !important;
    padding: 0 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}


.audit-filter {
    display: grid;
    grid-template-columns: 220px 280px 1fr auto;
    gap: 14px;
    align-items: end;
    margin-top: 18px;
}

.audit-filter label {
    margin-top: 0;
}

.audit-filter select,
.audit-filter input {
    width: 100%;
    height: 44px;
    padding: 10px 12px;
    border: 1px solid #cbd5df;
    border-radius: 10px;
    font-size: 15px;
    background: #ffffff;
}

.audit-buttons {
    display: flex;
    gap: 10px;
}

.audit-buttons button {
    width: auto;
    height: 44px;
    min-width: 96px;
    margin: 0;
    padding: 0 18px;
}

.audit-table {
    font-size: 14px;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1) {
    width: 170px;
}

.audit-table th:nth-child(2),
.audit-table td:nth-child(2) {
    width: 90px;
}

.audit-table th:nth-child(3),
.audit-table td:nth-child(3) {
    width: 230px;
}

.audit-table th:nth-child(4),
.audit-table td:nth-child(4) {
    width: 130px;
}

.audit-table th:nth-child(6),
.audit-table td:nth-child(6) {
    width: 120px;
}

.details-cell {
    max-width: 420px;
    word-break: break-word;
}

.nowrap {
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .audit-filter {
        grid-template-columns: 1fr;
    }

    .audit-buttons {
        flex-direction: column;
    }

    .audit-buttons button {
        width: 100%;
    }
}

.page-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.add-client-button {
    height: 44px;
    min-width: 120px;
    margin-top: 4px;
}

@media (max-width: 700px) {
    .page-heading-row {
        flex-direction: column;
    }
}

.verification-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

.masked-pin {
    font-size: 24px;
    letter-spacing: 4px;
    font-weight: 800;
}

.revealed-pin {
    display: inline-block;
    font-size: 28px;
    letter-spacing: 3px;
    font-weight: 900;
    background: #fff4ce;
    color: #6f4e00;
    padding: 8px 12px;
    border-radius: 10px;
}

.nested-panel {
    margin-top: 18px;
    box-shadow: none;
    border: 1px solid #e5eaf0;
}

textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5df;
    border-radius: 10px;
    font-size: 16px;
    font-family: "Segoe UI", Arial, sans-serif;
}

@media (max-width: 900px) {
    .verification-grid {
        grid-template-columns: 1fr;
    }
}

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

.stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-left: 6px solid #1f4e79;
}

.stat-card.warning {
    border-left-color: #b7791f;
}

.stat-card.danger {
    border-left-color: #b91c1c;
}

.stat-label {
    color: #607080;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 34px;
    font-weight: 900;
    margin-top: 8px;
    color: #17202a;
}

.dashboard-table-panel {
    margin-top: 18px;
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Clean dashboard layout */
.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.dashboard-hero {
    background: #ffffff;
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.dashboard-hero h1 {
    margin-bottom: 8px;
}

.dashboard-hero p {
    margin: 0;
    color: #526170;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

.dashboard-stat-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-left: 6px solid #1f4e79;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dashboard-stat-card span {
    color: #607080;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dashboard-stat-card strong {
    font-size: 34px;
    font-weight: 900;
    color: #17202a;
    margin-top: 12px;
}

.dashboard-stat-card.warning {
    border-left-color: #b7791f;
}

.dashboard-stat-card.danger {
    border-left-color: #b91c1c;
}

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

.dashboard-nav-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
    display: block;
    min-height: 150px;
}

.dashboard-nav-card:hover {
    transform: translateY(-1px);
}

.dashboard-nav-card h2 {
    margin: 0 0 12px;
}

.dashboard-nav-card p {
    margin: 0;
    color: #526170;
}

.dashboard-client-panel {
    margin-top: 0;
}

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

.panel-heading-row h2 {
    margin-bottom: 6px;
}

.compact-button {
    height: 36px;
    min-width: 72px;
    padding: 0 12px;
}

/* Hide older dashboard/card styles if previous CSS still exists */
.stats-grid {
    display: none !important;
}

@media (max-width: 1100px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-nav-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 650px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }

    .panel-heading-row {
        flex-direction: column;
    }
}

.clean-hero {
    min-height: auto;
}

.dashboard-main .dashboard-nav-grid {
    margin-top: 0;
}

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

.dashboard-nav-card {
    min-height: 135px;
}

@media (max-width: 800px) {
    .dashboard-nav-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* NAV buttons */
.dashboard-nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.dashboard-nav-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
    min-height: 120px;
}

/* Stats */
.dashboard-stats-grid.compact {
    grid-template-columns: repeat(4, 1fr);
}

.dashboard-stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #1f4e79;
}

.dashboard-stat-card span {
    font-size: 12px;
    font-weight: 700;
    color: #607080;
    text-transform: uppercase;
}

.dashboard-stat-card strong {
    font-size: 28px;
    font-weight: 900;
}

@media (max-width: 1000px) {
    .dashboard-nav-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stats-grid.compact {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .dashboard-stats-grid.compact {
        grid-template-columns: 1fr;
    }
}

/* Force dashboard navigation to look like real buttons */
.dashboard-nav-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 18px !important;
}

.dashboard-nav-card {
    background: #1f4e79 !important;
    color: #ffffff !important;
    border-radius: 16px !important;
    padding: 28px 24px !important;
    min-height: 130px !important;
    box-shadow: 0 10px 24px rgba(31, 78, 121, 0.22) !important;
    text-decoration: none !important;

    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}

.dashboard-nav-card h2 {
    color: #ffffff !important;
    font-size: 26px !important;
    margin: 0 0 10px 0 !important;
}

.dashboard-nav-card p {
    color: #eaf2f8 !important;
    margin: 0 !important;
    font-weight: 600 !important;
}

.dashboard-nav-card:hover {
    background: #173b5c !important;
    transform: translateY(-2px) !important;
}

@media (max-width: 900px) {
    .dashboard-nav-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Fix Add Client button alignment */
button,
.button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Optional: make sure height is consistent */
button {
    height: 42px;
    padding: 0 18px;
}


/* Final dashboard button/menu override */
.dashboard-nav-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 22px !important;
    margin-top: 0 !important;
}

.dashboard-nav-card {
    background: #1f4e79 !important;
    color: #ffffff !important;
    border-radius: 18px !important;
    padding: 32px 24px !important;
    min-height: 140px !important;
    box-shadow: 0 10px 24px rgba(31, 78, 121, 0.24) !important;
    text-decoration: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.dashboard-nav-card h2 {
    color: #ffffff !important;
    font-size: 28px !important;
    margin: 0 0 10px 0 !important;
    text-decoration: none !important;
}

.dashboard-nav-card p {
    color: #eaf2f8 !important;
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.dashboard-nav-card:hover {
    background: #173b5c !important;
    transform: translateY(-2px) !important;
}

@media (max-width: 900px) {
    .dashboard-nav-grid {
        grid-template-columns: 1fr !important;
    }
}


.enroll-button {
    width: 100%;
    height: 46px;
    margin-top: 18px;
}

.enroll-card {
    max-width: 520px;
}


.license-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef3f7;
    color: #1f4e79;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 800;
    margin: 2px;
}

.danger-button,
.danger-submit {
    background: #9f1d17 !important;
    color: #ffffff !important;
}

.danger-button:hover,
.danger-submit:hover {
    background: #7f1712 !important;
}

.soft-divider {
    border: 0;
    border-top: 1px solid #e5eaf0;
    margin: 24px 0;
}

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

.license-select-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0 22px;
}

.license-option {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid #d7e0ea;
    border-radius: 12px;
    padding: 14px;
    background: #ffffff;
    cursor: pointer;
}

.license-option input {
    width: auto;
    margin-top: 4px;
}

.disabled-license {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f4f6f8;
}

@media (max-width: 900px) {
    .form-grid-two,
    .license-select-grid {
        grid-template-columns: 1fr;
    }
}

/* Fix onboarding license checkbox alignment */
.license-select-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

.license-option {
    display: grid !important;
    grid-template-columns: 24px 1fr !important;
    align-items: start !important;
    column-gap: 12px !important;
}

.license-option input[type="checkbox"] {
    grid-column: 1 !important;
    width: 18px !important;
    height: 18px !important;
    margin: 3px 0 0 0 !important;
    padding: 0 !important;
}

.license-option span {
    grid-column: 2 !important;
    display: block !important;
}


/* User onboarding license selector - fixed layout */
.license-table-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    margin: 16px 0 24px !important;
}

.license-table-row {
    display: grid !important;
    grid-template-columns: 28px 1fr !important;
    gap: 12px !important;
    align-items: start !important;
    padding: 14px !important;
    border: 1px solid #d7e0ea !important;
    border-radius: 12px !important;
    background: #ffffff !important;
}

.license-check {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: 3px !important;
}

.license-check input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.license-info {
    display: block !important;
}

@media (max-width: 900px) {
    .license-table-list {
        grid-template-columns: 1fr !important;
    }
}


.copy-block {
    white-space: pre-line;
    background: #eef3f7;
    border: 1px solid #d7e0ea;
    border-radius: 12px;
    padding: 14px;
    margin: 14px 0;
    font-family: Consolas, "Courier New", monospace;
    color: #17202a;
}


/* Security Actions checkbox alignment */
.security-checkbox-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 14px 0 18px;
}

.security-checkbox-row {
    display: grid !important;
    grid-template-columns: 24px 1fr !important;
    align-items: center !important;
    column-gap: 10px !important;
    margin: 0 !important;
    font-weight: 700;
}

.security-checkbox-row input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.security-checkbox-row span {
    display: block;
}


.group-result-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 14px 0 24px;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid #d7e0ea;
    border-radius: 12px;
    padding: 12px;
    background: #f8fafc;
}

.group-result-row {
    display: grid !important;
    grid-template-columns: 28px 1fr !important;
    gap: 12px !important;
    align-items: start !important;
    padding: 12px !important;
    border: 1px solid #d7e0ea !important;
    border-radius: 10px !important;
    background: #ffffff !important;
}

.group-result-row input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin: 3px 0 0 0 !important;
    padding: 0 !important;
}

.selected-group-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.selected-group-pill {
    display: inline-flex;
    align-items: center;
    background: #1f4e79;
    color: #ffffff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
}


/* Onboarding section spacing cleanup */
.user-onboarding-section {
    margin-top: 30px;
    padding-top: 8px;
}

.user-onboarding-section h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

.user-onboarding-section p.subtle {
    margin-bottom: 18px;
}


.group-search-row {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.group-search-row input {
    margin: 0 !important;
}

.group-search-row button {
    height: 44px;
}

@media (max-width: 700px) {
    .group-search-row {
        grid-template-columns: 1fr;
    }
}


/* Group search controls */
.group-search-row {
    display: grid !important;
    grid-template-columns: 1fr 110px 110px !important;
    gap: 12px !important;
    align-items: center !important;
    margin-bottom: 14px !important;
}

.group-search-row input {
    height: 44px !important;
    margin: 0 !important;
}

.group-search-row button {
    height: 44px !important;
    margin: 0 !important;
    padding: 0 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

@media (max-width: 800px) {
    .group-search-row {
        grid-template-columns: 1fr !important;
    }
}


/* Allow group search to actually hide rows */
.group-result-row.group-hidden {
    display: none !important;
}


.required-marker {
    color: #b91c1c;
    font-weight: 900;
}


/* ===== TierTek Professional UI Refresh ===== */

:root {
    --tt-blue: #1f4e79;
    --tt-blue-dark: #173b5c;
    --tt-bg: #f4f7fb;
    --tt-card: #ffffff;
    --tt-text: #17202a;
    --tt-muted: #627386;
    --tt-border: #d8e1eb;
    --tt-danger: #b91c1c;
    --tt-warning: #b7791f;
    --tt-success: #15803d;
}

body {
    background: var(--tt-bg);
    color: var(--tt-text);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    background: var(--tt-blue);
    color: #ffffff;
    padding: 24px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 6px;
}

.sidebar-subtitle {
    font-size: 13px;
    color: #d9e8f5;
    margin-bottom: 28px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav a {
    color: #eef6fc;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 700;
}

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

.app-main {
    padding: 28px;
}

.app-header {
    background: var(--tt-card);
    border: 1px solid var(--tt-border);
    border-radius: 18px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    box-shadow: 0 8px 24px rgba(23, 32, 42, 0.06);
    margin-bottom: 22px;
}

.app-header h1 {
    margin: 0;
    font-size: 28px;
}

.app-header p {
    margin: 6px 0 0;
    color: var(--tt-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.portal-card {
    background: var(--tt-card);
    border: 1px solid var(--tt-border);
    border-radius: 18px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 24px rgba(23, 32, 42, 0.06);
    min-height: 145px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.portal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(23, 32, 42, 0.10);
}

.portal-card h2 {
    margin: 0 0 10px;
    font-size: 22px;
}

.portal-card p {
    margin: 0;
    color: var(--tt-muted);
    line-height: 1.45;
}

.portal-card.primary {
    background: linear-gradient(135deg, var(--tt-blue), var(--tt-blue-dark));
    color: #ffffff;
    border: none;
}

.portal-card.primary p {
    color: #e7f1fa;
}

.portal-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.portal-stat {
    background: var(--tt-card);
    border: 1px solid var(--tt-border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(23, 32, 42, 0.05);
}

.portal-stat span {
    display: block;
    color: var(--tt-muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.portal-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
    font-weight: 900;
}

.portal-stat.warning {
    border-left: 5px solid var(--tt-warning);
}

.portal-stat.danger {
    border-left: 5px solid var(--tt-danger);
}

.portal-stat.success {
    border-left: 5px solid var(--tt-success);
}

button,
.button-link,
.clear-button {
    border-radius: 10px;
    font-weight: 800;
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

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

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

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

@media (max-width: 700px) {
    .app-main {
        padding: 18px;
    }

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

    .sidebar-nav,
    .portal-card-grid,
    .portal-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Shared page polish ===== */

.page-card {
    background: var(--tt-card);
    border: 1px solid var(--tt-border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(23, 32, 42, 0.06);
    margin-bottom: 22px;
}

.page-card h2,
.page-card h1 {
    margin-top: 0;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--tt-border);
    border-radius: 14px;
    background: #fff;
}

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

.table-wrap th {
    background: #eef3f7;
    color: var(--tt-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .04em;
}

.table-wrap th,
.table-wrap td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf1f5;
    vertical-align: top;
}

.table-wrap tr:last-child td {
    border-bottom: none;
}

.filter-card {
    background: #ffffff;
    border: 1px solid var(--tt-border);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 18px;
}

.filter-grid {
    display: grid;
    grid-template-columns: 260px 1fr auto;
    gap: 14px;
    align-items: end;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

@media (max-width: 900px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

/* Normalize action buttons */
.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
}

.form-actions a.button-link,
.form-actions button {
    min-width: 90px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    box-sizing: border-box;
    margin: 0;
}

.form-actions form {
    margin: 0;
}


/* ===== Onboarding Form Refresh ===== */

.page-card form {
    width: 100%;
}

.page-card input,
.page-card select,
.page-card textarea {
    width: 100%;
    border: 1px solid #cfd8e3;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    background: #fff;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.page-card input:focus,
.page-card select:focus,
.page-card textarea:focus {
    outline: none;
    border-color: var(--tt-blue);
    box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.12);
}

.page-card label {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
    color: var(--tt-text);
}

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

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

.page-card .full-width {
    grid-column: 1 / -1;
}

.page-card section {
    margin-top: 34px;
}

.page-card h2 {
    margin-bottom: 8px;
}

.page-card p.subtle {
    color: var(--tt-muted);
    margin-bottom: 18px;
}

.group-results-container {
    border-radius: 16px !important;
}

.group-result-row {
    border-radius: 14px !important;
}

@media (max-width: 900px) {
    .page-card .form-grid,
    .page-card .form-grid-3 {
        grid-template-columns: 1fr;
    }
}


.security-detail-grid {
    grid-template-columns: 1fr 1fr;
    margin-top: 18px;
}

.nested-panel {
    margin-top: 22px;
    box-shadow: none;
}

.pill.warning {
    background: #fef3c7;
    color: #92400e;
}

@media (max-width: 900px) {
    .security-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Verification filter layout */
.verification-filter-grid {
    display: grid;
    grid-template-columns: 280px minmax(320px, 520px) 120px 120px;
    gap: 14px;
    align-items: end;
}

.verification-filter-grid .form-actions {
    display: contents;
}

.verification-filter-grid button,
.verification-filter-grid a.button-link {
    width: 120px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

@media (max-width: 1000px) {
    .verification-filter-grid {
        grid-template-columns: 1fr;
    }

    .verification-filter-grid .form-actions {
        display: flex;
    }
}

/* Audit page */
.audit-filter-grid {
    display: grid;
    grid-template-columns: 240px 220px 160px minmax(280px, 1fr) 250px;
    gap: 14px;
    align-items: end;
}

.audit-filter-grid .form-actions {
    display: flex;
    gap: 10px;
}

.audit-filter-grid button,
.audit-filter-grid a.button-link {
    width: 120px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.audit-details {
    max-width: 520px;
    white-space: normal;
    line-height: 1.4;
    color: var(--tt-muted);
}

@media (max-width: 1200px) {
    .audit-filter-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 800px) {
    .audit-filter-grid {
        grid-template-columns: 1fr;
    }
}


/* Clients table action buttons */
.table-wrap .form-actions {
    flex-wrap: nowrap;
}

.table-wrap .form-actions form {
    margin: 0;
}

.table-wrap .form-actions a.button-link,
.table-wrap .form-actions button {
    width: 90px;
    min-width: 90px;
    height: 44px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    box-sizing: border-box;
}

/* ===== Public Web Password Reset ===== */

.public-reset-body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #1f4e79, #173b5c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #17202a;
}

.public-reset-shell {
    width: 100%;
    max-width: 480px;
    padding: 24px;
}

.public-reset-card {
    background: #ffffff;
    border-radius: 22px;
    padding: 34px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.22);
}

.public-reset-brand {
    color: #1f4e79;
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 12px;
}

.public-reset-card h1 {
    margin: 0 0 10px;
    font-size: 28px;
}

.public-reset-card h2 {
    margin-top: 24px;
}

.public-reset-card label {
    display: block;
    font-weight: 800;
    margin-top: 18px;
    margin-bottom: 8px;
}

.public-reset-card input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cfd8e3;
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 16px;
}

.public-reset-card button,
.public-reset-card .button-link {
    margin-top: 22px;
    width: 100%;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.public-reset-help {
    margin-top: 24px;
    color: #627386;
    font-size: 14px;
    line-height: 1.5;
}

.temp-password-box {
    background: #eef3f7;
    border: 1px solid #d8e1eb;
    border-radius: 14px;
    padding: 14px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 18px;
    word-break: break-all;
}

.temp-password-box button {
    margin-top: 12px;
}


.password-rules {
    margin-top: 18px;
    background: #eef3f7;
    border: 1px solid #d8e1eb;
    border-radius: 14px;
    padding: 14px 16px;
    color: #17202a;
    font-size: 14px;
}

.password-rules ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.password-rules li {
    margin: 4px 0;
}


/* Web reset password UX */
.password-input-wrap {
    display: grid;
    grid-template-columns: 1fr 82px;
    gap: 10px;
    align-items: center;
}

.public-reset-card .password-input-wrap input {
    margin: 0;
}

.public-reset-card .password-toggle {
    width: 82px;
    min-height: 46px;
    margin: 0;
    padding: 0 10px;
    font-size: 14px;
}

.password-strength {
    margin-top: 10px;
}

.password-strength-bar {
    width: 100%;
    height: 10px;
    background: #e5edf5;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #d8e1eb;
}

#password-strength-fill {
    height: 100%;
    width: 0%;
    transition: width 160ms ease;
}

#password-strength-fill.strength-weak {
    background: #b91c1c;
}

#password-strength-fill.strength-fair {
    background: #b7791f;
}

#password-strength-fill.strength-good {
    background: #1f4e79;
}

#password-strength-fill.strength-strong {
    background: #15803d;
}

#password-strength-label {
    margin-top: 6px;
    color: #627386;
    font-size: 13px;
    font-weight: 700;
}

.password-rules li.rule-pass {
    color: #15803d;
    font-weight: 800;
}

.password-rules li.rule-pass::marker {
    content: "✓ ";
}

.password-rules li.rule-fail {
    color: #627386;
}

.password-match-message {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 800;
}

.match-good {
    color: #15803d;
}

.match-bad {
    color: #b91c1c;
}


/* Web reset success/enrollment polish */
.public-reset-enroll-box {
    margin-top: 22px;
    padding: 16px;
    background: #eef3f7;
    border: 1px solid #d8e1eb;
    border-radius: 14px;
    color: #17202a;
}

.public-reset-enroll-box p {
    margin: 8px 0 12px;
    color: #627386;
    line-height: 1.45;
}

.public-reset-enroll-box a {
    font-weight: 900;
    color: #1f4e79;
    text-decoration: none;
}

.public-reset-enroll-box a:hover {
    text-decoration: underline;
}

.reset-success-panel {
    margin-top: 20px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #d8e1eb;
    border-radius: 14px;
}

.reset-success-panel .button-link {
    margin-top: 14px;
}

.secondary-reset-link {
    margin-top: 18px !important;
}

@media (max-width: 520px) {
    .public-reset-shell {
        padding: 14px;
    }

    .public-reset-card {
        padding: 24px 20px;
        border-radius: 18px;
    }

    .public-reset-card h1 {
        font-size: 24px;
    }

    .password-input-wrap {
        grid-template-columns: 1fr;
    }

    .public-reset-card .password-toggle {
        width: 100%;
    }
}


/* Reports */
.portal-stat.warning {
    border-left: 5px solid var(--tt-warning);
}

.portal-stat.danger {
    border-left: 5px solid var(--tt-danger);
}


/* Report drill-down links */
.report-count-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 34px;
    border-radius: 999px;
    background: #eef3f7;
    color: #1f4e79;
    font-weight: 900;
    text-decoration: none;
    border: 1px solid #d8e1eb;
}

.report-count-link:hover {
    background: #dceaf5;
    text-decoration: none;
}

