@font-face {
    font-family: "Lato";
    src: url("fonts/Lato-Regular.woff") format("woff");
    font-display: swap;
    font-style: normal;
    font-weight: 400;
}

@font-face {
    font-family: "Lato";
    src: url("fonts/Lato-Bold.woff") format("woff");
    font-display: swap;
    font-style: normal;
    font-weight: 700;
}

:root {
    --ink: #102a3d;
    --muted: #6f8190;
    --blue: #105787;
    --cyan: #00aeda;
    --cyan-dark: #008fba;
    --red: #d5090a;
    --surface: #ffffff;
    --line: #dce8ee;
    --panel: #f8fbfd;
    --shadow: 0 28px 80px rgba(17, 75, 105, 0.13);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    color-scheme: light;
    background: var(--panel);
    font-family: "Lato", Arial, sans-serif;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--panel);
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    color: inherit;
    font: inherit;
}

button {
    cursor: pointer;
}

.login-page {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(440px, 1.05fr) minmax(520px, 0.95fr);
}

.brand-panel {
    position: relative;
    display: flex;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 78%, rgba(255, 255, 255, 0.95) 0 5%, transparent 34%),
        radial-gradient(circle at 91% 16%, rgba(255, 255, 255, 0.78) 0 4%, transparent 30%),
        linear-gradient(145deg, #f1fbff 0%, #d9f2ff 45%, #c6eafa 100%);
}

.brand-panel::before,
.brand-panel::after {
    position: absolute;
    content: "";
    border-radius: 50%;
    pointer-events: none;
}

.brand-panel::before {
    width: 420px;
    height: 420px;
    right: -220px;
    top: 11%;
    border: 1px solid rgba(16, 87, 135, 0.1);
    box-shadow:
        0 0 0 60px rgba(255, 255, 255, 0.16),
        0 0 0 120px rgba(255, 255, 255, 0.09);
}

.brand-panel::after {
    width: 250px;
    height: 250px;
    left: -110px;
    bottom: -90px;
    background: rgba(255, 255, 255, 0.27);
}

.brand-panel__inner {
    position: relative;
    z-index: 1;
    width: min(100%, 780px);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: clamp(32px, 5vw, 64px) clamp(32px, 6vw, 88px) 34px;
}

.brand-logo {
    width: 202px;
    height: auto;
}

.brand-copy {
    width: min(100%, 610px);
    margin-top: clamp(64px, 10vh, 118px);
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--cyan-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    line-height: 1.2;
    text-transform: uppercase;
}

.brand-copy h1 {
    max-width: 590px;
    margin: 0;
    color: #103d59;
    font-size: clamp(2.7rem, 5.2vw, 4.75rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 0.98;
}

.brand-description {
    max-width: 520px;
    margin: 26px 0 0;
    color: #4f6e80;
    font-size: clamp(1.05rem, 1.5vw, 1.24rem);
    line-height: 1.6;
}

.calendar-preview {
    width: min(100%, 540px);
    margin-top: clamp(44px, 8vh, 78px);
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 24px 55px rgba(16, 87, 135, 0.13);
    backdrop-filter: blur(16px);
}

.calendar-preview__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0 2px 15px;
}

.calendar-preview__month {
    color: var(--blue);
    font-size: 1.1rem;
    font-weight: 700;
}

.calendar-preview__year {
    color: #7892a0;
    font-size: 0.8rem;
}

.calendar-preview__week {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 9px;
}

.day-pill {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.72);
    color: #718894;
}

.day-pill span {
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.day-pill strong {
    color: #31596f;
    font-size: 1.1rem;
}

.day-pill--active {
    background: var(--cyan);
    box-shadow: 0 12px 24px rgba(0, 174, 218, 0.24);
    color: rgba(255, 255, 255, 0.82);
}

.day-pill--active strong {
    color: #fff;
}

.calendar-preview__appointment {
    min-height: 52px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    padding: 0 15px;
    border-radius: 15px;
    background: #fff;
}

.appointment-time {
    color: var(--blue);
    font-size: 0.82rem;
    font-weight: 700;
}

.appointment-line {
    height: 1px;
    background: #e4eef2;
}

.appointment-status {
    color: #5e7b8b;
    font-size: 0.74rem;
}

.brand-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: auto 0 0;
    padding-top: 28px;
    color: #64808f;
    font-size: 0.78rem;
}

.brand-note__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #28a96b;
    box-shadow: 0 0 0 5px rgba(40, 169, 107, 0.12);
}

.login-panel {
    position: relative;
    display: flex;
    min-height: 100vh;
    min-height: 100svh;
    align-items: center;
    justify-content: center;
    padding: 56px clamp(32px, 6vw, 96px) 76px;
    background: var(--surface);
}

.login-card {
    width: min(100%, 430px);
}

.mobile-brand {
    display: none;
}

.login-heading .eyebrow {
    margin-bottom: 13px;
}

.login-heading h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(2rem, 3.2vw, 2.7rem);
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.login-heading > p:last-child {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.55;
}

.form-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 24px;
    padding: 13px 15px;
    border: 1px solid #f3cccc;
    border-radius: 12px;
    background: #fff6f6;
    color: #a51d1e;
    font-size: 0.88rem;
    line-height: 1.4;
}

.form-message svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.login-form {
    display: grid;
    gap: 22px;
    margin-top: 42px;
}

.remember-choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #365668;
    font-size: 0.9rem;
    cursor: pointer;
}
.remember-choice input { width: 18px; height: 18px; flex: 0 0 auto; margin: 2px 0 0; accent-color: #008ab1; }
.remember-choice span { display: flex; flex-direction: column; gap: 4px; }
.remember-choice small { color: #81939d; font-size: 0.78rem; }
.security-divider { border: 0; border-top: 1px solid #edf2f5; margin: 28px 0; }

.field {
    display: grid;
    gap: 9px;
}

.field label {
    color: #294759;
    font-size: 0.86rem;
    font-weight: 700;
}

.field-control {
    position: relative;
}

.field-control > svg {
    position: absolute;
    top: 50%;
    left: 17px;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: #7f96a3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.65;
    transform: translateY(-50%);
    pointer-events: none;
}

.field-control input {
    width: 100%;
    min-height: 58px;
    padding: 16px 52px 16px 50px;
    border: 1px solid var(--line);
    border-radius: 13px;
    outline: none;
    background: #fbfdfe;
    color: var(--ink);
    font-size: 1rem;
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease;
}

.field-control input::placeholder {
    color: #9aabb4;
}

.field-control input:hover {
    border-color: #c4d7df;
    background: #fff;
}

.field-control input:focus {
    border-color: var(--cyan);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 174, 218, 0.12);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #78909d;
    transform: translateY(-50%);
    transition:
        color 160ms ease,
        background-color 160ms ease;
}

.password-toggle:hover {
    background: #edf7fa;
    color: var(--cyan-dark);
}

.password-toggle svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.eye-closed,
.password-toggle[aria-pressed="true"] .eye-open {
    display: none;
}

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

.submit-button {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-top: 4px;
    padding: 14px 24px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(120deg, var(--cyan) 0%, #009bc7 100%);
    box-shadow: 0 14px 28px rgba(0, 161, 204, 0.22);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    transition:
        box-shadow 160ms ease,
        transform 160ms ease,
        filter 160ms ease;
}

.submit-button:hover {
    filter: brightness(0.97);
    box-shadow: 0 17px 32px rgba(0, 145, 185, 0.28);
    transform: translateY(-1px);
}

.submit-button:active {
    box-shadow: 0 8px 18px rgba(0, 145, 185, 0.2);
    transform: translateY(1px);
}

.submit-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.support-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #edf2f4;
    color: #81929c;
}

.support-note svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.support-note p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.45;
}

.copyright {
    position: absolute;
    bottom: 24px;
    margin: 0;
    color: #a0afb7;
    font-size: 0.72rem;
}

:where(button, input):focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

@media (max-width: 1050px) {
    .login-page {
        grid-template-columns: minmax(370px, 0.9fr) minmax(470px, 1.1fr);
    }

    .brand-panel__inner {
        padding-inline: 42px;
    }

    .brand-copy h1 {
        font-size: clamp(2.55rem, 5.2vw, 3.7rem);
    }
}

@media (max-width: 800px) {
    .login-page {
        display: block;
    }

    .brand-panel {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        min-height: 100svh;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 30px 24px 70px;
        background:
            radial-gradient(circle at 100% 0, rgba(0, 174, 218, 0.11), transparent 34%),
            radial-gradient(circle at 0 100%, rgba(183, 220, 255, 0.22), transparent 36%),
            #fff;
    }

    .login-card {
        width: 100%;
        margin: auto;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        margin-bottom: clamp(54px, 10vh, 94px);
    }

    .mobile-brand img {
        width: 172px;
        height: auto;
    }

    .copyright {
        position: static;
        align-self: center;
        margin-top: 44px;
    }
}

@media (max-width: 480px) {
    .login-panel {
        padding-inline: 19px;
    }

    .mobile-brand {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 54px;
    }

    .mobile-brand img {
        width: 165px;
    }

    .login-heading h2 {
        font-size: 2rem;
    }

    .login-form {
        margin-top: 34px;
    }
}

@media (max-height: 720px) and (min-width: 801px) {
    .brand-copy {
        margin-top: 42px;
    }

    .calendar-preview {
        margin-top: 30px;
    }

    .login-panel {
        padding-top: 35px;
        padding-bottom: 54px;
    }

    .login-form {
        margin-top: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Internal workspace */

.submit-button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
    box-shadow: none;
    transform: none;
}

.form-message--info {
    border-color: #bfe5f1;
    background: #f0fbff;
    color: #16617e;
}

.form-message--success {
    border-color: #bee8d0;
    background: #f2fcf6;
    color: #21724a;
}

.app-body {
    min-height: 100vh;
    background: #f4f8fb;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 264px;
    display: flex;
    flex-direction: column;
    padding: 30px 20px 22px;
    border-right: 1px solid #dfeaf0;
    background: #fff;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    padding: 0 12px 29px;
    border-bottom: 1px solid #edf2f5;
}

.sidebar-brand img {
    width: 178px;
    height: auto;
}

.app-nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding-top: 26px;
}

.app-nav__link {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 13px;
    border-radius: 12px;
    color: #657b88;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease;
}

.nav-new-count { margin-left: auto; min-width: 25px; padding: 4px 7px; border-radius: 7px; background: #c6442d; color: #fff; font-size: .72rem; text-align: center; font-weight: 700; }

.app-nav__link:hover {
    background: #f0f8fb;
    color: var(--blue);
}

.app-nav__link.is-active {
    background: linear-gradient(100deg, #e6f8fd, #f1fbfe);
    color: #008ab1;
}

.app-nav__link svg,
.icon-button svg,
.primary-button svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.sidebar-footer { margin-top: auto; padding-top: 20px; }
.sidebar-trash { margin-bottom: 12px; }
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 18px 6px 0;
    border-top: 1px solid #edf2f5;
}

.app-install-button {border:0;background:transparent;text-align:left;font-family:inherit;width:100%;cursor:pointer}
.app-install-button[hidden] {display:none}
.install-dialog {border:1px solid #d8e6ed;border-radius:18px;padding:28px;width:min(440px,calc(100% - 30px));color:#244d62;box-shadow:0 20px 80px #153d5030}
.install-dialog::backdrop {background:#153d5060}
.install-dialog h2 {font-size:1.25rem;margin:0 0 16px}
.install-dialog p {font-size:.9rem;line-height:1.65;margin:0 0 20px}
.install-dialog .install-note {font-size:.77rem;color:#627f8f}

.profile-avatar,
.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(145deg, #d6f4fd, #bce8f6);
    color: #08779b;
    font-weight: 700;
}

.profile-avatar {
    width: 38px;
    height: 38px;
    font-size: 0.88rem;
}

.profile-copy {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
}

.profile-copy strong,
.profile-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-copy strong {
    color: #264556;
    font-size: 0.8rem;
}

.profile-copy small {
    color: #8b9ba4;
    font-size: 0.66rem;
}

.icon-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #78909c;
}

.icon-button:hover {
    background: #edf7fa;
    color: var(--cyan-dark);
}

.app-workspace {
    width: calc(100% - 264px);
    min-width: 0;
    margin-left: 264px;
}

.mobile-app-header {
    display: none;
}

.app-main {
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: 46px clamp(28px, 4vw, 64px) 70px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 30px;
}

.page-heading h1 {
    margin: 0;
    color: #17394d;
    font-size: clamp(2rem, 3.6vw, 3rem);
    letter-spacing: -0.04em;
    line-height: 1;
}

.page-heading > div > p:last-child {
    margin: 13px 0 0;
    color: #718691;
    line-height: 1.55;
}

.primary-button,
.secondary-button,
.primary-link {
    min-height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 18px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(120deg, var(--cyan), #0097c3);
    box-shadow: 0 10px 22px rgba(0, 157, 199, 0.18);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.primary-button:hover,
.primary-link:hover {
    filter: brightness(0.97);
}

.secondary-button {
    border: 1px solid #d8e6ed;
    background: #fff;
    box-shadow: none;
    color: #416274;
}

.create-user-panel {
    position: relative;
}

.create-user-panel > summary {
    list-style: none;
}

.create-user-panel > summary::-webkit-details-marker,
.user-editor > summary::-webkit-details-marker {
    display: none;
}

.create-user-panel__body {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 15;
    width: min(780px, calc(100vw - 320px));
    padding: 25px;
    border: 1px solid #dfeaf0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(20, 67, 92, 0.18);
}

.app-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 24px;
    padding: 17px 19px;
    border: 1px solid #bfe7cf;
    border-radius: 14px;
    background: #f3fcf7;
    color: #276b48;
}

.app-alert--error {
    border-color: #f1c8c8;
    background: #fff6f6;
    color: #9b2526;
}

.app-alert--info {
    border-color: #c8e6ef;
    background: #f2fbfe;
    color: #1c6680;
}

.app-alert strong {
    font-size: 0.87rem;
}

.app-alert p {
    margin: 4px 0 0;
    font-size: 0.83rem;
    line-height: 1.45;
}

.secret-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px;
    border: 1px dashed #9cd3b4;
    border-radius: 10px;
    background: #fff;
}

.secret-box code {
    padding: 0 7px;
    color: #1d4d36;
    font-family: Consolas, monospace;
    font-size: 0.88rem;
    font-weight: 700;
}

.secret-box button {
    min-height: 34px;
    padding: 7px 10px;
    border: 0;
    border-radius: 8px;
    background: #e3f6eb;
    color: #26724b;
    font-size: 0.75rem;
    font-weight: 700;
}

.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    min-width: 0;
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border: 1px solid #e0ebf0;
    border-radius: 16px;
    background: #fff;
}

.stat-card span {
    color: #778b96;
    font-size: 0.79rem;
    line-height: 1.35;
}

.stat-card strong {
    color: #20465a;
    font-size: 1.75rem;
}

.stat-card--active strong {
    color: #269262;
}

.stat-card--attention strong {
    color: #d08a26;
}

.content-section,
.password-card,
.password-advice {
    padding: 27px;
    border: 1px solid #e0ebf0;
    border-radius: 18px;
    background: #fff;
}

.content-section + .content-section {
    margin-top: 24px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 21px;
}

.section-kicker {
    display: block;
    margin-bottom: 7px;
    color: #00a0ca;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.section-heading h2,
.password-advice h2 {
    margin: 0;
    color: #1e4154;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.section-heading > p {
    margin: 3px 0 0;
    color: #8a9aa3;
    font-size: 0.77rem;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.user-card {
    overflow: hidden;
    border: 1px solid #e2ecf1;
    border-radius: 14px;
    background: #fbfdfe;
}

.user-card.is-disabled {
    background: #f7f8f9;
}

.user-card__summary {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 16px;
}

.user-avatar {
    width: 44px;
    height: 44px;
}

.is-disabled .user-avatar {
    background: #e5eaed;
    color: #8798a1;
}

.user-identity {
    min-width: 170px;
    flex: 1 1 auto;
}

.user-identity h3 {
    margin: 0;
    color: #294c5f;
    font-size: 0.94rem;
}

.user-identity p {
    margin: 5px 0 0;
    color: #8799a2;
    font-size: 0.72rem;
}

.user-badges,
.user-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
    border-radius: 999px;
    background: #edf4f7;
    color: #5b7584;
    font-size: 0.66rem;
    font-weight: 700;
    white-space: nowrap;
}

.role-badge--superadmin {
    background: #e8f6fb;
    color: #087ea4;
}

.role-badge--doctor {
    background: #ecf8f1;
    color: #2f8259;
}

.role-badge--manager {
    background: #fff4e5;
    color: #9c6b25;
}

.status-badge::before {
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: #9eabb1;
    content: "";
}

.status-badge.is-active {
    background: #ebf8f1;
    color: #317a55;
}

.status-badge.is-active::before {
    background: #37aa73;
}

.text-button {
    padding: 7px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #287898;
    font-size: 0.72rem;
    font-weight: 700;
}

.text-button:hover {
    background: #eaf6fa;
}

.text-button--danger {
    color: #b64a4b;
}

.text-button--danger:hover {
    background: #fff0f0;
}

.user-editor {
    border-top: 1px solid #e7eff3;
    background: #fff;
}

.user-editor > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 17px;
    color: #567482;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
    list-style: none;
}

.user-editor[open] > summary span {
    transform: rotate(180deg);
}

.management-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.user-editor .management-form {
    padding: 8px 17px 19px;
}

.form-row {
    display: flex;
    gap: 13px;
}

.form-row > * {
    min-width: 0;
    flex: 1 1 0;
}

.compact-field {
    gap: 7px;
}

.compact-field input,
.compact-field select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #d8e6ed;
    border-radius: 10px;
    outline: none;
    background: #fbfdfe;
    color: #244658;
    font: inherit;
    font-size: 0.86rem;
}

.compact-field input:focus,
.compact-field select:focus {
    border-color: var(--cyan);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 174, 218, 0.1);
}

.compact-field > small {
    color: #8a9aa3;
    font-size: 0.71rem;
    line-height: 1.45;
}

.permission-fieldset {
    min-width: 0;
    margin: 0;
    padding: 15px;
    border: 1px solid #e1ebf0;
    border-radius: 12px;
}

.permission-fieldset legend {
    padding: 0 6px;
    color: #35586a;
    font-size: 0.78rem;
    font-weight: 700;
}

.permission-fieldset > p {
    margin: 0 0 12px;
    color: #8798a1;
    font-size: 0.72rem;
}

.permission-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.permission-check {
    min-width: 190px;
    display: flex;
    flex: 1 1 30%;
    align-items: flex-start;
    gap: 9px;
    padding: 10px;
    border-radius: 9px;
    background: #f6fafc;
    cursor: pointer;
}

.permission-check:has(input:checked) {
    background: #edf9fc;
}

.permission-check:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.5;
}

.permission-check input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--cyan);
}

.permission-check span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.permission-check strong {
    color: #365a6c;
    font-size: 0.74rem;
    line-height: 1.25;
}

.permission-check small {
    color: #8a9da7;
    font-size: 0.65rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.audit-list {
    display: flex;
    flex-direction: column;
}

.audit-row {
    min-height: 57px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 4px;
    border-top: 1px solid #eef3f5;
}

.audit-row:first-child {
    border-top: 0;
}

.audit-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #55bdd5;
    box-shadow: 0 0 0 5px #edf9fc;
}

.audit-row > div {
    min-width: 0;
    flex: 1 1 auto;
}

.audit-row strong {
    color: #365868;
    font-size: 0.78rem;
}

.audit-row p {
    margin: 3px 0 0;
    color: #8799a2;
    font-size: 0.68rem;
}

.audit-row time {
    color: #8b9ca4;
    font-size: 0.68rem;
    white-space: nowrap;
}

.password-section {
    display: flex;
    align-items: flex-start;
    gap: 22px;
}

.password-card {
    position: relative;
    width: min(100%, 620px);
}

.security-mark {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: #eaf8fc;
    color: #1592b7;
}

.security-mark svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.password-form {
    max-width: 470px;
}

.password-field {
    position: relative;
}

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

.password-field .password-toggle {
    right: 3px;
}

.password-advice {
    max-width: 340px;
    background: linear-gradient(145deg, #eaf8fd, #f7fcfe);
}

.password-advice ul {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin: 20px 0 0;
    padding-left: 19px;
    color: #607b89;
    font-size: 0.82rem;
    line-height: 1.55;
}

.status-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(145deg, #f0faff, #dff3fc);
}

.status-card {
    width: min(100%, 470px);
    padding: 42px;
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow);
    text-align: center;
}

.status-card h1 {
    margin: 0;
    font-size: 2rem;
}

.status-card > p:not(.eyebrow) {
    margin: 14px 0 24px;
    color: var(--muted);
}

@media (max-width: 1180px) {
    .user-card__summary {
        flex-wrap: wrap;
    }

    .user-identity {
        flex: 1 1 calc(100% - 70px);
    }

    .user-badges {
        margin-left: 59px;
    }

    .user-quick-actions {
        margin-left: auto;
    }
}

@media (max-width: 900px) {
    .app-sidebar {
        width: min(290px, 86vw);
        box-shadow: 18px 0 45px rgba(25, 65, 87, 0.18);
        transform: translateX(-105%);
        transition: transform 180ms ease;
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-workspace {
        width: 100%;
        margin-left: 0;
    }

    .mobile-app-header {
        min-height: 72px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 22px;
        border-bottom: 1px solid #e1ebf0;
        background: #fff;
    }

    .mobile-app-header img {
        width: 142px;
        height: auto;
    }

    .app-main {
        padding-top: 34px;
    }

    .create-user-panel__body {
        width: min(720px, calc(100vw - 56px));
    }
}

@media (max-width: 680px) {
    .app-main {
        padding: 27px 17px 50px;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 19px;
    }

    .page-heading h1 {
        font-size: 2.1rem;
    }

    .create-user-panel > summary {
        width: 100%;
    }

    .create-user-panel__body {
        position: static;
        width: 100%;
        margin-top: 10px;
        padding: 18px;
        box-shadow: 0 14px 34px rgba(20, 67, 92, 0.12);
    }

    .stats-row,
    .password-section,
    .form-row {
        flex-direction: column;
    }

    .stats-row {
        gap: 9px;
    }

    .stat-card {
        min-height: 69px;
    }

    .content-section,
    .password-card,
    .password-advice {
        padding: 19px;
    }

    .section-heading {
        flex-direction: column;
        gap: 6px;
    }

    .user-card__summary {
        gap: 11px;
    }

    .user-avatar {
        width: 40px;
        height: 40px;
    }

    .user-identity {
        flex-basis: calc(100% - 55px);
    }

    .user-badges,
    .user-quick-actions {
        width: 100%;
        margin-left: 0;
    }

    .user-quick-actions {
        justify-content: flex-start;
        border-top: 1px solid #e7eef2;
        padding-top: 8px;
    }

    .user-card__summary > .secondary-button {
        width: 100%;
    }

    .permission-check {
        flex-basis: 100%;
    }

    .app-alert {
        align-items: stretch;
        flex-direction: column;
    }

    .secret-box {
        align-items: stretch;
        flex-direction: column;
    }

    .secret-box code {
        padding: 7px;
        overflow-wrap: anywhere;
        text-align: center;
    }

    .audit-section .section-heading > p {
        display: none;
    }

    .audit-row {
        flex-wrap: wrap;
    }

    .audit-row time {
        width: 100%;
        padding-left: 20px;
    }

    .password-card,
    .password-advice {
        width: 100%;
        max-width: none;
    }

    .security-mark {
        top: 18px;
        right: 18px;
    }

    .status-card {
        padding: 30px 21px;
    }
}
