html,
body {
    min-height: 100%;
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: #f4f6f8;
}

a {
    color: inherit;
}

h1:focus {
    outline: none;
}

.page-heading {
    gap: 1rem;
}

.muted-text {
    color: #667085;
}

.surface-panel {
    border: 1px solid #dde3ea;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.active-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.active-user-card {
    border: 1px solid #dde3ea;
    border-radius: 8px;
    background: #fff;
    padding: 20px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.06);
}

.active-user-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.active-user-avatar {
    flex: 0 0 auto;
    font-weight: 700;
}

.active-user-title {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.active-user-name {
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.active-user-times {
    display: grid;
    gap: 12px;
}

.active-user-time {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid #edf1f5;
    border-radius: 8px;
    background: #f8fafc;
}

.active-user-time .mud-icon-root {
    color: #1976d2;
    margin-top: 2px;
}

.active-users-empty {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
}

.users-heading {
    align-items: flex-start;
}

.users-heading-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.users-toolbar {
    border: 1px solid #dde3ea;
    border-radius: 8px;
    background: #fff;
    padding: 14px;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: center;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.05);
}

.users-search {
    min-width: 0;
}

.users-mode-switch {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}

.new-user-panel {
    border: 1px solid #dde3ea;
    border-radius: 8px;
    background: #fff;
    padding: 16px;
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.06);
}

.new-user-header {
    gap: 1rem;
}

.new-user-actions {
    flex-wrap: wrap;
}

.new-user-switch-cell,
.new-user-verification-cell {
    display: flex;
    align-items: center;
}

.new-user-verification-cell {
    gap: 16px;
}

.verification-title {
    flex: 0 0 auto;
}

.verification-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
}

.user-card {
    min-height: 230px;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    background: #fff;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.06);
}

.user-card-inactive {
    background: #fafbfc;
}

.user-card-top {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.user-card-avatar {
    font-weight: 800;
}

.user-card-identity {
    min-width: 0;
    display: grid;
    justify-items: center;
}

.user-card-title {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.user-card-name {
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.user-card-account {
    width: 100%;
    display: block;
    text-align: left;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.user-card-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.user-card-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.user-card-chips .mud-icon-button {
    margin-left: auto;
}

.user-card-details {
    display: grid;
    gap: 8px;
    margin-top: auto;
}

.user-card-detail {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 9px 10px;
    border: 1px solid #edf1f5;
    border-radius: 8px;
    background: #f8fafc;
}

.user-card-detail .mud-icon-root {
    color: #1976d2;
    margin-top: 2px;
}

.users-empty {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
}

.user-details-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.42);
}

.user-details-dialog {
    width: min(620px, 100%);
    max-height: min(86vh, 760px);
    overflow: auto;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    background: #fff;
    padding: 18px;
    box-shadow: 0 28px 80px rgba(16, 24, 40, 0.24);
}

.user-details-header {
    gap: 1rem;
}

.user-details-list {
    display: grid;
}

.user-details-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 7px 0;
    border-bottom: 1px solid #edf1f5;
}

.user-details-row:last-child {
    border-bottom: 0;
}

.user-details-row .mud-icon-root {
    color: #1976d2;
    margin-top: 2px;
}

.profile-heading {
    align-items: flex-start;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.profile-identity-panel,
.profile-form-panel {
    border: 1px solid #dde3ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(16, 24, 40, 0.07);
}

.profile-identity-panel {
    min-height: 420px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(25, 118, 210, 0.14), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
}

.profile-avatar-ring {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e8f1fb;
    border: 1px solid #cfe0f4;
}

.profile-avatar {
    width: 118px !important;
    height: 118px !important;
    font-size: 2.35rem !important;
    font-weight: 800;
    box-shadow: 0 18px 40px rgba(25, 118, 210, 0.26);
}

.profile-identity-copy {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.profile-identity-copy .mud-typography {
    overflow-wrap: anywhere;
}

.profile-company {
    width: 100%;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #edf1f5;
    border-radius: 8px;
    background: #fff;
    color: #344054;
    text-align: left;
}

.profile-company .mud-icon-root {
    color: #1976d2;
}

.profile-form-panel {
    padding: 30px;
}

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

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(460px, 620px);
    gap: 0;
    align-items: stretch;
    padding: 0;
    background: #eef2f6;
}

.login-visual {
    min-height: 100vh;
    border-radius: 0;
    background:
        linear-gradient(130deg, rgba(12, 20, 30, 0.9), rgba(14, 88, 116, 0.7)),
        url("images/login-screen.jpg");
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: end;
    padding: 64px;
    color: #fff;
}

.login-copy {
    max-width: 720px;
}

.login-eyebrow {
    color: rgba(255, 255, 255, 0.74);
    font-weight: 700;
}

.login-copy .mud-typography-h2 {
    font-weight: 800;
    max-width: 760px;
    line-height: 1.04;
    margin-top: 8px;
    margin-bottom: 16px;
}

.login-panel-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 56px;
    background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
    border-left: 1px solid #d9e0e8;
}

.login-panel {
    width: 100%;
    max-width: 540px;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    padding: 52px 48px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(16, 24, 40, 0.16);
}

.login-header {
    padding-bottom: 8px;
}

.login-actions {
    flex-wrap: wrap;
    padding-top: 8px;
}

.login-actions .mud-button {
    min-height: 42px;
}

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

    .profile-identity-panel {
        min-height: 320px;
    }

    .users-toolbar {
        grid-template-columns: 1fr;
    }

    .users-mode-switch {
        justify-content: flex-start;
    }

    .login-page {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .login-visual {
        min-height: 340px;
        border-radius: 0 0 8px 8px;
        padding: 32px;
    }

    .login-panel-wrap {
        min-height: auto;
        padding: 24px 18px 32px;
        border-left: 0;
    }

    .login-panel {
        max-width: none;
        padding: 34px;
    }
}

@media (max-width: 600px) {
    .content-shell {
        padding: 18px;
    }

    .profile-heading {
        display: grid !important;
    }

    .users-heading {
        display: grid !important;
    }

    .users-heading-actions {
        justify-content: flex-start;
    }

    .user-card-top {
        grid-template-columns: 56px minmax(0, 1fr) auto;
    }

    .user-card-account {
        padding-left: 0;
    }

    .profile-form-panel,
    .profile-identity-panel {
        padding: 22px;
    }

    .login-copy .mud-typography-h2 {
        font-size: 2.25rem;
    }
}
