:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --bg-page: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --radius: 10px;
    --shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.25rem;
}

.nav-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: #ffffff;
}

/* Блок профиля справа */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-auth {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s ease;
}

.btn-auth-login {
    background: transparent;
    color: #cbd5e1;
    border: 1px solid #475569;
}
.btn-auth-login:hover {
    background: #1e293b;
    color: #ffffff;
}

.btn-auth-reg {
    background: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary);
}
.btn-auth-reg:hover {
    background: var(--primary-hover);
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #1e293b;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid #334155;
    color: #f8fafc;
    font-size: 0.9rem;
    user-select: none;
}

.profile-avatar {
    width: 26px;
    height: 26px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.profile-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 170px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 200;
}

.profile-dropdown.open {
    display: flex;
}

.profile-dropdown a,
.profile-dropdown button {
    padding: 0.65rem 1rem;
    text-align: left;
    background: none;
    border: none;
    width: 100%;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    display: block;
    transition: background 0.15s ease;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover {
    background: #f8fafc;
}

.profile-dropdown button.logout-item {
    color: var(--danger);
    border-top: 1px solid var(--border);
}

main {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.25rem;
}

h1 {
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--surface);
    padding: 1.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
    margin-bottom: 1rem;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

button.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.7rem 1.25rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

button.btn-primary:hover {
    background: var(--primary-hover);
}

button.btn-danger {
    background: #fee2e2;
    color: var(--danger);
    border: 1px solid #fecaca;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s ease;
}

button.btn-danger:hover {
    background: #fca5a5;
    color: #991b1b;
}

footer {
    background: #0f172a;
    color: #94a3b8;
    text-align: center;
    padding: 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    border-top: 1px solid #1e293b;
}

@media (max-width: 640px) {
    .navbar {
        flex-direction: column;
        gap: 0.75rem;
    }
    .nav-links {
        gap: 0.85rem;
        font-size: 0.9rem;
    }
}