/* =================================== */
/* == БАЗОВЫЕ СТИЛИ КУРСОРА И ВЫДЕЛЕНИЯ == */
/* =================================== */

/* Запрещаем выделение текста на всей странице */
* {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Разрешаем выделение только для полей ввода и текстовых областей */
input, textarea, [contenteditable="true"] {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Курсор для всей страницы */
* {
    cursor: default;
}

/* Курсор для кликабельных элементов */
a, button, [data-modal-target], .btn,
.profile-avatar, .close-button,
.nav-link, .dropdown-item,
.card-link, .card {
    cursor: pointer;
}

/* Курсор для полей ввода */
input, textarea, select {
    cursor: text;
}

/* Курсор для disabled элементов */
button:disabled, input:disabled {
    cursor: not-allowed;
}

/* =================================== */
/* == ГЛАВНЫЙ ФАЙЛ СТИЛЕЙ (main.css) == */
/* =================================== */

:root {
    --bg-color: #f4f7f6;
    --header-bg: #ffffff;
    --text-color: #333;
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.05);
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    box-shadow: inset 0 0 100vw rgba(0, 0, 0, 0.30);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Шапка сайта --- */
.main-header {
    background-color: var(--header-bg);
    padding: 16px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 40px;
}
.main-header > .container {
    max-width: 100%;
    padding: 0 40px;
    box-sizing: border-box;
}
.main-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.5em;
    font-weight: 700;
    color: black;
    text-decoration: none;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* --- Общие стили для кнопок --- */
.btn {
    display: inline-block;
    font-weight: 500;
    text-decoration: none;
    padding: 10px 18px;
    font-size: 0.95em;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
.btn-primary {
    background-color: #2a2d2e;
    color: white;
}
.btn-primary:hover {
    background-color: #444;
    transform: translateY(-1px);
}
.btn-secondary {
    background-color: #6c757d;
    color: white;
}
.btn-secondary:hover {
    background-color: #5a6268;
}

/* --- Выпадающее меню профиля --- */
.profile-dropdown {
    position: relative;
    display: inline-block;
}
.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: black;
    color: white;
    font-size: 1em;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 0 0 2px black;
    cursor: pointer;
    transition: all 0.2s;
}
.profile-avatar:hover {
    background-color: #333;
}
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    min-width: 200px;
    z-index: 100;
    overflow: hidden;
    padding: 8px 0;
}
.dropdown-menu.show {
    display: block;
}
.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.95em;
    transition: background-color 0.2s;
}
.dropdown-item:hover {
    background-color: #f4f7f6;
}
.dropdown-item-logout { color: #d93025; }
.dropdown-divider { height: 1px; background-color: #e0e0e0; margin: 8px 0; }
.dropdown-header { padding: 10px 20px; display: flex; flex-direction: column; }

/* --- Модальные окна (вход/регистрация) --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    z-index: 50;
}
.modal-overlay.visible {
    display: flex;
    opacity: 1;
}
.modal-content {
    background-color: #fff;
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h2 { margin: 0; }
.close-button {
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: #888;
}

/* --- Стили для Hero Section (для гостей) --- */
body:has(.hero-section) {
    padding-top: 0;
}
.hero-section {
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    background: url('/static/images/office.jpg') no-repeat center center;
    background-size: cover;
    position: relative;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(17, 24, 39, 0.8);
}
.hero-content {
    position: relative;
    z-index: 2;
    padding: 20px;
}
.hero-content h1 {
    font-size: 3.5em;
    font-weight: 700;
    margin-bottom: 0.5em;
}
.hero-content .subtitle {
    font-size: 1.25em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2em;
    max-width: 600px;
}
.hero-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}
.header-transparent {
    background-color: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
}
.header-transparent .logo, .header-transparent .nav-link { color: white; }
.header-transparent .btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid white;
}
.header-transparent .btn-secondary:hover {
     background-color: rgba(255, 255, 255, 0.2);
}

/* --- Дашборд авторизованного пользователя --- */
.dashboard-header {
    text-align: center;
    margin-bottom: 40px; /* Уменьшил отступ */
}
.dashboard-header h2 {
    font-size: 2em;
    margin-bottom: 10px;
    color: black;
}
.dashboard-header p {
    font-size: 1.1em;
    color: #222;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1080px;
    margin: 0 auto;
}
.card-link {
    text-decoration: none;
}
.card {
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 20px;
    color: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease, filter 0.4s ease;
    background-image: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%);
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}
.card:hover::before {
    transform: scale(1.05);
    filter: brightness(1.1);
}
.card-content {
    position: relative;
    z-index: 2;
}
.card-content h3 {
    font-size: 1.8em;
    margin: 0;
}

/* Фоны для карточек дашборда */
#card-procurement::before { background-image: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%), url('/static/images/retail-sales.jpg'); }
#card-tenders::before { background-image: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%), url('/static/images/tenders.jpg'); }
#card-warehouse::before { background-image: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%), url('/static/images/red-brick.jpg'); }
#card-obp::before { background-image: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%), url('/static/images/opb.jpg'); }
#card-admin::before { background-image: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%), url('/static/images/admin-finances.jpg'); }
#card-analytics::before { background-image: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%), url('/static/images/analis.jpg'); }

/* Просто улучшаем производительность */
.card {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.card::before {
    transform: translateZ(0);
    backface-visibility: hidden;
}