/* ================================================
   PFM - Bons de Préparation - Styles
   ================================================ */

:root {
    --primary: #1565c0;
    --primary-light: #1976d2;
    --primary-dark: #0d47a1;
    --accent: #ff6f00;
    --accent-light: #ffa000;
    --success: #2e7d32;
    --danger: #c62828;
    --warning: #f57f17;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #546e7a;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --transition: all 0.2s ease;
    --nav-height: 64px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding-top: var(--nav-height);
}

/* ===== NAVIGATION ===== */
#main-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-icon {
    font-size: 28px;
}

.nav-title {
    color: white;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.1);
    border: 2px solid transparent;
    border-radius: 50px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    font-family: inherit;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.nav-btn.active {
    background: white;
    color: var(--primary);
    border-color: white;
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ===== PAGES ===== */
.page {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.page-header .subtitle {
    color: var(--text-secondary);
    margin-top: 4px;
    font-size: 15px;
}

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-icon {
    font-size: 22px;
}

/* ===== FORM GRID ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

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

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

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: #fafafa;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}

.form-group input.error {
    border-color: var(--danger);
    background: #fff5f5;
}

/* ===== ORDER LAYOUT ===== */
.order-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

.order-right {
    position: relative;
}

.sticky {
    position: sticky;
    top: calc(var(--nav-height) + 24px);
}

/* ===== PLATEAUX GRID ===== */
.plateaux-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.plateau-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.plateau-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 4px;
    background: var(--plateau-color, var(--primary));
}

.plateau-card:hover {
    border-color: var(--plateau-color, var(--primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.plateau-card.selected {
    border-color: var(--plateau-color, var(--primary));
    background: linear-gradient(to bottom, rgba(var(--plateau-color-rgb, 21,101,192), 0.05), transparent);
}

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

.plateau-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.plateau-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--plateau-color, var(--primary));
    white-space: nowrap;
}

.plateau-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.plateau-ingredients {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.plateau-ingredients li {
    list-style: none;
    padding: 2px 0;
}

.plateau-ingredients li::before {
    content: "• ";
    color: var(--plateau-color, var(--primary));
    font-weight: bold;
}

.plateau-qty-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-family: inherit;
    color: var(--text);
}

.qty-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.qty-btn:active {
    transform: scale(0.9);
}

.qty-value {
    font-size: 20px;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

/* ===== CATEGORY TABS ===== */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cat-tab {
    padding: 8px 16px;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    color: var(--text-secondary);
}

.cat-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cat-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== ARTICLES GRID ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.article-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    background: white;
}

.article-item:hover {
    border-color: var(--primary-light);
}

.article-item.has-qty {
    border-color: var(--primary);
    background: #e3f2fd;
}

.article-info {
    flex: 1;
    min-width: 0;
}

.article-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-price {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.article-qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.article-qty-control .qty-btn {
    width: 30px;
    height: 30px;
    font-size: 16px;
}

.article-qty-control .qty-value {
    font-size: 16px;
    min-width: 24px;
}

/* ===== SUMMARY ===== */
.summary-card {
    max-height: calc(100vh - var(--nav-height) - 48px);
    overflow-y: auto;
}

.summary-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

#summary-content {
    margin-bottom: 12px;
}

.summary-section {
    margin-bottom: 12px;
}

.summary-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.summary-item-name {
    flex: 1;
    color: var(--text);
}

.summary-item-qty {
    font-weight: 600;
    color: var(--primary);
    margin: 0 12px;
    white-space: nowrap;
}

.summary-item-price {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.summary-total {
    border-top: 2px solid var(--text);
    padding-top: 12px;
    margin-top: 8px;
}

.total-line {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: 800;
}

#total-price {
    color: var(--primary);
}

/* ===== BUTTONS ===== */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 16px;
    font-family: inherit;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(21,101,192,0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 10px 18px;
    background: white;
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

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

.btn-danger {
    color: var(--danger) !important;
}

.btn-danger:hover {
    border-color: var(--danger) !important;
    background: #ffebee !important;
}

.btn-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--border);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text);
    font-family: inherit;
}

.btn-close:hover {
    background: var(--danger);
    color: white;
}

/* ===== KITCHEN PAGE ===== */
.kitchen-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 24px;
}

.kitchen-controls-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

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

.filter-date-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 12px !important;
    font-size: 12px !important;
}

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

/* ===== CUSTOM DATEPICKER ===== */
.custom-datepicker {
    position: relative;
    display: inline-block;
}

.datepicker-toggle {
    padding: 8px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    color: var(--text);
    min-width: 160px;
    justify-content: space-between;
}

.datepicker-toggle:hover {
    border-color: var(--primary);
}

.datepicker-caret {
    font-size: 10px;
    color: var(--text-secondary);
}

.datepicker-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 1000;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 12px;
    width: 280px;
}

.datepicker-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.datepicker-nav button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: var(--transition);
}

.datepicker-nav button:hover {
    background: var(--bg);
    color: var(--primary);
}

.datepicker-nav span {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.datepicker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.dp-day {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: none;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text);
    margin: 0 auto;
}

.dp-day:hover:not(.dp-empty) {
    background: var(--bg);
}

.dp-empty {
    cursor: default;
}

.dp-today {
    border: 2px solid var(--primary);
}

.dp-selected {
    background: var(--primary) !important;
    color: white !important;
    font-weight: 700;
}

.dp-has-orders {
    font-weight: 900;
    color: var(--primary);
    position: relative;
}

.dp-has-orders::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.dp-has-orders.dp-selected::after {
    background: white;
}

.dp-has-orders.dp-selected {
    color: white;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    color: var(--text-secondary);
}

.filter-btn:hover {
    border-color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.filter-count {
    font-size: 11px;
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.filter-btn.active .filter-count {
    background: rgba(255,255,255,0.2);
}

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

/* ===== PLATEAU ACCORDION ===== */
.plateau-accordion {
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.plateau-accordion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #e3f2fd;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.plateau-accordion-header:hover {
    background: #bbdefb;
}

.plateau-accordion-header.open {
    background: #bbdefb;
}

.plateau-accordion-arrow {
    font-size: 10px;
    color: var(--primary);
    transition: var(--transition);
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.plateau-accordion-body {
    background: #f5f9ff;
    padding: 4px 0;
    border-top: 1px solid #dce8f5;
}

.plateau-accordion-body .detail-ingredient {
    padding-top: 4px;
    padding-bottom: 4px;
}

/* ===== KITCHEN LAYOUT ===== */
.kitchen-layout {
    display: grid;
    grid-template-columns: 1fr 500px;
    gap: 24px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.kitchen-layout.no-detail {
    grid-template-columns: 1fr;
}

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

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text);
}

/* ===== ORDER CARD (Kitchen) ===== */
.order-card {
    background: white;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.order-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.15);
}

.order-card-status {
    height: 6px;
    width: 100%;
}

.order-card-body {
    padding: 16px;
}

.order-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.order-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.order-status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.order-client-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.order-card-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.order-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.order-preview {
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 10px;
    line-height: 1.6;
}

.order-preview-item {
    display: inline-block;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 2px 4px 2px 0;
}

/* ===== ORDER DETAIL PANEL ===== */
.order-detail-panel {
    background: white;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: calc(var(--nav-height) + 24px);
    max-height: calc(100vh - var(--nav-height) - 48px);
    overflow-y: auto;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
    border-radius: var(--radius) var(--radius) 0 0;
}

.detail-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.detail-content {
    padding: 24px;
}

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

.detail-info-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
}

.detail-info-item.full-width {
    grid-column: 1 / -1;
}

.detail-info-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.detail-info-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.detail-section {
    margin-top: 20px;
}

.detail-section h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.detail-ingredient {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    margin-bottom: 4px;
    font-size: 14px;
}

.detail-ingredient:nth-child(even) {
    background: #f8f9fa;
}

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

.detail-ingredient-qty {
    font-weight: 700;
    color: var(--primary);
    min-width: 60px;
    text-align: right;
}

.detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 2px solid var(--border);
}

.detail-action-btn {
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    background: white;
    font-family: inherit;
    text-align: center;
}

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

.detail-action-btn.btn-start {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1565c0;
}

.detail-action-btn.btn-ready {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.detail-action-btn.btn-deliver {
    background: #f3e5f5;
    border-color: #9c27b0;
    color: #6a1b9a;
}

.detail-action-btn.btn-print {
    background: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
}

.detail-action-btn.btn-delete {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
    grid-column: 1 / -1;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
}

.modal {
    background: white;
    border-radius: var(--radius);
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-sm {
    max-width: 480px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
    border-radius: var(--radius) var(--radius) 0 0;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.modal-footer .btn-primary {
    width: auto;
    margin-top: 0;
    padding: 10px 24px;
}

/* ===== INGREDIENTS SUMMARY ===== */
.ingredient-summary-category {
    margin-bottom: 20px;
}

.ingredient-summary-category h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 10px;
}

.ingredient-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    font-size: 14px;
}

.ingredient-summary-item:nth-child(even) {
    background: #f8f9fa;
}

.ingredient-summary-qty {
    font-weight: 800;
    color: var(--primary);
    font-size: 16px;
}

/* ===== CONFIRM MODAL ===== */
.confirm-order-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    margin-bottom: 12px;
}

.confirm-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

.confirm-info strong {
    color: var(--text);
}

/* ===== PRINT ===== */
.print-only {
    display: none;
}

@media print {
    @page {
        size: A4;
        margin: 10mm;
    }

    /* Hide everything */
    body > *:not(#print-area) {
        display: none !important;
    }

    /* Show only print area */
    #print-area {
        display: block !important;
        position: static;
        width: 100%;
        padding: 10px;
        margin: 0;
        overflow: visible;
    }

    .print-header {
        text-align: center;
        border-bottom: 2px solid #000;
        padding-bottom: 12px;
        margin-bottom: 16px;
    }

    .print-header h1 {
        font-size: 22px;
        margin-bottom: 4px;
    }

    .print-info {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 16px;
        font-size: 14px;
    }

    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 12px;
    }

    .print-table th,
    .print-table td {
        border: 1px solid #333;
        padding: 6px 10px;
        text-align: left;
        font-size: 13px;
    }

    .print-table th {
        background: #eee;
        font-weight: 700;
    }

    .print-total {
        text-align: right;
        font-size: 18px;
        font-weight: 700;
        margin-top: 12px;
        padding-top: 8px;
        border-top: 2px solid #000;
    }

    .print-footer {
        margin-top: 24px;
        text-align: center;
        font-size: 11px;
        color: #666;
    }
}

/* ===== TOAST / NOTIFICATION ===== */
.toast-container {
    position: fixed;
    top: calc(var(--nav-height) + 12px);
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: white;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

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

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .order-layout {
        grid-template-columns: 1fr;
    }

    .order-right {
        order: -1;
    }

    .sticky {
        position: relative;
        top: auto;
    }

    .kitchen-layout {
        grid-template-columns: 1fr;
    }

    .order-detail-panel {
        position: relative;
        top: auto;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .page {
        padding: 16px;
        padding-bottom: 90px; /* space for fixed validate button */
    }

    .nav-title {
        display: none;
    }

    .nav-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .plateaux-grid {
        grid-template-columns: 1fr;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

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

    .kitchen-controls {
        flex-direction: column;
        padding: 0 16px;
    }

    .kitchen-controls-top {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-date-group {
        flex-wrap: wrap;
    }

    .kitchen-recap-actions {
        flex-direction: column;
    }

    .kitchen-recap-actions .btn-secondary {
        width: 100%;
        text-align: center;
    }

    .kitchen-layout {
        padding: 0 16px;
    }

    .detail-actions {
        grid-template-columns: 1fr;
    }

    .detail-info-grid {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn-primary,
    .modal-footer .btn-secondary {
        width: 100%;
        text-align: center;
    }

    /* Fixed validate button at bottom of screen on mobile */
    #btn-validate {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 900;
        margin: 0;
        border-radius: 0;
        padding: 18px;
        font-size: 16px;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
    }
}

/* ===== ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.3s ease;
}

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ===== ADMIN MODULE ===== */

/* Login */
.admin-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.admin-login-card {
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.admin-login-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.admin-login-card h2 {
    margin-bottom: 4px;
}

.admin-login-card .subtitle {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.92rem;
}

.admin-login-card .form-group {
    text-align: left;
}

.admin-error {
    color: var(--danger);
    font-size: 0.88rem;
    margin-top: 12px;
    font-weight: 500;
}

.shake {
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 4px;
    background: white;
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    white-space: nowrap;
}

.admin-tab:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.admin-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 6px rgba(21, 101, 192, 0.3);
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Admin List Items */
.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-section-header h2 {
    margin: 0;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-main);
    border-radius: 10px;
    transition: all 0.2s;
    gap: 12px;
}

.admin-list-item:hover {
    background: #e8eaf6;
}

.admin-list-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.admin-plateau-item .admin-list-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.admin-plateau-item .admin-list-info > div:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-list-icon {
    font-size: 1.4rem;
}

.admin-list-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.admin-list-price {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.95rem;
}

.admin-list-meta {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.admin-list-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.admin-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 24px;
    font-style: italic;
}

/* Admin Table (articles) */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr 100px;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    gap: 8px;
}

.admin-table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr 100px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    font-size: 0.9rem;
    gap: 8px;
    transition: background 0.15s;
}

.admin-table-row:hover {
    background: var(--bg-main);
}

.admin-table-row:last-child {
    border-bottom: none;
}

.col-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* Small Buttons */
.btn-sm {
    width: 34px;
    height: 34px;
    border: none;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.btn-sm:hover {
    transform: scale(1.1);
}

.btn-sm.btn-delete:hover {
    background: #ffebee;
}

.btn-sm.btn-edit:hover {
    background: #e3f2fd;
}

/* Danger button */
.btn-danger {
    background: var(--danger) !important;
    color: white !important;
    border-color: var(--danger) !important;
}

.btn-danger:hover {
    background: #c62828 !important;
}

/* Admin Select */
.admin-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

/* Color Input */
.color-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-input-wrap input[type="color"] {
    width: 48px;
    height: 40px;
    padding: 2px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.color-hex {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Design Preview */
.design-preview {
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border);
}

.preview-nav {
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-icon {
    font-size: 1.5rem;
}

.preview-title {
    font-weight: 700;
    font-size: 1rem;
}

/* Plateau Items Editor */
.plateau-item-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.plateau-item-select {
    flex: 1;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
}

.plateau-item-qty-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.plateau-item-qty-wrap label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.plateau-item-qty {
    width: 70px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
}

/* Admin Stats */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-main);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

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

/* Toast Error */
.toast-error {
    background: var(--danger) !important;
}

/* Admin modal body scrollable */
#modal-admin-edit .modal {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#modal-admin-edit .modal-body {
    overflow-y: auto;
    flex: 1;
    max-height: 60vh;
}

/* Responsive Admin */
@media (max-width: 768px) {
    .admin-table-header,
    .admin-table-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .admin-table-header {
        display: none;
    }

    .admin-table-row {
        padding: 12px;
        background: var(--bg-main);
        border-radius: 10px;
        margin-bottom: 8px;
        border-bottom: none;
    }

    .admin-table-row .col-name {
        font-weight: 600;
        font-size: 1rem;
    }

    .admin-table-row .col-price::before { content: 'Prix: '; color: var(--text-secondary); }
    .admin-table-row .col-unit::before { content: 'Unité: '; color: var(--text-secondary); }
    .admin-table-row .col-cat::before { content: 'Cat: '; color: var(--text-secondary); }

    .col-actions {
        justify-content: flex-start;
        margin-top: 6px;
    }

    .admin-tabs {
        gap: 2px;
        padding: 4px;
    }

    .admin-tab {
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .plateau-item-row {
        flex-direction: column;
        align-items: stretch;
    }

    .plateau-item-select {
        min-width: unset;
    }
}
