.clients-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.clients-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.clients-kicker {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
}

.clients-hero h1 {
    font-size: 2rem;
    letter-spacing: -0.035em;
}

.clients-lead {
    margin: 8px 0 0;
    max-width: 40rem;
    color: var(--text-secondary);
    font-size: 14.5px;
    line-height: 1.55;
}

.clients-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.clients-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 12px;
    overflow: hidden;
    background: #e7e9ee;
    border-radius: 16px;
}

.clients-metric {
    text-align: left;
    background: var(--bg-surface);
    border: 0;
    border-radius: 0;
    padding: 18px 20px 16px;
    cursor: pointer;
    color: inherit;
    font: inherit;
    transition: background 0.15s ease;
}

.clients-metric:hover {
    background: #fafafa;
}

.clients-metric:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    z-index: 1;
}

.clients-metric--active,
.clients-metric--active:hover {
    background: #f5f3ff;
    box-shadow: inset 0 -2px 0 var(--primary);
}

.clients-metric__value {
    display: block;
    font-size: 1.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.045em;
    line-height: 1;
}

.clients-metric--address .clients-metric__value--alert { color: #4338ca; }
.clients-metric--progress .clients-metric__value--alert { color: #b45309; }
.clients-metric--failed .clients-metric__value--alert { color: #b91c1c; }

.clients-metric__value--quiet {
    color: #9ca3af;
}

.clients-metric__label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.3;
}

.clients-metric__label::before {
    content: "";
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #c7d2fe;
}

.clients-metric--address .clients-metric__label::before { background: #4f46e5; }
.clients-metric--progress .clients-metric__label::before { background: #d97706; }
.clients-metric--failed .clients-metric__label::before { background: #dc2626; }

.licenses-board {
    margin-bottom: 16px;
    overflow: hidden;
    background: var(--bg-surface);
    border-radius: 16px;
}

.licenses-board .summary-cards {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    margin: 10px 10px 0;
    padding: 4px;
    background: #f3f4f6;
    border-radius: 12px;
}

.licenses-board .summary-card {
    align-items: center;
    gap: 1px;
    padding: 10px 8px 11px;
    border-radius: 10px;
    background: transparent;
    text-align: center;
}

.licenses-board .summary-card:hover {
    background: rgba(255, 255, 255, 0.72);
}

.licenses-board .summary-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.licenses-board .summary-card--active,
.licenses-board .summary-card--active:hover {
    background: #fff;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06), 0 0 0 1px rgba(17, 24, 39, 0.04);
}

.licenses-board .summary-card__value {
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
}

.licenses-board .summary-card__label {
    font-size: 12px;
    font-weight: 550;
    line-height: 1.25;
}

.licenses-board .list-toolbar.card {
    margin: 0;
    padding: 12px 12px 14px;
    background: transparent;
    border-radius: 0;
}

.licenses-board .list-toolbar__row {
    align-items: flex-end;
    justify-content: flex-start;
    gap: 10px;
}

.licenses-board .list-toolbar__search {
    flex: 1 1 240px;
    min-width: 0;
}

.licenses-board .list-toolbar__selects {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.licenses-board .search-input,
.licenses-board .filter-select select {
    height: 42px;
    border-radius: 12px;
    background: #f3f4f6;
}

.licenses-board .search-input:focus,
.licenses-board .filter-select select:focus {
    outline: none;
    background: #fff;
    box-shadow: inset 0 0 0 1.5px var(--primary);
}

.licenses-board .filter-select {
    min-width: 196px;
}

.licenses-board .filter-select label {
    letter-spacing: 0.04em;
}

.licenses-board .btn-link {
    height: 42px;
    padding: 0 4px;
    white-space: nowrap;
}

.clients-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
}

.clients-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px 16px 0;
}

.clients-page .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
}

.clients-page .form-field--wide {
    grid-column: 1 / -1;
}

.clients-page .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 0;
}

.clients-search {
    flex: 1;
}

.clients-search input {
    width: 100%;
}

.clients-host {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #312e81;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.clients-host--empty {
    background: #f3f4f6;
    color: #6b7280;
    font-family: inherit;
}

a.clients-host {
    text-decoration: none;
}

a.clients-host:hover {
    background: #e0e7ff;
}

a.clients-host--empty:hover {
    background: #e5e7eb;
}

.clients-pending-host {
    display: block;
    margin-top: 6px;
    color: #92400e;
    font-size: 12.5px;
}

.clients-name {
    display: block;
    font-weight: 650;
    color: inherit;
    text-decoration: none;
}

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

.clients-code {
    display: block;
    color: var(--text-secondary);
    font-size: 12.5px;
}

.col-address {
    min-width: 148px;
}

.license-address {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.license-address .clients-host {
    white-space: nowrap;
    overflow-wrap: normal;
}

.license-address__place {
    color: var(--color-text-muted, #6b7280);
    font-size: 12px;
    line-height: 1.3;
}

.license-address .clients-actions {
    justify-content: flex-start;
}

.licenses-table .table-row--clickable td {
    border-bottom: none;
    vertical-align: middle;
}

.licenses-table .col-rownum {
    color: #64748b;
    font-weight: 650;
    font-size: 13px;
}

.license-actions-row td {
    padding-top: 0 !important;
    padding-bottom: 14px !important;
    background: transparent;
    border-bottom: 1px solid var(--color-border-subtle, #e5e7eb);
}

.licenses-table tbody tr.table-row--clickable:hover td,
.licenses-table tbody tr.table-row--clickable:hover + tr.license-actions-row td {
    background: #f8fafc;
}

.license-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 32px;
}

.license-row-actions__buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.license-row-actions__split {
    width: 1px;
    height: 16px;
    margin: 0 4px;
    background: #e5e7eb;
    flex: 0 0 auto;
}

.license-row-actions__buttons .btn {
    height: 30px;
    padding: 0 12px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

.clients-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    justify-content: flex-end;
}

.clients-actions a,
.clients-actions button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--primary);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.clients-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.clients-side h2 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.clients-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.clients-timeline li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 10px;
}

.clients-timeline__dot {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    border-radius: 50%;
    background: #c7d2fe;
}

.clients-timeline__dot--ok { background: #059669; }
.clients-timeline__dot--bad { background: #dc2626; }
.clients-timeline__dot--run { background: #d97706; }

.clients-timeline__title {
    font-weight: 650;
    font-size: 14px;
}

.clients-timeline__meta,
.clients-timeline__error {
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 1.45;
}

.clients-timeline__error {
    color: #b91c1c;
}

.clients-create {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.clients-preview {
    position: sticky;
    top: 20px;
    padding: 22px;
    border-radius: 20px;
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(129, 140, 248, 0.45), transparent 55%),
        linear-gradient(165deg, #111827 0%, #312e81 100%);
    color: #f9fafb;
}

.clients-preview__kicker {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c7d2fe;
}

.clients-preview__url {
    margin: 14px 0 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}

.clients-preview__meta {
    margin: 0;
    color: #e5e7eb;
    font-size: 13.5px;
    line-height: 1.5;
}

.clients-preview__note {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    color: #c7d2fe;
    font-size: 13px;
    line-height: 1.5;
}

.clients-address {
    max-width: 760px;
}

.clients-address-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    margin-bottom: 18px;
}

.clients-address-card {
    padding: 16px;
    border-radius: 16px;
    background: #f8fafc;
}

.clients-address-card--next {
    background: #eef2ff;
}

.clients-address-card span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.clients-address-card strong {
    display: block;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 15px;
}

.clients-address-arrow {
    align-self: center;
    color: #9ca3af;
    font-size: 22px;
}

.clients-success-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ecfdf5;
    color: #047857;
    font-size: 22px;
    font-weight: 700;
}

.clients-success-mark--wait {
    background: #fffbeb;
    color: #b45309;
}

.clients-success-mark--wait .load-state__spinner {
    border-color: #fde68a;
    border-top-color: #b45309;
}

.clients-job-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.alert.clients-job-live {
    display: flex;
    gap: 10px;
}

.clients-success-mark--bad {
    background: #fef2f2;
    color: #b91c1c;
}

.clients-hint--bad {
    color: #b91c1c;
}

.clients-hint--warn {
    color: #92400e;
}

.clients-inline-action {
    align-self: flex-start;
    margin-top: 2px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.clients-inline-action:hover {
    text-decoration: underline;
}

.clients-status-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 10px;
}

.clients-preview__note--bad {
    color: #fecaca;
}

.clients-key {
    margin-top: 16px;
}

.client-stage {
    min-height: calc(100dvh - 148px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0 28px;
}

.client-stage__panel {
    width: min(560px, 100%);
    margin: 0 auto;
    text-align: center;
}

.client-stage__panel h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.15rem);
    letter-spacing: -0.04em;
}

.client-stage__ring {
    position: relative;
    width: 148px;
    height: 148px;
    margin: 0 auto 22px;
}

.client-stage__orbit,
.client-stage__glow,
.client-stage__core {
    position: absolute;
    border-radius: 50%;
}

.client-stage__orbit {
    inset: 0;
    background: conic-gradient(from 20deg, transparent 0 62%, #818cf8 78%, #4f46e5 92%, transparent 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
    animation: client-stage-spin 1.05s linear infinite;
}

.client-stage__glow {
    inset: 18px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.22), transparent 68%);
    animation: client-stage-pulse 1.8s ease-in-out infinite;
}

.client-stage__core {
    inset: 34px;
    display: grid;
    place-items: center;
    background: #fff;
    color: #4338ca;
    font-size: 34px;
    font-weight: 650;
    box-shadow: inset 0 0 0 1px #e0e7ff;
}

.client-stage__lead,
.client-stage__meta {
    margin: 10px auto 0;
    max-width: 36rem;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
}

.client-stage__steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.client-stage__steps li {
    min-width: 108px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 13px;
    font-weight: 650;
}

.client-stage__steps li.is-now {
    background: #eef2ff;
    color: #3730a3;
}

.client-stage__steps li.is-done {
    background: #ecfdf5;
    color: #047857;
}

.client-stage__steps li.is-bad {
    background: #fef2f2;
    color: #b91c1c;
}

.client-stage__host,
.client-stage__actions,
.client-stage .clients-key,
.client-stage .config-spoiler {
    justify-content: center;
    text-align: left;
}

.client-stage__host,
.client-stage__actions {
    margin-top: 16px;
}

.client-stage__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.client-stage .overview-key-result__row,
.client-stage__host {
    justify-content: center;
}

.client-stage--done .client-stage__orbit {
    animation: none;
    background: #059669;
}

.client-stage--done .client-stage__glow {
    animation: none;
    background: radial-gradient(circle, rgba(5, 150, 105, 0.2), transparent 68%);
}

.client-stage--done .client-stage__core {
    color: #047857;
    box-shadow: inset 0 0 0 1px #a7f3d0;
}

.client-stage--fail .client-stage__orbit {
    animation: none;
    background: #dc2626;
}

.client-stage--fail .client-stage__glow {
    animation: none;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.16), transparent 68%);
}

.client-stage--fail .client-stage__core {
    color: #b91c1c;
    box-shadow: inset 0 0 0 1px #fecaca;
}

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

@keyframes client-stage-pulse {
    0%, 100% { transform: scale(0.92); opacity: 0.55; }
    50% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .client-stage__orbit,
    .client-stage__glow {
        animation: none;
    }
}

@media (max-width: 1180px) {
    .licenses-board .summary-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

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

    .clients-layout,
    .clients-create,
    .clients-address-flow,
    .clients-page .form-grid {
        grid-template-columns: 1fr;
    }

    .clients-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .clients-preview {
        position: static;
    }

    .clients-address-arrow {
        transform: rotate(90deg);
        justify-self: center;
    }
}

@media (max-width: 720px) {
    .licenses-board .summary-cards {
        grid-template-columns: 1fr 1fr;
    }

    .licenses-board .filter-select {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .clients-metrics {
        grid-template-columns: 1fr;
    }
}
