/* Основная тема и сброс */
:root {
    --primary-bg: #000000;
    --surface-bg: #000000;
    --surface-elevated: #111111;
    --accent-green: #2e7d32;
    --accent-green-hover: #3d9c42;
    --accent-green-light: rgba(46, 125, 50, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-muted: #ffffff;
    --border-color: #333333;
    --border-hover: #444444;
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.7);
}

* {
    box-sizing: border-box;
}

body {
    background-color: #000000 !important;
    color: #ffffff !important;
    font-family: var(--font-main);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container, .container-fluid {
    background-color: #000000 !important;
    color: #ffffff !important;
}

/* Все тексты белые */
* {
    color: #ffffff !important;
}

/* Исключения для изображений и SVG */
img, svg, .img-thumbnail {
    color: inherit !important;
}

/* Исключения для кнопок и форм */
.btn, .form-control, .form-select, input, textarea, select {
    color: #ffffff !important;
}

.btn-primary, .btn-success {
    color: #ffffff !important;
}

.btn-outline-secondary, .btn-outline-danger {
    color: #ffffff !important;
    border-color: #ffffff !important;
}

.btn-outline-secondary:hover, .btn-outline-danger:hover {
    color: #000000 !important;
    background-color: #ffffff !important;
}

/* Badges */
.badge {
    color: #ffffff !important;
}

.badge.bg-warning {
    color: #000000 !important;
}

.badge.bg-success, .badge.bg-danger, .badge.bg-primary, .badge.bg-info, .badge.bg-secondary {
    color: #ffffff !important;
}

/* Все текстовые элементы белые */
p, span, div, a, label, small, .small {
    color: #ffffff !important;
}

a {
    color: #ffffff !important;
}

a:hover {
    color: var(--accent-green) !important;
}

/* Alert */
.alert {
    background-color: #111111 !important;
    border-color: var(--border-color) !important;
    color: #ffffff !important;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.2) !important;
    border-color: #dc3545 !important;
    color: #f8d7da !important;
}

.alert-info {
    background-color: rgba(13, 110, 253, 0.2) !important;
    border-color: #0d6efd !important;
    color: #cfe2ff !important;
}

.objorka-layout {
    min-height: 100vh;
}

.objorka-sidebar {
    background-color: #000000;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.objorka-brand {
    font-weight: 900;
    font-size: 1.75rem;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.objorka-content {
    padding: 2rem;
    background-color: var(--primary-bg);
    max-width: 1400px;
    margin: 0 auto;
}

.objorka-sidebar .nav-link {
    color: var(--text-secondary);
    border-left: 3px solid transparent;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    border-radius: 4px;
    text-decoration: none;
}

.objorka-sidebar .nav-link:hover,
.objorka-sidebar .nav-link:focus {
    color: var(--text-primary);
    border-left-color: var(--accent-green);
    background-color: var(--accent-green-light);
    transform: translateX(4px);
}

/* Карточки блюд */
.dish-card {
    background-color: var(--surface-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.dish-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg) !important;
    border-color: var(--accent-green) !important;
}

.dish-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: var(--surface-elevated);
}

.dish-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.dish-card:hover .dish-image {
    transform: scale(1.05);
}

.dish-placeholder {
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--surface-bg) 100%);
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.dish-card .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.dish-card .card-title {
    font-weight: 600;
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.dish-card .card-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dish-price {
    color: var(--text-primary);
}

.btn-add-to-cart {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-add-to-cart:hover {
    background-color: var(--accent-green-hover);
    border-color: var(--accent-green-hover);
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.btn-add-to-cart:active {
    transform: scale(0.95);
}

.btn-add-to-cart svg {
    width: 20px;
    height: 20px;
}

/* Таблицы */
.table {
    color: #ffffff !important;
    background-color: #000000 !important;
    border-radius: 12px;
    overflow: visible !important;
    border: 1px solid var(--border-color);
}

.table thead th {
    background-color: #111111 !important;
    color: #ffffff !important;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    padding: 1.25rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: #ffffff !important;
    background-color: #000000 !important;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background-color: #111111 !important;
}

.table tbody tr:hover td {
    background-color: #111111 !important;
    color: #ffffff !important;
}

/* Карточки */
.card {
    background-color: #000000 !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-sm);
}

.card-body {
    background-color: #000000 !important;
    color: #ffffff !important;
}

.card-title {
    color: #ffffff !important;
    font-weight: 600;
}

/* Кнопки */
.btn-primary {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--accent-green-hover);
    border-color: var(--accent-green-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
    background-color: transparent;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-outline-secondary:hover {
    background-color: var(--surface-bg);
    border-color: var(--text-secondary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-success:hover {
    background-color: var(--accent-green-hover);
    border-color: var(--accent-green-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    border-radius: 8px;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Формы */
.form-control, .form-select {
    background-color: #111111 !important;
    border: 1px solid var(--border-color) !important;
    color: #ffffff !important;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    background-color: #111111 !important;
    border-color: var(--accent-green) !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
    outline: none;
}

.form-control::placeholder {
    color: #ffffff !important;
    opacity: 0.6;
}

/* Input type="number" - белые цифры */
input[type="number"] {
    color: #ffffff !important;
    background-color: #111111 !important;
    border-color: #333333 !important;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"]:focus {
    color: #ffffff !important;
    background-color: #111111 !important;
    border-color: var(--accent-green) !important;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2) !important;
}

input[type="number"]::placeholder {
    color: #ffffff !important;
    opacity: 0.6;
}

.form-label {
    color: #ffffff !important;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-text {
    color: #ffffff !important;
    opacity: 0.8;
    font-size: 0.875rem;
}

.form-check-input {
    background-color: #111111 !important;
    border-color: var(--border-color) !important;
}

.form-check-label {
    color: #ffffff !important;
}

.form-check-input:checked {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

/* Общие стили */
body > .container {
    max-width: 800px;
    margin-top: 3rem;
    padding: 2rem;
    background-color: #000000 !important;
    color: #ffffff !important;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

/* Админская панель - увеличенный размер и белый текст */
body .container-fluid[style*="max-width"] {
    color: #ffffff !important;
    background-color: #000000 !important;
}

body .container-fluid[style*="max-width"] .table {
    color: #ffffff !important;
    background-color: #000000 !important;
}

body .container-fluid[style*="max-width"] .table thead th {
    color: #ffffff !important;
    background-color: #111111 !important;
}

body .container-fluid[style*="max-width"] .table tbody td {
    color: #ffffff !important;
    background-color: #000000 !important;
}

body .container-fluid[style*="max-width"] .card-title,
body .container-fluid[style*="max-width"] h1,
body .container-fluid[style*="max-width"] h2,
body .container-fluid[style*="max-width"] h3,
body .container-fluid[style*="max-width"] h4,
body .container-fluid[style*="max-width"] h5,
body .container-fluid[style*="max-width"] h6 {
    color: #ffffff !important;
}

body .container-fluid[style*="max-width"] .form-label {
    color: #ffffff !important;
}

body .container-fluid[style*="max-width"] .text-muted {
    color: #ffffff !important;
    opacity: 0.8;
}

body .container-fluid[style*="max-width"] strong {
    color: #ffffff !important;
}

body .container-fluid[style*="max-width"] .badge {
    color: #ffffff !important;
}

body .container-fluid[style*="max-width"] .badge.bg-warning {
    color: #000000 !important;
}

body .container-fluid[style*="max-width"] .badge.bg-info,
body .container-fluid[style*="max-width"] .badge.bg-primary,
body .container-fluid[style*="max-width"] .badge.bg-success,
body .container-fluid[style*="max-width"] .badge.bg-danger {
    color: #ffffff !important;
}

.bg-light {
    background-color: var(--primary-bg) !important;
}

h1, h2, h3, h4, h5, h6 {
    color: #ffffff !important;
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.text-muted {
    color: #ffffff !important;
    opacity: 0.8;
}

.text-success {
    color: var(--accent-green) !important;
}

.border {
    border-color: var(--border-color) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* Изображения */
.img-thumbnail {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--surface-bg);
}

/* Алерты */
.alert {
    border-radius: 8px;
    border: 1px solid;
    padding: 1rem 1.25rem;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
    color: #f8d7da;
}

/* Элементы управления корзиной */
.dish-cart-controls {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.cart-controls-wrapper {
    flex-shrink: 0;
    min-width: 0;
    align-items: center;
    display: flex;
}

.cart-minus-btn,
.cart-plus-btn {
    flex-shrink: 0 !important;
    min-width: 32px !important;
    align-items: center;
    justify-content: center;
    display: flex;
}

.cart-quantity {
    flex-shrink: 0;
    white-space: nowrap;
    min-width: fit-content;
    line-height: 1.2;
}

.dish-price {
    flex-shrink: 1;
    min-width: 0;
    margin-right: 0.75rem;
    align-self: flex-start;
    padding-top: 0.25rem;
}

.dish-price strong {
    font-size: 1.1rem;
    white-space: nowrap;
    line-height: 1.2;
    display: block;
}

/* Мобильная версия */
@media (max-width: 768px) {
    .objorka-layout {
        flex-direction: column;
    }
    
    .objorka-sidebar {
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
        max-height: none;
    }
    
    .objorka-content {
        padding: 1rem;
    }
    
    .dish-card {
        border-radius: 12px !important;
    }
    
    .dish-image,
    .dish-placeholder {
        height: 180px;
    }
    
    .dish-card .card-body {
        padding: 1rem;
    }
    
    .dish-card .card-title {
        font-size: 1rem;
    }
    
    .dish-card .card-text {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .btn-add-to-cart {
        width: 40px;
        height: 40px;
    }
    
    .btn-add-to-cart svg {
        width: 18px;
        height: 18px;
    }
    
    /* Уменьшаем размеры элементов управления корзиной на мобильных */
    .cart-minus-btn,
    .cart-plus-btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        font-size: 0.875rem;
    }
    
    .cart-quantity {
        font-size: 0.75rem;
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    
    /* Вертикальное расположение на мобильных */
    .dish-cart-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    
    .dish-price {
        margin-right: 0;
        padding-top: 0;
        width: 100%;
    }
    
    .dish-price strong {
        font-size: 0.95rem;
    }
    
    .cart-controls-wrapper {
        width: 100%;
        justify-content: flex-start;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    body > .container {
        margin-top: 1rem;
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.75rem;
    }
}

@media (max-width: 576px) {
    .objorka-brand {
        font-size: 1.5rem;
    }
    
    .dish-image,
    .dish-placeholder {
        height: 150px;
    }
    
    .dish-card .card-body {
        padding: 0.875rem;
    }
    
    .dish-card .card-text {
        margin-bottom: 0.4rem;
    }
    
    .btn-add-to-cart {
        width: 36px;
        height: 36px;
    }
    
    .btn-add-to-cart svg {
        width: 16px;
        height: 16px;
    }
    
    /* Еще больше уменьшаем элементы управления корзиной на очень маленьких экранах */
    .cart-minus-btn,
    .cart-plus-btn {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        font-size: 0.75rem;
    }
    
    .cart-quantity {
        font-size: 0.7rem;
        padding-left: 0.2rem !important;
        padding-right: 0.2rem !important;
    }
    
    /* Вертикальное расположение на очень маленьких экранах */
    .dish-cart-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        margin-top: 0.4rem;
        padding-top: 0.4rem;
    }
    
    .dish-price {
        margin-right: 0;
        padding-top: 0;
        width: 100%;
    }
    
    .dish-price strong {
        font-size: 0.875rem;
    }
    
    .cart-controls-wrapper {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Плавная прокрутка */
html {
    scroll-behavior: smooth;
}

/* Кастомный скроллбар */
.objorka-sidebar::-webkit-scrollbar {
    width: 6px;
}

.objorka-sidebar::-webkit-scrollbar-track {
    background: #000000;
}

.objorka-sidebar::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 3px;
}

.objorka-sidebar::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

/* Убираем scrollbar из таблиц */
.table-responsive {
    overflow: visible !important;
}

.table-responsive::-webkit-scrollbar {
    display: none;
}
