@media (max-width: 1180px) {
    .users-forms-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .users-hero {
        position: relative;
        overflow: hidden;
        border-color: rgba(96, 165, 250, 0.64);
        background: linear-gradient(135deg, rgba(219, 234, 254, 0.98) 0%, rgba(191, 219, 254, 0.9) 40%, rgba(255, 255, 255, 1) 100%);
        box-shadow: 0 24px 50px rgba(37, 99, 235, 0.16);
    }

    .users-list,
    .users-detail {
        border-color: rgba(191, 219, 254, 0.95);
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
    }

    .users-detail {
        background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(239, 246, 255, 0.95) 100%);
    }

    .users-form__triple,
    .users-form__split,
    .users-forms-grid,
    .users-meta,
    .users-permission-row {
        grid-template-columns: 1fr;
    }

    .users-hero__body,
    .users-section__header,
    .users-detail__header {
        display: grid;
        gap: 16px;
    }

    .users-detail__identity {
        width: 100%;
    }

    .users-hero__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .users-hero__copy {
        gap: 10px;
    }

    .users-title {
        font-size: clamp(2rem, 6vw, 2.5rem);
    }

    .users-text {
        max-width: none;
        font-size: 0.98rem;
    }

    .users-detail__aside {
        width: 100%;
        justify-items: start;
        min-width: 0;
        gap: 12px;
    }

    .users-detail__header-actions {
        width: 100%;
        align-items: flex-start;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .users-detail__last-access,
    .users-detail__header .status {
        text-align: left;
    }

    .users-hero__status {
        padding: 0 20px 20px;
        text-align: left;
    }

    .users-hero__status:not(:empty) {
        margin: 0;
        padding-top: 14px;
        border-top: 1px solid rgba(191, 219, 254, 0.9);
    }

    .users-detail__header .status {
        width: 100%;
    }

    .users-modal-form__actions .button {
        width: 100%;
    }

    .users-empty {
        padding: 22px 20px;
        border-style: solid;
        border-color: rgba(191, 219, 254, 0.92);
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 246, 255, 0.9) 100%);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
    }
}

@media (max-width: 720px) {
    .users-hero__body,
    .users-card__body {
        padding: 24px 20px;
    }

    .users-layout {
        gap: 18px;
    }

    .users-hero__body {
        gap: 20px;
    }

    .users-hero {
        box-shadow: 0 26px 54px rgba(37, 99, 235, 0.2);
    }

    .users-list,
    .users-detail {
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
    }

    .users-title,
    .users-card__body h3,
    .users-card__body h4 {
        line-height: 1.18;
    }

    .users-text,
    .users-helper {
        line-height: 1.5;
    }

    .users-hero__copy {
        gap: 12px;
    }

    .users-hero__actions {
        display: grid;
        grid-template-columns: 48px 48px minmax(0, 1fr);
        gap: 10px;
        align-items: stretch;
    }

    .users-hero__actions .button {
        min-height: 48px;
        font-weight: 700;
    }

    .users-hero__action--icon {
        width: 48px;
        min-width: 48px;
    }

    .users-hero__action--create {
        width: 100%;
        min-width: 0;
    }

    .users-hero__status:not(:empty) {
        padding-top: 16px;
        padding-bottom: 22px;
        font-weight: 600;
    }

    .users-list .users-card__body,
    .users-detail .users-card__body {
        display: grid;
        gap: 18px;
    }

    .users-section__header--stack {
        margin-bottom: 0;
    }

    .users-detail__header {
        gap: 18px;
        padding: 20px;
        margin-bottom: 22px;
        border: 1px solid rgba(96, 165, 250, 0.34);
        border-radius: 3px;
        background: linear-gradient(135deg, rgba(219, 234, 254, 0.9) 0%, rgba(255, 255, 255, 0.98) 72%, rgba(239, 246, 255, 0.96) 100%);
        box-shadow: 0 16px 34px rgba(59, 130, 246, 0.12);
    }

    .users-detail__identity {
        grid-template-columns: 58px minmax(0, 1fr);
        display: grid;
        gap: 14px;
        align-items: start;
    }

    .users-detail__avatar {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
        border-color: rgba(96, 165, 250, 0.34);
        box-shadow: 0 14px 30px rgba(59, 130, 246, 0.16);
    }

    .users-detail__identity-copy {
        display: grid;
        gap: 4px;
    }

    .users-detail__header-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .users-detail__last-access {
        margin-right: 0;
        padding: 0 0 12px;
        border-bottom: 1px solid rgba(147, 197, 253, 0.5);
        gap: 6px;
    }

    .users-detail__last-access strong {
        line-height: 1.25;
    }

    .users-detail__header-actions .button {
        width: 100%;
        min-height: 46px;
    }

    .users-detail__header .status:not(:empty) {
        margin-top: 2px;
        padding: 10px 12px;
        border: 1px solid rgba(191, 219, 254, 0.92);
        border-radius: 3px;
        background: rgba(255, 255, 255, 0.78);
    }

    .users-empty {
        padding: 24px 20px;
        font-size: 0.98rem;
        line-height: 1.55;
    }

    .users-table-wrap {
        margin-left: 0;
        margin-right: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .users-table {
        width: 100%;
        min-width: 0;
        display: block;
        border-collapse: separate;
        border-spacing: 0;
    }

    .users-table thead {
        display: none;
    }

    .users-table tbody {
        display: grid;
        gap: 12px;
    }

    .users-table tbody tr {
        display: grid;
        grid-template-columns: 72px minmax(0, 1fr) 42px 46px;
        gap: 12px;
        align-items: center;
        padding: 16px;
        border: 1px solid rgba(191, 219, 254, 0.92);
        border-radius: 3px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 246, 255, 0.92) 100%);
        box-shadow: 0 16px 32px rgba(148, 163, 184, 0.12);
    }

    .users-table tbody tr.is-selected {
        border-color: rgba(59, 130, 246, 0.62);
        background: linear-gradient(135deg, rgba(219, 234, 254, 0.98) 0%, rgba(239, 246, 255, 0.96) 100%);
        box-shadow: 0 18px 36px rgba(59, 130, 246, 0.16);
    }

    .users-table tbody tr:hover {
        background: linear-gradient(135deg, rgba(248, 250, 252, 0.98) 0%, rgba(239, 246, 255, 0.95) 100%);
    }

    .users-table td {
        padding: 0;
        border: 0;
        background: transparent;
    }

    .users-table td[colspan] {
        grid-column: 1 / -1;
    }

    .users-user-cell {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 8px;
        text-align: center;
    }

    .users-user-cell__avatar {
        width: 56px;
        height: 56px;
        box-shadow: 0 14px 28px rgba(59, 130, 246, 0.16);
    }

    .users-user-cell__content {
        display: none;
    }

    .users-user-cell__secondary--mobile {
        display: block !important;
        max-width: 72px;
        font-size: 0.72rem;
        line-height: 1.2;
        color: var(--text-soft);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .users-table__identity-mobile {
        display: grid !important;
        gap: 4px;
        min-width: 0;
    }

    .users-table__role {
        display: none;
    }

    .users-table__identity-name {
        display: block;
        font-weight: 700;
        color: #0f172a;
        line-height: 1.18;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .users-table__identity-role {
        display: block;
        color: var(--text-soft);
        font-size: 0.82rem;
        line-height: 1.25;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .users-badge {
        display: none;
    }

    .users-table__state-cell {
        display: grid;
        justify-items: center;
    }

    .users-state-mobile {
        display: grid !important;
        gap: 6px;
        justify-items: center;
    }

    .users-state-mobile__title {
        font-size: 0.68rem;
        font-weight: 800;
        line-height: 1;
        color: var(--text-soft);
        letter-spacing: 0.08em;
    }

    .users-state-mobile__icon {
        width: 34px;
        height: 34px;
        display: grid;
        place-items: center;
        border: 1px solid rgba(191, 219, 254, 0.92);
        border-radius: 3px;
        background: #fff;
        color: #1d4ed8;
        box-shadow: 0 10px 20px rgba(148, 163, 184, 0.14);
    }

    .users-state-mobile__icon svg {
        width: 18px;
        height: 18px;
        display: block;
    }

    .users-state-mobile__icon--active {
        border-color: rgba(31, 143, 95, 0.26);
        background: rgba(31, 143, 95, 0.1);
        color: var(--success);
    }

    .users-state-mobile__icon--pending {
        border-color: rgba(217, 119, 6, 0.26);
        background: rgba(251, 191, 36, 0.14);
        color: #b45309;
    }

    .users-state-mobile__icon--blocked {
        border-color: rgba(192, 57, 43, 0.24);
        background: rgba(192, 57, 43, 0.12);
        color: var(--danger);
    }

    .users-state-mobile__icon--disabled {
        border-color: rgba(100, 116, 139, 0.28);
        background: rgba(226, 232, 240, 0.88);
        color: #475569;
    }

    .users-table__action-cell {
        justify-self: end;
    }

    .users-table__action.button--secondary {
        width: 46px;
        min-width: 46px;
        min-height: 46px;
        padding: 0;
        box-shadow: 0 10px 22px rgba(148, 163, 184, 0.14);
    }

    .users-table__action-label {
        display: none;
    }

    .users-table__action-icon {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

    .users-table__action-icon svg {
        width: 18px;
        height: 18px;
        display: block;
    }
}

@media (max-width: 560px) {
    .users-hero__body,
    .users-card__body {
        padding: 20px 16px;
    }

    .users-layout {
        gap: 16px;
    }

    .users-hero__actions {
        grid-template-columns: 44px 44px minmax(0, 1fr);
    }

    .users-hero__action--icon {
        width: 44px;
        min-width: 44px;
    }

    .users-hero__status {
        padding-left: 16px;
        padding-right: 16px;
        padding-bottom: 20px;
    }

    .users-detail__identity {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 10px;
    }

    .users-detail__header {
        padding: 16px;
    }

    .users-detail__avatar {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
    }

    .users-detail__last-access {
        padding-bottom: 6px;
    }

    .users-empty {
        padding: 20px 16px;
    }

    .users-table-wrap {
        margin-left: 0;
        margin-right: 0;
    }

    .users-table tbody {
        gap: 10px;
    }

    .users-table tbody tr {
        grid-template-columns: 64px minmax(0, 1fr) 38px 42px;
        gap: 10px;
        padding: 14px 12px;
    }

    .users-user-cell__avatar {
        width: 52px;
        height: 52px;
    }

    .users-user-cell__secondary--mobile {
        max-width: 64px;
        font-size: 0.68rem;
    }

    .users-table__identity-name {
        font-size: 0.94rem;
    }

    .users-table__identity-role {
        font-size: 0.78rem;
    }

    .users-state-mobile {
        gap: 5px;
    }

    .users-state-mobile__icon {
        width: 32px;
        height: 32px;
    }

    .users-state-mobile__icon svg {
        width: 16px;
        height: 16px;
    }

    .users-table__action.button--secondary {
        width: 42px;
        min-width: 42px;
        min-height: 42px;
    }
}