* {
    box-sizing: border-box;
}

html {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

body {
    margin: 0;
    background: #f4f7fb;
    color: #182033;
}


/* LOGIN */

.login-page {
    min-height: 100vh;
}

.login-wrapper {
    min-height: 100vh;

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

    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 430px;

    background: white;

    padding: 42px;

    border-radius: 18px;

    box-shadow:
        0 12px 40px rgba(20, 30, 55, 0.10);
}

.brand {
    margin-bottom: 36px;
}

.brand-name {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
}

.brand-product {
    color: #667085;
    margin-top: 3px;
}

.login-card h1 {
    margin-bottom: 8px;
    font-size: 30px;
}

.login-description {
    margin-top: 0;
    margin-bottom: 28px;
    color: #667085;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    font-size: 14px;
    font-weight: 600;

    margin-bottom: 8px;
}

.form-control {
    width: 100%;

    padding: 13px 14px;

    border: 1px solid #d0d5dd;
    border-radius: 9px;

    font-size: 16px;

    background: white;

    outline: none;
}

.form-control:focus {
    border-color: #344054;

    box-shadow:
        0 0 0 3px rgba(52, 64, 84, 0.10);
}

.btn-primary {
    width: 100%;

    border: none;
    border-radius: 9px;

    padding: 14px 18px;

    background: #101828;
    color: white;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;
}

.btn-primary:hover {
    opacity: 0.94;
}

.login-footer {
    margin-top: 26px;

    text-align: center;

    font-size: 13px;
    color: #98a2b3;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;

    margin-bottom: 20px;

    font-size: 14px;
}

.alert-error {
    background: #fef3f2;
    color: #b42318;
}


/* DASHBOARD */

.topbar {
    min-height: 70px;

    background: #101828;
    color: white;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 32px;
}

.portal-label {
    margin-left: 10px;
    color: #d0d5dd;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logout-link {
    color: white;
    text-decoration: none;
}

.dashboard-container {
    max-width: 1300px;

    margin: auto;

    padding: 40px 32px;
}

.page-heading h1 {
    margin: 0;
    font-size: 34px;
}

.page-heading p {
    color: #667085;
}

.dashboard-grid {
    margin-top: 30px;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 20px;
}

.dashboard-card {
    background: white;

    border: 1px solid #e4e7ec;
    border-radius: 14px;

    padding: 24px;

    min-height: 150px;
}

.dashboard-card h3 {
    margin-top: 0;
}

.dashboard-card p {
    color: #667085;
}


/* TABLET */

@media (max-width: 900px) {

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

}


/* MOBILE */

@media (max-width: 600px) {

    .login-wrapper {
        padding: 16px;
    }

    .login-card {
        padding: 28px 22px;
        border-radius: 14px;
    }

    .login-card h1 {
        font-size: 26px;
    }

    .topbar {
        padding: 14px 18px;

        align-items: flex-start;
    }

    .portal-label {
        display: block;
        margin-left: 0;
        font-size: 13px;
    }

    .topbar-user {
        flex-direction: column;
        align-items: flex-end;

        gap: 4px;

        font-size: 13px;
    }

    .dashboard-container {
        padding: 26px 18px;
    }

    .page-heading h1 {
        font-size: 27px;
    }

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

}

/* LOGOUT BUTTON */

.logout-form {
    margin: 0;
}

.logout-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: white;
    font: inherit;
    cursor: pointer;
}

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


/* CLIENT MANAGEMENT */

.clients-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.secondary-button {
    border: 0;
    border-radius: 9px;
    padding: 12px 18px;
    background: #101828;
    color: white;
    font-size: 15px;
    font-weight: 600;
}

.secondary-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.table-card {
    margin-top: 30px;
    background: white;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    overflow: hidden;
}

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

.client-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.client-table th,
.client-table td {
    padding: 18px 20px;
    text-align: left;
    border-bottom: 1px solid #eaecf0;
}

.client-table th {
    font-size: 13px;
    color: #667085;
    text-transform: uppercase;
}

.client-table tbody tr:last-child td {
    border-bottom: 0;
}

.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    text-transform: capitalize;
}

.status-active {
    background: #ecfdf3;
    color: #027a48;
}

.status-suspended {
    background: #fffaeb;
    color: #b54708;
}

.status-disabled {
    background: #fef3f2;
    color: #b42318;
}

.empty-state {
    margin-top: 30px;
    padding: 60px 24px;
    background: white;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    text-align: center;
}

.empty-state h2 {
    margin-top: 0;
}

.empty-state p {
    color: #667085;
}


@media (max-width: 600px) {

    .clients-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .secondary-button {
        width: 100%;
    }

    .empty-state {
        padding: 40px 20px;
    }

}


/* ADD CLIENT */

.button-link {
    display: inline-block;
    text-decoration: none;
}

.form-card {
    margin-top: 30px;

    background: white;

    border: 1px solid #e4e7ec;
    border-radius: 14px;

    padding: 30px;
}

.form-section {
    padding-bottom: 30px;
    margin-bottom: 30px;

    border-bottom: 1px solid #eaecf0;
}

.form-section:last-of-type {
    border-bottom: 0;
}

.form-section h2 {
    margin-top: 0;
    margin-bottom: 8px;

    font-size: 20px;
}

.section-description {
    margin-top: 0;
    margin-bottom: 20px;

    color: #667085;
}

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;
}

.field-help {
    margin-top: 6px;

    color: #667085;
    font-size: 13px;
}

.feature-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}

.feature-option {
    display: flex;

    align-items: flex-start;

    gap: 12px;

    border: 1px solid #e4e7ec;
    border-radius: 10px;

    padding: 16px;

    cursor: pointer;
}

.feature-option:hover {
    background: #f9fafb;
}

.feature-option input {
    margin-top: 3px;

    width: 18px;
    height: 18px;
}

.feature-option strong {
    display: block;
}

.feature-option small {
    display: block;

    margin-top: 5px;

    line-height: 1.4;

    color: #667085;
}

.form-actions {
    display: flex;

    justify-content: flex-end;
    align-items: center;

    gap: 12px;
}

.cancel-button {
    padding: 11px 16px;

    color: #344054;

    text-decoration: none;
}


@media (max-width: 700px) {

    .form-card {
        padding: 22px 18px;
    }

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

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .secondary-button,
    .form-actions .cancel-button {
        width: 100%;

        text-align: center;
    }

}


/* CLIENT OVERVIEW */

.client-link {
    color: #101828;
    text-decoration: none;
}

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

.back-link {
    display: inline-block;
    margin-bottom: 24px;
    color: #475467;
    text-decoration: none;
}

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

.client-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.client-title-row h1 {
    margin: 5px 0;
    font-size: 34px;
}

.client-title-row p {
    margin: 0;
    color: #667085;
}

.client-code-label {
    font-size: 13px;
    font-weight: 700;
    color: #667085;
    letter-spacing: 0.5px;
}

.summary-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 30px;
}

.summary-card {
    background: white;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    padding: 22px;
}

.summary-card span {
    display: block;
    color: #667085;
    font-size: 14px;
}

.summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.detail-card {
    margin-top: 24px;
    background: white;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    padding: 28px;
}

.detail-card-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 26px;
}

.detail-card-heading h2 {
    margin: 0;
}

.detail-card-heading p {
    margin: 6px 0 0;
    color: #667085;
}

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

.detail-item span,
.detail-item small {
    display: block;
    color: #667085;
}

.detail-item span {
    margin-bottom: 7px;
    font-size: 13px;
}

.detail-item small {
    margin-top: 5px;
    font-size: 12px;
}

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

.feature-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;

    border: 1px solid #eaecf0;
    border-radius: 10px;
    padding: 16px;
}

.feature-summary strong,
.feature-summary small {
    display: block;
}

.feature-summary small {
    margin-top: 5px;
    color: #667085;
}

.feature-enabled {
    color: #027a48;
    font-weight: 600;
    font-size: 13px;
}

.feature-disabled {
    color: #667085;
    font-size: 13px;
}

.client-module-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.module-card {
    background: white;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    padding: 22px;
}

.module-card h3 {
    margin-top: 0;
}

.module-card p {
    color: #667085;
    min-height: 44px;
}

.module-card span {
    font-size: 13px;
    font-weight: 600;
    color: #475467;
}

.muted-text {
    color: #667085;
}


@media (max-width: 900px) {

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

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

}


@media (max-width: 600px) {

    .client-title-row,
    .detail-card-heading {
        flex-direction: column;
    }

    .summary-grid,
    .client-module-grid,
    .detail-grid,
    .feature-summary-grid {
        grid-template-columns: 1fr;
    }

    .detail-card {
        padding: 22px 18px;
    }

    .detail-card-heading .secondary-button {
        width: 100%;
    }

}


/* READ-ONLY / PERMANENT FIELDS */

.readonly-field {
    background: #f2f4f7;
    color: #667085;
    cursor: not-allowed;
}


/* FEATURE MANAGEMENT */

.feature-management-list {
    display: grid;
    gap: 14px;
}

.feature-management-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    border: 1px solid #e4e7ec;
    border-radius: 12px;

    padding: 18px;

    cursor: pointer;
}

.feature-management-item:hover {
    background: #f9fafb;
}

.feature-management-info {
    flex: 1;
}

.feature-management-info strong,
.feature-management-info span,
.feature-management-info small {
    display: block;
}

.feature-management-info span {
    margin-top: 5px;

    color: #667085;

    font-size: 14px;
}

.feature-management-info small {
    margin-top: 7px;

    color: #475467;

    font-size: 12px;
}


/* TOGGLE */

.toggle-control {
    position: relative;

    width: 48px;
    height: 26px;

    flex: 0 0 auto;
}

.toggle-control input {
    opacity: 0;

    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;

    inset: 0;

    background: #d0d5dd;

    border-radius: 999px;

    transition: 0.2s;
}

.toggle-slider::before {
    content: "";

    position: absolute;

    width: 20px;
    height: 20px;

    left: 3px;
    top: 3px;

    background: white;

    border-radius: 50%;

    transition: 0.2s;

    box-shadow:
        0 1px 3px rgba(0,0,0,0.2);
}

.toggle-control input:checked
+ .toggle-slider {
    background: #101828;
}

.toggle-control input:checked
+ .toggle-slider::before {
    transform: translateX(22px);
}

.feature-actions {
    margin-top: 28px;
}


@media (max-width: 600px) {

    .feature-management-item {
        padding: 16px;
    }

}
