* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    gap: 10px;
}

header h1 {
    font-size: 24px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
}

.sidebar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dishes-list {
    list-style: none;
}

.dish-item, .group-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.dish-item {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.dish-item:hover, .group-item:hover {
    background: #f8f9fa;
    border-left-color: #3498db;
}

.dish-item.active {
    background: #e3f2fd;
    border-left-color: #2196f3;
    font-weight: 500;
}

.dish-item iconify-icon {
    flex-shrink: 0;
}

.dish-item span {
    flex: 1;
}

.group-item {
    font-weight: 600;
    color: #555;
    background: #f8f9fa;
}

.group-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.group-toggle:hover {
    background: #e9ecef;
    border-radius: 4px;
}

.group-icon {
    transition: transform 0.2s ease;
    font-size: 16px;
    color: #666;
}

.group-toggle.collapsed .group-icon {
    transform: rotate(0deg);
}

.group-children {
    margin-left: 20px;
    margin-top: 8px;
    display: block;
}

.group-children[style*="display: none"] {
    display: none !important;
}

/* Цветные точки статуса анализа */
.status-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    min-height: 10px;
    max-width: 10px;
    max-height: 10px;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
    margin-left: auto;
    flex-grow: 0;
}

.status-dot-green {
    background-color: #27ae60;
    box-shadow: 0 0 4px rgba(39, 174, 96, 0.5);
}

.status-dot-yellow {
    background-color: #f39c12;
    box-shadow: 0 0 4px rgba(243, 156, 18, 0.5);
}

.status-dot-red {
    background-color: #e74c3c;
    box-shadow: 0 0 4px rgba(231, 76, 60, 0.5);
}

.content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 30px;
    min-height: 600px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.empty-state p {
    margin-top: 20px;
    font-size: 18px;
}

.ttk-view {
    display: none;
}

.ttk-view.active {
    display: block;
}

.ttk-header {
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.ttk-header h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.ttk-header .dish-info {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 15px;
}

.status-pending {
    background: #ecf0f1;
    color: #7f8c8d;
}

.status-green {
    background: #d4edda;
    color: #155724;
}

.status-yellow {
    background: #fff3cd;
    color: #856404;
}

.status-red {
    background: #f8d7da;
    color: #721c24;
}

.analysis-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.analysis-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.analysis-text {
    color: #555;
    line-height: 1.6;
}

.ttk-items {
    margin-top: 30px;
}

.ttk-items h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.items-table th,
.items-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.items-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.items-table tr:hover {
    background: #f8f9fa;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.analyze-btn {
    margin-top: 15px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

#importForm {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}
