/* ==========================================================================
   ARTICLES TAB STYLES
   ========================================================================== */

.articles-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 0;
}

/* Header Section */
.articles-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 10px;
}

.header-left h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.header-left p {
    color: #64748b;
    margin: 0;
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.header-actions .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Font Awesome icon styling for buttons */
.btn-primary .fas.fa-plus {
    color: white !important;
    font-size: 0.9rem;
}

.header-actions .icon {
    font-size: 1rem;
}

/* Filters Section */
.articles-filters {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: 150px;
    transition: all 0.2s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #d4a574;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

/* Bulk Actions */
.bulk-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #fef3e2, #fde68a);
    border-radius: 12px;
    border: 1px solid #f59e0b;
    animation: slideDown 0.3s ease;
}

.bulk-info {
    font-weight: 600;
    color: #92400e;
}

.bulk-buttons {
    display: flex;
    gap: 10px;
}

.bulk-buttons .btn {
    padding: 8px 14px;
    font-size: 0.85rem;
}

/* ==========================================================================
   GLASS CONTAINER DESIGN
   ========================================================================== */

/* Main Articles Container - Glass Background */
.articles-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    padding: 24px;
    margin: 20px 0;
    position: relative;
}

.articles-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

/* Articles Header */
.articles-header {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.articles-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.articles-title-section h2 {
    margin: 0;
    color: #1e293b;
    font-size: 1.75rem;
    font-weight: 700;
}

.articles-count {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 4px;
}

.articles-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Search Section */
.search-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Bulk Mode Notice */
.bulk-mode-notice {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bulk-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e40af;
    font-weight: 500;
}

.bulk-actions {
    display: flex;
    gap: 8px;
}

/* Articles List */
.articles-list {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.item-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 165, 116, 0.15);
    border-color: rgba(212, 165, 116, 0.2);
}

.item-card.selected {
    border-color: #d4a574;
    background: linear-gradient(135deg, #fef9f3, #ffffff);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.item-category {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(212, 165, 116, 0.1);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #d4a574;
}

.category-emoji {
    font-size: 1rem;
}

.item-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.item-card:hover .item-actions {
    opacity: 1;
}

/* Updated icon buttons to match menu templates design */
.btn-icon {
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.9);
    color: #64748b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Specific styles for edit and delete icon buttons */
.btn-icon.edit-icon:hover {
    background: #f1f5f9;
    border-color: #d4a574;
    color: #d4a574;
}

.btn-icon.delete-icon {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-icon.delete-icon:hover {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    color: #7f1d1d;
    border-color: rgba(239, 68, 68, 0.3);
}

.item-content {
    margin-bottom: 15px;
}

.item-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.detail-label {
    color: #6b7280;
    font-weight: 500;
}

.detail-value {
    color: #374151;
    font-weight: 600;
}

.item-checkbox {
    position: absolute;
    top: 15px;
    right: 15px;
}

.item-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #d4a574;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 10px 0;
}

.empty-state p {
    font-size: 1rem;
    margin: 0 0 25px 0;
}

/* Pagination */
.articles-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .articles-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 15px;
    }

    .articles-header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        margin-bottom: 15px;
    }

    .articles-title-section h2 {
        font-size: 1.5rem;
        text-align: center;
    }

    .articles-actions {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .articles-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }

    .filter-group select,
    .filter-group input {
        min-width: auto;
        width: 100%;
    }

    .items-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .bulk-actions {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .articles-container {
        gap: 15px;
        padding: 10px;
    }

    .articles-header {
        padding: 12px;
        margin-bottom: 15px;
    }

    .articles-header-top {
        gap: 12px;
        margin-bottom: 12px;
    }

    .articles-title-section h2 {
        font-size: 1.25rem;
    }

    .articles-count {
        font-size: 0.8rem;
    }

    .articles-actions {
        gap: 6px;
    }

    .articles-actions .btn {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    .header-left h2 {
        font-size: 1.25rem;
    }

    .item-card {
        padding: 15px;
    }

    .item-name {
        font-size: 1rem;
    }

    .detail-row {
        font-size: 0.85rem;
    }

    /* Search section improvements */
    .search-section {
        padding: 12px;
    }

    .search-section input {
        font-size: 0.9rem;
    }

    .search-section select {
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .articles-header {
        padding: 10px;
        margin-bottom: 12px;
    }

    .articles-title-section h2 {
        font-size: 1.1rem;
    }

    .articles-count {
        font-size: 0.75rem;
    }

    .articles-actions .btn {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    .search-section {
        padding: 10px;
    }

    .search-section input,
    .search-section select {
        font-size: 0.85rem;
        padding: 8px;
    }
}

/* ==========================================================================
   MODAL STYLES FOR ARTICLES
   ========================================================================== */

/* Modal overlay styles are defined in components.css */

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    position: relative;
}

.modal-content.medium {
    width: 90%;
    max-width: 600px;
}

.modal-content.large {
    width: 90%;
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.modal-body {
    padding: 0 24px 24px 24px;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #d4a574;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Item Details View */
.item-details-view {
    margin-bottom: 30px;
}

.detail-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.item-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(212, 165, 116, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #d4a574;
    margin-bottom: 15px;
}

.item-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    font-size: 1rem;
    color: #374151;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
        max-height: calc(100vh - 40px);
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-actions,
    .modal-actions {
        flex-direction: column;
    }

    .modal-header {
        padding: 20px 20px 0 20px;
    }

    .modal-body {
        padding: 0 20px 20px 20px;
    }
}

/* ==========================================================================
   CATEGORIES MANAGEMENT STYLES
   ========================================================================== */

.categories-management {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.categories-actions {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.category-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.category-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-emoji {
    font-size: 1.5rem;
    line-height: 1;
}

.category-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.category-actions {
    display: flex;
    gap: 4px;
}

.category-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #64748b;
}

.category-order {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.category-items-count {
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

/* Large Modal for Categories */
.large-modal {
    max-width: 800px;
    width: 90vw;
}

/* Category Form Styles */
#categoryForm .form-group {
    margin-bottom: 20px;
}

#categoryForm label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
}

#categoryForm input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

#categoryForm input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#categoryEmoji {
    text-align: center;
    font-size: 1.2rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-size: 1rem;
}

/* Responsive Categories */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }

    .large-modal {
        width: 95vw;
        max-width: none;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .category-actions {
        align-self: flex-end;
    }
}

/* ==========================================================================
   BULK OPERATIONS STYLES
   ========================================================================== */

/* Bulk Edit Modal */
.bulk-edit-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bulk-edit-options .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bulk-edit-options .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
}

.bulk-edit-options .form-group label input[type="checkbox"] {
    margin: 0;
}

.bulk-edit-options .form-group select,
.bulk-edit-options .form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.bulk-edit-options .form-group select:disabled,
.bulk-edit-options .form-group input[type="text"]:disabled {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.bulk-edit-options .form-group select:focus,
.bulk-edit-options .form-group input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Bulk Export Modal */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.export-format h4,
.export-fields h4,
.export-preview h4 {
    margin: 0 0 12px 0;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
}

.format-options,
.fields-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.format-options label,
.fields-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.format-options label:hover,
.fields-options label:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.format-options label input,
.fields-options label input {
    margin: 0;
}

/* Export Preview Table */
.preview-table {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.preview-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.preview-table th {
    background: #f9fafb;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
}

.preview-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f3f4f6;
    color: #6b7280;
}

.preview-table tr:hover {
    background: #f9fafb;
}

/* Item Checkbox Styles */
.item-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.item-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.item-checkbox label {
    display: none;
}

/* Responsive Bulk Operations */
@media (max-width: 768px) {
    .bulk-actions {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .bulk-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .format-options,
    .fields-options {
        gap: 6px;
    }

    .preview-table {
        font-size: 0.8rem;
    }

    .preview-table th,
    .preview-table td {
        padding: 8px 6px;
    }
}

/* ==========================================================================
   NEW CARD DESIGN STYLES
   ========================================================================== */

/* Category Badge */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(212, 165, 116, 0.1);
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #d4a574;
    margin-bottom: 8px;
    width: fit-content;
}

.category-emoji {
    font-size: 0.8rem;
}

.category-name {
    white-space: nowrap;
}

/* Price Info */
.price-info {
    display: flex;
    gap: 8px;
    margin: 8px 0;
    font-size: 0.85rem;
}

/* Грамажът стои преди цената на същия ред. Собствен цвят и по-леко тегло -
   различава се от пръв поглед, но не се състезава с цената за внимание. */
.item-weight {
    color: #e67e22;
    font-weight: 500;
}

.price-bgn {
    color: #27ae60;
    font-weight: 600;
}

.price-eur {
    color: #3498db;
    font-weight: 600;
}

.no-price {
    color: #95a5a6;
    font-style: italic;
}

/* Action Buttons at Bottom */
.item-actions-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

/* Updated action buttons to match menu templates design */
.action-btn {
    flex: 1 1 auto;
    min-width: 80px;
    max-width: 100%;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    position: relative;
    overflow: hidden;
    min-height: 32px;
}

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

/* Edit button - matches template secondary button style */
.edit-btn {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.edit-btn:hover {
    background: #f1f5f9;
    border-color: #d4a574;
    color: #d4a574;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Delete button - matches template delete button style */
.delete-btn {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1);
}

.delete-btn:hover {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    color: #7f1d1d;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Checkbox Group Layout */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0;
    /* No max-height or overflow restrictions - show all items */
}

.checkbox-item {
    flex: 0 0 calc(25% - 12px);
    max-width: calc(25% - 12px);
    min-height: 180px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}

.checkbox-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 165, 116, 0.1), transparent);
    transition: left 0.6s;
    /* Този слой е чиста декорация и покрива цялата карта. Без pointer-events:none
       той краде hit-test-а, докато се плъзга - бутонът под курсора губи :hover,
       вдига се обратно, hover-ът се връща и така в кръг. Точно това се вижда
       като трептене, когато посочиш бутон. */
    pointer-events: none;
}

.checkbox-item:hover::before {
    left: 100%;
}

.checkbox-item:hover {
    transform: translateY(-2px) scale(1.005);
    border-color: #d4a574;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(212, 165, 116, 0.15), 0 4px 12px rgba(0,0,0,0.08);
}

.checkbox-item.selected {
    background: #fef7ed;
    border-color: #d4a574;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(212, 165, 116, 0.22), 0 4px 12px rgba(0,0,0,0.08);
}

.checkbox-item.selected::after {
    content: '✓';
    position: absolute;
    /* Значката също е декорация - да не поема кликове. */
    pointer-events: none;
    top: 10px;
    right: 15px;
    width: 24px;
    height: 24px;
    background: #d4a574;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
    animation: checkmark 0.6s ease-out;
}

.checkbox-item-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    justify-content: space-between;
}

.checkbox-item-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 8px;
    flex-grow: 1;
}

.checkbox-item.selected .checkbox-item-title {
    color: #d4a574;
}

/* Checkmark animation */
@keyframes checkmark {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .checkbox-item {
        flex: 0 0 calc(33.333% - 12px);
        max-width: calc(33.333% - 12px);
    }
}

/* Medium screens (tablets landscape and small desktops) */
@media (min-width: 769px) and (max-width: 1200px) {
    .checkbox-item {
        flex: 0 0 calc(33.333% - 12px);
        max-width: calc(33.333% - 12px);
        min-height: 200px;
        padding: 16px;
    }

    .action-btn {
        font-size: 0.75rem;
        padding: 6px 8px;
        min-height: 32px;
        min-width: 70px;
    }

    .item-actions-bottom {
        flex-direction: column;
        gap: 4px;
    }

    .action-btn {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .checkbox-item {
        flex: 0 0 calc(50% - 8px);
        max-width: calc(50% - 8px);
        min-height: 160px;
        padding: 12px;
    }

    .action-btn {
        font-size: 0.7rem;
        padding: 6px 8px;
        min-width: 60px;
    }

    .item-actions-bottom {
        flex-direction: column;
        gap: 4px;
    }

    .action-btn {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .action-btn {
        font-size: 0.65rem;
        padding: 5px 6px;
        gap: 2px;
    }

    .item-actions-bottom {
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .checkbox-item {
        flex: 0 0 100%;
        max-width: 100%;
        min-height: 140px;
        padding: 10px;
    }

    .action-btn {
        font-size: 0.65rem;
        padding: 6px 8px;
        gap: 3px;
        min-width: 160px;
        width: 160px;
        white-space: nowrap;
        flex: none;
    }

    .item-actions-bottom {
        flex-direction: column;
        gap: 4px;
        margin-top: 8px;
        padding-top: 8px;
    }
}

@media (max-width: 360px) {
    .action-btn {
        font-size: 0.55rem;
        padding: 3px 4px;
        gap: 1px;
        /* Намаляваме още повече размера на текста */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
        flex-shrink: 1;
    }

    .item-actions-bottom {
        gap: 2px;
    }
}

/* ==========================================================================
   PAGINATION STYLES
   ========================================================================== */

.pagination-wrapper {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(212, 165, 116, 0.2);
    position: relative;
}

.pagination-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 165, 116, 0.8), transparent);
}



.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.pagination-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(212, 165, 116, 0.2);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #5a4a3a;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(212, 165, 116, 0.1);
    position: relative;
    overflow: hidden;
}

.pagination-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 165, 116, 0.1), transparent);
    transition: left 0.6s;
    /* Този слой е чиста декорация и покрива цялата карта. Без pointer-events:none
       той краде hit-test-а, докато се плъзга - бутонът под курсора губи :hover,
       вдига се обратно, hover-ът се връща и така в кръг. Точно това се вижда
       като трептене, когато посочиш бутон. */
    pointer-events: none;
}

.pagination-btn:hover:not(.disabled)::before {
    left: 100%;
}

.pagination-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(212, 165, 116, 0.4);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 16px rgba(212, 165, 116, 0.2);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #d4a574, #c49464);
    border-color: #d4a574;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(212, 165, 116, 0.3);
    transform: translateY(-1px);
}

.pagination-btn.active::before {
    display: none;
}

.pagination-btn.disabled {
    background: rgba(255, 255, 255, 0.6);
    color: #9ca3af;
    cursor: not-allowed;
    border-color: rgba(212, 165, 116, 0.1);
    box-shadow: none;
}

.pagination-dots {
    color: rgba(90, 74, 58, 0.6);
    font-weight: 600;
    padding: 0 8px;
    display: flex;
    align-items: center;
    height: 44px;
    font-size: 1.2rem;
}

.pagination-info {
    text-align: center;
    color: rgba(90, 74, 58, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(212, 165, 116, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    margin-top: 8px;
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   MODAL STYLES
   ========================================================================== */

/* Modal overlay styles are defined in components.css - avoiding duplication */

.modal-content {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px 16px;
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
}

.modal-header h3 {
    margin: 0;
    color: #5a4a3a;
    font-size: 1.4rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(212, 165, 116, 0.1);
    color: #d4a574;
}

.modal-body {
    padding: 24px 32px 32px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================================================
   FORM STYLES
   ========================================================================== */

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

/* Modal form labels - high specificity */
.modal-overlay .modal-content .form-group label {
    display: block !important;
    margin-bottom: 8px !important;
    color: #374151 !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Modal form inputs - high specificity to override templates.css */
.modal-overlay .modal-content .form-group input,
.modal-overlay .modal-content .form-group select {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background: white !important;
    font-size: 0.95rem !important;
    color: #374151 !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
    backdrop-filter: none !important;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    font-size: 0.95rem;
    color: #374151;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

/* Modal form inputs focus - high specificity */
.modal-overlay .modal-content .form-group input:focus,
.modal-overlay .modal-content .form-group select:focus {
    outline: none !important;
    border-color: #d4a574 !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1) !important;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #d4a574;
    background: white;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid rgba(212, 165, 116, 0.2);
}

.form-actions .btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.form-actions .btn-primary {
    background: linear-gradient(135deg, #d4a574, #c49464);
    color: white;
    box-shadow: 0 4px 16px rgba(212, 165, 116, 0.3);
}

.form-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.4);
}

.form-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: #5a4a3a;
    border: 1px solid rgba(212, 165, 116, 0.3);
}

.form-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(212, 165, 116, 0.5);
}

/* ==========================================================================
   NOTIFICATION STYLES
   ========================================================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(12px);
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

.notification-success {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
}

.notification-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
}

.notification-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

.notification button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.notification button:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .pagination-controls {
        gap: 4px;
    }

    .pagination-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
        min-width: 36px;
        height: 36px;
    }

    .pagination-info {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .pagination-controls {
        flex-wrap: wrap;
        gap: 6px;
    }

    .pagination-btn {
        padding: 4px 6px;
        font-size: 0.75rem;
        min-width: 32px;
        height: 32px;
    }
}



/* ==========================================================================
   SIMPLIFIED UI STYLES
   ========================================================================== */

/* Simplified Header */
.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 16px;
}

#articles .articles-container .header-title h2 {
    margin: 0 0 4px 0;
    color: #2d3748 !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: #2d3748 !important;
    background-clip: initial !important;
    font-size: 24px;
    font-weight: 600;
}

.items-count {
    color: #7f8c8d;
    font-size: 14px;
}

.primary-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
    margin-top: 4px;
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: #2c3e50;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
}

/* Search Section */
.search-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.category-filter {
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    min-width: 180px;
}

/* Bulk Mode Notice */
.bulk-mode-notice {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.bulk-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.bulk-icon {
    font-size: 16px;
}

.btn-text {
    background: none;
    border: none;
    color: #1976d2;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    margin-left: auto;
}

/* Simplified Article Cards */
.article-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
}

.article-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.article-card.selected {
    border: 2px solid #3498db;
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.2);
}

.article-main {
    padding-right: 60px; /* Space for actions */
}

.article-category {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.article-name {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.article-price {
    color: #27ae60;
    font-size: 16px;
    font-weight: 600;
}

/* Article Actions */
.article-actions {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.article-card:hover .article-actions {
    opacity: 1;
}

/* Removed duplicate .btn-icon styles - using the updated ones above */

/* Article Checkbox */
.article-checkbox {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.article-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3498db;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    transition: all 0.2s ease;
}

.article-checkbox input[type="checkbox"]:checked {
    background: #3498db;
    border-color: #3498db;
    transform: scale(1.1);
}

.article-checkbox input[type="checkbox"]:hover {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ==========================================================================
   IMPORT/EXPORT MODAL STYLES
   ========================================================================== */

/* Large Modal */
.large-modal .modal-content {
    max-width: 800px;
    width: 90%;
}

/* Import Steps */
.import-steps {
    margin-bottom: 20px;
}

.import-step {
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
}

.import-step.active {
    border-color: #007bff;
    background-color: #f8f9ff;
}

.import-step h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

/* File Upload Area */
.file-upload-area {
    margin-bottom: 20px;
    border: 2px dashed #d4a574;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.05) 0%, rgba(196, 148, 100, 0.05) 100%);
    position: relative;
    overflow: hidden;
}

.file-upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.1) 0%, rgba(196, 148, 100, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.file-upload-area:hover {
    border-color: #c49464;
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.1) 0%, rgba(196, 148, 100, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 165, 116, 0.2);
}

.file-upload-area:hover::before {
    opacity: 1;
}

.file-upload-area .upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #d4a574;
    display: block;
}

.file-upload-area .upload-text {
    font-size: 18px;
    font-weight: 600;
    color: #d4a574;
    margin-bottom: 8px;
    display: block;
}

.file-upload-area .upload-hint {
    color: #8b7355;
    font-size: 14px;
    margin: 0;
    opacity: 0.8;
}

.file-upload-area.drag-over {
    border-color: #c49464;
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.2) 0%, rgba(196, 148, 100, 0.2) 100%);
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(212, 165, 116, 0.3);
}

/* Format tabs */
.format-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.format-tab {
    padding: 8px 16px;
    border: 1px solid #d4a574;
    background: transparent;
    color: #d4a574;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.format-tab:hover {
    background: rgba(212, 165, 116, 0.1);
}

.format-tab.active {
    background: #d4a574;
    color: white;
}

/* File input styling */
.file-input-wrapper {
    margin-top: 15px;
    position: relative;
}

.styled-file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #d4a574, #c49464);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(212, 165, 116, 0.3);
    user-select: none;
}

.file-input-label:hover {
    background: linear-gradient(135deg, #c49464, #b8855a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
}

.styled-file-input:focus + .file-input-label {
    outline: 2px solid #d4a574;
    outline-offset: 2px;
}

.file-upload-area.drag-over .upload-icon {
    animation: bounce 0.6s ease-in-out infinite alternate;
}

.file-upload-area.drag-over .upload-text {
    color: #c49464;
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

.upload-zone {
    border: 2px dashed #007bff;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8f9ff;
}

.upload-zone:hover {
    border-color: #0056b3;
    background-color: #e6f0ff;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.upload-text strong {
    display: block;
    font-size: 16px;
    color: #007bff;
    margin-bottom: 5px;
}

.upload-text p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

/* Format Info */
.format-info {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
}

.format-info h5 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
}

.format-example {
    background-color: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    overflow-x: auto;
    margin: 0;
}

/* Import Preview */
.import-preview {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    background-color: #fafafa;
}

.import-summary {
    background-color: #e3f2fd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.import-summary h4 {
    margin: 0 0 10px 0;
    color: #1976d2;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.stat-item {
    background-color: white;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.import-errors {
    background-color: #ffebee;
    border: 1px solid #f44336;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.import-errors h4 {
    margin: 0 0 10px 0;
    color: #d32f2f;
}

.import-warnings {
    background-color: #fff3e0;
    border: 1px solid #ff9800;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.import-warnings h4 {
    margin: 0 0 10px 0;
    color: #f57c00;
}

.import-categories {
    margin-bottom: 20px;
}

.import-categories h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.category-preview {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-emoji {
    font-size: 20px;
}

.category-name {
    flex: 1;
    font-weight: 500;
}

.category-count {
    font-size: 12px;
    color: #666;
    background-color: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
}

.import-items-preview h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.items-preview-list {
    max-height: 200px;
    overflow-y: auto;
}

.item-preview {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: 10px;
    align-items: center;
}

.item-category {
    font-size: 12px;
    color: #666;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.item-name {
    font-weight: 500;
}

.item-details {
    font-size: 12px;
    color: #666;
    text-align: right;
}

.more-items {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 10px;
}

/* Import Options */
.import-options {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 10px;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

.option-description {
    margin: 0;
    font-size: 12px;
    color: #666;
    margin-left: 30px;
}

/* Progress Bar */
.import-progress {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background-color: #28a745;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #495057;
}

/* Export Options */
.export-options {
    margin-bottom: 20px;
}

.export-format,
.export-scope {
    margin-bottom: 25px;
}

.export-format h4,
.export-scope h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.format-options,
.scope-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-label:hover {
    border-color: #007bff;
    background-color: #f8f9ff;
}

.radio-label input[type="radio"] {
    margin: 0;
}

.format-info,
.scope-info {
    flex: 1;
}

.format-info strong,
.scope-info strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.format-info p,
.scope-info p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.export-preview {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
}

.export-preview h4 {
    margin: 0 0 15px 0;
    color: #495057;
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.preview-stats .stat-item {
    background-color: white;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

/* Filter-related styles */
.radio-label.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.radio-label.disabled input[type="radio"] {
    cursor: not-allowed;
}

.filter-details {
    margin-top: 8px;
}

.filter-details small {
    color: #666;
    font-style: italic;
}

.filter-help {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.filter-help p {
    margin: 0 0 10px 0;
    color: #495057;
}

.filter-help ul {
    margin: 10px 0;
    padding-left: 20px;
}

.filter-help li {
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

.btn-text {
    background: none;
    border: none;
    color: #007bff;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 0;
}

.btn-text:hover {
    color: #0056b3;
}

/* Import format tabs */
.import-format-selection {
    margin-bottom: 20px;
}

.format-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.format-tab {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.format-tab:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.format-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: #f8f9fa;
}

/* CSV info styles */
.csv-info {
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.csv-info p {
    margin: 0 0 10px 0;
    color: #0066cc;
    font-weight: 500;
}

.csv-info ul {
    margin: 0;
    padding-left: 20px;
}

.csv-info li {
    margin-bottom: 5px;
    color: #0066cc;
    font-size: 13px;
}

.csv-info code {
    background-color: #fff;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

/* Import preview styles */
.import-preview {
    max-height: 70vh;
    overflow-y: auto;
}

.preview-header {
    margin-bottom: 20px;
}

.preview-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.preview-options {
    margin-bottom: 20px;
}

.import-mode h4 {
    margin-bottom: 15px;
    color: #333;
}

.mode-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mode-info {
    margin-left: 10px;
}

.mode-info strong {
    display: block;
    margin-bottom: 4px;
}

.mode-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/* Preview table */
.preview-table-container {
    margin-bottom: 20px;
}

.preview-table {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.preview-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.preview-table th {
    background-color: #f8f9fa;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 1;
}

.preview-table td {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

.preview-table tr:hover {
    background-color: #f8f9fa;
}

.category-preview {
    display: inline-block;
    margin-right: 8px;
}

.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    min-width: 20px;
}

.status-badge.success {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.new {
    background-color: #fff3cd;
    color: #856404;
}

.status-badge.error {
    background-color: #f8d7da;
    color: #721c24;
}

.status-badge.ready {
    background-color: #d1ecf1;
    color: #0c5460;
}

.more-rows td {
    text-align: center;
    font-style: italic;
    color: #666;
    background-color: #f8f9fa;
}

/* Large modal for import preview */
.large-modal {
    max-width: 900px;
    width: 90vw;
}

/* Import Progress Modal */
.import-progress-modal {
    max-width: 500px;
    width: 90%;
    z-index: 1200 !important;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.progress-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.progress-counter {
    font-size: 14px;
    font-weight: 600;
    color: #d4a574;
    background: rgba(212, 165, 116, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4a574, #c49464);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percentage {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    min-width: 40px;
    text-align: right;
}

.progress-details {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(212, 165, 116, 0.05);
    border-radius: 8px;
    border-left: 4px solid #d4a574;
}

.progress-icon {
    font-size: 24px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.progress-message {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* ==========================================================================
   RECIPE NOTEBOOK
   ========================================================================== */

/* Card icon */
.recipe-icon-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 2;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 4px;
}
.recipe-icon-btn:hover {
    opacity: 1;
    transform: scale(1.2);
    background: rgba(212, 165, 116, 0.1);
}
.recipe-icon-btn.has-recipe { opacity: 0.85; }
.recipe-icon-btn.has-recipe::after {
    content: '';
    position: absolute;
    top: 1px;
    right: 1px;
    width: 7px;
    height: 7px;
    background: #d4a574;
    border-radius: 50%;
}

/* ── Modal shell ── */
.recipe-modal-content {
    width: min(820px, 96vw);
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(0,0,0,0.22);
}

/* Header */
.recipe-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 16px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.recipe-modal-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.recipe-modal-icon { font-size: 1.3rem; }
.recipe-modal-title-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: #92642a;
}

/* Name bar */
.recipe-name-bar {
    background: linear-gradient(135deg, #fdf6ee, #fef9f3);
    border-bottom: 1px solid #f0e8d8;
    padding: 12px 24px;
    flex-shrink: 0;
}
.recipe-name-bar-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #b08050;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.recipe-name-bar-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
}

/* Two-column layout */
.recipe-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    flex: 1;
    overflow: hidden;
}
.recipe-col {
    display: flex;
    flex-direction: column;
    padding: 18px 20px 16px;
}
.recipe-col:first-child {
    border-right: 1px solid #f1f5f9;
}
.recipe-col-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
}
.recipe-col-icon { font-size: 1rem; }
.recipe-col-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #92642a;
    text-transform: uppercase;
}

/* Shared textarea */
.recipe-textarea {
    flex: 1;
    width: 100%;
    min-height: 200px;
    resize: vertical;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.93rem;
    line-height: 1.65;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.recipe-textarea:focus {
    outline: none;
    border-color: #d4a574;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.12);
}
.recipe-textarea[readonly] {
    background: #f8f9fa;
    color: #374151;
    cursor: default;
}

/* Footer */
.recipe-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
    gap: 10px;
}
.recipe-footer-right {
    display: flex;
    gap: 10px;
}

/* Responsive — stack on narrow screens */
@media (max-width: 600px) {
    .recipe-two-col {
        grid-template-columns: 1fr;
    }
    .recipe-col:first-child {
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
    }
    .recipe-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .recipe-footer-right { justify-content: flex-end; }
}

/* ==========================================================================
   ТАБ „АРТИКУЛИ" - ПРЕНАРЕЖДАНЕ (2026-09-11)

   Състоянието преди: под 480px картите ставаха по една на ред с
   `min-height: 140px`, а двата бутона - един под друг с ФИКСИРАНА широчина
   160px. На телефон в екрана се събираха по два артикула от 299. Отделно
   `.category-filter` има `min-width: 180px` и до входа за търсене избутваше
   цялата страница настрани (459px при екран 375px).
   ========================================================================== */

/* ❗ Картата е content-box, а широчината ѝ е зададена като `calc(25% - 12px)` -
   падингът и рамката (30px) се ДОБАВЯТ отгоре и реалната карта става 305px
   вместо 275px. Затова на 1280px се събираха по ТРИ карти на ред, въпреки че
   правилото казва 25%, и оставаше празна четвърт от реда. */
.checkbox-item {
    box-sizing: border-box;
}

/* --- Десктоп и таблет (≥600px) ---------------------------------- */
@media (min-width: 600px) {
    /* Двата бутона стоят един до друг, а не един под друг. Старите правила
       ги редяха в колона между 769 и 1200px и под 768px, което добавяше
       по ~36px височина на всяка карта без никаква полза. */
    .item-actions-bottom {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 6px;
        padding-top: 10px;
    }

    .item-actions-bottom .action-btn {
        flex: none;
        width: auto;
        min-width: 0;
        max-width: none;
        white-space: nowrap;
        overflow: hidden;
    }

    .art-btn-label {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .checkbox-item {
        min-height: 0;
        padding: 14px;
    }

    .checkbox-item-title {
        font-size: 0.92rem;
        margin-bottom: 6px;
    }

    .price-info { margin: 6px 0; }
    .category-badge { margin-bottom: 6px; }
}

/* Над 1600px се губеше място - пети стълб, както при шаблоните. */
@media (min-width: 1600px) {
    .checkbox-item {
        flex: 0 0 calc(20% - 13px);
        max-width: calc(20% - 13px);
    }
}

/* --- Телефон (≤599px) ------------------------------------------- */
@media (max-width: 599px) {

    /* Три вложени бели кутии една в друга (`.articles-header` обгражда
       `.header-main` и `.search-section`, всяка със свой падинг и рамка).
       На телефон външната отпада - вътрешните две си носят рамката. */
    .articles-header { margin-bottom: 10px; }

    .header-main {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        margin-bottom: 8px;
        border-radius: 12px;
    }

    #articles .articles-container .header-title h2 { font-size: 19px; margin: 0; }
    .items-count { font-size: 12px; }

    /* Заглавието и броят на един ред - два реда тук са чиста загуба. */
    .header-title {
        display: flex;
        align-items: baseline;
        gap: 8px;
        flex-wrap: wrap;
    }

    .primary-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    .primary-actions .btn {
        padding: 0.6rem 0.5rem;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    /* Търсенето и филтърът един под друг - `min-width: 180px` на филтъра
       избутваше страницата извън екрана. */
    .search-section { padding: 10px; }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .search-input,
    .category-filter {
        width: 100%;
        min-width: 0;
        /* Без border-box падингът се ДОБАВЯ към 100% и входът излиза
           26px извън контейнера си. */
        box-sizing: border-box;
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Картите: по 2 на ред, без наложена височина.
       Грид, а не flex с проценти: `calc(50% - 4px)` при gap 8px дава точно
       широчината на контейнера и субпикселното окръгляне пренася втората
       карта на нов ред. Гридът сам дели остатъка. */
    .articles-list { padding: 10px; border-radius: 12px; }

    .checkbox-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .checkbox-item {
        flex: none;
        width: auto;
        max-width: none;
        min-height: 0;
        padding: 10px;
        border-radius: 10px;
    }

    /* Няма hover на тъч - анимацията само мести картите под пръста. */
    .checkbox-item:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    /* Етикетът с категорията е НАД името, но на телефон е само дребен
       надпис, а не плътен чип: в карта от ~170px фонът, рамката и падингът
       му го правеха едро колкото самото име и окото не знаеше къде да спре.
       Фокусът е името на артикула. */
    .category-badge {
        background: none;
        border: none;
        padding: 0;
        margin-bottom: 3px;
        /* Иконката за рецепта седи абсолютно в горния десен ъгъл - без фон
           етикетът се разпростира и двете се допират. */
        max-width: calc(100% - 30px);
        overflow: hidden;
        font-size: 0.62rem;
        font-weight: 500;
        color: #a8a29e;
        letter-spacing: 0.01em;
        gap: 3px;
    }

    .category-emoji { font-size: 0.7rem; }

    .category-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Името е главното - по-едро и по-тъмно от всичко останало в картата.
       Дългите имена („Пилешки късчета с тирияки сос и гарнитура ориз") иначе
       разтягат една карта двойно по-висока от съседната. */
    .checkbox-item-title {
        font-size: 0.88rem;
        font-weight: 700;
        color: #1e293b;
        line-height: 1.25;
        margin-bottom: 5px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .price-info {
        flex-wrap: wrap;
        gap: 5px;
        margin: 5px 0;
        font-size: 0.72rem;
    }

    /* Двата бутона са само икони и стоят на един ред. */
    .item-actions-bottom {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 5px;
        margin-top: 6px;
        padding-top: 7px;
    }

    .item-actions-bottom .action-btn {
        flex: none;
        width: auto;
        min-width: 0;
        max-width: none;
        min-height: 28px;
        padding: 5px 4px;
        font-size: 0.8rem;
        gap: 0;
    }

    .art-btn-label { display: none; }

    .recipe-icon-btn {
        top: 5px;
        right: 5px;
        font-size: 0.95rem;
    }
}

/* Най-тесните телефони (≤360px). */
@media (max-width: 360px) {
    .checkbox-group { gap: 6px; }
    .checkbox-item { padding: 8px; }
    .checkbox-item-title { font-size: 0.78rem; }
    .price-info { font-size: 0.68rem; }

    /* Старото правило сваляше шрифта до 0.55rem - иконите ставаха
       нечетими. Без етикети мястото стига за нормален размер. */
    .item-actions-bottom .action-btn {
        font-size: 0.75rem;
        padding: 5px 2px;
    }
}

/* --- Еднакъв вид с таб „Шаблони на меню" ------------------------------
   Там редактирането е топло оранжево с `fa-edit`, а триенето - пастелно
   червено с `fa-trash`. Тук бяха емоджита върху сив бутон - два таба със
   същото действие изглеждаха различно. */
.item-actions-bottom .edit-btn {
    background: linear-gradient(135deg, #fff7ed, #fed7aa);
    color: #c2410c;
    border: 1px solid rgba(194, 65, 12, 0.2);
    box-shadow: 0 2px 8px rgba(251, 146, 60, 0.15);
}

.item-actions-bottom .edit-btn:hover {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    color: #9a3412;
    border-color: rgba(194, 65, 12, 0.3);
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.25);
}

.item-actions-bottom .delete-btn {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1);
}

.item-actions-bottom .delete-btn:hover {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    color: #7f1d1d;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.item-actions-bottom .action-btn i {
    font-size: 0.85em;
    flex-shrink: 0;
}

/* ==========================================================================
   ПЛОСЪК ИЗГЛЕД - без бяло върху бяло върху бяло

   Табът имаше четири вложени светли кутии: `.articles-container`
   (бяло 85% + blur + сянка) обгражда `.articles-header` (сива с рамка),
   в нея седят `.header-main` и `.search-section` (бели), а отдолу
   `.articles-list` (бяла с рамка) обгражда белите карти.

   Остават само трите елемента, които носят съдържание - хедърът, търсачката
   и картите, точно както е в таб „Шаблони на меню".
   ========================================================================== */
.articles-container {
    background: none;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.articles-container::before { display: none; }

.articles-header {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.articles-list {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}


/* ==========================================================================
   БЕЛЕЖНИК ЗА РЕЦЕПТА - телефон (2026-09-11)

   Преди: двете полета се редяха едно под друго, всяко с `min-height: 200px`.
   На 812px екран модалът заемаше 749px, от които само ~400px бяха за писане,
   разделени на две кутийки по седем реда - човек скролва вътре в малко поле,
   докато наоколо има празно място. На по-нисък телефон (667px) футърът с
   „Запази" изобщо излизаше извън екрана.

   Сега на телефон двете полета са ТАБОВЕ и активното получава почти цялата
   височина. Табовете се крият на широк екран - там двете колони си стоят
   една до друга и превключване не трябва.
   ========================================================================== */

.recipe-tabs { display: none; }

@media (max-width: 600px) {

    /* Модалът заема екрана като лист отдолу - без празни полета встрани,
       които само смаляват мястото за писане. */
    .recipe-modal-content {
        width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 14px;
    }

    .recipe-modal-header { padding: 12px 14px 10px; }
    .recipe-modal-title-text { font-size: 1rem; }
    .recipe-modal-icon { font-size: 1.1rem; }

    /* Името е важно, но три реда по 1.2rem изяждат четвърт екран. */
    .recipe-name-bar { padding: 8px 14px; }
    .recipe-name-bar-label { font-size: 0.6rem; margin-bottom: 2px; }
    .recipe-name-bar-value {
        font-size: 0.95rem;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* --- Табовете --- */
    .recipe-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 10px 14px 0;
        flex-shrink: 0;
    }

    .recipe-tab {
        padding: 9px 6px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 9px;
        font-family: inherit;
        font-size: 0.82rem;
        font-weight: 600;
        color: #64748b;
        cursor: pointer;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .recipe-tab.active {
        background: linear-gradient(135deg, #fdf6ee, #fbe8d2);
        border-color: #d4a574;
        color: #92642a;
    }

    /* --- Полетата --- */
    .recipe-two-col {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .recipe-two-col[data-active="ingredients"] .recipe-col[data-recipe-pane="instructions"],
    .recipe-two-col[data-active="instructions"] .recipe-col[data-recipe-pane="ingredients"] {
        display: none;
    }

    .recipe-col {
        padding: 10px 14px 12px;
        border-right: none !important;
        border-bottom: none !important;
    }

    /* Табът вече казва кое поле е отворено - заглавието е повторение. */
    .recipe-col-header { display: none; }

    /* Активното поле взима това, което остава от екрана. */
    /* `flex: 1` от базовото правило разтяга полето до края на колоната.
       `height: 100%` би добавило цялата височина ПЛЮС брояча отдолу и
       колоната щеше да прелее. */
    .recipe-textarea {
        min-height: 0;
        height: auto;
        font-size: 0.92rem;
        line-height: 1.55;
        padding: 10px 12px;
        resize: none;
    }

    /* --- Футър: един ред, залепен долу --- */
    .recipe-modal-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    }

    .recipe-footer-right {
        gap: 6px;
        flex: 1;
        justify-content: flex-end;
    }

    /* `flex-shrink: 0` - без него flex свива бутоните под широчината на
       текста и етикетите се налагат един върху друг, вместо да се види,
       че мястото не стига. */
    .recipe-modal-footer .btn {
        padding: 0.6rem 0.7rem;
        font-size: 0.8rem;
        min-width: 0;
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Много тесни телефони - бутоните остават само с икони, за да се съберат
   трите на един ред. Прагът е 340px, а не 400: на 375px трите етикета се
   побират спокойно и голите икони само гадаеш кое какво прави. */
@media (max-width: 340px) {
    .recipe-modal-footer .recipe-btn-label { display: none; }
    .recipe-modal-footer .btn { padding: 0.6rem 0.85rem; font-size: 0.95rem; }

    /* „Запази" е основното действие - на него оставяме думата. */
    #recipeSaveBtn .recipe-btn-label { display: inline; font-size: 0.8rem; }
}

/* Брояч на символите под полетата на бележника.
   Лимитът съществува, за да се събере рецептата на един лист - затова
   броячът е видим, а не се разбира чрез внезапно спряло писане. */
.recipe-counter {
    margin-top: 5px;
    text-align: right;
    font-size: 0.72rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.recipe-counter.near-limit {
    color: #b45309;
    font-weight: 600;
}

/* ==========================================================================
   ТАБ „АРТИКУЛИ" - ИЗЧИСТВАНЕ НА ХОВЪРА И ЦВЕТОВЕТЕ (2026-09-11)

   Три неща от обратната връзка:

   1. Картата имаше сянка, която при hover се сменяше с ДРУГА сянка плюс
      `translateY(-2px) scale(1.005)`. Отстрани изглеждаше като че сянката
      изчезва, защото картата се мести изпод нея.
   2. При hover на „Редактирай"/„Изтрий" се появяваше тъмна ивица в горния им
      край: бутонът се повдига с 2px, а под него остава сянката от предишното
      му място плюс светлинният `::before`, който в този момент минава през
      цялата карта. Ефект без смисъл - махнат.
   3. Грамажът беше оранжев, а цената синя - два ярки цвята, които не са в
      палитрата на продукта и се състезават с името на артикула.
   ========================================================================== */

/* --- Картата: една сянка, без скачане ---------------------------------- */
.checkbox-item {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.checkbox-item:hover {
    transform: none;
    border-color: #d4a574;
    box-shadow: 0 2px 10px rgba(212, 165, 116, 0.16);
}

/* Светлинният отблясък през картата е чиста декорация, но точно той
   създаваше тъмната ивица над бутоните, докато минава. */
.checkbox-item::before,
.checkbox-item:hover::before {
    display: none;
}

.checkbox-item.selected {
    transform: none;
    box-shadow: 0 2px 10px rgba(212, 165, 116, 0.2);
}

/* --- Бутоните: без повдигане --------------------------------------------- */
.item-actions-bottom .action-btn {
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.item-actions-bottom .action-btn:hover {
    transform: none;
}

.item-actions-bottom .edit-btn:hover,
.item-actions-bottom .delete-btn:hover {
    box-shadow: none;
}

/* --- Грамаж и цена: в палитрата на продукта ------------------------------ */
/* Грамажът е контекст - тих. Цената е стойността, която окото търси - тъмна
   и по-плътна. Оранжево и синьо тук нямаха основание. */
.price-info .item-weight {
    color: #94a3b8;
    font-weight: 500;
}

.price-info .price-eur,
.price-info .price-bgn {
    color: #1e293b;
    font-weight: 700;
}

/* --- Белият контейнер около картите се връща на десктоп ------------------ */
/* На телефон остава плосък - там всеки допълнителен слой яде широчина. */
@media (min-width: 600px) {
    .articles-list {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
        padding: 18px;
    }
}

/* --- Комбо категории ------------------------------------------------------ */
/* Бележката за синтаксиса се показва само когато избраната категория е комбо
   (`window.articlesManager.toggleComboHint()`), затова стои с `hidden`. */
.combo-hint {
    grid-column: 1 / -1;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid #f97316;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #7c2d12;
}

/* `.form-group { display: flex }` е авторско правило и бие браузърния
   `[hidden] { display: none }` независимо от реда - бележката излизаше
   за всеки клиент, във всяка категория, защото атрибутът hidden не правеше
   нищо видимо. По-специфичен селектор го връща в ред. */
.combo-hint[hidden] {
    display: none;
}

.combo-hint em {
    color: #9a3412;
    font-style: normal;
    font-weight: 600;
}

.combo-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}

.combo-toggle-label input {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.combo-toggle-help {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.category-combo-badge {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f97316;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

/* --- Алергени (флаг `allergens`, docs/ALLERGENS_PLAN.md) ------------------ */
.allergen-field {
    grid-column: 1 / -1;
}

.allergen-chips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 6px;
}

.allergen-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    user-select: none;
}

.allergen-chip input {
    width: auto;
    min-height: 0;
    margin: 0;
}

.allergen-chip b {
    display: inline-block;
    min-width: 18px;
    color: #64748b;
}

.allergen-chip:has(input:checked) {
    background: #fff7ed;
    border-color: #f97316;
    color: #7c2d12;
}

.item-allergens {
    margin-top: 4px;
    font-size: 12px;
    color: #94a3b8;
}
.allergen-field-note { display: block; margin-top: 6px; font-size: 12px; color: #9a3412; }

/* ==========================================================================
   "Категории вляво" (30.09.2026) - всичко е под #articles .art2
   Тялото е бялата карта от tab-card.css, затова старите рамки на контейнера,
   хедъра и списъка се нулират. Старите правила са над 3000 реда с по пет
   пренаписвания - затова новите са с висока специфичност, а не редакция.
   ========================================================================== */

#articles .articles-container.art2 {
    display: block; background: none; border: 0; box-shadow: none; padding: 0; margin: 0; border-radius: 0; max-width: none;
}
#articles .articles-container.art2::before { display: none; }

#articles .art2-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
#articles .art2-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #8a7a6b; }
#articles .art2-head h2 { font-size: 1.75rem; line-height: 1.2; color: #3f3328; letter-spacing: -.4px; margin: 2px 0 4px; }
#articles .art2-sub { margin: 0; color: #8a7a6b; font-size: .88rem; }
#articles .art2-sub .items-count { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; font-weight: 600; }
#articles .art2-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

#articles .art2-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }

/* лентата с категории */
#articles .art2-rail {
    position: sticky; top: 16px; display: grid; gap: 2px; align-content: start; padding: 8px;
    border: 1px solid #efe4d8; border-radius: 18px; background: #fbf4ec;
    max-height: calc(100vh - 32px); overflow-y: auto;
}
#articles .art2-cat {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 0;
    padding: 10px 12px; border: 0; border-radius: 11px; background: none;
    font: inherit; font-size: .92rem; font-weight: 600; color: #5a4a3a; text-align: left; cursor: pointer;
    transition: background .12s;
}
#articles .art2-cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#articles .art2-cat em { font-style: normal; font-size: .76rem; font-weight: 700; color: #a0907f; flex: none; }
#articles .art2-cat:hover:not(.on) { background: rgba(255, 255, 255, .7); }
#articles .art2-cat.on { background: #fff; color: #3f3328; box-shadow: 0 2px 10px rgba(160, 110, 70, .12); }
#articles .art2-cat.on em { color: #a8743f; }
#articles .art2-cat-add { color: #a8743f; margin-top: 4px; }

/* търсене */
#articles .art2-tools { margin-bottom: 14px; }
#articles .art2-tools .search-input {
    width: 100%; padding: 12px 16px; border: 1px solid #efe4d8; border-radius: 12px; background: #fff;
    font: inherit; font-size: .95rem; color: #3f3328; box-shadow: none;
}
#articles .art2-tools .search-input:focus { outline: none; border-color: #d4a574; box-shadow: 0 0 0 3px rgba(212, 165, 116, .2); }
#articles #categoryFilter { display: none !important; }

/* списъкът и картите */
#articles .art2 .articles-list { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; }
#articles .art2 .checkbox-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
#articles .art2 .checkbox-item {
    flex: none; width: auto; max-width: none; min-height: 0; padding: 14px 16px;
    background: #fff; border: 1px solid #efe4d8; border-radius: 16px; box-shadow: none; transform: none;
}
#articles .art2 .checkbox-item:hover { border-color: #d4a574; box-shadow: 0 6px 18px rgba(160, 110, 70, .12); transform: none; }
#articles .art2 .checkbox-item::before { display: none; }
#articles .art2 .checkbox-item-content { display: grid; gap: 8px; padding: 0; min-height: 0; }
#articles .art2 .category-badge {
    justify-self: start; display: inline-flex; align-items: center; gap: 5px; max-width: calc(100% - 30px);
    background: #fbf1e6; border: 0; border-radius: 7px; padding: 3px 9px; box-shadow: none;
    font-size: .72rem; font-weight: 700; color: #9a6b3d;
}
#articles .art2 .checkbox-item-title { font-size: .98rem; font-weight: 700; color: #3f3328; line-height: 1.3; }
#articles .art2 .price-info { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; }
#articles .art2 .item-weight { color: #9a8a79; font-size: .82rem; }
#articles .art2 .item-actions-bottom { display: flex; gap: 8px; margin-top: 4px; }
#articles .art2 .item-actions-bottom .action-btn {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 0;
    padding: 8px 10px; border-radius: 10px; border: 1px solid #efe4d8; background: #fff; box-shadow: none;
    color: #3f3328; font-size: .82rem; font-weight: 700;
}
#articles .art2 .item-actions-bottom .action-btn:hover { background: #fbf4ec; border-color: #d4a574; transform: none; }
#articles .art2 .item-actions-bottom .delete-btn { flex: 0 0 auto; color: #b3261e; }
#articles .art2 .item-actions-bottom .delete-btn .art-btn-label { display: none; }
#articles .art2 .item-actions-bottom .delete-btn:hover { background: #fdecea; border-color: #f0bdb8; }
#articles .art2 .recipe-icon-btn { top: 10px; right: 10px; }

#articles .art2 .empty-state { padding: 48px 20px; border: 1.5px dashed #dbc8b2; border-radius: 18px; background: #fbf4ec; }

@media (max-width: 860px) {
    #articles .art2-layout { grid-template-columns: 1fr; gap: 14px; }
    /* на малък екран лентата става ред с чипове, който се плъзга */
    #articles .art2-rail {
        position: static; display: flex; gap: 6px; max-height: none; overflow-x: auto; overflow-y: hidden;
        padding: 6px; scrollbar-width: none;
    }
    #articles .art2-rail::-webkit-scrollbar { display: none; }
    #articles .art2-cat { width: auto; flex: none; padding: 8px 12px; white-space: nowrap; }
    #articles .art2 .checkbox-group { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    #articles .art2 .checkbox-item { padding: 12px; }
    #articles .art2 .item-actions-bottom .action-btn .art-btn-label { display: none; }
}
@media (max-width: 420px) {
    #articles .art2 .checkbox-group { grid-template-columns: 1fr; }
    #articles .art2-head h2 { font-size: 1.45rem; }
}

/* вътре в етикета на категорията имената и емоджитата са със собствени размера
   от старите правила (20px / 16px) - свеждаме ги до размера на етикета */
#articles .art2 .category-badge .category-emoji { font-size: .85rem; line-height: 1; }
#articles .art2 .category-badge .category-name { font-size: .72rem; font-weight: 700; color: inherit; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#articles .art2-actions .btn-outline {
    background: #fff; border: 1px solid #efe4d8; color: #3f3328; box-shadow: none; padding: 10px 18px; min-height: 0; font-weight: 700; border-radius: 10px;
}
#articles .art2-actions .btn-outline:hover { background: #fbf4ec; border-color: #d4a574; }
#articles .art2-actions .btn-primary { padding: 10px 18px; min-height: 0; border-radius: 10px; }

/* На телефон старите правила нареждат "Редактирай" и "Изтрий" един под друг. */
#articles .art2 .item-actions-bottom { flex-direction: row; flex-wrap: nowrap; }

/* ==========================================================================
   Телефони и таблети с допир (30.09.2026)
   Целта е едно хващане с палец: зони за допир от поне 44px, шрифт 16px в
   полето за търсене (иначе iOS приближава страницата), две компактни карти на
   ред като в стария оформление, а категориите остават залепени най-горе,
   докато се върти дългият списък.
   ========================================================================== */

#articles .art2-sm-hide { }

@media (pointer: coarse) {
    #articles .art2-cat { min-height: 44px; }
    #articles .art2-tools .search-input { min-height: 46px; font-size: 16px; }
    #articles .art2 .item-actions-bottom .action-btn { min-height: 44px; }
    #articles .art2-actions .btn { min-height: 44px; }
    #articles .art2 .pagination-btn { min-width: 42px; min-height: 42px; }
}

@media (max-width: 860px) {
    #articles .art2-head { margin-bottom: 14px; align-items: center; flex-wrap: nowrap; gap: 10px; }
    #articles .art2-title { min-width: 0; }
    #articles .art2-head h2 { font-size: 1.35rem; margin: 0; }
    #articles .art2-eyebrow { display: none; }
    #articles .art2-sub { font-size: .8rem; }
    #articles .art2-sm-hide { display: none; }
    #articles .art2-actions { flex: none; flex-wrap: nowrap; gap: 8px; }
    #articles .art2-actions .btn { padding: 0 14px; min-height: 44px; }
    #articles .art2-actions .btn-outline { padding: 0; width: 44px; justify-content: center; }

    /* категориите: залепен ред с чипове, който се плъзга; в десния край има
       избледняване, за да личи, че има още */
    #articles .art2-rail {
        position: sticky; top: 0; z-index: 6; margin: 0 -14px 12px; padding: 8px 14px; gap: 8px;
        border-radius: 0; border: 0; border-bottom: 1px solid #efe4d8; background: rgba(255, 255, 255, .96);
        -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
        mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    }
    #articles .art2-cat {
        flex: none; min-height: 42px; padding: 0 15px; border: 1px solid #efe4d8; border-radius: 999px; background: #fbf4ec;
    }
    #articles .art2-cat.on { background: #3f3328; border-color: #3f3328; color: #fff; box-shadow: none; }
    #articles .art2-cat.on em { color: #e0b98a; }
    #articles .art2-cat-add { background: none; border-style: dashed; }

    #articles .art2-tools { margin-bottom: 12px; }
    #articles .art2-tools .search-input { min-height: 46px; font-size: 16px; border-radius: 14px; }

    /* карти: по две на ред, компактни */
    #articles .art2 .checkbox-group { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    #articles .art2 .checkbox-item { padding: 12px 12px 10px; border-radius: 14px; }
    #articles .art2 .checkbox-item-content { gap: 6px; }
    #articles .art2 .category-badge { max-width: calc(100% - 38px); padding: 2px 8px; }
    #articles .art2 .category-badge .category-emoji { font-size: .8rem; }
    #articles .art2 .category-badge .category-name { font-size: .68rem; }
    #articles .art2 .checkbox-item-title {
        font-size: .92rem; line-height: 1.25; min-height: 2.5em;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    #articles .art2 .price-info { align-items: baseline; }
    #articles .art2 .price-info .item-weight { font-size: .74rem; }
    #articles .art2 .price-info > :last-child { font-size: .95rem; font-weight: 800; color: #3f3328; }
    #articles .art2 .recipe-icon-btn { top: 4px; right: 4px; width: 36px; height: 36px; min-height: 0; display: grid; place-items: center; font-size: 1rem; }

    /* бутоните: две големи зони за допир, само иконите */
    #articles .art2 .item-actions-bottom { flex-direction: row; gap: 8px; margin-top: 2px; }
    #articles .art2 .item-actions-bottom .action-btn { flex: 1; min-height: 44px; padding: 0; border-radius: 12px; }
    #articles .art2 .item-actions-bottom .action-btn .art-btn-label { display: none; }
    #articles .art2 .item-actions-bottom .delete-btn { flex: 1; }
}

@media (max-width: 340px) {
    #articles .art2 .checkbox-group { grid-template-columns: 1fr; }
}

/* Етикетът на категорията в картата: на телефон само текст (емоджито е в
   чипа на лентата горе), иначе "Основни ястия" се реже на "Основн...". */
@media (max-width: 860px) {
    #articles .art2 .category-badge .category-emoji { display: none; }
    #articles .art2 .category-badge { max-width: calc(100% - 36px); padding: 2px 9px; }
}

/* Колоната на съдържанието в картата се свиваше до най-широкия си елемент - при кратко
   име бутоните излизаха тесни. Винаги на цялата ширина. */
#articles .art2 .checkbox-item-content { grid-template-columns: minmax(0, 1fr); width: 100%; }
@media (max-width: 860px) {
    #articles .art2 .recipe-icon-btn { top: 6px; right: 6px; width: 32px; height: 32px; }
    #articles .art2 .category-badge { max-width: calc(100% - 34px); padding: 2px 8px; }
}

@media (max-width: 860px) {
    #articles .art2 .recipe-icon-btn { top: 4px; right: 4px; width: 30px; height: 30px; }
    #articles .art2 .category-badge { max-width: calc(100% - 32px); padding: 2px 7px; }
}

#articles .art2 .action-btn::after, #articles .art2 .action-btn::before { display: none; }

/* най-тесни екрани: основното действие остава само "+", за да има място за заглавието */
@media (max-width: 360px) {
    #articles .art2-head h2 { font-size: 1.2rem; }
    #articles .art2-sub { white-space: nowrap; }
    #articles .art2-add-txt { display: none; }
    #articles .art2-actions .btn-primary { width: 44px; padding: 0; justify-content: center; }
}

/* таблет (600-860px): повече колони, не две ширини по 330px */
@media (min-width: 600px) and (max-width: 860px) {
    #articles .art2 .checkbox-group { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* ==========================================================================
   05.10.2026 - колоната с категории като тъмната колона на дигиталното меню
   (tabs/digital-menu.css .dm-side / .dm-snav-item) и тъмен главен бутон
   „Добави артикул" като „Запази шаблон". Без хоризонтален скрол: на десктоп
   колоната е вертикална и дългите имена се режат с многоточие; на телефон е
   ред с чипове - 2 реда, плъзгане само ако не стигат (utils.fitChipRows).
   ========================================================================== */
#articles .art2-actions .btn-primary,
#articles .art2 .empty-state .btn-primary {
    border: 1px solid #3a2f26; background: #3a2f26; color: #fff; box-shadow: none; font-weight: 700;
}
#articles .art2-actions .btn-primary i,
#articles .art2 .empty-state .btn-primary i { color: #f1d3a6; }
#articles .art2-actions .btn-primary:hover,
#articles .art2 .empty-state .btn-primary:hover { background: #2b231d; border-color: #2b231d; transform: none; box-shadow: none; }
#articles .art2-actions .btn-primary::before,
#articles .art2 .empty-state .btn-primary::before { display: none; }

#articles .art2-rail {
    padding: 16px 10px 14px; border: 0; border-radius: 18px; color: #d8c8b6;
    background: linear-gradient(180deg, #3a2f26, #2b231d);
    box-shadow: 0 16px 34px -18px rgba(60, 40, 25, .5);
    overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent;
}
#articles .art2-rail-eyebrow {
    display: block; padding: 0 10px 10px; margin-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, .1);
    font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #b9a48e;
}
#articles .art2-cat {
    min-width: 0; padding: 9px 12px; border-radius: 12px; background: none; color: #d8c8b6;
    font-size: .92rem; font-weight: 600; transition: background .15s, color .15s;
}
#articles .art2-cat-name { flex: 1; min-width: 0; }
#articles .art2-cat em { color: #a8927b; }
#articles .art2-cat:hover:not(.on) { background: rgba(255, 255, 255, .07); color: #fff; }
#articles .art2-cat.on {
    background: linear-gradient(135deg, #d4a574, #c49464); color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
#articles .art2-cat.on em { color: rgba(255, 255, 255, .9); }
#articles .art2-cat:focus-visible { outline: 3px solid #e0b98a; outline-offset: 2px; }
/* „Нова категория" - като прозрачните плочки за сваляне в генератора
   (menu-generator-v2.css .action-buttons .btn): прозрачна, с бял текст */
#articles .art2-cat-add {
    justify-content: center; gap: 8px; margin-top: 12px; padding: 11px 12px;
    border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; background: rgba(255, 255, 255, .1); color: #fff;
    font-weight: 700; box-shadow: none;
}
#articles .art2-cat-add i { font-size: .8rem; color: #f1d3a6; }
#articles .art2-cat-add:hover:not(.on) { background: rgba(255, 255, 255, .18); color: #fff; }

@media (max-width: 860px) {
    #articles .art2-rail {
        display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; overflow-x: visible; overflow-y: visible;
        border-radius: 16px;
    }
    #articles .art2-rail.chip-rows-scroll { display: block; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
    #articles .art2-rail .chip-rows-inner { display: flex; flex-wrap: wrap; gap: 6px; }
    #articles .art2-rail-eyebrow { display: none; }
    #articles .art2-cat { width: auto; flex: none; padding: 8px 12px; white-space: nowrap; }
    #articles .art2-cat-add { margin-top: 0; padding: 8px 14px; box-shadow: none; }
}

/* ==========================================================================
   05.10.2026 - прозорците на „Артикули" в новия вид (вариант A,
   docs/mockups/articles-modals.html). JS: articles-modals.js слага клас `am`.
   Всичко е под .modal-overlay.am - другите прозорци в таблото не се пипат.
   ========================================================================== */
.modal-overlay.am { background: rgba(43, 35, 29, .45); backdrop-filter: blur(2px); }
.modal-overlay.am .modal-content {
    width: min(620px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 40px); padding: 0;
    border: 0; border-radius: 20px; background: #fff; color: #3f3328;
    box-shadow: 0 30px 80px rgba(43, 35, 29, .4); display: flex; flex-direction: column; overflow: hidden;
}
.modal-overlay.am .modal-content.large-modal,
.modal-overlay.am#importPreviewModal .modal-content { width: min(820px, calc(100vw - 32px)); }

/* ---- глава */
.modal-overlay.am .modal-header {
    display: flex; align-items: center; gap: 12px; margin: 0; padding: 18px 22px;
    border: 0; border-bottom: 1px solid #f1e8de; background: #fff;
}
.modal-overlay.am .am-ic {
    flex: none; width: 42px; height: 42px; border-radius: 12px; background: #f3e6d6; color: #a8743f;
    display: grid; place-items: center; font-size: 1rem;
}
.modal-overlay.am .am-ht { flex: 1; min-width: 0; }
/* !important - старите правила оцветяват заглавието по id на прозореца (златист градиент) */
.modal-overlay.am .am-ht h3 { margin: 0; font-size: 1.15rem; font-weight: 800; color: #2b231d !important; background: none !important; -webkit-text-fill-color: #2b231d !important; }
.modal-overlay.am .am-ht p { margin: 2px 0 0; font-size: .84rem; color: #8a7866; }
.modal-overlay.am .modal-close {
    flex: none; width: 36px; height: 36px; min-height: 0; padding: 0; border: 0; border-radius: 10px;
    background: #fbf4ec; color: #5a4a3a; font-size: .95rem; display: grid; place-items: center;
}
.modal-overlay.am .modal-close:hover { background: #f3e6d6; color: #2b231d; }

/* ---- тяло и лента с бутони */
.modal-overlay.am .modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px 0; }
.modal-overlay.am .form-actions,
.modal-overlay.am .modal-actions {
    position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
    margin: 18px -22px 0; padding: 14px 22px; border-top: 1px solid #f1e8de; background: #fff;
}
.modal-overlay.am .am-sp { flex: 1; }
.modal-overlay.am .btn {
    min-width: 0; min-height: 0; margin: 0; padding: 10px 16px; border: 1px solid #e6d4bf; border-radius: 12px;
    background: #fff; color: #3f3328; box-shadow: none; font-size: .92rem; font-weight: 700; transform: none;
    display: inline-flex; align-items: center; gap: 8px; width: auto;
}
.modal-overlay.am .btn::before { display: none; }
.modal-overlay.am .btn i { color: #a8743f; }
.modal-overlay.am .btn:hover { background: #fbf4ec; transform: none; box-shadow: none; }
.modal-overlay.am .btn-primary { border-color: #3a2f26; background: #3a2f26; color: #fff; }
.modal-overlay.am .btn-primary i { color: #f1d3a6; }
.modal-overlay.am .btn-primary:hover { background: #2b231d; color: #fff; }
.modal-overlay.am .btn-secondary { background: #fff; color: #3f3328; }
.modal-overlay.am .btn.am-gold { border-color: transparent; background: linear-gradient(135deg, #f1d3a6, #d4a574); color: #2b231d; }
.modal-overlay.am .btn.am-gold i { color: #2b231d; }
.modal-overlay.am .btn.am-gold:hover { background: linear-gradient(135deg, #f6dfbd, #dcb084); }
.modal-overlay.am .btn-sm { padding: 7px 12px; font-size: .84rem; }
.modal-overlay.am .btn:focus-visible, .modal-overlay.am .modal-close:focus-visible { outline: 3px solid #e0b98a; outline-offset: 2px; }

/* ---- полета */
.modal-overlay.am .form-grid { grid-template-columns: 1fr 1fr; gap: 16px; margin: 0; }
.modal-overlay.am .form-group { gap: 6px; margin: 0; }
.modal-overlay.am .form-group.am-full, .modal-overlay.am .am-full { grid-column: 1 / -1; }
.modal-overlay.am .form-group > label,
.modal-overlay.am .am-field-label {
    font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #8a7866;
}
.modal-overlay.am .form-group > label small { text-transform: none; letter-spacing: 0; font-weight: 600; color: #b3a08c; }
.modal-overlay.am .form-group input,
.modal-overlay.am .form-group select,
.modal-overlay.am .form-group textarea {
    padding: 11px 12px; border: 1px solid #efe4d8; border-radius: 12px; background: #fff; color: #2b231d; font-size: .95rem;
}
.modal-overlay.am .form-group input:focus,
.modal-overlay.am .form-group select:focus { border-color: #d4a574; box-shadow: 0 0 0 3px rgba(212, 165, 116, .25); outline: none; }
.modal-overlay.am .form-group input[readonly] { background: #fbf7f2 !important; color: #8a7866; }

/* категорията като чипове - падащото меню остава в DOM, но невидимо */
.modal-overlay.am .am-select-hidden {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0 0 0 0) !important; border: 0 !important; opacity: 0;
}
.modal-overlay.am .am-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-overlay.am .am-chip {
    min-height: 0; padding: 7px 12px; border: 1px solid #efe4d8; border-radius: 999px; background: #fff;
    color: #5a4a3a; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer;
}
.modal-overlay.am .am-chip:hover { background: #fbf4ec; }
.modal-overlay.am .am-chip.on { border-color: #3a2f26; background: #3a2f26; color: #fff; }
.modal-overlay.am .am-chip:focus-visible { outline: 3px solid #e0b98a; outline-offset: 2px; }

/* сгънато „по избор" (алергени, пример за файла); в формата за артикул алергените са последни,
   за да застанат грамажът и цената един до друг */
.modal-overlay.am .form-grid > details.am-more { order: 10; }
.modal-overlay.am details.am-more { border: 1px solid #efe4d8; border-radius: 12px; padding: 0; background: #fff; }
.modal-overlay.am details.am-more > summary { cursor: pointer; padding: 11px 14px; font-weight: 700; font-size: .9rem; color: #3f3328; list-style-position: inside; }
.modal-overlay.am details.am-more > summary span { font-weight: 500; color: #8a7866; }
.modal-overlay.am details.am-more[open] > summary { border-bottom: 1px solid #f1e8de; }
.modal-overlay.am details.am-more > :not(summary) { margin: 12px 14px 14px; }
.modal-overlay.am details.am-more .allergen-field > label { display: none; }
.modal-overlay.am .am-note { margin: 10px 0 0; font-size: .82rem; color: #8a7866; line-height: 1.45; }

/* ---- категории: редове */
.modal-overlay.am .am-cat-list { display: flex; flex-direction: column; gap: 6px; }
.modal-overlay.am .am-cat {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px;
    border: 1px solid #efe4d8; border-radius: 12px; background: #fff;
}
.modal-overlay.am .am-cat.is-dragging { opacity: .45; }
.modal-overlay.am .am-cat.is-drop { box-shadow: 0 -3px 0 #d4a574; }
.modal-overlay.am .am-grip { color: #c4b2a0; cursor: grab; }
.modal-overlay.am .am-cat-em { font-size: 1.1rem; width: 24px; text-align: center; }
.modal-overlay.am .am-cat-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2b231d; }
.modal-overlay.am .am-cat-count { font-size: .8rem; color: #8a7866; white-space: nowrap; }
.modal-overlay.am .am-icon-btn {
    flex: none; width: 34px; height: 34px; min-height: 0; padding: 0; border: 0; border-radius: 10px;
    background: none; color: #a8743f; cursor: pointer; display: grid; place-items: center;
}
.modal-overlay.am .am-icon-btn:hover:not(:disabled) { background: #fbf4ec; }
.modal-overlay.am .am-icon-btn.am-danger { color: #b3261e; }
.modal-overlay.am .am-icon-btn.am-danger:hover:not(:disabled) { background: #fdecea; }
.modal-overlay.am .am-icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.modal-overlay.am .am-cat-edit { flex-wrap: wrap; background: #fbf4ec; border-color: #e6d4bf; }
.modal-overlay.am .am-cat-edit input[type="text"] {
    min-height: 0; padding: 8px 10px; border: 1px solid #e6d4bf; border-radius: 9px; background: #fff; font: inherit; color: #2b231d;
}
/* ⚠️ Старото `#categoryForm input { width: 100% }` е с id и бие всичко с класове: без `#categoryForm` тук
   емоджи полето и отметката „Комбо“ се разтягаха на цял ред (10.10.2026). */
.modal-overlay.am #categoryForm input.am-cat-emoji { flex: none; width: 52px; text-align: center; font-size: 1.15rem; padding: 7px 4px; }
.modal-overlay.am #categoryForm input.am-cat-emoji::placeholder { opacity: .35; }
.modal-overlay.am #categoryForm input.am-cat-name { flex: 1 1 160px; width: auto; min-width: 0; }
/* „Допълнително“ (комбо) - сгънато по подразбиране; на цял ред под полетата */
.modal-overlay.am #categoryForm .am-cat-more { flex: 1 1 100%; margin-top: 2px; font-size: .85rem; color: #6d5a48; }
.modal-overlay.am #categoryForm .am-cat-more > summary { cursor: pointer; font-weight: 600; color: #8a7866; padding: 2px 0; }
.modal-overlay.am #categoryForm .am-cat-more .am-combo { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 2px; white-space: normal; line-height: 1.4; }
.modal-overlay.am #categoryForm .am-cat-more .am-combo input { margin-top: 3px; }
.modal-overlay.am #categoryForm .am-combo { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; min-height: 0; white-space: nowrap; }
.modal-overlay.am #categoryForm .am-combo input { flex: none; width: 16px; height: 16px; min-height: 0; margin: 0; }
.modal-overlay.am .am-cat-name { flex: 1 1 160px; min-width: 0; }
.modal-overlay.am .am-combo { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: #5a4a3a; cursor: pointer; }
.modal-overlay.am .am-combo input { width: 16px; height: 16px; margin: 0; accent-color: #3a2f26; }
.modal-overlay.am .am-cat-btns { display: inline-flex; gap: 6px; margin-left: auto; }

/* ---- износ: два избора + превключвател */
.modal-overlay.am .am-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.modal-overlay.am .am-choice {
    position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px;
    border: 1px solid #efe4d8; border-radius: 14px; background: #fff; cursor: pointer;
}
.modal-overlay.am .am-choice input { position: absolute; opacity: 0; pointer-events: none; }
.modal-overlay.am .am-choice-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #f3e6d6; color: #a8743f; display: grid; place-items: center; }
.modal-overlay.am .am-choice b { display: block; color: #2b231d; }
.modal-overlay.am .am-choice small { color: #8a7866; }
.modal-overlay.am .am-choice:has(input:checked) { border-color: #3a2f26; box-shadow: 0 0 0 1px #3a2f26; }
.modal-overlay.am .am-choice:has(input:checked) .am-choice-ic { background: #3a2f26; color: #f1d3a6; }
.modal-overlay.am .am-choice:has(input:focus-visible) { outline: 3px solid #e0b98a; outline-offset: 2px; }
.modal-overlay.am .am-field-label { display: block; margin-bottom: 8px; }
.modal-overlay.am .am-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 12px; background: #fbf4ec; }
.modal-overlay.am .am-seg label { position: relative; cursor: pointer; }
.modal-overlay.am .am-seg input { position: absolute; opacity: 0; pointer-events: none; }
.modal-overlay.am .am-seg span { display: block; padding: 8px 14px; border-radius: 9px; font-size: .88rem; font-weight: 700; color: #5a4a3a; }
.modal-overlay.am .am-seg input:checked + span { background: #fff; color: #2b231d; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.modal-overlay.am .am-seg input:focus-visible + span { outline: 3px solid #e0b98a; outline-offset: 1px; }
.modal-overlay.am .am-seg label.is-off { cursor: not-allowed; opacity: .45; }

/* ---- внос: стъпки, зоната за файл, прегледът */
.modal-overlay.am .am-steps { display: flex; gap: 6px; margin-bottom: 16px; }
.modal-overlay.am .am-step {
    flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 11px;
    background: #fbf4ec; font-size: .84rem; font-weight: 700; color: #8a7866;
}
.modal-overlay.am .am-step-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid #e2d2bf; font-size: .72rem; }
.modal-overlay.am .am-step.on { background: #3a2f26; color: #fff; }
.modal-overlay.am .am-step.on .am-step-n { background: #f1d3a6; border-color: #f1d3a6; color: #3a2f26; }
.modal-overlay.am .am-step.done { color: #2f7a35; }
.modal-overlay.am .am-step.done .am-step-n { background: #2f7a35; border-color: #2f7a35; color: #fff; }
.modal-overlay.am .format-tabs { gap: 4px; border: 0; margin-bottom: 12px; }
.modal-overlay.am .format-tab {
    min-height: 0; padding: 8px 14px; border: 1px solid #efe4d8; border-radius: 999px; background: #fff;
    color: #5a4a3a; font-weight: 700; font-size: .86rem; box-shadow: none;
}
.modal-overlay.am .format-tab.active { border-color: #3a2f26; background: #3a2f26; color: #fff; }
.modal-overlay.am .file-upload-area {
    margin: 0 0 14px; padding: 26px 18px; border: 2px dashed #e0c49e; border-radius: 16px; background: #fdfaf6; text-align: center;
}
.modal-overlay.am .file-upload-area.drag-over, .modal-overlay.am .file-upload-area:hover { border-color: #d4a574; background: #fbf4ec; }
.modal-overlay.am .upload-icon { font-size: 1.8rem; color: #d4a574; }
.modal-overlay.am .upload-text { color: #2b231d; font-weight: 700; }
.modal-overlay.am .upload-hint { color: #8a7866; font-size: .84rem; }
.modal-overlay.am .file-input-label {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 16px; border-radius: 12px;
    background: #3a2f26; color: #fff; font-weight: 700; box-shadow: none; cursor: pointer;
}
.modal-overlay.am .format-info { padding: 0; border: 0; background: none; }
.modal-overlay.am .format-example { border-radius: 12px; font-size: .78rem; }
.modal-overlay.am .preview-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.modal-overlay.am .preview-stats .stat-item { padding: 6px 12px; border-radius: 999px; background: #fbf4ec; border: 1px solid #efe4d8; font-size: .84rem; }
.modal-overlay.am h4 { margin: 16px 0 8px; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #8a7866; }
.modal-overlay.am .radio-label { border: 1px solid #efe4d8; border-radius: 14px; background: #fff; }
.modal-overlay.am .radio-label:has(input:checked) { border-color: #3a2f26; box-shadow: 0 0 0 1px #3a2f26; }
.modal-overlay.am .preview-table table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.modal-overlay.am .preview-table th { padding: 8px 10px; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #8a7866; background: #fbf4ec; text-align: left; }
.modal-overlay.am .preview-table td { padding: 8px 10px; border-bottom: 1px solid #f1e8de; }

@media (max-width: 640px) {
    .modal-overlay.am .modal-content { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 18px; }
    .modal-overlay.am .form-grid, .modal-overlay.am .am-choices { grid-template-columns: 1fr; }
    .modal-overlay.am .modal-header { padding: 14px 16px; }
    .modal-overlay.am .modal-body { padding: 16px 16px 0; }
    .modal-overlay.am .form-actions, .modal-overlay.am .modal-actions { margin: 16px -16px 0; padding: 12px 16px; }
    .modal-overlay.am .form-actions .btn, .modal-overlay.am .modal-actions .btn { flex: 1 1 auto; justify-content: center; }
    .modal-overlay.am .am-steps .am-step { font-size: .78rem; padding: 7px 8px; }
    .modal-overlay.am .am-cat-count { display: none; }
}
@media (pointer: coarse) {
    .modal-overlay.am .am-chip, .modal-overlay.am .am-icon-btn, .modal-overlay.am .btn { min-height: 44px; }
    .modal-overlay.am .am-icon-btn { width: 44px; }
}
