* { box-sizing: border-box; font-family: 'Segoe UI', Roboto, sans-serif; }

body {
    /* Обновленная палитра: добавил чуть больше контраста и промежуточный оттенок */
    background: linear-gradient(-45deg, #0fdec9, #05668d, #028c9c, #00a896, #02c39a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease-in-out infinite;
    background-attachment: fixed;
    
    min-height: 100vh;
    margin: 0; /* Важно сбросить отступы */
    padding-bottom: 130px;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    position: relative;
}

/* Эффект глубины и мягкого виньетирования */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Смешивание радиального градиента для эффекта "освещения" сверху */
    background: radial-gradient(circle at top left, rgba(255,255,255,0.15) 0%, transparent 40%),
                radial-gradient(circle at bottom right, rgba(0,0,0,0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: 1;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* --- 1. ПРАВИМ ШАПКУ ДЛЯ ВТОРОГО РЯДА --- */
.header-top {
    padding: 15px 10px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Позволяет кнопкам переходить на новую строку */
    gap: 10px;       /* Единый отступ между всеми кнопками */
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- 2. УНИФИЦИРУЕМ ВСЕ КНОПКИ В ШАПКЕ --- */
.header-top button {
    /* Одинаковый размер для всех */
    padding: 10px 16px !important;
    font-size: 12px !important;
    border-radius: 12px !important;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: 0.3s all ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* --- Стили для кнопки ДЕТАЛИ --- */
.btn-details {
    padding: 8px 12px !important;
    font-size: 11px !important;
    border-radius: 10px !important;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    transition: 0.2s;
    white-space: nowrap;
    background: rgba(2, 195, 154, 0.2); /* Полупрозрачный бирюзовый */
    color: white;
}

.btn-details:hover {
    background: rgba(2, 195, 154, 0.4);
}

.btn-details:active {
    transform: scale(0.95);
}

.btn-incas {
    padding: 8px 12px !important; /* Компактные отступы */
    font-size: 11px !important;    /* Уменьшенный шрифт */
    border-radius: 10px !important;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    transition: 0.2s;
    white-space: nowrap;          /* Текст в одну строку внутри кнопки */
}

.btn-incas:hover {
    background: rgba(255, 80, 80, 0.2); /* Слегка краснеет при наведении */
}

.header-title {
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    margin: 10px 0;
    letter-spacing: 2px;
}

.btn-exchange {
    padding: 8px 12px !important; /* Компактные отступы */
    font-size: 11px !important;    /* Уменьшенный шрифт */
    border-radius: 10px !important;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    transition: 0.2s;
    white-space: nowrap;          /* Текст в одну строку внутри кнопки */
}

.btn-cashdesk {
    padding: 8px 12px !important; /* Компактные отступы */
    font-size: 11px !important;    /* Уменьшенный шрифт */
    border-radius: 10px !important;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    transition: 0.2s;
    white-space: nowrap;          /* Текст в одну строку внутри кнопки */
}

/* Стили для строк внутри размена */
.exchange-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 5px;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.exch-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.exch-input-group span { font-size: 10px; opacity: 0.7; }

.exch-input {
    width: 100% !important;
    font-size: 14px !important;
    padding: 5px 0 !important;
}

.container { padding: 0 15px; display: flex; flex-direction: column; gap: 10px; }

/* Карточка номинала (Стекло) */
.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 12px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}

.denom { font-size: 18px; font-weight: 700; width: 75px; }

.counter-wrapper { display: flex; align-items: center; gap: 10px; }

.btn-step {
    width: 38px; height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

input[type="number"] {
    width: 60px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    padding: 8px 0;
    font-size: 18px;
    text-align: center;
    outline: none;
}

.subtotal { font-size: 17px; font-weight: 800; min-width: 90px; text-align: right; }

/* Плавающая панель итога */
.total-bar {
    position: fixed;
    bottom: 20px; left: 15px; right: 15px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.total-info { font-size: 22px; font-weight: 800; }

.btn-revenue {
    padding: 8px 12px !important; /* Компактные отступы */
    font-size: 11px !important;    /* Уменьшенный шрифт */
    border-radius: 10px !important;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    transition: 0.2s;
    white-space: nowrap;          /* Текст в одну строку внутри кнопки */
}

.btn-clear {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white; padding: 10px 15px;
    border-radius: 12px; font-weight: 600;
}

.user-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 15px;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
}

/* Модалка */
.modal {
    display: none; position: fixed; z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    margin: 10% auto; width: 95%; max-height: 80vh;
    border-radius: 25px; border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header { padding: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 10px; overflow-y: auto; max-height: 55vh; }
.modal-footer { padding: 20px; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; }
.close-btn { background: none; border: none; color: white; font-size: 30px; cursor: pointer; }

.btn-add-to-safe {
    width: 100%; padding: 16px; border: none; border-radius: 15px;
    background: white; color: #008073; font-weight: 800; font-size: 17px;
}

/* Индивидуальные цвета (если нужно оставить разные) */
.btn-revenue { background: white; color: #008073; }
.btn-exchange { background: rgba(255, 255, 255, 0.2); color: white; }
.btn-cashdesk { background: rgba(255, 255, 255, 0.2); color: white; }
.btn-incas { background: rgba(255, 255, 255, 0.1); color: white; }

.btn-revenue:active, .btn-exchange:active, .btn-cashdesk:active, .btn-incas:active {
    transform: scale(0.95);
}

/* Стили для экрана логина */
#login-screen {
    display: none; /* Будет переключено на flex через JS, если сессия пуста */
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10000;
    backdrop-filter: blur(20px);
}

#login-screen .modal-content {
    max-width: 350px;
    padding: 30px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

#login-screen input {
    width: 100%;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 16px;
    outline: none;
}

#login-screen button {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: none;
    background: white;
    color: #008073;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

#login-screen button:active {
    transform: scale(0.95);
}

/* --- 3. КНОПКА АДМИНА (ТЕПЕРЬ НЕ ПЛАВАЕТ) --- */
#admin-btn {
    display: none; /* Скроем по умолчанию, JS покажет её только админу */
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Никаких position: fixed! */
}

#admin-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* Красивая кнопка выхода */
.btn-logout {
    padding: 8px 15px !important;
    font-size: 11px !important;
    border-radius: 10px !important;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    
    /* Стеклянный стиль с красным оттенком */
    background: rgba(255, 82, 82, 0.1);
    color: #ff8a8a;
    border: 1px solid rgba(255, 82, 82, 0.3);
    backdrop-filter: blur(5px);
    
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-logout:hover {
    background: rgba(255, 82, 82, 0.25);
    color: white;
    box-shadow: 0 0 15px rgba(255, 82, 82, 0.3);
    border-color: rgba(255, 82, 82, 0.5);
}

.btn-logout:active {
    transform: scale(0.9);
}