/* ============================================================
   Loriental Bestellsystem Manager – v2.0
   ============================================================ */

.loriental-orders {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 16px;
    color: #1a1a1a;
}

/* ── Header ─────────────────────────────────────────────── */

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

/* ── Tabs ────────────────────────────────────────────────── */

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

.lo-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 999px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    background: #f0f0f0;
    transition: background 0.18s, color 0.18s;
    line-height: 1;
}

.lo-tab:hover {
    background: #e0e0e0;
    color: #111;
}

.lo-tab.active {
    background: #1a1a1a;
    color: #fff;
}

.lo-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0,0,0,0.08);
    color: inherit;
    min-width: 20px;
    text-align: center;
}

.lo-tab.active .lo-badge {
    background: rgba(255,255,255,0.2);
}

/* ── Controls ────────────────────────────────────────────── */

.lo-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.lo-btn-toggle {
    padding: 8px 18px;
    border-radius: 10px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    background: #f5f5f5;
    color: #444;
    transition: background 0.18s;
}

.lo-btn-toggle:hover { background: #e8e8e8; }
.lo-btn-toggle.is-done { background: #e8f5e9; color: #2e7d32; }

.lo-btn-refresh {
    padding: 8px 18px;
    border-radius: 10px;
    border: none;
    background: #e8f0fe;
    color: #1a56db;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s;
}

.lo-btn-refresh:hover { background: #d5e3fd; }

.lo-btn-auto {
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    background: #f0f0f0;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    min-width: 104px;
    transition: background 0.18s, color 0.18s;
}

.lo-btn-auto:hover { background: #e6e6e6; }

.lo-btn-auto.is-on {
    background: #e8f5e9;
    color: #2e7d32;
}

.lo-btn-auto.is-on:hover { background: #d8eeda; }

/* ── Datum-Filter ─────────────────────────────────────────── */

.lo-date-filter {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lo-date-input {
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    color: #444;
    background: #f5f5f5;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
}

.lo-date-input:hover,
.lo-date-input:focus {
    border-color: #bbb;
    background: #fff;
    outline: none;
}

.lo-btn-heute {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: #1a1a1a;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s;
    white-space: nowrap;
}

.lo-btn-heute:hover { background: #333; }

/* ── Grid ────────────────────────────────────────────────── */

.lo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
    align-items: start;
}

.lo-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #aaa;
    font-size: 16px;
}

/* ── Karte ───────────────────────────────────────────────── */

.lo-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.05);
    border-top: 4px solid #ddd;
    transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
    position: relative;
}

.lo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.09), 0 8px 24px rgba(0,0,0,0.08);
}

.lo-card.is-processed {
    opacity: 0.55;
}

/* Farbstreifen oben je Typ */
.lo-card.lo-type-pickup   { border-top-color: #f59e0b; }
.lo-card.lo-type-delivery { border-top-color: #3b82f6; }
.lo-card.lo-type-dine_in  { border-top-color: #10b981; }

/* ── Karten-Header ───────────────────────────────────────── */

.lo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 8px;
}

.lo-customer {
    font-size: 17px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
}

.lo-type-badge {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.lo-type-badge.lo-type-pickup   { background: #fef3c7; color: #92400e; }
.lo-type-badge.lo-type-delivery { background: #dbeafe; color: #1e40af; }
.lo-type-badge.lo-type-dine_in  { background: #d1fae5; color: #065f46; }

/* ── Zeit ────────────────────────────────────────────────── */

.lo-time {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 14px;
}

.lo-time-icon { font-size: 22px; }

.lo-time-text {
    font-size: 26px;
    font-weight: 800;
    color: #111;
    line-height: 1;
    letter-spacing: -0.01em;
}

.lo-btn-edit-time {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #bbb;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}

.lo-btn-edit-time:hover { color: #555; }

.lo-datetime-input {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 13px;
    font-family: inherit;
    color: #444;
}

.lo-btn-save-time,
.lo-btn-cancel-time {
    padding: 4px 10px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    cursor: pointer;
}

.lo-btn-save-time   { background: #10b981; color: #fff; }
.lo-btn-cancel-time { background: #e5e7eb; color: #374151; }

/* ── Kontakt (Adresse / Telefon) ─────────────────────────── */

.lo-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13.5px;
    color: #555;
    margin-bottom: 14px;
}

.lo-contact-row {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    line-height: 1.35;
}

.lo-contact-icon { font-size: 14px; flex-shrink: 0; }

.lo-contact-tel,
.lo-contact-addr {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.lo-contact-tel:hover,
.lo-contact-addr:hover { text-decoration: underline; }

/* ── Bezahlung (Gesamtbetrag / Methode) ──────────────────── */

.lo-payment {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.lo-total {
    font-size: 19px;
    font-weight: 800;
    color: #111;
    letter-spacing: -0.02em;
}

.lo-pay-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 4px 11px;
    white-space: nowrap;
}

/* ── Item-Liste ──────────────────────────────────────────── */

.lo-items {
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
    margin-bottom: 14px;
}

.lo-item-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lo-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.lo-item.lo-item-stage1 {
    background: #f5e6d3;
}

.lo-item.lo-item-stage2 {
    background: #d1fae5;
    position: relative;
}

.lo-item.lo-item-stage2 .lo-item-name::after {
    content: ' ✓';
    color: #065f46;
    font-weight: 700;
}

.lo-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #111;
}

.lo-item-opt {
    font-size: 13px;
    color: #777;
    padding-left: 10px;
}

.lo-item-opt::before {
    content: '↳ ';
    color: #bbb;
}

.lo-item-note {
    font-size: 13px;
    color: #c05621;
    background: #fff7ed;
    border-radius: 6px;
    padding: 3px 8px;
    margin-top: 2px;
}

/* ── Notiz ───────────────────────────────────────────────── */

.lo-note {
    font-size: 13px;
    color: #c05621;
    background: #fff7ed;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 14px;
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

/* ── Footer / Button ─────────────────────────────────────── */

.lo-card-footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

.lo-btn-process {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    background: #10b981;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, opacity 0.18s;
}

.lo-btn-process:hover { background: #059669; }

.lo-btn-reopen {
    background: #e5e7eb;
    color: #374151;
}

.lo-btn-reopen:hover { background: #d1d5db; }

.lo-btn-process:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 640px) {
    .lo-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .lo-tabs {
        width: 100%;
    }

    .lo-controls {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .lo-date-filter {
        width: 100%;
        justify-content: flex-end;
    }

    .lo-date-input {
        flex: 1;
    }

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

/* ── Stationsseiten: Gericht-Items ──────────────────────── */

.lo-station-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 2px 0;
}

.lo-station-item {
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 20px;
}

.lo-station-item.lo-item-stage1 {
    background: #f5e6d3;
}

.lo-station-item.lo-item-stage2 {
    background: #d1fae5;
}


/* Hintergrundfarben der Stationsspalten deaktivieren */
td.teigwaren-cell,
td.teigwaren-cell.teigwaren-pending,
td.teigwaren-cell.teigwaren-started,
td.teigwaren-cell.teigwaren-finished,
tr.orders-teigwaren-zellen td,
tr.orders-friteuse td,
tr.orders-bowls td,
tr.orders-reststation td {
    background-color: transparent !important;
}

/* Kartenhintergrund je nach Bearbeitungsstand */
td.teigwaren-cell.lo-cell-started {
    background-color: #fffde7 !important;
    transition: background-color 0.3s;
}

td.teigwaren-cell.lo-cell-done {
    background-color: #e8f5e9 !important;
    transition: background-color 0.3s;
}

/* ── Rote Umrandung (Viewport-Rahmen) bei neuer Bestellung ── */
body.lo-has-new::before {
    content: '';
    position: fixed;
    inset: 0;
    border-top: 48px solid #ef4444;
    border-right: 16px solid #ef4444;
    border-bottom: 16px solid #ef4444;
    border-left: 16px solid #ef4444;
    pointer-events: none;
    z-index: 99999;
}

@keyframes lo-border-flash {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ── Indikator pro Zelle: Neue Bestellung ────────────────── */
.lo-cell-indicator {
    display: none;
    margin-top: 12px;
    background: #ef4444;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    user-select: none;
    animation: lo-pulse 1.8s ease-in-out infinite;
}

.lo-cell-indicator.lo-indicator-visible {
    display: block;
}

@keyframes lo-pulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 4px 20px rgba(239,68,68,0.4); }
    50%       { transform: scale(1.06); box-shadow: 0 6px 28px rgba(239,68,68,0.6); }
}

