/* Общие стили интерфейса */
:root {
    --bg: #0f172a;
    --panel: #0b1224;
    --accent: #667eea;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --border: rgba(255,255,255,0.08);
    --shadow: 0 10px 24px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

body {
    background: linear-gradient(135deg, #0f172a 0%, #111827 60%, #0b1224 100%);
    color: var(--text);
}

a, button, input, select, textarea {
    transition: 0.18s ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn,
button {
    border-radius: 10px;
    border: none;
    padding: 0.65rem 1rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.btn.secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text);
}
.btn.danger {
    background: #dc3545;
}
.btn:hover,
button:hover {
    opacity: 0.9;
}

input[type='text'],
input[type='password'],
input[type='number'],
textarea,
select {
    width: 100%;
    padding: 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--text);
}

.card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.sidebar {
    background: var(--panel);
    border-right: 1px solid var(--border);
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    transform: translateX(0);
    transition: transform 0.2s ease;
    z-index: 15;
}
.sidebar.open { transform: translateX(0); }

.nav a {
    border: 1px solid rgba(255,255,255,0.06);
}
.nav a:focus-visible {
    border-color: var(--accent);
}

.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    visibility: hidden;
    transition: 0.2s ease;
    z-index: 14;
}
.backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Мобильная адаптация */
@media (max-width: 960px) {
    .sidebar { transform: translateX(-260px); }
    .sidebar.open { transform: translateX(0); }
    
    /* Улучшенные отступы для мобильных */
    body {
        font-size: 15px;
    }
    
    .card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .btn, button {
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
    }
    
    input[type='text'],
    input[type='password'],
    input[type='number'],
    textarea,
    select {
        padding: 0.65rem;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .card {
        padding: 0.85rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .btn, button {
        padding: 0.55rem 0.9rem;
        font-size: 0.9rem;
    }
}
