* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
    background: #e6e9f0;
    min-height: 100vh;
    padding: 24px;
    color: #1a1a1a;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
}

/* ===== Шапка с тремя частями ===== */
.header {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 40px;
    padding: 8px 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: center;
}

.header-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-weight: 600;
    font-size: 24px;
}
.logo-on {
    background: #0078d4;
    color: white;
    padding: 4px 12px;
    border-radius: 40px;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.4);
}
.logo-mu {
    color: #1a1a1a;
    font-weight: 500;
    margin-left: 4px;
}

.status-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.7);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.green { background: #107c10; }
.status-dot.yellow { background: #ffb900; }
.status-dot.red { background: #e81123; }

.stat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 6px 14px;
    border-radius: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-size: 14px;
}
.stat-chip i {
    font-size: 18px;
    color: #0078d4;
}
.stat-label {
    color: #4a4a4a;
    font-weight: 500;
    margin-right: 2px;
}
.stat-value {
    font-weight: 600;
    color: #1a1a1a;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 4px 12px 4px 16px;
    border-radius: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.user-chip span {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 13px;
}
.logout-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #1a1a1a;
    border-radius: 30px;
    text-decoration: none;
    font-size: 12px;
    transition: 0.2s;
}
.logout-btn:hover {
    background: white;
    border-color: #0078d4;
    color: #0078d4;
}

/* ===== Карточки действий ===== */
.action-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 32px;
    padding: 40px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.action-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1a1a1a;
}
.action-title i {
    color: #0078d4;
}
.action-text {
    font-size: 15px;
    color: #2d2d2d;
    margin-bottom: 24px;
}

/* ===== Кнопка ===== */
.btn-primary {
    background: #0078d4;
    border: none;
    color: white;
    padding: 10px 28px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}
.btn-primary:hover {
    background: #006cbd;
    transform: scale(0.98);
}
.full-width {
    width: 100%;
    justify-content: center;
}

/* ===== Карточка ключа (цвета поменяны) ===== */
.key-card {
    display: flex;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 32px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    min-height: 80px;
}

/* Левая часть теперь синяя */
.key-left {
    background: #0078d4;
    width: 220px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.6);
    border-top-right-radius: 32px;   /* добавьте */
    border-bottom-right-radius: 32px; /* добавьте */
}

.key-left .key-icon {
    font-size: 24px;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid white;
}

.key-left .user-name-id {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap; /* на случай, если имя очень длинное */
}

.key-left .user-name {
    font-size: 16px;
    font-weight: 600;
    color: white;
}
.key-left .user-id {
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 40px;
    display: inline-block;
    width: fit-content;
}
.key-left .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #b0b0b0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
    margin-left: 8px;
}
.key-left .status-indicator.online {
    background: #107c10;
}

/* Правая часть теперь полупрозрачная белая */
.key-metrics {
    flex: 1;
    background: rgba(255, 255, 255, 0.4);
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.metric {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}
.metric i {
    font-size: 18px;
    color: #0078d4;
}
.metric-text {
    font-size: 14px;
    color: #1a1a1a;
}
.metric-text .label {
    font-weight: 500;
    margin-right: 4px;
}
.metric-text .value {
    font-weight: 600;
}

.key-action {
    background: rgba(255, 255, 255, 0.4);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    border-left: 1px solid rgba(255,255,255,0.6);
}
.copy-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0078d4;
    border: 2px solid white;
    color: white;
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.copy-btn i {
    font-size: 18px;
}
.copy-btn:hover {
    background: white;
    color: #0078d4;
    border-color: #0078d4;
    transform: scale(1.05);
}

/* ===== Форма подписки ===== */
.subscription-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    margin-top: 20px;
}

.subscription-header {
    background: #0078d4;
    padding: 16px 24px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.subscription-header .card-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.subscription-header .card-title i {
    color: white;
    font-size: 20px;
}

.plan-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    padding: 4px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.plan-tab {
    flex: 1;
    padding: 8px 0;
    border: none;
    background: transparent;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
}
.plan-tab.active {
    background: white;
    color: #0078d4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.plan-tab .badge {
    position: absolute;
    top: -8px;
    right: 0;
    background: #107c10;
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 20px;
    white-space: nowrap;
}

.subscription-body {
    padding: 24px;
}

.price-info {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}
.price-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    color: #1a1a1a;
}
.price-row.total {
    font-size: 18px;
    font-weight: 600;
    color: #0078d4;
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    margin-top: 6px;
    padding-top: 10px;
}
.price-row.total span:last-child::after {
    content: " ₽";
    font-size: 16px;
}
.price-row.discount {
    color: #107c10;
}
.footnote {
    font-size: 11px;
    color: #4a4a4a;
    text-align: center;
    margin-top: 16px;
}

/* ===== Подвал ===== */
.footer {
    margin-top: 40px;
    text-align: center;
    color: #4a4a4a;
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    padding: 20px 0;
}
.footer-links a {
    color: #2d2d2d;
    text-decoration: none;
}
.footer-links a:hover {
    color: #0078d4;
}

/* ===== Уведомления ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    color: #1a1a1a;
    padding: 12px 24px;
    border-radius: 60px;
    font-size: 14px;
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: 0.3s;
}
.toast.show {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.success { background: #107c10; color: white; border-color: #107c10; }
.toast.error { background: #e81123; color: white; border-color: #e81123; }
.toast.warning { background: #ffb900; color: #1a1a1a; border-color: #ffb900; }

/* ===== Адаптивность ===== */
@media (max-width: 768px) {
    body { padding: 12px; }
    .header { flex-direction: column; align-items: stretch; }
    .header-left, .header-center, .header-right { justify-content: center; width: 100%; }
    .key-card { flex-direction: column; }
    .key-left { width: 100%; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.6); }
    .key-metrics { flex-direction: column; align-items: flex-start; }
    .key-action { border-left: none; border-top: 1px solid rgba(255,255,255,0.6); justify-content: center; }
    .plan-tabs { flex-wrap: wrap; }
    .plan-tab { flex: 1 0 auto; }
}

/* ===== Скелетон ===== */
.key-card.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    pointer-events: none;
    border: none;
}
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Дополнительная информация в карточке ключа */
.key-details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 13px;
}
.detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #1a1a1a;
}
.detail-item i {
    color: #0078d4;
    font-size: 16px;
}

/* ===== Детали ключа в стиле метрик ===== */
.key-details {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 8px 20px;
    background: transparent;
}
.detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}
.detail-item i {
    font-size: 18px;
    color: #0078d4;
}
.detail-item span {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
}
