/* ═══════════════════════════════════════════
   FadeLink Dashboard — Dark Cyberlux Theme
   ═══════════════════════════════════════════ */

:root {
    --bg-deep: #0a0a0f;
    --bg-base: #0f1018;
    --bg-surface: #161824;
    --bg-elevated: #1c1f30;
    --bg-hover: #232640;

    --border: #242840;
    --border-subtle: #1a1d30;

    --text-primary: #e8eaf0;
    --text-secondary: #8b8fa8;
    --text-muted: #555978;

    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.25);

    --green: #00d2a0;
    --green-glow: rgba(0, 210, 160, 0.15);
    --red: #ff6b6b;
    --yellow: #ffd93d;

    --font-body: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 240px;
    --topbar-height: 60px;
}

/* ─── Reset ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    max-width: 100%;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════
   BUTTONS & INPUTS
   ═══════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 16px var(--accent-glow);
}
.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 24px var(--accent-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #845ef7 100%);
    color: #fff;
    box-shadow: 0 2px 20px var(--accent-glow);
}
.btn-accent:hover {
    box-shadow: 0 4px 30px rgba(108, 92, 231, 0.4);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: var(--bg-base);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: all var(--transition);
}
input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder { color: var(--text-muted); }

.input-mono {
    font-family: var(--font-mono) !important;
    letter-spacing: 0.05em;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.input-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ─── Password Toggle ─── */
.password-wrapper {
    position: relative;
    width: 100%;
}
.password-wrapper input {
    padding-right: 48px;
}
.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition);
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.password-toggle:hover { color: var(--text-secondary); }
.password-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}
.password-wrapper input:focus ~ .password-toggle {
    color: var(--accent-light);
}
.eye-icon { pointer-events: none; flex-shrink: 0; }

/* ═══════════════════════
   AUTH SCREEN
   ═══════════════════════ */

.screen { min-height: 100vh; }

.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
    position: relative;
    overflow: hidden;
}

.auth-back {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
    z-index: 10;
}
.auth-back:hover { color: var(--text-primary); }
.auth-back svg { flex-shrink: 0; }

.auth-brand {
    text-align: center;
    margin-bottom: 24px;
    animation: fadeSlideUp 0.6s ease-out;
}

.brand-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    animation: pulseGlow 3s ease-in-out infinite;
}
.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-name {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px 20px;
    position: relative;
    animation: fadeSlideUp 0.6s ease-out 0.1s both;
}

.auth-tabs {
    display: flex;
    position: relative;
    margin-bottom: 28px;
    background: var(--bg-base);
    border-radius: var(--radius);
    padding: 3px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    z-index: 1;
}
.auth-tab.active { color: var(--text-primary); }

.auth-tab-indicator {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    transition: transform var(--transition);
}
.auth-tab[data-tab="register"].active ~ .auth-tab-indicator {
    transform: translateX(100%);
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 16px;
}
.auth-form.active { display: flex; }

/* ─── Consent Checkbox ─── */
.consent-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
    -webkit-tap-highlight-color: transparent;
}
.consent-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 1px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--bg-base);
    cursor: pointer;
    transition: all var(--transition);
}
.consent-check input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}
.consent-check input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.consent-check a {
    color: var(--accent-light);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.consent-check a:hover {
    color: var(--text-primary);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-tg-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.btn-tg {
    background: #2AABEE;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    transition: background 0.2s;
}
.btn-tg:hover { background: #229ED9; }
.tg-deeplink-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
}
.tg-deeplink-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: tg-spin 0.8s linear infinite;
}
@keyframes tg-spin {
    to { transform: rotate(360deg); }
}
.tg-deeplink-expired {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
}
.tg-help-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.visible { display: flex; }
.modal-card {
    background: var(--bg-elevated);
    border: none;
    border-radius: 16px;
    padding: 28px;
    max-width: 400px;
    width: 100%;
    position: relative;
    animation: modalIn 0.2s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}
.modal-body p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.modal-body p:last-child { margin-bottom: 0; }

.auth-error {
    display: none;
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: var(--radius);
    color: var(--red);
    font-size: 0.85rem;
}
.auth-error.visible { display: block; }

/* Auth decorative grid lines */
.auth-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.grid-line {
    position: absolute;
    background: linear-gradient(180deg, transparent, var(--accent-glow), transparent);
    opacity: 0.3;
}
.gl-1 { left: 15%; width: 1px; height: 100%; animation: gridPulse 4s ease-in-out infinite; }
.gl-2 { left: 50%; width: 1px; height: 100%; animation: gridPulse 4s ease-in-out 1.5s infinite; }
.gl-3 { left: 85%; width: 1px; height: 100%; animation: gridPulse 4s ease-in-out 3s infinite; }

/* ═══════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════ */

#dashboard-screen {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--topbar-height) 1fr;
    grid-template-areas:
        "topbar topbar"
        "sidebar content";
    min-height: 100vh;
}

.topbar {
    grid-area: topbar;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 10;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-light);
    font-weight: 600;
    font-size: 1.05rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar-user span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 20px 12px;
    background: var(--bg-base);
    border-right: 1px solid var(--border-subtle);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}
.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent-light);
    font-weight: 500;
}
.nav-item.active svg { color: var(--accent); }

.content {
    grid-area: content;
    padding: 32px;
    overflow-y: auto;
    max-height: calc(100vh - var(--topbar-height));
}

/* ═══════════════════════
   TAB PANELS
   ═══════════════════════ */

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-out;
}
.tab-panel.active { display: block; }

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.panel-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-badge.active {
    background: var(--green-glow);
    color: var(--green);
    box-shadow: 0 0 12px var(--green-glow);
}
.status-badge.active::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}
.status-badge.offline {
    background: rgba(85, 89, 120, 0.15);
    color: var(--text-muted);
}

/* Stat grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.stat-value {
    font-size: 1.3rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* Section blocks */
.section-block {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}
.section-block h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.copy-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.copy-value {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.happ-btn {
    margin-top: 12px;
    text-decoration: none;
}

.inline-form {
    display: flex;
    gap: 10px;
}
.inline-form input { flex: 1; }

/* ─── Devices ─── */
.devices-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.device-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.device-name {
    font-size: 0.9rem;
    font-weight: 500;
}
.device-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ─── Device Selector Card ─── */
.device-slider {
    margin-bottom: 24px;
}

.ds-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.ds-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ds-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ds-num {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.ds-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ds-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ds-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ds-badge {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 5px 12px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--green);
    white-space: nowrap;
}

/* Slider track */
.ds-track {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    touch-action: none;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.ds-rail {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 4px;
    background: var(--bg-base);
    border-radius: 2px;
}

.ds-fill {
    position: absolute;
    left: 8px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ds-dots {
    position: relative;
    display: flex;
    justify-content: space-between;
    width: 100%;
    z-index: 1;
}

.ds-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--bg-base);
    background: var(--bg-base);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ds-dot::before {
    content: '';
    position: absolute;
    inset: -8px;
}

.ds-dot:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.ds-dot.passed {
    background: var(--accent);
    border-color: transparent;
}

.ds-dot.active {
    width: 20px;
    height: 20px;
    margin: -2px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border: 3px solid var(--bg-deep);
    box-shadow: 0 0 12px var(--accent-glow), 0 0 24px rgba(108, 92, 231, 0.15);
}

/* ─── Plans Matrix Grid ─── */
.plans-grid-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.period-card {
    position: relative;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 18px 16px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.period-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.period-card.selected {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(132, 94, 247, 0.04));
    box-shadow: 0 0 0 1px rgba(108, 92, 231, 0.25), 0 4px 24px var(--accent-glow);
}

.period-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.period-card-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.period-card.selected .period-card-label {
    color: var(--text-primary);
}

.period-card-star {
    font-size: 16px;
    line-height: 1;
}

.period-card-price {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.period-card-price .rub {
    font-size: 1.1rem;
    font-weight: 600;
}

.period-card-monthly {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: auto;
}

.period-card-old {
    text-decoration: line-through;
    color: var(--red, #ff6b6b);
    opacity: 0.7;
    margin-right: 3px;
}

.period-card-per-month {
    color: var(--green, #00d2a0);
    font-weight: 700;
}

.period-card-head-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.period-card-discount {
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(0, 210, 160, 0.12);
    color: var(--green, #00d2a0);
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.period-card.best-deal {
    border-color: rgba(0, 210, 160, 0.3);
}
.period-card.best-deal:not(.selected) {
    box-shadow: 0 0 0 1px rgba(0, 210, 160, 0.1), 0 4px 16px rgba(0, 210, 160, 0.06);
}
.period-card.best-deal.selected {
    border-color: var(--green, #00d2a0);
    background: linear-gradient(135deg, rgba(0, 210, 160, 0.08), rgba(59, 130, 246, 0.05));
    box-shadow: 0 0 0 1px rgba(0, 210, 160, 0.3), 0 4px 20px rgba(0, 210, 160, 0.12);
}

/* ─── Tariff CTA Button ─── */
.tariff-cta-dash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 24px;
    margin-top: 20px;
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent) 0%, #845ef7 100%);
    color: #fff;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 24px var(--accent-glow);
}

.tariff-cta-dash:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 32px rgba(108, 92, 231, 0.4);
}

.tariff-cta-dash:active {
    transform: translateY(0);
}

.tariff-cta-dash:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.tariff-cta-dash-label {
    font-size: 0.95rem;
    font-weight: 600;
}

.tariff-cta-dash-prices {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tariff-cta-dash-price {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
}

.tariff-cta-dash-old {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: line-through;
    opacity: 0.5;
}

/* ─── Telegram Prompt ─── */
.tg-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08) 0%, rgba(42, 171, 238, 0.06) 100%);
    border: 1px solid rgba(108, 92, 231, 0.18);
    border-radius: var(--radius-lg);
    animation: fadeSlideUp 0.4s ease-out;
}
.tg-prompt-content {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.tg-prompt-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(42, 171, 238, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #2AABEE;
}
.tg-prompt-text strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.tg-prompt-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}
#tg-prompt-default,
#tg-prompt-waiting,
#tg-prompt-expired {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}
.tg-prompt-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .tg-prompt {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .tg-prompt-actions {
        justify-content: stretch;
    }
    .tg-prompt-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

/* ─── Trial ─── */
.trial-section { margin-top: 20px; }
.trial-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08) 0%, rgba(132, 94, 247, 0.05) 100%);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: var(--radius-lg);
    gap: 20px;
}
.trial-text h3 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}
.trial-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ─── Referrals ─── */
.referral-hero {
    padding: 20px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}
.referral-hero p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ─── Balance ─── */
.balance-amount {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-light);
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tx-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
}
.tx-info { display: flex; flex-direction: column; gap: 2px; }
.tx-desc { font-size: 0.88rem; }
.tx-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.tx-amount {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
}
.tx-amount.positive { color: var(--green); }
.tx-amount.negative { color: var(--red); }

/* ─── Settings ─── */
.settings-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}
.settings-section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.settings-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.tg-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
}
.tg-status-badge.linked {
    background: var(--green-glow);
    color: var(--green);
}

.tg-status {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tg-status span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ─── Telegram Link States ─── */
.tg-link-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 12px;
}
.tg-link-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: tg-spin 0.8s linear infinite;
    flex-shrink: 0;
}
.tg-link-expired {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.info-row:last-child { border-bottom: none; }
.info-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.info-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
}
.settings-form-actions {
    display: flex;
    gap: 8px;
}

/* ─── Empty state ─── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.empty-state.small { padding: 32px 20px; }
.empty-icon {
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: 16px;
}
.empty-state p { margin-bottom: 20px; }

/* Skeleton */
.skeleton-card {
    height: 240px;
    background: linear-gradient(110deg, var(--bg-surface) 0%, var(--bg-elevated) 50%, var(--bg-surface) 100%);
    background-size: 200% 100%;
    border-radius: var(--radius-lg);
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.88rem;
    z-index: 9999;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s ease-out;
    pointer-events: none;
}
.toast.visible {
    transform: translateY(0);
    opacity: 1;
}
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }

/* ─── Device Popup QR ─── */
.dash-device-overlay .modal-card {
    max-width: 420px;
}
.dash-device-card {
    text-align: center;
}
.dash-device-qr {
    display: inline-block;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 16px;
}
.dash-device-qr svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 200px;
    max-height: 200px;
}
.dash-device-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Copy field with inline icon */
.copy-field {
    position: relative;
    width: 100%;
}
.copy-field code {
    display: block;
    width: 100%;
    padding: 11px 44px 11px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: border-color var(--transition);
}
.copy-field code:hover {
    border-color: var(--accent);
}
.copy-field-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition);
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.copy-field-btn:hover { color: var(--accent-light); }
.copy-field-btn.copied { color: var(--green); }

/* ─── TV Help button & popup ─── */
.device-btn-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.device-btn-row .btn { flex: 1; }

.tv-help-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px 6px 8px;
    border-radius: 100px;
    border: 1px solid rgba(108, 92, 231, 0.2);
    background: rgba(108, 92, 231, 0.08);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}
.tv-help-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.tv-help-btn:hover {
    background: rgba(108, 92, 231, 0.15);
    border-color: rgba(108, 92, 231, 0.35);
    color: var(--text-secondary);
    box-shadow: 0 0 12px rgba(108, 92, 231, 0.15);
}
.tv-help-btn:active {
    background: rgba(108, 92, 231, 0.22);
    border-color: rgba(108, 92, 231, 0.5);
    color: var(--text-primary);
    transform: scale(0.96);
}

.tv-help-card { text-align: left; max-width: 380px; }
.tv-help-back {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-family: var(--font-body);
    cursor: pointer;
    padding: 0;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.tv-help-back:hover { color: var(--text-primary); }
.tv-help-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 12px; }
.tv-help-steps { list-style: none; padding: 0; margin: 0 0 16px; }
.tv-help-steps li {
    padding: 8px 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-primary);
    display: flex;
    gap: 10px;
}
.tv-help-steps .step-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tv-help-note {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
}

/* ═══════════════════════
   WIZARD MODAL (Timeline)
   ═══════════════════════ */

.dwiz-overlay {
    align-items: center;
    justify-content: center;
}

.dwiz-overlay .modal-card {
    max-width: 460px;
    width: 100%;
    padding: 0;
    overflow: hidden;
    max-height: 90vh;
}

.dwiz-overlay .dwiz-card {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 36px 32px 32px;
    padding-top: 52px;
}

.dwiz-close {
    z-index: 2;
}

/* Header */
.dwiz-header {
    text-align: center;
    margin-bottom: 24px;
}

.dwiz-header-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
}

.dwiz-header-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Timeline */
.dwiz-timeline {
    display: flex;
    flex-direction: column;
}

.dwiz-timeline-step {
    display: flex;
    gap: 12px;
    opacity: 0;
    transform: translateY(12px);
    animation: dwizAppear 0.4s ease forwards;
}

.dwiz-timeline-step:nth-child(1) { animation-delay: 0.05s; }
.dwiz-timeline-step:nth-child(2) { animation-delay: 0.12s; }
.dwiz-timeline-step:nth-child(3) { animation-delay: 0.19s; }
.dwiz-timeline-step:nth-child(4) { animation-delay: 0.28s; }

@keyframes dwizAppear {
    to { opacity: 1; transform: translateY(0); }
}

.dwiz-timeline-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 36px;
}

.dwiz-timeline-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1.5px solid rgba(108, 92, 231, 0.3);
    background: rgba(108, 92, 231, 0.08);
}

.dwiz-timeline-icon--success {
    border-color: rgba(0, 210, 160, 0.3);
    background: rgba(0, 210, 160, 0.08);
}

.dwiz-timeline-icon--warning {
    border-color: rgba(255, 217, 61, 0.3);
    background: rgba(255, 217, 61, 0.08);
}

.dwiz-timeline-line {
    width: 2px;
    flex: 1;
    min-height: 12px;
    background: var(--border);
    border-radius: 1px;
}

.dwiz-timeline-line--accent {
    background: rgba(108, 92, 231, 0.3);
}

.dwiz-timeline-content {
    flex: 1;
    padding-bottom: 16px;
    min-width: 0;
}

.dwiz-timeline-step:last-child .dwiz-timeline-content {
    padding-bottom: 0;
}

.dwiz-timeline-step:last-child .dwiz-timeline-line {
    display: none;
}

.dwiz-timeline-step-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 1px;
}

.dwiz-timeline-step-title {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.dwiz-timeline-step-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 10px;
}

.dwiz-timeline-content .btn {
    width: 100%;
    padding: 10px 18px;
    font-size: 0.85rem;
}

.dwiz-timeline-content .btn-ghost {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.dwiz-timeline-separator {
    margin: 6px 0 6px 17px;
    border: none;
    border-top: 1px solid var(--border);
    margin-bottom: 16px;
}

/* Warning block inside step 3 */
.dwiz-warning {
    padding: 14px 16px;
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    text-align: left;
}

.dwiz-warning p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 4px;
}

.dwiz-warning p:last-child {
    margin-bottom: 0;
}

/* ═══════════════════════
   ANIMATIONS
   ═══════════════════════ */

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes pulseGlow {
    0%, 100% { filter: drop-shadow(0 0 4px var(--accent-glow)); }
    50% { filter: drop-shadow(0 0 16px var(--accent-glow)); }
}
@keyframes gridPulse {
    0%, 100% { opacity: 0.05; }
    50% { opacity: 0.25; }
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ═══════════════════════
   RESPONSIVE
   ═══════════════════════ */

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    /* Prevent iOS auto-zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    select, textarea {
        font-size: 16px;
    }

    /* Wizard as bottom-sheet on mobile */
    .dwiz-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .dwiz-overlay .modal-card {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
        animation: dwizSlideUp 0.3s ease;
    }
    @keyframes dwizSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    .dwiz-overlay .dwiz-card {
        padding: 28px 24px 28px;
        padding-top: 44px;
    }

    #dashboard-screen {
        grid-template-columns: 1fr;
        grid-template-rows: var(--topbar-height) 1fr auto;
        grid-template-areas:
            "topbar"
            "content"
            "sidebar";
    }

    .sidebar {
        flex-direction: row;
        justify-content: center;
        padding: 8px;
        border-right: none;
        border-top: 1px solid var(--border-subtle);
        overflow-x: hidden;
        gap: 4px;
    }
    .nav-item {
        flex-direction: column;
        gap: 4px;
        padding: 8px 12px;
        font-size: 0.7rem;
        min-width: 0;
    }
    .nav-item svg { width: 18px; height: 18px; }

    .topbar {
        padding: 0 12px;
    }
    .topbar-brand span {
        font-size: 0.9rem;
    }
    .topbar-user span {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .content {
        padding: 20px 16px;
        max-height: calc(100vh - var(--topbar-height) - 70px);
    }

    .stat-grid.cols-3 {
        grid-template-columns: 1fr 1fr;
    }


    .trial-card {
        flex-direction: column;
        text-align: center;
    }

    .plans-grid-matrix {
        grid-template-columns: 1fr 1fr;
    }

    .copy-row {
        flex-direction: column;
        gap: 8px;
    }
    .copy-value {
        white-space: normal;
        word-break: break-all;
        font-size: 0.78rem;
    }
    .copy-row .btn {
        width: 100%;
        justify-content: center;
    }

    .modal-overlay {
        padding: 12px;
    }
    .modal-card {
        padding: 20px 16px;
        max-width: 100%;
    }

    .toast {
        bottom: 80px;
        right: 16px;
        left: 16px;
        text-align: center;
    }
}

/* ─── Small screens (320-480px) ─── */
@media (max-width: 480px) {
    .auth-container {
        padding: 16px 12px;
    }
    .auth-brand {
        margin-bottom: 20px;
    }
    .brand-name {
        font-size: 1.6rem;
    }
    .auth-card {
        padding: 24px 16px;
        border-radius: var(--radius-lg);
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .stat-grid.cols-3 {
        grid-template-columns: 1fr 1fr;
    }
    .stat-card {
        padding: 14px;
    }
    .stat-value {
        font-size: 1.1rem;
    }

    .plans-grid-matrix {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .tariff-cta-dash {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 4px;
    }
    .tariff-cta-dash-label {
        font-size: 0.88rem;
    }

    .period-card {
        padding: 16px 14px 14px;
    }

    .panel-header h2 {
        font-size: 1.25rem;
    }

    .device-item {
        padding: 10px 12px;
    }
    .device-name {
        font-size: 0.82rem;
        word-break: break-word;
    }

    .settings-section {
        padding: 18px 14px;
    }

    .referral-hero {
        padding: 16px;
    }

    .section-block {
        padding: 16px;
    }
}

/* ═══════════════════════
   PWA Install Banner
   ═══════════════════════ */

.pwa-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-banner.visible {
    transform: translateY(0);
}

.pwa-banner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
    flex: 1;
}

.pwa-banner-icon {
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.pwa-banner-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.pwa-banner-text strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.pwa-banner-text span {
    font-size: 11px;
    color: var(--text-secondary);
}

.pwa-banner-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.25s;
}

.pwa-banner.expanded .pwa-banner-chevron {
    transform: rotate(180deg);
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pwa-banner-install {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.pwa-banner-install:hover {
    background: var(--accent-light);
}

.pwa-banner-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.2s;
}

.pwa-banner-close:hover {
    color: var(--text-primary);
}

/* Expandable details */
.pwa-banner-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 16px;
    border-top: 0 solid transparent;
}

.pwa-banner.expanded .pwa-banner-details {
    max-height: 200px;
    padding: 0 16px 14px;
    border-top: 1px solid var(--border-subtle);
}

.pwa-banner-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.pwa-banner-step + .pwa-banner-step {
    border-top: 1px solid var(--border-subtle);
}

.pwa-banner-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-banner-step-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
    display: flex;
}

.pwa-banner-step-text {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.4;
}

/* ═══════════════════════
   TRAFFIC TAB
   ═══════════════════════ */

.traffic-period-selector {
    display: flex;
    gap: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    padding: 3px;
}
.traffic-period-btn {
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
}
.traffic-period-btn:hover {
    color: var(--text-secondary);
}
.traffic-period-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.traffic-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.traffic-progress {
    height: 8px;
    background: var(--bg-base);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 8px;
}
.traffic-progress-fill {
    height: 100%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transition: width 0.6s ease;
    width: 0%;
}
.traffic-progress-fill.warning {
    background: linear-gradient(90deg, var(--yellow), #ffb347);
}
.traffic-progress-fill.danger {
    background: linear-gradient(90deg, var(--red), #ff8e8e);
}

.traffic-progress-label {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-align: right;
}

.traffic-chart-container {
    height: 220px;
    margin-top: 12px;
}
.traffic-chart-container .uplot {
    width: 100% !important;
}

.traffic-countries-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.traffic-country-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.traffic-country-row:last-child {
    border-bottom: none;
}
.traffic-country-flag {
    font-size: 1.2rem;
    line-height: 1;
}
.traffic-country-code {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 28px;
}
.traffic-country-value {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .traffic-chart-container { height: 180px; }
    .panel-header { flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 480px) {
    .traffic-chart-container { height: 150px; }
}

/* ─── Confirm Modal ─── */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.confirm-modal-overlay.visible { opacity: 1; }

.confirm-modal {
    background: var(--bg-elevated);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    max-width: 340px;
    width: 100%;
    transform: scale(0.95);
    transition: transform 0.2s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.confirm-modal-overlay.visible .confirm-modal { transform: scale(1); }

.confirm-modal-icon { margin-bottom: 16px; }
.confirm-modal-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
}
.confirm-modal-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}
.confirm-modal-device {
    font-family: var(--font-mono);
    color: var(--text-primary);
}
.confirm-modal-actions { display: flex; flex-direction: column; gap: 8px; }
.confirm-modal-actions .btn { width: 100%; justify-content: center; }
.confirm-modal-btn-danger {
    background: var(--red);
    color: #fff;
    font-weight: 600;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all var(--transition);
}
.confirm-modal-btn-danger:hover { opacity: 0.9; transform: translateY(-1px); }
.confirm-modal-btn-danger:active { transform: translateY(0); }
