:root {
    color-scheme: light;
    --background: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #dbe3ee;
    --border-strong: #c8d3e1;
    --text: #142033;
    --muted: #64748b;
    --primary: #1769e0;
    --primary-dark: #0f50b4;
    --primary-soft: #e9f2ff;
    --success: #0f9d68;
    --success-soft: #e7f8f1;
    --warning: #c47a00;
    --warning-soft: #fff4dd;
    --danger: #c73535;
    --danger-dark: #9f2525;
    --danger-soft: #ffeded;
    --shadow: 0 18px 50px rgba(31, 48, 72, 0.09);
    --shadow-soft: 0 8px 28px rgba(31, 48, 72, 0.07);
    --radius-large: 22px;
    --radius: 14px;
    --radius-small: 10px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--background);
    line-height: 1.5;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.hidden {
    display: none !important;
}

.center-view {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 15% 10%, rgba(23, 105, 224, 0.14), transparent 34%),
        radial-gradient(circle at 88% 86%, rgba(15, 157, 104, 0.11), transparent 32%),
        linear-gradient(145deg, #eef4fb 0%, #f8fafc 56%, #edf3f9 100%);
}

.loading-card,
.login-card {
    width: min(100%, 460px);
    border: 1px solid rgba(219, 227, 238, 0.9);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 28px 80px rgba(31, 48, 72, 0.16);
    backdrop-filter: blur(12px);
}

.loading-card {
    min-height: 280px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 20px;
    color: var(--muted);
}

.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.brand-logo.large {
    width: 70px;
    height: 70px;
}

.spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #dce8f7;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.login-card {
    overflow: hidden;
}

.login-header {
    padding: 38px 38px 24px;
    text-align: center;
}

.login-header h1 {
    margin: 12px 0 8px;
    font-size: clamp(1.7rem, 5vw, 2.15rem);
    letter-spacing: -0.04em;
}

.login-header p:last-child {
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: var(--primary);
}

.login-form {
    display: grid;
    gap: 18px;
    padding: 0 38px 34px;
}

.login-form label,
.search-box,
.content-toolbar select {
    display: grid;
    gap: 7px;
}

.login-form label span {
    font-size: 0.84rem;
    font-weight: 700;
    color: #334155;
}

.login-form input,
.search-box input,
.content-toolbar select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-form input {
    padding: 0 14px;
}

.login-form input:focus,
.search-box input:focus,
.content-toolbar select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(23, 105, 224, 0.12);
}

.login-card footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
}

.form-error {
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--danger-soft);
    color: var(--danger-dark);
    font-size: 0.88rem;
    font-weight: 650;
}

.primary-button,
.secondary-button,
.danger-button,
.session-action,
.icon-button {
    border: 0;
    border-radius: 11px;
    font-weight: 750;
    transition: transform 0.14s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.danger-button:hover:not(:disabled),
.session-action:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.primary-button {
    min-height: 48px;
    padding: 0 20px;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 9px 22px rgba(23, 105, 224, 0.23);
}

.primary-button:hover:not(:disabled) {
    background: var(--primary-dark);
}

.primary-button.wide {
    width: 100%;
}

.secondary-button {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--border-strong);
    background: #fff;
    color: #334155;
}

.secondary-button:hover:not(:disabled) {
    background: var(--surface-soft);
}

.danger-button {
    min-height: 42px;
    padding: 0 18px;
    color: #fff;
    background: var(--danger);
    box-shadow: 0 8px 20px rgba(199, 53, 53, 0.2);
}

.danger-button:hover:not(:disabled) {
    background: var(--danger-dark);
}

.dashboard {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px clamp(18px, 4vw, 52px);
    border-bottom: 1px solid rgba(219, 227, 238, 0.9);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

.brand-block,
.topbar-actions,
.admin-chip,
.heading-actions,
.audit-header,
.computer-header,
.computer-footer,
.session-main,
.session-meta,
.status-line,
.dialog-actions {
    display: flex;
    align-items: center;
}

.brand-block {
    gap: 12px;
}

.brand-block strong {
    display: block;
    margin-top: 2px;
    font-size: 1rem;
}

.topbar-actions {
    gap: 10px;
}

.version-chip,
.admin-chip {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
}

.version-chip {
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.admin-chip {
    gap: 8px;
    padding: 0 13px 0 5px;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 700;
}

.admin-avatar {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.75rem;
}

.icon-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    background: #fff;
    color: #475569;
    font-size: 1.1rem;
}

.main-content {
    width: min(1480px, calc(100% - 36px));
    margin: 0 auto;
    padding: 34px 0 60px;
}

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

.page-heading h1 {
    margin: 5px 0 4px;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.045em;
}

.page-heading p:last-child {
    margin: 0;
    color: var(--muted);
}

.heading-actions {
    gap: 12px;
    flex-shrink: 0;
}

.refresh-label {
    color: var(--muted);
    font-size: 0.82rem;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 22px;
    padding: 5px;
    width: fit-content;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.tab {
    min-height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-weight: 750;
}

.tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 7px 16px rgba(23, 105, 224, 0.2);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-card {
    min-height: 150px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.summary-card span {
    display: block;
    color: var(--muted);
    font-size: 0.83rem;
    font-weight: 700;
}

.summary-card strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 2.25rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.summary-card small {
    color: #94a3b8;
}

.content-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 18px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 520px;
}

.search-box span {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.15rem;
}

.search-box input {
    padding: 0 15px 0 42px;
}

.content-toolbar select {
    width: 210px;
    padding: 0 38px 0 13px;
}

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

.computer-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.computer-card.offline {
    background: #fbfcfe;
}

.computer-header {
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
}

.computer-title {
    min-width: 0;
}

.computer-title h2 {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.17rem;
    letter-spacing: -0.02em;
}

.computer-title p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.status-badge,
.command-badge,
.audit-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
    white-space: nowrap;
}

.status-badge {
    gap: 7px;
    padding: 7px 11px;
    font-size: 0.76rem;
}

.status-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge.online {
    color: var(--success);
    background: var(--success-soft);
}

.status-badge.warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.status-badge.offline {
    color: #7b8798;
    background: #eef2f6;
}

.computer-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
}

.info-cell {
    min-width: 0;
    padding: 13px 17px;
    border-right: 1px solid var(--border);
}

.info-cell:last-child {
    border-right: 0;
}

.info-cell span {
    display: block;
    margin-bottom: 3px;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.info-cell strong {
    display: block;
    overflow: hidden;
    color: #334155;
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sessions-section {
    padding: 18px 22px 8px;
}

.section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-label h3 {
    margin: 0;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #475569;
}

.section-label span {
    min-width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
}

.session-list {
    display: grid;
    gap: 10px;
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
}

.session-main {
    min-width: 0;
    gap: 11px;
}

.session-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 850;
}

.session-copy {
    min-width: 0;
}

.session-copy strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.session-meta {
    flex-wrap: wrap;
    gap: 4px 9px;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.75rem;
}

.session-state {
    color: var(--success);
    font-weight: 750;
}

.session-action {
    min-height: 34px;
    flex: 0 0 auto;
    padding: 0 12px;
    border: 1px solid #f0bcbc;
    background: var(--danger-soft);
    color: var(--danger-dark);
    font-size: 0.76rem;
}

.no-session {
    min-height: 74px;
    display: grid;
    place-items: center;
    padding: 15px;
    border: 1px dashed var(--border-strong);
    border-radius: 13px;
    background: var(--surface-soft);
    color: var(--muted);
    text-align: center;
    font-size: 0.84rem;
}

.command-line {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--warning-soft);
    color: #855d17;
    font-size: 0.77rem;
}

.command-badge {
    margin-right: 6px;
    padding: 3px 7px;
    background: rgba(255, 255, 255, 0.65);
    font-size: 0.68rem;
}

.computer-footer {
    justify-content: space-between;
    gap: 14px;
    padding: 16px 22px 20px;
}

.last-contact {
    min-width: 0;
    color: var(--muted);
    font-size: 0.75rem;
}

.last-contact strong {
    display: block;
    color: #475569;
    font-size: 0.8rem;
}

.power-actions {
    display: flex;
    gap: 8px;
}

.power-button {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-weight: 750;
    font-size: 0.78rem;
}

.power-button.shutdown {
    border-color: #efc5c5;
    color: var(--danger-dark);
    background: #fffafa;
}

.empty-state {
    min-height: 340px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 30px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-large);
    background: rgba(255, 255, 255, 0.65);
    text-align: center;
}

.empty-state.compact {
    min-height: 160px;
    border: 0;
    border-radius: 0;
}

.empty-state h2,
.empty-state p {
    margin: 0;
}

.empty-state p {
    max-width: 560px;
    color: var(--muted);
}

.empty-icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 850;
}

.audit-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.audit-header {
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
    border-bottom: 1px solid var(--border);
}

.audit-header h2,
.audit-header p {
    margin: 0;
}

.audit-header p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
}

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

.audit-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 880px;
}

.audit-table th,
.audit-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.audit-table th {
    background: var(--surface-soft);
    color: #64748b;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.audit-table td {
    font-size: 0.82rem;
}

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

.audit-status {
    padding: 4px 8px;
    font-size: 0.7rem;
}

.audit-status.success,
.audit-status.queued {
    color: var(--success);
    background: var(--success-soft);
}

.audit-status.error {
    color: var(--danger-dark);
    background: var(--danger-soft);
}

.audit-status.info,
.audit-status.accepted {
    color: var(--primary);
    background: var(--primary-soft);
}

.confirm-dialog {
    width: min(92vw, 470px);
    padding: 0;
    border: 0;
    border-radius: 22px;
    box-shadow: 0 32px 90px rgba(15, 23, 42, 0.3);
}

.confirm-dialog::backdrop {
    background: rgba(15, 23, 42, 0.56);
    backdrop-filter: blur(3px);
}

.confirm-dialog form {
    padding: 28px;
}

.dialog-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    border-radius: 15px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 1.3rem;
    font-weight: 900;
}

.confirm-dialog h2 {
    margin: 0 0 8px;
    letter-spacing: -0.025em;
}

.confirm-dialog p {
    margin: 0;
    color: var(--muted);
}

.dialog-details {
    margin: 18px 0 22px;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    color: #334155;
    font-size: 0.86rem;
    white-space: pre-line;
}

.password-dialog {
    width: min(92vw, 520px);
}

.password-dialog .password-icon {
    background: var(--primary-soft);
    color: var(--primary);
}

.password-fields {
    display: grid;
    gap: 14px;
    margin: 20px 0 16px;
}

.password-fields label {
    display: grid;
    gap: 7px;
}

.password-fields label span {
    color: #334155;
    font-size: 0.82rem;
    font-weight: 750;
}

.password-fields input {
    width: 100%;
    min-height: 45px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    color: var(--text);
    outline: none;
}

.password-fields input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.12);
}

.password-dialog .form-error {
    margin: 0 0 16px;
}

.dialog-actions {
    justify-content: flex-end;
    gap: 10px;
}

.toast-region {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100;
    width: min(380px, calc(100vw - 40px));
    display: grid;
    gap: 10px;
}

.toast {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
    color: #334155;
    font-size: 0.86rem;
    animation: toast-in 0.2s ease-out;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

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

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

@media (max-width: 760px) {
    .topbar {
        min-height: 68px;
        padding: 10px 14px;
    }

    .brand-block .eyebrow,
    .version-chip,
    .admin-chip span:last-child {
        display: none;
    }

    .admin-chip {
        padding-right: 5px;
    }

    .main-content {
        width: min(100% - 24px, 1480px);
        padding-top: 24px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .heading-actions {
        width: 100%;
        justify-content: space-between;
    }

    .summary-grid {
        gap: 10px;
    }

    .summary-card {
        min-height: 126px;
        padding: 17px;
    }

    .summary-card strong {
        font-size: 1.85rem;
    }

    .content-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box,
    .content-toolbar select {
        width: 100%;
        max-width: none;
    }

    .computer-info-grid {
        grid-template-columns: 1fr;
    }

    .info-cell,
    .info-cell:last-child {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .info-cell:last-child {
        border-bottom: 0;
    }

    .session-item,
    .computer-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .session-action {
        width: 100%;
    }

    .power-actions {
        width: 100%;
    }

    .power-button {
        flex: 1;
    }

    .audit-header {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .center-view {
        padding: 14px;
    }

    .login-header,
    .login-form {
        padding-left: 24px;
        padding-right: 24px;
    }

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

    .summary-card small {
        display: none;
    }

    .tabs {
        width: 100%;
    }

    .tab {
        flex: 1;
        padding: 0 8px;
        font-size: 0.8rem;
    }

    .computer-header,
    .sessions-section,
    .computer-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.stale-session-notice {
    padding: 10px 12px;
    border: 1px solid #ead8a8;
    border-radius: 10px;
    background: #fff8e6;
    color: #785b18;
    font-size: 0.78rem;
    line-height: 1.45;
}

.link-button {
    justify-self: center;
    padding: 4px 8px;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 750;
    font-size: 0.86rem;
}

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

.update-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    padding: 16px 18px;
    border: 1px solid #e9c978;
    border-radius: 14px;
    background: var(--warning-soft);
    color: #74500f;
}

.update-banner strong,
.update-banner span {
    display: block;
}

.update-banner span {
    margin-top: 2px;
    font-size: 0.84rem;
}

.update-banner a {
    flex: 0 0 auto;
    padding: 9px 13px;
    border-radius: 9px;
    background: #8c5c00;
    color: #fff;
    text-decoration: none;
    font-weight: 750;
    font-size: 0.82rem;
}

.filters-toolbar {
    flex-wrap: wrap;
}

.filters-toolbar .search-box {
    min-width: min(100%, 320px);
}

.filters-toolbar select {
    width: min(230px, 100%);
}

.computer-location-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 22px;
    border-bottom: 1px solid var(--border);
    background: #fbfdff;
}

.computer-location-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.structure-badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    max-width: 100%;
    padding: 4px 9px;
    overflow: hidden;
    border-radius: 999px;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 800;
}

.site-badge {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.location-badge {
    background: var(--success-soft);
    color: #08744d;
}

.neutral-badge {
    background: #eef2f6;
    color: #657184;
}

.assign-button {
    min-height: 32px;
    flex: 0 0 auto;
    padding: 0 11px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: #fff;
    color: #334155;
    font-weight: 750;
    font-size: 0.75rem;
}

.assign-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.power-button.lock {
    border-color: #bbd1ef;
    background: #f7fbff;
    color: var(--primary-dark);
}

.structure-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.structure-heading h2,
.structure-heading p {
    margin: 0;
}

.structure-heading p {
    margin-top: 4px;
    color: var(--muted);
}

.structure-grid {
    display: grid;
    gap: 18px;
}

.site-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.site-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px;
}

.site-card-copy {
    min-width: 0;
}

.site-card-copy h3,
.site-card-copy p {
    margin: 0;
}

.site-card-copy h3 {
    font-size: 1.22rem;
    letter-spacing: -0.025em;
}

.site-card-copy p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
}

.site-counters {
    display: flex;
    gap: 8px;
    padding: 0 22px 18px;
}

.site-counters span {
    padding: 5px 9px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 750;
}

.structure-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.structure-actions.compact {
    flex: 0 0 auto;
}

.structure-action {
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: #fff;
    color: #334155;
    font-weight: 750;
    font-size: 0.75rem;
}

.structure-action:hover {
    background: var(--surface-soft);
}

.structure-action.primary {
    border-color: #b8d2f6;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.structure-action.danger {
    border-color: #efc5c5;
    background: #fffafa;
    color: var(--danger-dark);
}

.location-list {
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
}

.location-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 22px;
    border-bottom: 1px solid var(--border);
}

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

.location-row-copy {
    min-width: 0;
}

.location-row-copy strong,
.location-row-copy span,
.location-row-copy small {
    display: block;
}

.location-row-copy strong {
    font-size: 0.9rem;
}

.location-row-copy span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.8rem;
}

.location-row-copy small {
    margin-top: 4px;
    color: #94a3b8;
}

.no-locations {
    padding: 22px;
    color: var(--muted);
    text-align: center;
    font-size: 0.84rem;
}

.form-dialog {
    width: min(92vw, 560px);
}

.assignment-icon,
.structure-icon {
    background: var(--primary-soft);
    color: var(--primary);
}

.password-fields select {
    width: 100%;
    min-height: 45px;
    padding: 0 38px 0 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    color: var(--text);
    outline: none;
}

.password-fields select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.12);
}

.recovery-result {
    display: grid;
    gap: 9px;
    margin: 16px 0;
    padding: 14px;
    border: 1px solid #a8dbc9;
    border-radius: 12px;
    background: var(--success-soft);
}

.recovery-result span {
    color: #116b4e;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.recovery-result input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #96ccb9;
    border-radius: 9px;
    background: #fff;
    color: #164e3c;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-weight: 800;
}

.recovery-result small {
    color: #417461;
    line-height: 1.4;
}

.account-secondary-action {
    margin: 4px 0 18px;
}

.account-secondary-action .secondary-button {
    width: 100%;
}

@media (max-width: 900px) {
    .filters-toolbar select {
        flex: 1 1 210px;
    }

    .site-card-header {
        flex-direction: column;
    }

    .site-card-header .structure-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .update-banner,
    .structure-heading,
    .location-row {
        align-items: stretch;
        flex-direction: column;
    }

    .update-banner a,
    .structure-heading .primary-button {
        width: 100%;
        text-align: center;
    }

    .computer-location-bar {
        padding-left: 16px;
        padding-right: 16px;
    }

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

    .power-button {
        min-width: calc(50% - 4px);
    }

    .structure-actions.compact {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .filters-toolbar select {
        flex-basis: 100%;
    }

    .computer-location-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .assign-button {
        width: 100%;
    }

    .site-card-header,
    .site-counters,
    .location-row {
        padding-left: 16px;
        padding-right: 16px;
    }

    .site-counters {
        flex-wrap: wrap;
    }

    .power-button {
        min-width: 100%;
    }
}

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

.power-button.screen {
    border-color: #b8cff7;
    color: var(--primary);
    background: #f7faff;
}

.screen-dialog {
    width: min(96vw, 1180px);
    max-height: 94vh;
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 34px 100px rgba(15, 23, 42, 0.38);
}

.screen-dialog::backdrop {
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(4px);
}

.screen-dialog-shell {
    display: grid;
    gap: 0;
}

.screen-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border);
}

.screen-dialog-header h2,
.screen-dialog-header p {
    margin: 0;
}

.screen-dialog-header h2 {
    margin-top: 4px;
    font-size: 1.35rem;
}

.screen-dialog-header > div > p:last-child {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.84rem;
}

.screen-close-button {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    color: #475569;
    font-size: 1.6rem;
    line-height: 1;
}

.screen-stage {
    position: relative;
    min-height: 430px;
    max-height: 66vh;
    display: grid;
    place-items: center;
    overflow: auto;
    margin: 18px 24px 0;
    border: 1px solid #263244;
    border-radius: 16px;
    background: #0b1220;
}

.screen-stage img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 66vh;
    object-fit: contain;
    background: #050a13;
}

.screen-stage:fullscreen {
    width: 100vw;
    height: 100vh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #000000;
}

.screen-stage:fullscreen img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
}

.screen-placeholder {
    max-width: 520px;
    display: grid;
    gap: 8px;
    padding: 44px;
    color: #cbd5e1;
    text-align: center;
}

.screen-placeholder strong {
    color: #ffffff;
    font-size: 1.05rem;
}

.screen-placeholder span {
    color: #94a3b8;
    font-size: 0.86rem;
    line-height: 1.55;
}

.screen-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    background: rgba(8, 15, 28, 0.76);
    color: #ffffff;
    font-size: 0.86rem;
    backdrop-filter: blur(2px);
}

.screen-loading .spinner {
    border-color: rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
}

.screen-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 13px 24px;
    color: var(--muted);
    font-size: 0.78rem;
}

.screen-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 24px;
    border-top: 1px solid var(--border);
}

.screen-action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
}

.screen-quality-option {
    display: grid;
    gap: 6px;
    color: #475569;
    font-size: 0.8rem;
}

.screen-quality-option select {
    min-width: 250px;
    height: 40px;
    padding: 0 38px 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

.screen-privacy-note {
    margin: 0;
    padding: 0 24px 18px;
    color: #64748b;
    font-size: 0.72rem;
    line-height: 1.5;
}

@media (max-width: 760px) {
    .screen-stage {
        min-height: 280px;
        margin: 12px 12px 0;
    }

    .screen-dialog-header,
    .screen-metadata,
    .screen-dialog-actions,
    .screen-privacy-note {
        padding-left: 15px;
        padding-right: 15px;
    }

    .screen-dialog-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .screen-action-buttons {
        width: 100%;
        justify-content: stretch;
    }

    .screen-dialog-actions button {
        flex: 1;
    }

    .screen-quality-option,
    .screen-quality-option select {
        width: 100%;
    }
}
