.root {
    display: flex;
    height: calc(100vh - var(--header-height) - var(--space-8) - var(--space-4));
    height: calc(100dvh - var(--header-height) - var(--space-8) - var(--space-4));
    min-height: 0;
    flex-direction: column;
}

.contentPanel {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--bg-card);
}

.contentPanel :global(.data-state),
.contentPanel :global(.table-frame) {
    flex: 1;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.contentPanel :global(.table-scroll) {
    overflow: auto;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
}

.filters {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.toolbarActions {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--space-2);
}

.robotConfigPanel {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) minmax(220px, 1fr) auto;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border);
    background: var(--bg-card-strong);
}

.humanConfigActions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

.formGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

@media (max-width: 720px) {
    .formGrid {
        grid-template-columns: 1fr;
    }

    .robotConfigPanel {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

.search {
    flex: 0 1 320px;
}

.statusSelect {
    flex: 0 0 150px;
}

.regionInput {
    flex: 0 0 auto;
}

.listBlock {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    background: var(--bg-card);
}

.listBlock :global(.pagination-bar) {
    margin: var(--space-3) var(--space-5) var(--space-4);
}

.identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: var(--space-3);
}

.identityButton {
    display: block;
    width: 100%;
    padding: 2px;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition:
        background var(--motion-base) var(--ease-standard),
        box-shadow var(--motion-base) var(--ease-standard),
        transform var(--motion-base) var(--ease-emphasized);
}

.identityButton:hover {
    background: var(--bg-hover);
}

.identityButton:hover .name {
    color: var(--primary);
}

.identityButton:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.cover {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--bg-card-strong);
    color: var(--text-secondary);
}

.cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ownerAvatar {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card-strong);
    color: var(--text-secondary);
}

.ownerAvatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.identityText {
    min-width: 0;
}

.name {
    overflow: hidden;
    color: var(--text-primary);
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta {
    color: var(--text-tertiary);
    font-size: var(--admin-font-size);
}

.ownerRobotOption {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.ownerRobotOption > :first-child {
    min-width: 0;
}

.ownerRobotLocation {
    flex: 0 1 320px;
    color: var(--text-secondary);
    font-size: var(--admin-font-size);
    line-height: 1.35;
    text-align: right;
}

@media (max-width: 720px) {
    .ownerRobotOption {
        align-items: flex-start;
        flex-direction: column;
        gap: var(--space-1);
    }

    .ownerRobotLocation {
        flex-basis: auto;
        padding-left: 48px;
        text-align: left;
    }
}

.sortHeader {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.sortHeader:hover,
.sortHeaderActive {
    color: var(--primary);
}

.sortHeader:focus-visible {
    border-radius: var(--radius-sm);
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.sortArrow {
    color: currentColor;
    font-size: 12px;
    line-height: 1;
}

.stack {
    display: grid;
    gap: 2px;
}

.primaryText {
    color: var(--text-primary);
    font-weight: 650;
}

.switchField {
    display: inline-flex;
    min-height: var(--control-height);
    align-items: center;
}

.configSwitchActions {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: var(--space-2);
}

.countryRulesSection {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--bg-card-strong);
}

.countryRulesHeader {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.countryRuleRows {
    display: grid;
    gap: var(--space-3);
}

.countryRuleRow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(128px, 160px) auto;
    align-items: start;
    gap: var(--space-3);
}

.countryRuleRow > :global(.MuiTextField-root),
.countryRuleRow > :global(.MuiFormControl-root) {
    width: 100%;
}

.countryRuleOwners {
    grid-column: 1 / -1;
    grid-row: 2;
}

.countryRuleRemove {
    display: inline-flex;
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-content: flex-end;
}

@media (max-width: 720px) {
    .countryRulesHeader,
    .configSwitchActions,
    .humanConfigActions {
        align-items: stretch;
        flex-direction: column;
    }

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

    .countryRuleOwners {
        grid-column: auto;
        grid-row: auto;
    }

    .countryRuleRemove {
        grid-column: auto;
        grid-row: auto;
        justify-content: flex-start;
    }
}

.rowActions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.statusCell {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: var(--space-2);
}

.statusButton {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.statusButton:focus-visible {
    border-radius: 999px;
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.statusButton:hover :global(.status-badge) {
    border-color: var(--primary-border);
}

.detailHero {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.detailCover {
    display: inline-flex;
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--bg-card-strong);
    color: var(--text-secondary);
}

.detailCover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detailHeroText {
    display: grid;
    min-width: 0;
    gap: var(--space-2);
}

.detailTitleRow {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.detailTitleRow h3 {
    overflow: hidden;
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detailMeta {
    color: var(--text-tertiary);
    font-size: var(--admin-font-size);
}

.copyValue {
    display: inline-flex;
    max-width: 100%;
    min-width: 0;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
}

.copyValue span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copyValue:hover {
    color: var(--primary);
}

.copyValue:disabled {
    cursor: default;
}

.copyValue:focus-visible {
    border-radius: var(--radius-sm);
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.copyIcon {
    flex: 0 0 auto;
    color: currentColor;
}

.copyState {
    flex: 0 0 auto;
    color: var(--success);
    font-size: 12px;
    font-weight: 700;
}

.detailSection {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--bg-card-strong);
}

.detailSectionTitle {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--admin-font-size);
    font-weight: 800;
}

.detailGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.detailItem {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.detailLabel {
    color: var(--text-tertiary);
    font-size: 12px;
}

.detailValue {
    overflow: hidden;
    color: var(--text-primary);
    font-size: var(--admin-font-size);
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detailOwner {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: var(--space-3);
}

.detailOwnerAvatar {
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-secondary);
}

.detailOwnerAvatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detailOwnerText {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.detailOwnerText strong,
.detailOwnerText span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detailOwnerText strong {
    color: var(--text-primary);
    font-size: var(--admin-font-size);
}

.detailOwnerText span {
    color: var(--text-tertiary);
    font-size: 12px;
}

.configForm {
    padding: var(--space-5);
}

.configSection {
    display: grid;
    max-width: 720px;
    gap: var(--space-4);
}

.configHeader {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: var(--space-3);
}

.configIcon {
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--bg-card-strong);
    color: var(--text-secondary);
}

.configTitle {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.configTitle h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 800;
}

.configTitle span {
    color: var(--text-tertiary);
    font-size: var(--admin-font-size);
}

.seatOptions {
    display: grid;
    grid-template-columns: repeat(5, minmax(92px, 1fr));
    gap: var(--space-2);
}

.seatOptions :global(.MuiFormControlLabel-root) {
    min-height: 40px;
    margin: 0;
    padding: 0 var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--bg-card);
}

@media (max-width: 760px) {
    .toolbar,
    .filters {
        align-items: stretch;
        flex-direction: column;
    }

    .search,
    .statusSelect,
    .regionInput {
        flex: 1 1 auto;
        width: 100%;
    }

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

    .configForm {
        padding: var(--space-4);
    }

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