:root {
    --bg-color: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --accent: #e74c3c;
    --accent-hover: #c0392b;
    --border-color: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --header-bg: #ffffff;
    --nav-bg: #fafafa;
    --footer-bg: #333333;
    --footer-text: #ffffff;
    --table-header: #f8f8f8;
    --success: #27ae60;
    --error: #e74c3c;
    --price-color: #e74c3c;
    --icon-color: #333333;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --bg-card: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --accent: #ff6b5b;
    --accent-hover: #ff8577;
    --border-color: #404040;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.4);
    --header-bg: #252525;
    --nav-bg: #2a2a2a;
    --footer-bg: #0a0a0a;
    --footer-text: #e0e0e0;
    --table-header: #333333;
    --success: #2ecc71;
    --error: #ff6b5b;
    --price-color: #ff6b5b;
    --icon-color: #e0e0e0;
}

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

body {
    font-family: 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.fa,
.fa-solid,
.fas {
    color: var(--icon-color);
}

.container {
    max-width: 768px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0.95;
}

.header-inner {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    gap: 10px;
}

.header-logo {
    height: 28px;
    width: auto;
    flex-shrink: 0;
    background: white;
    border-radius: 50%;
}

.header-logo-link {
    display: flex;
    align-items: center;
}

.header-menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.header-menu-icon:hover {
    background: var(--accent);
    color: white;
}

.header-menu-icon i {
    font-size: 1rem;
    color: var(--text-primary);
}

.header-menu-icon:hover i {
    color: white;
}

.header-cats {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex: 1;
    justify-content: flex-start;
    padding: 0 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(to right, transparent, black 10px, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10px, black 95%, transparent);
}

.header-cats::-webkit-scrollbar {
    display: none;
}

.header-cat {
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s ease;
}

.header-cat:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.header-cat.active {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

.theme-toggle {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.theme-toggle:hover {
    background: var(--accent);
    color: white;
}

.theme-toggle:hover i {
    color: white;
}

.theme-toggle i {
    color: var(--text-primary);
}

.bell-toggle {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.bell-toggle:hover {
    background: var(--accent);
    color: white;
}

.bell-toggle:hover i {
    color: white;
}

.bell-toggle i {
    color: var(--text-primary);
}

.view-toggle {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.view-toggle:hover {
    background: var(--accent);
    color: white;
}

.view-toggle:hover i {
    color: white;
}

.view-toggle i {
    color: var(--text-primary);
}

.service-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.service-overlay.active {
    opacity: 1;
    visibility: visible;
}

.service-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: 0 0 25px 25px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.service-overlay.active .service-panel {
    transform: translateY(0);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.service-header h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 600;
}

.service-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--table-header);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.service-close:active {
    transform: scale(0.95);
}

.service-actions {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    background: var(--table-header);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.service-btn:active {
    transform: scale(0.98);
}

.service-btn i {
    font-size: 1.2rem;
    color: var(--accent);
    width: 24px;
    text-align: center;
}

.service-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.service-btn:hover i,
.service-btn:hover span {
    color: white;
}

.service-btn.cancel {
    background: transparent;
    border-color: var(--border-color);
}

.service-btn.cancel i {
    color: var(--text-muted);
}

.service-btn.cancel:hover {
    background: var(--error);
    border-color: var(--error);
}

.header-cart {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 2px 12px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.header-cart:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.header-cart:hover i,
.header-cart:hover .header-cart-info {
    color: white;
}

.header-cart i {
    font-size: 1rem;
    color: var(--accent);
    transition: color 0.2s ease;
}

.header-cart-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.header-cart-total {
    font-weight: 600;
}

.header-cart-count {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.dock {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: calc(100% - 40px);
    max-width: 900px;
}

.dock-full-width {
    width: calc(100% - 40px);
    max-width: 100%;
    left: 0;
    transform: none;
    right: 0;
    margin: auto;
    height: 66px;
}

.dock-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .dock-inner {
    background: rgba(42, 42, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
}

.dock-cart {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.4);
}

.dock-cart:active {
    transform: scale(0.95);
}

.dock-cart i {
    font-size: 1.2rem;
    color: white;
}

.dock-cart-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: white;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.dock-cats {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex: 1;
    justify-content: flex-start;
    padding: 0 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(to right, transparent, black 5px, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5px, black 95%, transparent);
}

.dock-cats::-webkit-scrollbar {
    display: none;
}

.dock-cat {
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dock-cat:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.dock-cat.active {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

.dock-scroll {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.dock-scroll:active {
    transform: scale(0.95);
}

.dock-scroll i {
    font-size: 1rem;
    color: var(--text-primary);
}

.dock-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 40px;
    background: var(--accent);
    color: white;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.dock-menu-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

.dock-menu-btn i {
    font-size: 1rem;
    color: white;
}

.dock-menu-btn span {
    font-size: 0.9rem;
}

.main {
    flex: 1;
    padding: 30px 0;
    padding-bottom: 120px;
}

@media (min-width: 769px) {
    .dock {
        width: 100%;
        max-width: 100%;
        left: 0;
        transform: none;
    }

    .dock-inner {
        margin: 0 15px;
        max-width: 100%;
        border-radius: 25px;
    }

    .dock-cats {
        justify-content: center;
        padding: 0 20px;
    }
}

.nav {
    background-color: var(--nav-bg);
    border-top: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-content {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
}

.nav-content a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-content a:hover {
    background: var(--accent);
    color: white;
}

.main {
    flex: 1;
    padding: 30px 0;
}

.footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 20px 0;
    text-align: center;
    transition: background-color 0.3s ease;
}

.page-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.category {
    margin-bottom: 50px;
}

.category-title {
    font-size: 1.3rem;
    border-bottom: 2px solid var(--accent);
    padding: 12px 0 10px;
    margin-bottom: 15px;
    color: var(--text-primary);
    scroll-margin-top: 70px;
}

/* Стили для меню теперь в menu.html */

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.highlight {
    background: var(--accent);
    color: white;
}

.stat-card.highlight .stat-label {
    color: rgba(255,255,255,0.8);
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.section-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.stats-table {
    margin-bottom: 40px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--table-header);
    font-weight: 600;
    color: var(--text-primary);
}

td {
    color: var(--text-secondary);
}

.price-min {
    color: var(--success);
    font-weight: 600;
}

.price-max {
    color: var(--price-color);
    font-weight: 600;
}

.stats-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.list-column {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.item-list {
    list-style: none;
}

.item-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.item-list li:last-child {
    border-bottom: none;
}

.item-cat {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: 8px;
}

.item-list .item-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.item-list .item-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--price-color);
}

.average-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.admin-actions {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.action-form {
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--table-header);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.result-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.result-message.success {
    background: rgba(39, 174, 96, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
}

.result-message.error {
    background: rgba(231, 76, 60, 0.15);
    color: var(--error);
    border: 1px solid var(--error);
}

.last-update {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--table-header);
    border-radius: 8px;
}

.last-update .label {
    color: var(--text-muted);
    margin-right: 10px;
}

.last-update .value {
    font-weight: 600;
    color: var(--text-primary);
}

.data-preview {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.json-preview {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
}

@media (max-width: 768px) {
    .header-content {
        padding: 12px 15px;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .nav-content {
        padding: 10px 15px;
    }
    
    .nav-content a {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 1.4rem;
    }
    
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    
    th, td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
}