* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: #f4f7fb;
    background: #0f172a;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 32px;
    border: 1px solid #334155;
    border-radius: 16px;
    background: #1e293b;
    box-shadow: 0 20px 50px rgb(0 0 0 / 30%);
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 32px;
}

.login-card p {
    margin: 0 0 28px;
    color: #94a3b8;
}

label {
    display: block;
    margin-bottom: 18px;
    font-weight: 600;
}

input {
    width: 100%;
    margin-top: 8px;
    padding: 13px 14px;
    border: 1px solid #475569;
    border-radius: 8px;
    color: #f8fafc;
    background: #0f172a;
    font-size: 16px;
}

input:focus {
    outline: 2px solid #38bdf8;
    border-color: transparent;
}

button {
    width: 100%;
    padding: 13px;
    border: 0;
    border-radius: 8px;
    background: #0ea5e9;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.message {
    min-height: 24px;
    margin-top: 16px;
    text-align: center;
}

.message.error {
    color: #fca5a5;
}

/* Admin page */

/* Верхняя панель */

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 32px;
    border-bottom: 1px solid #334155;
    background: #1e293b;
}

.topbar strong {
    font-size: 22px;
}

.topbar > div {
    display: flex;
    align-items: center;
    gap: 18px;
}

#current-user {
    color: #94a3b8;
    font-weight: 600;
}

.topbar button {
    width: auto;
    padding: 10px 18px;
    background: #dc2626;
}


/* Панель администратора */

.dashboard {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
    padding: 48px 0;
}

.dashboard > h1 {
    margin: 0 0 12px;
    font-size: 36px;
}

.dashboard > p {
    margin: 0 0 36px;
    color: #94a3b8;
    font-size: 17px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.dashboard-card {
    min-height: 180px;
    padding: 24px;
    border: 1px solid #334155;
    border-radius: 14px;
    background: #1e293b;
    box-shadow: 0 16px 35px rgb(0 0 0 / 20%);
}

.dashboard-card h2 {
    margin: 0 0 12px;
}

.dashboard-card p {
    margin: 0;
    color: #94a3b8;
    line-height: 1.6;
}


/* Адаптация под небольшие экраны */

@media (max-width: 800px) {
    .topbar {
        padding: 16px 20px;
    }

    .dashboard {
        width: min(100% - 32px, 1200px);
        padding: 32px 0;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}


/* Client Dashboard */

/* Клиентский кабинет */

.dashboard-heading,
.panel-heading,
.modal-heading,
.equipment-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.dashboard-heading {
    margin-bottom: 32px;
}

.dashboard-heading h1,
.panel-heading h2,
.modal-heading h2 {
    margin: 0;
}

.dashboard-heading p,
.modal-heading p {
    margin: 8px 0 0;
    color: #94a3b8;
}

.primary-button,
.secondary-button,
.modal-close {
    width: auto;
}

.primary-button {
    padding: 13px 22px;
}

.secondary-button {
    padding: 9px 16px;
    border: 1px solid #475569;
    background: #334155;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.summary-card {
    padding: 24px;
    border: 1px solid #334155;
    border-radius: 14px;
    background: #1e293b;
}

.summary-card span {
    display: block;
    color: #94a3b8;
}

.summary-card strong {
    display: block;
    margin-top: 12px;
    font-size: 36px;
}

.data-panel {
    margin-bottom: 28px;
    padding: 24px;
    border: 1px solid #334155;
    border-radius: 14px;
    background: #1e293b;
}

.panel-heading {
    margin-bottom: 22px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid #334155;
    text-align: left;
    white-space: nowrap;
}

th {
    color: #94a3b8;
    font-size: 13px;
    text-transform: uppercase;
}

.empty-state {
    margin: 20px 0 0;
    color: #64748b;
    text-align: center;
}

.status {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-pending {
    color: #fef3c7;
    background: #92400e;
}

.status-processing {
    color: #dbeafe;
    background: #1d4ed8;
}

.status-approved,
.status-active {
    color: #dcfce7;
    background: #166534;
}

.status-rejected,
.status-disabled,
.status-cancelled {
    color: #fee2e2;
    background: #991b1b;
}

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

.equipment-card {
    padding: 20px;
    border: 1px solid #334155;
    border-radius: 12px;
    background: #0f172a;
}

.equipment-card dl {
    margin: 18px 0 0;
}

.equipment-card dl div {
    margin-bottom: 12px;
}

.equipment-card dt {
    color: #64748b;
    font-size: 12px;
}

.equipment-card dd {
    margin: 4px 0 0;
}

.modal[hidden] {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 72%);
}

.modal-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 500px);
    padding: 28px;
    border: 1px solid #475569;
    border-radius: 16px;
    background: #1e293b;
    box-shadow: 0 24px 70px rgb(0 0 0 / 50%);
}

.modal-close {
    padding: 4px 10px;
    background: transparent;
    font-size: 28px;
}

.modal-dialog form {
    margin-top: 24px;
}

.modal-dialog label {
    margin: 18px 0 8px;
}

.modal-open {
    overflow: hidden;
}

.message.success {
    color: #86efac;
}

@media (max-width: 800px) {
    .dashboard-heading {
        align-items: stretch;
        flex-direction: column;
    }

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


/* Панель администратора */

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

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

.action-button {
    width: auto;
    padding: 7px 11px;
    font-size: 13px;
}

.approve-button {
    background: #15803d;
}

.reject-button {
    background: #b91c1c;
}

.action-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

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

@media (max-width: 600px) {
    .admin-stats {
        grid-template-columns: 1fr;
    }
}


/* Журнал действий администратора */

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

.audit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 16px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #0f172a;
}

.audit-item strong {
    margin-right: 6px;
}

.audit-item span,
.audit-item time {
    color: #94a3b8;
}

.audit-item time {
    white-space: nowrap;
    font-size: 13px;
}

@media (max-width: 600px) {
    .audit-item {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Результат отправки заявки */

.request-result-dialog {
    text-align: center;
}

.request-result-dialog h2 {
    margin: 18px 0 10px;
}

.request-result-dialog p {
    color: #94a3b8;
    line-height: 1.5;
}

.request-spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto;
    border: 4px solid #334155;
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: request-spinner-rotation 0.8s linear infinite;
}

.request-result-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 auto;
    border-radius: 50%;
    color: white;
    font-size: 34px;
    font-weight: 700;
}

.request-result-icon.success {
    background: #16a34a;
}

.request-result-icon.error {
    background: #dc2626;
}

.request-result-id {
    padding: 10px;
    border-radius: 8px;
    color: #e2e8f0 !important;
    background: #0f172a;
    font-weight: 700;
}

.request-result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.request-result-actions button {
    width: auto;
}

@keyframes request-spinner-rotation {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 500px) {
    .request-result-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .request-result-actions button {
        width: 100%;
    }
}

/* Карточка статистики Users */

.overview-card {
    min-height: 220px;
    overflow: hidden;
}

.overview-title {
    color: #e2e8f0 !important;
    font-size: 18px;
    font-weight: 700;
}

.overview-value {
    margin-top: 8px !important;
    font-size: 48px !important;
    line-height: 1;
    letter-spacing: -2px;
}

.overview-change {
    margin: 10px 0 4px;
    color: #86efac;
    font-size: 14px;
    font-weight: 600;
}

.overview-chart {
    width: 100%;
    height: 82px;
    margin-top: 4px;
}

.overview-chart svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

#users-chart-line {
    stroke: #60a5fa;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 5px rgb(96 165 250 / 55%));
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    margin-top: 3px;
    color: #64748b;
    font-size: 10px;
}

/* Верхний ряд административной панели */

.admin-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}


/* Карточка терминалов */

.terminals-overview-card {
    position: relative;
}

.terminal-status-list {
    display: grid;
    gap: 8px;
    margin-top: 20px;
}

.terminal-status-list p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #94a3b8;
    font-size: 15px;
}

.terminal-status-list strong {
    color: #f8fafc;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.terminal-dot-online {
    background: #3b82f6;
    box-shadow: 0 0 8px rgb(59 130 246 / 75%);
}

.terminal-dot-offline {
    background: #ef4444;
    box-shadow: 0 0 8px rgb(239 68 68 / 65%);
}

.terminal-description,
.requests-card-description {
    margin: auto 0 0;
    padding-top: 24px;
    color: #64748b;
    font-size: 13px;
}


/* Базовая карточка заявок */

.requests-overview-values {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 20px;
}

.requests-overview-values strong {
    font-size: 38px;
    line-height: 1;
}

.requests-overview-values span {
    color: #94a3b8;
}

.requests-divider {
    margin: 0 4px;
    font-size: 24px;
}

@media (max-width: 1000px) {
    .admin-stats {
        grid-template-columns: 1fr;
    }
}


/* Исправление верхнего ряда статистики */

.admin-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
    margin-bottom: 32px;
}

.admin-stats > .overview-card {
    width: auto;
    min-width: 0;
    min-height: 230px;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.overview-chart {
    width: 100%;
    min-width: 0;
    margin-top: auto;
}

@media (max-width: 1000px) {
    .admin-stats {
        grid-template-columns: 1fr;
    }
}

/* График заявок */

#requests-chart-line {
    stroke: #60a5fa;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(
        0 0 5px rgb(96 165 250 / 55%)
    );
}

/* Двойной блок после очереди заявок */

.dashboard-split {
    display: grid;
    grid-template-columns:
        minmax(0, 0.9fr)
        minmax(0, 1.4fr);
    gap: 24px;
    margin-bottom: 28px;
}

.dashboard-split-panel {
    min-width: 0;
    margin-bottom: 0;
}

.chart-panel-heading {
    align-items: flex-start;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    color: #94a3b8;
    font-size: 12px;
}

.chart-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-legend-dot {
    width: 9px;
    height: 9px;
    display: inline-block;
    border-radius: 50%;
}

.chart-legend-dot.successful {
    background: #3b82f6;
}

.chart-legend-dot.waiting {
    background: #ef4444;
}


/* Столбчатая диаграмма */

.activation-status-chart {
    min-height: 230px;
    display: grid;
    grid-template-columns: repeat(6, minmax(45px, 1fr));
    align-items: end;
    gap: 14px;
    padding: 20px 10px 0;
    overflow-x: auto;
    border-bottom: 1px solid #334155;
}

.activation-chart-group {
    min-width: 45px;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
}

.activation-chart-bars {
    height: 185px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 7px;
}

.activation-chart-column {
    height: 100%;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: flex-end;
    gap: 5px;
}

.activation-chart-value {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
}

.activation-chart-bar {
    width: 18px;
    min-height: 2px;
    border-radius: 6px 6px 2px 2px;
    transition: height 0.25s ease;
}

.activation-chart-bar.successful {
    background: #3b82f6;
    box-shadow: 0 0 8px rgb(59 130 246 / 35%);
}

.activation-chart-bar.waiting {
    background: #ef4444;
    box-shadow: 0 0 8px rgb(239 68 68 / 30%);
}

.activation-chart-label {
    color: #64748b;
    font-size: 11px;
}


/* Поток действий */

.dashboard-split .audit-list {
    max-height: 280px;
    overflow-y: auto;
}

.dashboard-split .audit-item {
    position: relative;
    padding-left: 28px;
}

.dashboard-split .audit-item::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 13px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
}

@media (max-width: 950px) {
    .dashboard-split {
        grid-template-columns: 1fr;
    }
}

/* ==================================================
   HEADER АДМИНИСТРАТОРА
   ================================================== */

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 100;

    min-height: 86px;
    display: grid;
    grid-template-columns:
        minmax(260px, 360px)
        minmax(320px, 720px)
        auto;
    align-items: center;
    gap: 28px;

    padding: 12px 36px;

    background: #1e293b;
    border-bottom: 1px solid #334155;
    box-shadow: 0 8px 24px rgb(2 6 23 / 18%);
}


/* Логотип */

.admin-brand {
    width: fit-content;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.admin-brand-logo {
    display: block;
    width: 310px;
    max-width: 100%;
    height: 58px;
    object-fit: contain;
    object-position: left center;
}


/* Глобальный поиск */

.admin-global-search {
    width: 100%;
    height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 16px;

    background: #111c2f;
    border: 1px solid #3b4a60;
    border-radius: 10px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.admin-global-search:focus-within {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgb(96 165 250 / 14%);
}

.admin-global-search svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;

    fill: none;
    stroke: #94a3b8;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.admin-global-search input {
    width: 100%;
    min-width: 0;

    color: #f8fafc;
    background: transparent;
    border: 0;
    outline: 0;

    font: inherit;
    font-size: 14px;
}

.admin-global-search input::placeholder {
    color: #718096;
}


/* Правая часть Header */

.admin-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.admin-header-dropdown {
    position: relative;
}

.admin-icon-button,
.admin-profile-button {
    border: 0;
    color: #e2e8f0;
    background: transparent;
    cursor: pointer;
}

.admin-icon-button {
    position: relative;

    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;

    border-radius: 10px;
}

.admin-icon-button:hover,
.admin-profile-button:hover {
    background: #2b3a50;
}

.admin-icon-button svg {
    width: 23px;
    height: 23px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* Счетчик уведомлений */

.notifications-badge {
    position: absolute;
    top: 3px;
    right: 2px;

    min-width: 19px;
    height: 19px;
    display: grid;
    place-items: center;

    padding: 0 5px;

    color: #ffffff;
    background: #ef4444;
    border: 2px solid #1e293b;
    border-radius: 999px;

    font-size: 10px;
    font-weight: 800;
}


/* Кнопка профиля */

.admin-profile-button {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0 12px;
    border-radius: 10px;

    font-size: 15px;
    font-weight: 700;
}

.admin-avatar {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;

    color: #ffffff;
    background: #3b82f6;
    border-radius: 50%;

    font-size: 13px;
    font-weight: 800;
}

.admin-profile-arrow {
    width: 16px;
    height: 16px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;

    transition: transform 0.2s ease;
}

.admin-profile-button[aria-expanded="true"]
.admin-profile-arrow {
    transform: rotate(180deg);
}


/* Выпадающие меню */

.header-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 120;

    background: #1e293b;
    border: 1px solid #3b4a60;
    border-radius: 12px;

    box-shadow: 0 18px 45px rgb(2 6 23 / 45%);
    overflow: hidden;
}

.header-dropdown-menu[hidden] {
    display: none;
}


/* Уведомления */

.notifications-menu {
    width: min(390px, calc(100vw - 32px));
}

.notifications-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    padding: 16px 18px;
    border-bottom: 1px solid #334155;
}

.notifications-header strong {
    color: #f8fafc;
}

.notifications-header span {
    color: #94a3b8;
    font-size: 12px;
}

.notifications-list {
    max-height: 340px;
    overflow-y: auto;
}

.notification-item {
    width: 100%;
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: 12px;

    padding: 14px 18px;

    color: #e2e8f0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #2d3b50;

    text-align: left;
    cursor: pointer;
}

.notification-item:hover {
    background: #26364c;
}

.notification-item-dot {
    width: 9px;
    height: 9px;
    margin-top: 6px;

    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 8px rgb(239 68 68 / 55%);
}

.notification-item-content {
    min-width: 0;
}

.notification-item-content strong {
    display: block;
    margin-bottom: 4px;

    color: #f8fafc;
    font-size: 13px;
}

.notification-item-content span {
    display: block;

    color: #94a3b8;
    font-size: 12px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notifications-empty {
    margin: 0;
    padding: 22px 18px;

    color: #94a3b8;
    text-align: center;
    font-size: 13px;
}


/* Меню профиля */

.profile-menu {
    width: 170px;
    padding: 6px;
}

.profile-menu-item {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;

    padding: 0 12px;

    color: #e2e8f0;
    background: transparent;
    border: 0;
    border-radius: 8px;

    font: inherit;
    font-size: 14px;
    text-decoration: none;
    text-align: left;

    cursor: pointer;
}

.profile-menu-item:hover {
    background: #2b3a50;
}

.profile-logout {
    color: #f87171;
}


/* Подсветка заявки из уведомления */

.admin-request-highlight {
    animation: request-highlight 2.2s ease;
}

@keyframes request-highlight {
    0%,
    100% {
        background: transparent;
    }

    30% {
        background: rgb(59 130 246 / 22%);
    }
}


/* Адаптивность */

@media (max-width: 1100px) {
    .admin-topbar {
        grid-template-columns:
            minmax(210px, 270px)
            minmax(260px, 1fr)
            auto;

        gap: 18px;
        padding-inline: 22px;
    }

    .admin-brand-logo {
        width: 250px;
    }
}

@media (max-width: 780px) {
    .admin-topbar {
        position: relative;
        grid-template-columns: 1fr auto;
        gap: 12px;

        padding: 12px 16px;
    }

    .admin-brand-logo {
        width: 220px;
        height: 50px;
    }

    .admin-global-search {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .admin-profile-button > span:not(.admin-avatar) {
        display: none;
    }
}

/* ==================================================
   КОРРЕКТИРОВКА HEADER
   ================================================== */

.admin-topbar {
    min-height: 96px;

    grid-template-columns:
        minmax(310px, 390px)
        minmax(360px, 760px)
        auto;

    align-items: center;
    gap: 28px;

    padding: 12px 38px;
}


/* Логотип */

.admin-brand {
    width: 100%;
    min-width: 0;

    display: flex;
    align-items: center;
}

.admin-brand-logo {
    display: block;

    width: clamp(280px, 20vw, 360px);
    height: auto;
    max-height: 72px;

    object-fit: contain;
    object-position: left center;
}


/* Поле поиска */

.admin-global-search {
    width: 100%;
    height: 50px;

    align-self: center;
    margin: 0;

    display: flex;
    align-items: center;

    font-family: inherit;
}

.admin-global-search input {
    height: 100%;
    display: block;

    padding: 0;

    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    line-height: normal;
}

.admin-global-search input::placeholder {
    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
}


/* Планшеты */

@media (max-width: 1100px) {
    .admin-topbar {
        grid-template-columns:
            minmax(250px, 310px)
            minmax(280px, 1fr)
            auto;

        gap: 18px;
        padding-inline: 22px;
    }

    .admin-brand-logo {
        width: clamp(240px, 25vw, 300px);
        max-height: 64px;
    }
}


/* Телефоны */

@media (max-width: 780px) {
    .admin-topbar {
        grid-template-columns: 1fr auto;
        min-height: auto;

        gap: 12px;
        padding: 12px 16px;
    }

    .admin-brand-logo {
        width: clamp(210px, 60vw, 280px);
        max-height: 60px;
    }

    .admin-global-search {
        grid-column: 1 / -1;
        grid-row: 2;

        height: 46px;
    }

    .admin-global-search input,
    .admin-global-search input::placeholder {
        font-size: 14px;
    }
}

/* Чередование строк в таблицах администратора */

#admin-requests-body tr:nth-child(odd),
#admin-equipment-body tr:nth-child(odd),
#admin-users-body tr:nth-child(odd) {
    background: #172235;
}

#admin-requests-body tr:nth-child(even),
#admin-equipment-body tr:nth-child(even),
#admin-users-body tr:nth-child(even) {
    background: #1c293d;
}


/* Подсветка строки при наведении */

#admin-requests-body tr:hover,
#admin-equipment-body tr:hover,
#admin-users-body tr:hover {
    background: #263852;
}


/* Плавное изменение оттенка */

#admin-requests-body tr,
#admin-equipment-body tr,
#admin-users-body tr {
    transition: background-color 0.15s ease;
}

#admin-requests-body td,
#admin-equipment-body td,
#admin-users-body td {
    border-bottom: 1px solid rgb(148 163 184 / 10%);
}

/* Кабинеты клиентов в Header */

.client-cabinets-button {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 9px;

    padding: 0 14px;

    color: #e2e8f0;
    background: transparent;
    border: 1px solid #3b4a60;
    border-radius: 10px;

    font: inherit;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}

.client-cabinets-button:hover {
    background: #2b3a50;
}

.client-cabinets-button > svg:first-child {
    width: 20px;
    height: 20px;
}

.client-cabinets-button svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.client-cabinets-arrow {
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease;
}

.client-cabinets-button[aria-expanded="true"]
.client-cabinets-arrow {
    transform: rotate(180deg);
}

.client-cabinets-menu {
    width: 310px;
    padding: 10px;
}

.client-cabinets-search {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;

    padding: 0 12px;
    margin-bottom: 8px;

    background: #111c2f;
    border: 1px solid #3b4a60;
    border-radius: 8px;
}

.client-cabinets-search svg {
    width: 17px;
    height: 17px;

    fill: none;
    stroke: #94a3b8;
    stroke-width: 2;
}

.client-cabinets-search input {
    width: 100%;

    color: #f8fafc;
    background: transparent;
    border: 0;
    outline: 0;

    font: inherit;
    font-size: 13px;
}

.client-cabinets-list {
    max-height: 320px;
    overflow-y: auto;
}

.client-cabinet-item {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 8px 11px;

    color: #e2e8f0;
    background: transparent;
    border: 0;
    border-radius: 8px;

    font: inherit;
    text-align: left;

    cursor: pointer;
}

.client-cabinet-item:hover {
    background: #2b3a50;
}

.client-cabinet-item small {
    color: #94a3b8;
}

@media (max-width: 900px) {
    .client-cabinets-button > span {
        display: none;
    }

    .client-cabinets-button {
        width: 46px;
        justify-content: center;
        padding: 0;
    }

    .client-cabinets-arrow {
        display: none;
    }
}

/* ==================================================
   ПРОФИЛЬ ПОЛЬЗОВАТЕЛЯ В HEADER
   ================================================== */

.admin-profile-name {
    max-width: 140px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-profile-arrow {
    width: 15px;
    height: 15px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;

    transition: transform 0.2s ease;
}

.admin-profile-button[aria-expanded="true"]
.admin-profile-arrow {
    transform: rotate(180deg);
}

.admin-profile-menu {
    width: 220px;
    padding: 8px;
}

.profile-menu-info {
    display: flex;
    flex-direction: column;
    gap: 4px;

    padding: 10px 12px;
}

.profile-menu-role {
    color: #94a3b8;

    font-size: 12px;
    font-weight: 500;
}

.profile-menu-username {
    color: #f8fafc;

    font-size: 14px;
    font-weight: 600;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-menu-divider {
    height: 1px;

    margin: 4px 0;

    background: rgb(148 163 184 / 14%);
}

.profile-menu-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;

    color: #fca5a5;
}

.profile-menu-logout:hover {
    color: #fecaca;
    background: rgb(239 68 68 / 12%);
}

.profile-menu-logout svg {
    width: 17px;
    height: 17px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Позиционирование меню профиля */

.admin-header-dropdown {
    position: relative;
}

.admin-profile-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1000;

    width: 220px;
}

.admin-profile-menu[hidden] {
    display: none;
}

/* ==================================================
   КОМПАКТНЫЙ HEADER ПОЛЬЗОВАТЕЛЯ
   ================================================== */

.client-topbar {
    min-height: 82px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    padding: 10px 38px;

    background: #1e2b3e;
    border-bottom: 1px solid #34445b;
}

.client-brand {
    min-width: 0;

    display: flex;
    align-items: center;

    text-decoration: none;
}

.client-brand-logo {
    display: block;

    width: clamp(240px, 22vw, 340px);
    height: auto;
    max-height: 64px;

    object-fit: contain;
    object-position: left center;
}

.client-profile-dropdown {
    position: relative;
    flex: 0 0 auto;
}

.client-profile-button {
    min-height: 46px;
}


/* Планшеты */

@media (max-width: 900px) {
    .client-topbar {
        padding-inline: 22px;
    }

    .client-brand-logo {
        width: clamp(210px, 30vw, 280px);
        max-height: 58px;
    }
}


/* Телефоны */

@media (max-width: 600px) {
    .client-topbar {
        min-height: 70px;
        gap: 12px;

        padding: 9px 14px;
    }

    .client-brand-logo {
        width: clamp(170px, 48vw, 230px);
        max-height: 50px;
    }

    .client-profile-button {
        padding-inline: 8px;
    }

    .client-profile-button .admin-profile-name {
        display: none;
    }
}

.client-profile-dropdown {
    position: relative;
}

.client-profile-dropdown .admin-profile-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1000;

    width: 220px;
}

.client-profile-dropdown .admin-profile-menu[hidden] {
    display: none;
}

/* ==================================================
   СВОДКА ПОЛЬЗОВАТЕЛЬСКОГО КАБИНЕТА
   ================================================== */

.client-overview {
    width: min(100%, 920px);

    margin: 32px auto;
    padding: 0 24px;
}

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


/* Карточка */

.client-overview-card {
    min-height: 225px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;

    padding: 22px;

    background:
        linear-gradient(
            145deg,
            #263347,
            #1b2738
        );

    border: 1px solid rgb(148 163 184 / 16%);
    border-radius: 15px;

    box-shadow:
        0 12px 28px rgb(0 0 0 / 18%);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.client-overview-card:hover {
    transform: translateY(-3px);

    border-color: rgb(96 165 250 / 42%);

    box-shadow:
        0 16px 34px rgb(0 0 0 / 24%);
}


/* Верхняя часть карточки */

.client-overview-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}


/* Иконка */

.client-overview-icon {
    width: 90px;
    height: 90px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #a8b7d3;
}

.client-overview-icon svg {
    width: 100%;
    height: 100%;

    fill: none;
    stroke: currentColor;
    stroke-width: 2.7;
    stroke-linecap: round;
    stroke-linejoin: round;

    filter:
        drop-shadow(
            0 5px 10px rgb(0 0 0 / 25%)
        );
}


/* Счетчик */

.client-overview-ratio {
    display: flex;
    align-items: baseline;
    gap: 4px;

    color: #cbd5e1;

    font-size: 23px;
    font-weight: 500;
    line-height: 1;
}

.client-overview-ratio strong {
    color: #f8fafc;

    font-size: 29px;
    font-weight: 700;
}


/* Текст карточки */

.client-overview-card-content h2 {
    margin: 0 0 7px;

    color: #f8fafc;

    font-size: 22px;
    font-weight: 650;
}

.client-overview-card-content p {
    margin: 0 0 5px;

    color: #aab7cb;

    font-size: 14px;
}

.client-overview-card-content small {
    color: #7f91aa;

    font-size: 13px;
}


/* Кнопка активации */

.client-overview-activate {
    min-width: 360px;
    min-height: 54px;

    display: block;

    margin: 26px auto 0;
    padding: 0 30px;

    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            #2563eb,
            #3b82f6
        );

    border: 1px solid rgb(147 197 253 / 36%);
    border-radius: 11px;

    box-shadow:
        0 10px 24px rgb(37 99 235 / 26%);

    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.025em;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.client-overview-activate:hover {
    transform: translateY(-2px);

    filter: brightness(1.08);

    box-shadow:
        0 14px 30px rgb(37 99 235 / 34%);
}

.client-overview-activate:active {
    transform: translateY(0);
}


/* Планшеты */

@media (max-width: 760px) {
    .client-overview {
        margin-top: 24px;
        padding-inline: 18px;
    }

    .client-overview-card {
        min-height: 205px;
    }

    .client-overview-icon {
        width: 76px;
        height: 76px;
    }
}


/* Телефоны */

@media (max-width: 600px) {
    .client-overview-grid {
        grid-template-columns: 1fr;
    }

    .client-overview-card {
        min-height: 190px;
    }

    .client-overview-activate {
        width: 100%;
        min-width: 0;

        font-size: 14px;
    }
}

/* Изображение антенн Starlink */

.client-overview-antennas {
    width: 120px;
    height: 100px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: visible;
}

.client-overview-icon-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
    object-position: center;

    user-select: none;
    pointer-events: none;
}

@media (min-width: 761px) {
    .client-overview-antennas {
        width: 140px;
        height: 110px;
    }
}

/* ==================================================
   ГОРИЗОНТАЛЬНЫЙ СПИСОК STARLINK
   ================================================== */

.equipment-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* Отдельная строка оборудования */

.equipment-card.equipment-row {
    width: 100%;
    min-height: auto;

    display: block;

    padding: 18px 20px;

    background: #172235;

    border: 1px solid #34445b;
    border-radius: 12px;

    box-shadow:
        0 5px 14px rgb(0 0 0 / 14%);

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

.equipment-card.equipment-row:hover {
    transform: translateY(-1px);

    background: #1b2940;
    border-color: #49607e;
}


/* Верхняя строка */

.equipment-row-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 10px;
}

.equipment-row-kit {
    display: flex;
    align-items: baseline;
    gap: 7px;

    color: #a8b5ca;
    font-size: 14px;
}

.equipment-row-kit strong {
    color: #f8fafc;
    font-size: 16px;
    font-weight: 700;
}


/* Информация */

.equipment-row-information {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.equipment-row-information p {
    display: flex;
    align-items: baseline;
    gap: 6px;

    margin: 0;

    color: #99a8bf;
    font-size: 14px;
}

.equipment-row-information strong {
    color: #dce5f2;
    font-weight: 500;
}


/* Онлайн / офлайн */

.equipment-connection-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    flex: 0 0 auto;

    font-size: 14px;
    font-weight: 650;
}

.equipment-connection-dot {
    width: 10px;
    height: 10px;

    flex: 0 0 auto;

    border-radius: 50%;
}


/* Онлайн */

.equipment-connection-online {
    color: #70db96;
}

.equipment-connection-online
.equipment-connection-dot {
    background: #32c466;

    box-shadow:
        0 0 0 4px rgb(50 196 102 / 12%),
        0 0 10px rgb(50 196 102 / 42%);
}


/* Офлайн */

.equipment-connection-offline {
    color: #ff8080;
}

.equipment-connection-offline
.equipment-connection-dot {
    background: #ef5350;

    box-shadow:
        0 0 0 4px rgb(239 83 80 / 12%),
        0 0 10px rgb(239 83 80 / 38%);
}


/* Чередование тона строк */

.equipment-row:nth-child(even) {
    background: #1a2639;
}


/* Мобильная версия */

@media (max-width: 600px) {
    .equipment-card.equipment-row {
        padding: 16px;
    }

    .equipment-row-heading {
        align-items: flex-start;
        gap: 12px;
    }

    .equipment-row-kit {
        flex-direction: column;
        gap: 2px;
    }

    .equipment-row-information p {
        flex-wrap: wrap;
    }
}

/* ==================================================
   УПРАВЛЕНИЕ STARLINK
   ================================================== */

.starlink-management-table th:last-child,
.starlink-management-table td:last-child {
    width: 330px;
}

.starlink-state-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.starlink-state-option {
    position: relative;

    display: inline-flex;

    cursor: pointer;
}

.starlink-state-radio {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    pointer-events: none;
}

.starlink-state-control {
    min-height: 38px;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 7px 13px;

    color: #9eabc0;
    background: #172235;

    border: 1px solid #394961;
    border-radius: 10px;

    font-size: 14px;
    font-weight: 650;

    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.starlink-state-dot {
    width: 10px;
    height: 10px;

    border-radius: 50%;

    background: #738198;
}


/* Включен */

.starlink-state-online
.starlink-state-radio:checked
+
.starlink-state-control {
    color: #d9ffe5;
    background: rgb(22 126 67 / 28%);

    border-color: #21864b;

    box-shadow:
        0 0 0 3px rgb(34 197 94 / 10%);
}

.starlink-state-online
.starlink-state-radio:checked
+
.starlink-state-control
.starlink-state-dot {
    background: #31d46a;

    box-shadow:
        0 0 9px rgb(49 212 106 / 55%);
}


/* Выключен */

.starlink-state-offline
.starlink-state-radio:checked
+
.starlink-state-control {
    color: #ffe0e0;
    background: rgb(185 28 28 / 25%);

    border-color: #b83232;

    box-shadow:
        0 0 0 3px rgb(239 68 68 / 9%);
}

.starlink-state-offline
.starlink-state-radio:checked
+
.starlink-state-control
.starlink-state-dot {
    background: #ef5350;

    box-shadow:
        0 0 9px rgb(239 83 80 / 52%);
}


/* Фокус с клавиатуры */

.starlink-state-radio:focus-visible
+
.starlink-state-control {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}


/* Заблокированное состояние */

.starlink-state-radio:disabled
+
.starlink-state-control {
    cursor: wait;
    opacity: 0.65;
}


/* Чередование строк */

.starlink-management-table tbody tr:nth-child(odd) {
    background: rgb(15 27 46 / 44%);
}

.starlink-management-table tbody tr:nth-child(even) {
    background: rgb(31 45 65 / 58%);
}


@media (max-width: 760px) {
    .starlink-state-group {
        align-items: stretch;
        flex-direction: column;
    }

    .starlink-state-control {
        justify-content: center;
    }
}

/* Новое уведомление */

.notification-item-new
.notification-item-dot {
    background: #ef4444;

    box-shadow:
        0 0 8px rgb(239 68 68 / 55%);
}


/* Уже просмотренное уведомление */

.notification-item-read {
    opacity: 0.72;
}

.notification-item-read
.notification-item-dot {
    background: #64748b;
    box-shadow: none;
}

/* ==================================================
   ИТОГОВЫЕ ПОКАЗАТЕЛИ В КАРТОЧКАХ
   ================================================== */

.client-overview-total {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;

    min-width: 70px;
}

.client-overview-total strong {
    color: #f8fafc;

    font-size: 46px;
    font-weight: 750;
    line-height: 1;

    text-shadow:
        0 4px 12px rgb(0 0 0 / 20%);
}


/* Список показателей */

.client-overview-stat-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.client-overview-stat-list p {
    display: flex;
    align-items: baseline;
    gap: 6px;

    margin: 0;

    color: #a7b4c8;

    font-size: 15px;
    line-height: 1.35;
}

.client-overview-stat-list strong {
    color: #f1f5f9;

    font-size: 16px;
    font-weight: 700;
}


/* Цветовые акценты */

.client-overview-stat-online strong,
.client-overview-stat-approved strong {
    color: #58d987;
}

.client-overview-stat-offline strong {
    color: #ff7272;
}

.client-overview-stat-pending strong {
    color: #f5ad55;
}


@media (max-width: 600px) {
    .client-overview-total strong {
        font-size: 38px;
    }
}

.client-overview-stat-rejected strong {
    color: #ff7272;
}

.client-overview-stat-cancelled strong {
    color: #94a3b8;
}

/* Выпадающие списки в очереди заявок */
/* Выпадающие списки в очереди заявок */
#admin-requests-body select {
    width: 100%;
    min-width: 155px;
    height: 36px;
    padding: 0 24px 0 8px;

    color: #e8eef7;
    background-color: #111c2d;

    border: 1px solid #40516a;
    border-radius: 8px;

    font-family: inherit;
    font-size: 12px;
    font-weight: 500;

    cursor: pointer;
    outline: none;

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

/* Статус оплаты */
#admin-requests-body td:nth-child(5) select {
    min-width: 165px;
}

/* Действия */
#admin-requests-body td:nth-child(7) select {
    min-width: 175px;
}

#admin-requests-body select:hover {
    background-color: #17243a;
    border-color: #6682a8;
}

#admin-requests-body select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

#admin-requests-body select:disabled {
    color: #7e8999;
    background-color: #202938;
    border-color: #303b4c;
    cursor: not-allowed;
    opacity: 0.75;
}

#admin-requests-body select option {
    color: #e8eef7;
    background-color: #111c2d;
}


/* Отступ между реферальной ссылкой и кнопкой входа */
#referral-login {
    margin-bottom: 22px;
}

/* ==================================================
   Переключатель ПАД / ПАК
   ================================================== */

.admin-panel-tabs {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin: 0 0 24px;
    padding-left: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.admin-panel-tab {
    position: relative;
    min-width: 220px;
    padding: 12px 22px 11px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    background: rgba(30, 41, 59, 0.72);
    color: #94a3b8;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.admin-panel-tab:hover {
    color: #e2e8f0;
    background: rgba(51, 65, 85, 0.9);
}

.admin-panel-tab.is-active {
    z-index: 2;
    color: #ffffff;
    background: #0f172a;
    border-color: rgba(56, 189, 248, 0.65);
    transform: translateY(1px);
}

.admin-panel-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: #0f172a;
}

@media (max-width: 700px) {
    .admin-panel-tabs {
        overflow-x: auto;
        padding-left: 0;
    }

    .admin-panel-tab {
        min-width: 180px;
        white-space: nowrap;
    }
}



/* Модальное окно настройки счета */
.invoice-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.invoice-modal[hidden] {
    display: none !important;
}

.invoice-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(4px);
}

.invoice-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.invoice-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.invoice-modal-header h2 {
    margin: 0;
}

.invoice-modal-close {
    border: 0;
    background: transparent;
    color: #cbd5e1;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.invoice-modal-body {
    display: grid;
    gap: 16px;
}

.invoice-modal-body label {
    display: grid;
    gap: 7px;
    color: #cbd5e1;
    font-weight: 600;
}

.invoice-modal-body input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 13px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    background: #0f172a;
    color: #f8fafc;
    font: inherit;
}

.invoice-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}


/* Кнопка закрытия счета в верхнем правом углу */
.invoice-modal-dialog {
    position: relative;
}

.invoice-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
}

.invoice-modal-header {
    padding-right: 34px;
}


/* Модальное окно счета клиента */
.client-invoice-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.client-invoice-modal[hidden] {
    display: none !important;
}

.client-invoice-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(4px);
}

.client-invoice-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    padding: 28px 24px 24px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.client-invoice-dialog h2 {
    margin: 0 40px 24px 0;
}

.client-invoice-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    color: #cbd5e1;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.client-invoice-details {
    display: grid;
    gap: 14px;
}

.client-invoice-details > div {
    display: grid;
    gap: 5px;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.72);
    border-radius: 10px;
}

.client-invoice-details span {
    color: #94a3b8;
    font-size: 13px;
}

.client-invoice-details strong {
    color: #f8fafc;
    overflow-wrap: anywhere;
}

.client-invoice-wallet-row .secondary-button {
    width: fit-content;
    margin-top: 6px;
}


/* Состояния кнопок счета */
.invoice-sent-button {
    background: #047857 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

.invoice-sent-button:hover {
    background: #065f46 !important;
}

.client-invoice-button {
    background: #0369a1 !important;
    border-color: #38bdf8 !important;
}

.client-invoice-button.is-viewed {
    background: #475569 !important;
    border-color: #64748b !important;
    color: #e2e8f0 !important;
}


.invoice-viewed-button {
    background: #334155 !important;
    border-color: #94a3b8 !important;
    color: #f8fafc !important;
}

.invoice-viewed-button:hover {
    background: #475569 !important;
}


/* Единая таблица администратора */
.dashboard {
    width: calc(100% - 48px);
    max-width: 1720px;
    margin-left: auto;
    margin-right: auto;
}

.admin-main-table {
    width: 100%;
    min-width: 1380px;
    table-layout: auto;
}

.admin-main-table th:nth-child(1),
.admin-main-table td:nth-child(1) {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
}

.admin-main-table th:nth-child(2),
.admin-main-table td:nth-child(2) {
    min-width: 125px;
}

.admin-main-table th:nth-child(3),
.admin-main-table td:nth-child(3) {
    min-width: 170px;
}

.admin-main-table th:nth-child(4),
.admin-main-table td:nth-child(4) {
    min-width: 170px;
}

.admin-main-table th:nth-child(5),
.admin-main-table td:nth-child(5) {
    min-width: 180px;
    white-space: nowrap;
}

.admin-main-table th:nth-child(6),
.admin-main-table td:nth-child(6) {
    min-width: 200px;
}

.admin-main-table th:nth-child(7),
.admin-main-table td:nth-child(7) {
    min-width: 170px;
}

.admin-main-table th:nth-child(8),
.admin-main-table td:nth-child(8) {
    min-width: 260px;
}

.admin-request-comment {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .dashboard {
        width: calc(100% - 24px);
    }
}

/* Компактная колонка статуса */
.admin-main-table th:nth-child(6),
.admin-main-table td:nth-child(6) {
    width: 185px;
    min-width: 185px;
    max-width: 185px;
}

.admin-main-table .request-status-select {
    width: 100%;
    max-width: 185px;
}

/* Центрирование заголовков основной таблицы */
.admin-main-table thead th {
    text-align: center;
}

/* Добавление клиента в единую таблицу */
.admin-add-client-actions {
    display: flex;
    justify-content: center;
    padding: 22px 16px 6px;
}

#admin-add-client-button {
    min-width: 240px;
}


/* Все аккаунты — единая админка */

/* Фиксированная ширина всех состояний счета */
.admin-main-table .account-billing-cell .primary-button {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    white-space: nowrap;
}

.admin-all-accounts-actions {
    display: flex;
    justify-content: center;
    padding: 24px 16px 8px;
}

#admin-all-accounts-toggle {
    min-width: 240px;
}

/* Закрытое состояние */
.admin-all-accounts-panel {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    transition:
        max-height .35s ease,
        opacity .25s ease,
        margin-top .35s ease,
        padding .35s ease;
}

/* Открытое состояние */
.admin-all-accounts-panel.is-open {
    max-height: 720px;
    opacity: 1;
    margin-top: 18px;
    padding-top: 24px;
    padding-bottom: 24px;
    border-width: 1px;
}

.admin-all-accounts-wrapper {
    max-height: 520px;
    overflow-y: auto;
}

.admin-all-accounts-table {
    width: 100%;
}

.admin-all-accounts-table thead th {
    text-align: center;
}

.admin-all-accounts-table th,
.admin-all-accounts-table td {
    padding-left: 24px;
    padding-right: 24px;
}


/* Компактная таблица Все аккаунты */
.admin-all-accounts-panel {
    width: min(1180px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.admin-all-accounts-table {
    width: 100%;
    table-layout: auto;
}

.admin-all-accounts-table th:nth-child(1),
.admin-all-accounts-table td:nth-child(1) {
    width: 65px;
    text-align: center;
}

.admin-all-accounts-table th:nth-child(2),
.admin-all-accounts-table td:nth-child(2) {
    width: 170px;
}

.admin-all-accounts-table th:nth-child(3),
.admin-all-accounts-table td:nth-child(3) {
    width: 240px;
}

.admin-all-accounts-table th:nth-child(4),
.admin-all-accounts-table td:nth-child(4) {
    width: 220px;
}

.admin-all-accounts-table th:nth-child(5),
.admin-all-accounts-table td:nth-child(5) {
    width: 190px;
    white-space: nowrap;
}


/* Dashboard layout 12.08.2026 */

/* Старые верхние карточки остаются для JS, но не отображаются */
.users-overview-card,
.terminals-overview-card {
    display: none !important;
}

/* Верх: Поток последних действий | Requests */
.admin-stats {
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr) !important;
    align-items: stretch;
}

.top-audit-card,
.requests-overview-card {
    width: 100%;
    min-width: 0;
    height: 100%;
}

.top-audit-card {
    margin: 0;
}

/* Старые нижние аналитические карточки скрыты */
.admin-secondary-metrics {
    display: none !important;
}

/* Управление Starlink пока скрыто */
.admin-starlink-management-hidden {
    display: none !important;
}

/* Requests: online справа сверху */
.requests-overview-card {
    position: relative;
}

.requests-online-indicator {
    position: absolute;
    top: 20px;
    right: 22px;

    display: inline-flex;
    align-items: baseline;
    gap: 4px;

    font-size: 14px;
    font-weight: 700;
    color: #dc2626;
}

.requests-online-indicator strong {
    font-size: inherit;
    color: inherit;
}

/* Меньшая стрелка в статусах */
.admin-main-table .request-status-select {
    appearance: none;
    -webkit-appearance: none;

    padding-right: 25px;

    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%2364758b' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 8px 5px;
}

/* Все аккаунты: немного компактнее */
.admin-all-accounts-panel {
    width: min(1080px, calc(100% - 32px));
}

/* Фиксированный header Все аккаунты */
.admin-all-accounts-wrapper {
    position: relative;
    overflow-y: auto;
}

.admin-all-accounts-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;

    background: #ffffff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.10);
}

@media (max-width: 900px) {
    .admin-stats {
        grid-template-columns: 1fr !important;
    }
}


/* ADMIN UI FIX 20260812 */

/* --------------------------------------------------
   Верхний Header
-------------------------------------------------- */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.admin-topbar {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    margin-left: 0;
    margin-right: 0;

    display: grid;
    grid-template-columns:
        auto
        minmax(280px, 600px)
        minmax(0, 1fr);

    align-items: center;
    column-gap: 24px;

    padding-left: 32px;
    padding-right: 32px;
}

.admin-brand {
    min-width: 0;
}

.admin-global-search {
    width: 100%;
    min-width: 0;
    max-width: 600px;
}

.admin-global-search input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.admin-header-actions {
    min-width: 0;
    justify-self: end;
}

/* Широкие таблицы не должны ломать всю страницу */
.table-wrapper {
    max-width: 100%;
    overflow-x: auto;
}


/* --------------------------------------------------
   Старые табы больше не показываем
-------------------------------------------------- */

.admin-panel-tabs {
    display: none !important;
}

#admin-panel-dashboard {
    display: block !important;
}

#admin-panel-accounts {
    display: none !important;
}


/* --------------------------------------------------
   Поток последних действий
-------------------------------------------------- */

.top-audit-card {
    height: 650px;
    min-height: 650px;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

.top-audit-card .audit-list {
    flex: 1 1 auto;
    min-height: 0;

    max-height: none !important;
    overflow-y: auto;
    overflow-x: hidden;

    padding-right: 6px;
}

.top-audit-card .audit-item {
    flex: 0 0 auto;
}

.top-audit-card .audit-item > div {
    min-width: 0;
}

.top-audit-card .audit-item span {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.top-audit-card .audit-item time {
    flex: 0 0 auto;
}


/* --------------------------------------------------
   Requests
-------------------------------------------------- */

.requests-overview-card {
    height: 650px;
    min-height: 650px;

    overflow: hidden;
}

.requests-overview-card .overview-title {
    font-size: 30px;
    line-height: 1.1;
    font-weight: 800;
}

/* Весь график и даты движутся одним scroll */
.requests-chart-scroll {
    width: 100%;
    min-width: 0;

    margin-top: auto;

    overflow-x: auto;
    overflow-y: hidden;

    padding-bottom: 8px;

    scrollbar-gutter: stable;
    overscroll-behavior-x: contain;
}

.requests-chart-canvas {
    width: 760px;
    min-width: 760px;
}

.requests-chart-canvas .overview-chart {
    width: 100%;
}

.requests-chart-canvas .overview-chart svg {
    width: 100%;
}

.requests-chart-canvas .chart-labels {
    width: 100%;
    min-width: 100%;
}


/* --------------------------------------------------
   Все аккаунты — фиксированный Header
-------------------------------------------------- */

.admin-all-accounts-wrapper {
    position: relative;
    max-height: 520px;

    overflow-y: auto;
    overflow-x: auto;
}

.admin-all-accounts-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;

    /* Светло-серый вместо белого */
    background: #e2e8f0 !important;

    color: #64748b;

    border-bottom: 1px solid #cbd5e1;

    box-shadow:
        0 1px 0 rgba(15, 23, 42, 0.10);
}


@media (max-width: 900px) {
    .admin-topbar {
        grid-template-columns:
            auto
            minmax(180px, 1fr)
            auto;

        column-gap: 12px;

        padding-left: 16px;
        padding-right: 16px;
    }

    .top-audit-card,
    .requests-overview-card {
        height: 520px;
        min-height: 520px;
    }
}

/* FIX: центрирование Header на широких экранах */
.admin-topbar {
    width: 100% !important;
    max-width: none !important;

    margin-left: auto !important;
    margin-right: auto !important;

    left: auto !important;
    right: auto !important;

    box-sizing: border-box;

    /*
     * На обычном экране — стандартный отступ.
     * На широком — содержимое Header остается
     * по центру относительно Dashboard 1720px.
     */
    padding-left: max(
        32px,
        calc((100vw - 1720px) / 2)
    ) !important;

    padding-right: max(
        32px,
        calc((100vw - 1720px) / 2)
    ) !important;

    grid-template-columns:
        auto
        minmax(280px, 600px)
        minmax(0, 1fr) !important;
}

@media (max-width: 900px) {
    .admin-topbar {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}


/* ADMIN FINAL LAYOUT FIX */

/* ==================================================
   HEADER — поведение как раньше
   ================================================== */

.admin-topbar {
    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;

    left: auto !important;
    right: auto !important;

    transform: none !important;

    box-sizing: border-box;

    display: grid !important;

    grid-template-columns:
        300px
        minmax(320px, 560px)
        minmax(0, 1fr) !important;

    align-items: center !important;

    column-gap: 24px !important;

    padding:
        18px
        32px !important;

    min-height: 108px;
}

.admin-brand {
    justify-self: start;
}

.admin-global-search {
    width: 100%;
    max-width: 560px;
    min-width: 0;

    justify-self: start;
}

.admin-header-actions {
    justify-self: end !important;

    margin-left: 0 !important;
}


/* ==================================================
   Поток последних действий + Requests
   650 / 1.5 ≈ 433 px
   ================================================== */

.top-audit-card,
.requests-overview-card {
    height: 430px !important;
    min-height: 430px !important;
    max-height: 430px !important;
}


/* История действий прокручивается внутри */
.top-audit-card .audit-list {
    min-height: 0;
    overflow-y: auto !important;
}


/* ==================================================
   ONLINE
   ================================================== */

.requests-online-indicator {
    top: 24px !important;
    right: 28px !important;

    display: inline-flex !important;

    align-items: center;

    gap: 8px;

    white-space: nowrap;

    font-size: 42px !important;
    line-height: 1 !important;
    font-weight: 800 !important;

    color: #ef4444 !important;
}

.requests-online-indicator strong {
    font-size: 42px !important;
    line-height: 1 !important;

    color: #ef4444 !important;
}


/* ==================================================
   Requests — горизонтальная история
   ================================================== */

.requests-chart-scroll {
    width: 100%;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    scrollbar-width: thin;
}

.requests-chart-canvas {
    min-width: 760px;
}


/* ==================================================
   Комментарии
   ================================================== */

.admin-comment-cell {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    width: 100%;
}

.admin-comment-text {
    flex: 1 1 auto;

    min-width: 0;

    white-space: normal;

    overflow-wrap: anywhere;
}

.admin-comment-edit-button {
    flex: 0 0 30px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    padding: 0;

    border: 1px solid #475569;
    border-radius: 7px;

    background: #172033;

    color: #94a3b8;

    cursor: pointer;

    transition:
        border-color .15s ease,
        color .15s ease,
        background .15s ease;
}

.admin-comment-edit-button:hover {
    border-color: #38bdf8;

    color: #38bdf8;

    background: #1e293b;
}

.admin-comment-edit-button svg {
    width: 15px;
    height: 15px;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.8;

    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ==================================================
   Header responsive
   ================================================== */

@media (max-width: 1000px) {
    .admin-topbar {
        grid-template-columns:
            auto
            minmax(180px, 1fr)
            auto !important;

        column-gap: 12px !important;

        padding:
            14px
            16px !important;
    }

    .requests-online-indicator,
    .requests-online-indicator strong {
        font-size: 28px !important;
    }
}


/* REQUESTS MULTI-LINE CHART */

#requests-chart-line {
    stroke: #60a5fa;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#requests-activations-line {
    stroke: #ef4444;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.requests-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;

    margin-top: 14px;
    padding-left: 4px;

    font-size: 13px;
    font-weight: 600;

    color: #94a3b8;
}

.requests-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.requests-chart-dot {
    display: inline-block;

    width: 10px;
    height: 10px;

    border-radius: 999px;
}

.requests-chart-dot-requests {
    background: #60a5fa;
}

.requests-chart-dot-activations {
    background: #ef4444;
}

/* Более аккуратный online */
.requests-online-indicator {
    font-size: 26px !important;
    line-height: 1 !important;

    font-weight: 700 !important;

    color: #ef4444 !important;

    letter-spacing: -0.01em;
}

.requests-online-indicator strong {
    font-size: 26px !important;
    line-height: 1 !important;

    font-weight: 800 !important;

    color: #ef4444 !important;
}

@media (max-width: 1000px) {
    .requests-online-indicator,
    .requests-online-indicator strong {
        font-size: 20px !important;
    }
}


/* FIX Requests online + header Все аккаунты */

.requests-online-indicator,
.requests-online-indicator strong {
    font-weight: 500 !important;
}

/* Типичный светло-серый header */
.admin-all-accounts-table thead th {
    background: #cbd5e1 !important;
    color: #64748b !important;
}

/* Отступ кнопки отправки заявки от поля S/N */
#request-submit-button {
    margin-top: 22px;
}

/* ==================================================
   КОПИРОВАНИЕ ЛОГИНА / KIT / S/N
   ================================================== */

.admin-copy-cell {
    position: relative;
    padding-right: 38px !important;
}

.admin-cell-copy-button {
    position: absolute;
    top: 7px;
    right: 7px;

    width: 25px;
    height: 25px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 6px;
    background: transparent;

    color: #94a3b8;

    opacity: 0;
    visibility: hidden;

    cursor: pointer;

    transition:
        opacity 0.15s ease,
        background 0.15s ease,
        color 0.15s ease;
}

.admin-copy-cell:hover .admin-cell-copy-button,
.admin-cell-copy-button:focus-visible {
    opacity: 1;
    visibility: visible;
}

.admin-cell-copy-button:hover {
    background: rgba(148, 163, 184, 0.14);
    color: #e2e8f0;
}

.admin-cell-copy-button.is-copied {
    opacity: 1;
    visibility: visible;
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}

.admin-cell-copy-button svg {
    width: 15px;
    height: 15px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==================================================
   РЕФЕРАЛЬНАЯ ССЫЛКА В HEADER КЛИЕНТА
   ================================================== */

.client-header-referral {
    margin-left: auto;

    display: flex;
    align-items: center;
    gap: 7px;

    min-width: 0;

    font-size: 14px;
    white-space: nowrap;
}

.client-header-referral span {
    color: #94a3b8;
    font-weight: 500;
}

.client-header-referral strong {
    max-width: 220px;

    overflow: hidden;
    text-overflow: ellipsis;

    color: #e2e8f0;
    font-weight: 600;
}

.client-profile-dropdown {
    margin-left: 18px !important;
}

@media (max-width: 900px) {
    .client-header-referral span {
        display: none;
    }

    .client-header-referral strong {
        max-width: 130px;
    }
}

.client-header-referral-copy {
    padding: 3px 5px;

    border: 0;
    border-radius: 5px;

    background: transparent;
    color: #e2e8f0;

    font: inherit;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.client-header-referral-copy:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #ffffff;
}

.client-header-referral-copy.is-copied {
    color: #86efac;
}

/* ==================================================
   КНОПКА ЗАКРЫТИЯ ОКНА СЧЕТА
   ================================================== */

.invoice-modal-dialog,
.invoice-modal-content,
.invoice-modal-header {
    position: relative;
}

.invoice-modal-close {
    position: absolute !important;
    top: 14px !important;
    right: 18px !important;

    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    font-size: 34px !important;
    line-height: 1 !important;
    font-weight: 600 !important;

    cursor: pointer;
    z-index: 10;
}

/* Успешно сохраненный счет */
#invoice-save-button.invoice-save-success {
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.16) !important;
    border-color: rgba(56, 189, 248, 0.55) !important;
    font-weight: 700 !important;
}

#invoice-save-button.invoice-save-success:hover {
    color: #7dd3fc !important;
    background: rgba(56, 189, 248, 0.22) !important;
    border-color: #38bdf8 !important;
}


/* Пометка повторно измененного поля счета */
.invoice-field-change-note {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 500;
    color: #38bdf8;
}

.invoice-field-change-note[hidden] {
    display: none !important;
}

/* Кликабельные данные клиентского счета */
.client-invoice-copy-value {
    width: fit-content;
    max-width: 100%;
    padding: 0;
    margin: 0;

    border: 0;
    background: transparent;

    color: #f8fafc;
    font: inherit;
    font-weight: 700;
    text-align: left;

    overflow-wrap: anywhere;
    cursor: pointer;

    transition:
        color 0.15s ease,
        opacity 0.15s ease;
}

.client-invoice-copy-value:hover {
    color: #38bdf8;
}

.client-invoice-copy-value:active {
    opacity: 0.7;
}

.client-invoice-copy-value:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 4px;
    border-radius: 3px;
}

.client-invoice-copy-status {
    display: block;
    width: fit-content;
    margin-top: 3px;

    color: #38bdf8;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 500;
}

.client-invoice-copy-status[hidden] {
    display: none !important;
}


/* Кнопка закрытия клиентского счета */
#client-invoice-modal
.client-invoice-dialog
.client-invoice-close {
    position: absolute !important;

    top: 16px !important;
    right: 18px !important;
    left: auto !important;

    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    border: 0 !important;
    background: transparent !important;

    color: #cbd5e1 !important;
    font-size: 32px !important;
    line-height: 1 !important;

    cursor: pointer;
    z-index: 5;
}
