/* ===== ОБЩИЕ СТИЛИ ИНТЕРФЕЙСА ===== */
:root {
    --bg-base: #121212;
    --surface-color: rgba(32, 33, 36, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --accent-blue: #8ab4f8;
    --accent-red: #f28b82;
    --accent-green: #81c995;
    --accent-yellow: #fde293;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
}

/* Анимированные огни */
.blinking-lights {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
    opacity: 0.4;
}
.light {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 20px 2px rgba(255,255,255,0.3);
    animation: float-light 8s infinite ease-in-out alternate;
}
@keyframes float-light {
    0% { opacity: 0; transform: translateY(20px) scale(0.8); }
    50% { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-20px) scale(1.2); }
}
.light:nth-child(1) { top: 15%; left: 12%; }
.light:nth-child(2) { top: 25%; right: 13%; }
.light:nth-child(3) { bottom: 10%; left: 15%; }
.light:nth-child(4) { bottom: 30%; right: 18%; }
.light:nth-child(5) { top: 40%; left: 5%; }
.light:nth-child(6) { top: 70%; right: 5%; }

/* Основной контейнер приложения */
.app {
    position: relative;
    z-index: 10;
    max-width: 100%;
    margin: 0;
    padding: 16px 24px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 16px;
}

/* Шапка */
.app-bar {
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 100px;
    padding: 10px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    flex-shrink: 0;
    z-index: 1500;
}
.app-bar h1 {
    font-weight: 400;
    font-size: 1.25rem;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

/* Кнопки */
.btn {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    padding: 10px 24px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
}
.btn-primary {
    background: var(--text-primary);
    color: var(--bg-base);
    font-weight: 500;
}
.btn-primary:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255,255,255,0.2);
}
.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: not-allowed;
}
.btn-outline {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid rgba(138, 180, 248, 0.3);
}
.btn-outline:hover:not(:disabled) {
    background: rgba(138, 180, 248, 0.08);
    border-color: var(--accent-blue);
}

/* Модальные окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s ease;
}
.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}
.modal {
    background: #202124;
    border-radius: 28px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    border: 1px solid var(--border-color);
    box-shadow: 0 16px 32px rgba(0,0,0,0.6);
    text-align: center;
    transform: translateY(10px) scale(0.98);
    transition: 0.3s ease;
}
.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}
.modal h2 {
    font-weight: 300;
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 24px;
    letter-spacing: 0px;
}
.modal input {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
    color: var(--text-primary);
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    transition: all 0.2s;
    padding: 14px 18px;
    font-size: 1rem;
    margin-bottom: 16px;
}
.modal input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(0,0,0,0.4);
}
.modal .btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    border-radius: 16px;
    margin-top: 8px;
}
.switch-link {
    color: var(--accent-blue);
    cursor: pointer;
    margin-top: 16px;
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.error-message {
    color: var(--accent-red);
    font-size: 0.85rem;
    margin-top: 8px;
    min-height: 20px;
}

/* Дашборд */
.dashboard {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-bottom: 16px;
}
.welcome-header {
    background: var(--surface-color);
    border-radius: 24px;
    padding: 24px 32px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
}
.welcome-header h2 {
    font-weight: 300;
    font-size: 2rem;
    color: var(--text-primary);
}
.welcome-header p {
    color: var(--text-secondary);
    margin-top: 8px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface-color);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
}
.stat-value {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--accent-blue);
}
.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.action-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.action-btn {
    background: linear-gradient(145deg, #ff3366, #e61e4d);
    border: none;
    color: white;
    padding: 16px 32px;
    border-radius: 40px;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 8px 20px rgba(255,51,102,0.3);
}
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(255,51,102,0.5);
}
.logout-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 12px 24px;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s;
}
.logout-btn:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

/* Скрытие элементов */
.hidden {
    display: none !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .app {
        padding: 12px;
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }
    .modal {
        padding: 24px;
    }
}