/* ============================================================
   BASE — общие стили
   ============================================================ */

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

:root {
    --green-500: #4CAF50;
    --green-600: #2e7d32;
    --green-400: #81c784;
    --green-200: #b9f6ca;
    --bg-900: #07090e;
    --bg-800: #0a0e1a;
    --bg-700: #10161f;
    --bg-600: #121820;
    --card: rgba(18, 24, 32, 0.7);
    --border: rgba(76, 175, 80, 0.2);
    --text: #f0f3f8;
    --text-dim: #8a92b0;
    --text-mute: #6a7290;
    --danger: #f44336;
    --warn: #ffaa00;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

html {
    scroll-behavior: smooth;
    font-size: 14px;            /* База 14px вместо 15/16 */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: radial-gradient(circle at 30% 10%, var(--bg-700), var(--bg-900));
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
::-webkit-scrollbar-thumb {
    background: var(--green-600);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--green-500); }

/* ---------- Layout ---------- */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.25rem;
}

/* ---------- Header ---------- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--green-500), var(--green-400));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
}

/* ---------- User menu ---------- */
.user-menu {
    position: relative;
    cursor: pointer;
}

.avatar-small {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--green-500), #1b5e20);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: white;
    transition: transform 0.2s;
    user-select: none;
}

.avatar-small:hover { transform: scale(1.05); }

.dropdown-menu {
    position: absolute;
    top: 44px;
    right: 0;
    background: rgba(18, 24, 32, 0.98);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    min-width: 160px;
    overflow: hidden;
    display: none;
    z-index: 100;
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.dropdown-menu.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    padding: 0.6rem 1rem;
    color: #e0e0e0;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: background 0.15s;
    cursor: pointer;
    font-size: 12px;
}

.dropdown-item:hover { background: rgba(76, 175, 80, 0.08); }

.dropdown-item.logout {
    color: var(--danger);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-item.logout:hover { background: rgba(244, 67, 54, 0.1); }

/* ---------- Buttons ---------- */
.btn {
    background: linear-gradient(135deg, var(--green-500), var(--green-600));
    border: none;
    border-radius: 40px;
    padding: 0.6rem 1.15rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
    display: inline-block;
    font-size: 12px;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--green-500);
    color: var(--green-500);
}

.btn-outline:hover {
    background: rgba(76, 175, 80, 0.08);
    box-shadow: none;
}

/* ---------- Card ---------- */
.card-glass {
    background: var(--card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 1.1rem;
    border: 1px solid var(--border);
}

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-mute);
    font-size: 11px;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 2rem;
}

.footer a {
    color: var(--green-500);
    text-decoration: none;
    transition: color 0.15s;
}

.footer a:hover { color: var(--green-400); }

/* ---------- Modal ---------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.show { display: flex; }

.modal-content {
    background: rgba(18, 24, 32, 0.98);
    border-radius: var(--radius-xl);
    max-width: 420px;
    width: 100%;
    border: 1px solid rgba(76, 175, 80, 0.3);
    animation: fadeIn 0.2s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h2 {
    font-size: 14px;
    font-weight: 600;
}

.modal-body { padding: 1.15rem; }

.close-confirm {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: inherit;
}

.close-confirm:hover {
    color: var(--danger);
    background: rgba(244, 67, 54, 0.1);
}

.settings-btn {
    background: rgba(76, 175, 80, 0.15);
    border: none;
    color: var(--green-200);
    padding: 7px 14px;
    border-radius: 30px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 600;
    font-family: inherit;
}

.settings-btn:hover {
    background: var(--green-600);
    color: white;
}

.settings-btn.danger {
    background: rgba(244, 67, 54, 0.15);
    color: var(--danger);
}

.settings-btn.danger:hover {
    background: var(--danger);
    color: white;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--green-600);
    color: white;
    padding: 9px 18px;
    border-radius: 40px;
    z-index: 9999;
    font-size: 12px;
    font-weight: 600;
    animation: slideUp 0.3s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    max-width: 90vw;
}

.toast.error { background: var(--danger); }
.toast.warn { background: var(--warn); color: #000; }

@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    html { font-size: 13.5px; }
    .container { padding: 0.9rem; }
    .header { flex-direction: column; text-align: center; }
}