/* ===== ROOT ===== */
:root {
    --bg: #f4f7f6;
    --sidebar-bg: #1e1e2d;
    --accent: #d4a373;
    --white: #ffffff;
    --text-main: #2d2d2d;
    --text-muted: #7e7e8f;
    --radius: 16px;
    --transition: all 0.3s ease;

    --green: #2e7d32;
    --red: #c62828;
}

/* ===== BODY ===== */
body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    font-weight: 500;
    letter-spacing: -0.2px; /* 🔥 делает текст “дороже” */
    background: var(--bg);
    color: var(--text-main);
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 30px 0;
}

.logo {
    padding: 0 30px 30px;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.menu-item {
    padding: 15px 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.7;
    border-left: 4px solid transparent;
    transition: var(--transition);
}

.menu-item:hover,
.menu-item.active {
    opacity: 1;
    background: rgba(255,255,255,0.05);
    border-left-color: var(--accent);
}

/* ===== TEXT STYLES ===== */
.text-muted {
    color: var(--text-muted);
    font-size: 13px;
}

.text-soft {
    color: rgba(45, 45, 45, 0.6); /* мягче чем основной */
}

.text-light {
    color: rgba(45, 45, 45, 0.4); /* ещё прозрачнее */
}

.text-white-muted {
    color: rgba(255,255,255,0.6);
}

/* ===== CONTENT ===== */
.content {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* ===== CARD ===== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    margin-bottom: 20px;
}
.cardDark {
    background: #f3f0f0;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    margin-bottom: 20px;
}

/* ===== FLEX ===== */
.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== INPUT ===== */
input, select {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    outline: none;
    font-size: 12px;
}
table input, table select {
    padding: 6px;
    font-size: 12px;
    border-radius: 6px;
}
table input:focus {
    border-color: var(--accent);
    background: white;
}
table {
    table-layout: fixed;
}
table input, table select {
    width: 100%;
    box-sizing: border-box;
}

.actions {
    display: flex;
    gap: 6px;
}

th:last-child,
td:last-child {
    width: 100px;
}

input:focus, select:focus {
    border-color: var(--accent);
}

tr:hover {
    background: #fafafa;
    cursor: pointer;
}

#details-row {
    background: #f9f9f9;
}

.card {
    border-radius: 12px;
}

.ingredient-row {
    width: 300px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.ingredient-row select {
    width: 100px;
    flex: 2;
}

.ingredient-row input {
    width: 100px;
}

.ingredient-row button {
    padding: 4px 6px;
}

.ingredient-card {
    padding: 10px;
    margin: 6px 0;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 8px 8px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

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

/* save */
.btn-save {
    padding: 8px 8px;
    border-radius: 8px;
    background: var(--green);
    color: white;
    font-size: 12px;
    font-weight: 400;
}

/* delete */
.btn-delete {
    background: var(--red);
    color: white;
}

/* secondary */
.btn-outline {
    padding: 8px 8px;
    background: #f1f3f5;
    border: 1px solid #e0e0e0;
}

/* ===== TOGGLE BUTTON ===== */
.toggle-btn {
    background: #f1f3f5;
    color: var(--text-main);
    padding: 10px 16px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

/* ===== TABLE (HTML TABLE) ===== */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 12px;
}

thead {
    background: #f5f5f5;
}

th {
    text-align: left;
    padding: 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

td {
    padding: 12px;
    border-bottom: 1px solid #f1f1f1;
}

tbody tr:hover {
    background: #fafafa;
}

/* ===== BADGES ===== */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-admin {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-staff {
    background: #e3f2fd;
    color: #1976d2;
}

/* ===== FLOOR ===== */
#floor {
    background: #fafafa;
    border-radius: var(--radius);
    position: relative;
}

/* ===== TABLES (ЗАЛ) ===== */
/* ===== TABLES (НОВЫЙ СТИЛЬ) ===== */
.table {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 18px; /* 🔥 СКРУГЛЕНИЕ */
    
    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 600;
    color: white;

    cursor: pointer;
    transition: all 0.25s ease;

    box-shadow: 0 6px 15px rgba(0,0,0,0.1); /* 🔥 ТЕНЬ */
}

.table {
    user-select: none;
    cursor: grab;
}

#floor {
    position: relative;

    background-image: 
        linear-gradient(to right, #eee 1px, transparent 1px),
        linear-gradient(to bottom, #eee 1px, transparent 1px);

    background-size: 40px 40px;
}

/* 🟢 свободен */
.table.free {
    background: linear-gradient(135deg, #327735, #81ed86);
}

/* 🔴 занят */
.table.busy {
    background: linear-gradient(135deg, #ef5350, #ee7d7d);
}

.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    right: 0;
    bottom: 0;
    background: #666;
    cursor: se-resize;
}

/* 🟣 бар */
.table.bar {
    border-radius: 50%;
    background: linear-gradient(135deg, #7b1fa2, #cdaff1);
}

/* hover */
.table:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

#ingredientsTable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
}

#ingredientsTable thead {
    background: #f5f5f5;
}

#ingredientsTable th {
    padding: 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: left;
}

#ingredientsTable td {
    padding: 12px;
    border-bottom: 1px solid #f1f1f1;
}

#ingredientsTable tr:hover {
    background: #fafafa;
}

.form-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.form-row input {
    flex: 1;
}

.form-row select {
    min-width: 120px;
}

.form-row button {
    white-space: nowrap;
}

.table-card {
    padding: 10px;
}

.category-item {
    border-bottom: 1px solid #eee;
    padding: 8px 0;
}

.sub-list {
    margin-left: 10px;
    margin-top: 6px;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    width: 400px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}