:root {
    --tbb-deep: #006b78;
    --tbb-teal: #009eaa;
    --tbb-aqua: #22bcc5;
    --tbb-light: #eef9fa;
    --tbb-gold: #e7bd67;
    --text: #233238;
    --muted: #68777c;
    --border: #d7e4e6;
    --white: #ffffff;
    --danger: #a93c3c;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, #ffffff 0, #f4fbfc 38%, #e8f5f6 100%);
}

a {
    color: var(--tbb-deep);
}

.portal-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
}

.login-panel {
    width: 100%;
    max-width: 480px;
}

.brand {
    text-align: center;
    margin-bottom: 18px;
}

.brand img {
    display: block;
    width: 230px;
    max-width: 70%;
    height: auto;
    margin: 0 auto;
}

.portal-card {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 34px;
    box-shadow: 0 16px 45px rgba(0, 78, 87, 0.10);
}

.portal-card h1 {
    margin: 0;
    text-align: center;
    color: var(--tbb-deep);
    font-size: 27px;
}

.portal-subtitle {
    margin: 9px 0 27px;
    text-align: center;
    color: var(--muted);
    line-height: 1.5;
}

.form-group {
    margin-bottom: 19px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #aebfc2;
    border-radius: 6px;
    background: var(--white);
    color: var(--text);
    font-size: 16px;
}

.form-control:focus {
    outline: 2px solid rgba(0, 158, 170, 0.18);
    border-color: var(--tbb-teal);
}

.portal-button {
    width: 100%;
    border: 0;
    border-radius: 6px;
    padding: 13px 18px;
    background: linear-gradient(135deg, var(--tbb-deep), var(--tbb-teal));
    color: var(--white);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.portal-button:hover {
    filter: brightness(1.05);
}

.alert {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.45;
}

.alert-error {
    color: #762b2b;
    background: #fff0f0;
    border: 1px solid #efc1c1;
}

.login-footer {
    margin-top: 22px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.dashboard-body {
    min-height: 100vh;
    background: #f5f9fa;
}

.portal-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-logo {
    width: 125px;
    height: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
}

.logout-link {
    text-decoration: none;
    font-weight: bold;
}

.dashboard-main {
    width: min(1180px, calc(100% - 40px));
    margin: 38px auto;
}

.welcome-card {
    padding: 30px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 26px rgba(0, 78, 87, 0.06);
}

.welcome-card h1 {
    margin-top: 0;
    color: var(--tbb-deep);
}

.status-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 20px;
    background: var(--tbb-light);
    color: var(--tbb-deep);
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

@media (max-width: 600px) {
    .portal-card {
        padding: 27px 22px;
    }

    .brand img {
        width: 190px;
    }

    .header-inner {
        min-height: 76px;
    }

    .header-logo {
        width: 100px;
    }

    .header-actions {
        gap: 10px;
        font-size: 12px;
    }
}

.admin-launch {
    margin-top: 25px;
}

.admin-button {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 6px;
    background: var(--tbb-deep);
    color: var(--white);
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.admin-button:hover {
    background: var(--tbb-teal);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    padding: 24px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 78, 87, 0.05);
}

.stat-number {
    display: block;
    margin-bottom: 5px;
    color: var(--tbb-deep);
    font-size: 34px;
    font-weight: bold;
}

.stat-label {
    color: var(--muted);
    font-size: 14px;
}

.admin-panel {
    padding: 28px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 78, 87, 0.05);
}

.admin-panel h2 {
    margin-top: 0;
    color: var(--tbb-deep);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.admin-action {
    display: inline-block;
    padding: 11px 16px;
    border: 1px solid var(--tbb-teal);
    border-radius: 6px;
    color: var(--tbb-deep);
    background: var(--white);
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.admin-action:hover {
    background: var(--tbb-light);
}

.admin-action-primary {
    color: var(--white);
    background: var(--tbb-deep);
    border-color: var(--tbb-deep);
}

.admin-action-primary:hover {
    color: var(--white);
    background: var(--tbb-teal);
}

@media (max-width: 750px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.form-page {
    margin-top: 24px;
    padding: 30px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 78, 87, 0.05);
}

.form-section {
    margin-bottom: 32px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
    margin-bottom: 24px;
}

.form-section h2 {
    margin: 0 0 20px;
    color: var(--tbb-deep);
    font-size: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.field-note {
    margin: -3px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.form-submit-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.form-submit-button {
    width: auto;
    min-width: 220px;
}

.cancel-link {
    font-size: 14px;
    font-weight: bold;
}

.alert-success {
    color: #175f4b;
    background: #edf9f4;
    border: 1px solid #b8dfd1;
}

.success-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

@media (max-width: 700px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-page {
        padding: 22px;
    }

    .form-submit-row {
        align-items: stretch;
        flex-direction: column;
    }

    .form-submit-button {
        width: 100%;
    }

    .cancel-link {
        text-align: center;
    }
}

.client-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.client-page-heading h1 {
    margin-bottom: 8px;
}

.client-page-heading p {
    margin-bottom: 0;
}

.client-list-panel {
    margin-top: 24px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 78, 87, 0.05);
    overflow: hidden;
}

.client-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.client-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.client-table th {
    padding: 14px 16px;
    background: var(--tbb-light);
    color: var(--tbb-deep);
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.client-table td {
    padding: 17px 16px;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

.client-table tbody tr:hover {
    background: #fbfefe;
}

.client-email {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.client-status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
}

.client-status-active {
    color: #17624e;
    background: #e9f8f2;
}

.client-status-warning {
    color: #775719;
    background: #fff6d9;
}

.client-status-expired {
    color: #7a3434;
    background: #fdecec;
}

.client-status-disabled {
    color: #555f63;
    background: #edf0f1;
}

.client-action-cell {
    text-align: right;
}

.client-manage-link {
    font-weight: bold;
    text-decoration: none;
}

.client-manage-link:hover {
    text-decoration: underline;
}

.empty-state {
    padding: 50px 25px;
    text-align: center;
}

.empty-state h2 {
    color: var(--tbb-deep);
}

@media (max-width: 700px) {
    .client-page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .client-page-heading .admin-action {
        text-align: center;
    }
}

.client-record-nav {
    margin-bottom: 16px;
    font-size: 14px;
}

.client-record-nav a {
    font-weight: bold;
    text-decoration: none;
}

.client-record-nav a:hover {
    text-decoration: underline;
}

.client-record-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.client-record-heading h1 {
    margin-bottom: 8px;
}

.client-record-heading p {
    margin: 0;
}

.client-record-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.client-record-card {
    padding: 26px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 78, 87, 0.05);
}

.client-record-card h2 {
    margin: 0 0 20px;
    color: var(--tbb-deep);
    font-size: 19px;
}

.client-details {
    margin: 0;
}

.client-details > div {
    display: grid;
    grid-template-columns: 145px 1fr;
    gap: 15px;
    padding: 11px 0;
    border-top: 1px solid #edf2f3;
}

.client-details > div:first-child {
    padding-top: 0;
    border-top: 0;
}

.client-details dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: bold;
}

.client-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.client-controls-preview {
    margin-bottom: 40px;
}

.control-placeholder {
    opacity: 0.55;
    cursor: default;
}

@media (max-width: 750px) {
    .client-record-grid {
        grid-template-columns: 1fr;
    }

    .client-record-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .client-details > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.access-management-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.access-form-card {
    margin-top: 24px;
}

.access-form-card .form-section {
    min-height: 285px;
}

.access-description {
    min-height: 42px;
    margin-bottom: 24px;
}

.access-alert {
    margin-top: 24px;
    margin-bottom: 0;
}

@media (max-width: 750px) {
    .access-management-grid {
        grid-template-columns: 1fr;
    }

    .access-form-card .form-section,
    .access-description {
        min-height: 0;
    }
}

.password-reset-page {
    max-width: 850px;
}

.password-note {
    margin-bottom: 24px;
}

.status-control-card {
    max-width: 760px;
    margin-top: 24px;
    padding: 30px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 78, 87, 0.05);
}

.status-control-card h2 {
    margin-top: 0;
    color: var(--tbb-deep);
}

.status-control-card p {
    line-height: 1.6;
}

.status-control-note {
    color: var(--muted);
    font-size: 14px;
}

.status-warning {
    margin: 24px 0;
    padding: 15px;
    color: #7a3434;
    background: #fff2f2;
    border: 1px solid #efc7c7;
    border-radius: 6px;
    line-height: 1.5;
}

.danger-button {
    display: inline-block;
    padding: 12px 18px;
    border: 0;
    border-radius: 6px;
    background: #a93c3c;
    color: var(--white);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.danger-button:hover {
    filter: brightness(1.08);
}

.status-enable-button {
    width: auto;
    margin-top: 12px;
}

.status-cancel {
    display: inline-block;
    margin-top: 20px;
    font-size: 14px;
    font-weight: bold;
}

.disable-account-link {
    color: #8d3838;
    border-color: #d9aaaa;
}

.disable-account-link:hover {
    color: #762b2b;
    background: #fff3f3;
}

.enable-account-link {
    color: #17624e;
    border-color: #9fcfbe;
}

.enable-account-link:hover {
    color: #11503f;
    background: #edf9f4;
}

.status-alert {
    max-width: 760px;
    margin-top: 24px;
    margin-bottom: 0;
}