/**
 * Écran de contrôle v3 - Styles
 */

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

:root {
    --bg: #0a0b0f;
    --bg-panel: #12141a;
    --bg-header: #1a1d26;
    --bg-row: #1e222b;
    --border: #2a2f3a;
    --text: #f5f5f7;
    --text-dim: #94a3b8;
    --text-muted: #64748b;
    
    --blue: #38bdf8;
    --orange: #fb923c;
    --red: #f87171;
    --green: #4ade80;
    --cyan: #22d3ee;
    --purple: #a78bfa;
}

html, body { height: 100%; overflow: hidden; }
body { font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 13px; }

.screen-container { height: 100%; display: flex; flex-direction: column; padding: 16px; gap: 12px; }

/* Header */
.screen-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; }
.header-left { display: flex; align-items: center; gap: 24px; }
.header-left h1 { font-size: 24px; font-weight: 700; }
.legend { display: flex; gap: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); }
.header-right { display: flex; align-items: center; gap: 20px; }
.timer { color: var(--text-muted); font-size: 12px; }
.clock { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Main grid */
.screen-main { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.screen-main > .panel { flex: 1; min-height: 0; }
.middle-row { flex: 1; display: flex; gap: 12px; min-height: 0; }
.middle-row > .panel { flex: 1; min-height: 0; }
.bottom-row { flex: 0.8; display: flex; gap: 12px; min-height: 100px; }
.bottom-row > .panel { flex: 1; }

/* Panels */
.panel { display: flex; flex-direction: column; background: var(--bg-panel); border-radius: 10px; border: 1px solid var(--border); overflow: hidden; }
.panel-header { padding: 10px 16px; background: var(--bg-header); border-bottom: 1px solid var(--border); }
.panel-header h2 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.count { font-weight: 400; color: var(--text-dim); }

.panel-incoming { border-top: 3px solid var(--blue); }
.panel-incoming h2 { color: var(--blue); }
.panel-internal { border-top: 3px solid var(--orange); }
.panel-internal h2 { color: var(--orange); }
.panel-blocked { border-top: 3px solid var(--red); }
.panel-blocked h2 { color: var(--red); }
.panel-bat { border-top: 3px solid #fbbf24; }
.panel-bat h2 { color: #fbbf24; }
.panel-shipping { border-top: 3px solid var(--green); }
.panel-shipping h2 { color: var(--green); }
.panel-ready { border-top: 3px solid var(--cyan); }
.panel-ready h2 { color: var(--cyan); }
.panel-pickup { border-top: 3px solid var(--purple); }
.panel-pickup h2 { color: var(--purple); }

/* Subheader */
.panel-subheader { display: grid; grid-template-columns: 80px 1fr 1fr auto; gap: 12px; padding: 6px 16px; background: rgba(0,0,0,0.2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }

/* Orders list */
.orders-list { flex: 1; overflow: hidden; }
.empty { padding: 20px; text-align: center; color: var(--text-muted); }

.order-row { border-bottom: 1px solid var(--border); }
.order-row:nth-child(odd) { background: rgba(255,255,255,0.01); }
.order-main { display: grid; grid-template-columns: 80px 1fr 1fr auto; gap: 12px; padding: 8px 16px; align-items: center; }
.col { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.col-date { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.col-ref { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.col-site { color: var(--text-dim); font-size: 12px; }
.col-status { text-align: right; }
.order-products { padding: 0 16px 8px; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 10px; font-weight: 600; text-transform: uppercase; }
.badge-blue { background: #1e3a5f; color: #7dd3fc; }
.badge-orange { background: #7c2d12; color: #fdba74; }
.badge-red { background: #7f1d1d; color: #fca5a5; }
.badge-yellow { background: #78350f; color: #fde68a; }
.badge-green { background: #14532d; color: #86efac; }
.badge-cyan { background: #164e63; color: #67e8f9; }
.badge-purple { background: #4c1d95; color: #c4b5fd; }
.badge-gray { background: #374151; color: #9ca3af; }

/* Compact panels (bottom) */
.panel-compact .panel-header { padding: 8px 12px; }
.panel-compact h2 { font-size: 13px; }
.orders-simple { flex: 1; overflow: hidden; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.order-simple { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-row); border-radius: 6px; border: 1px solid var(--border); }
.order-simple .ref { font-weight: 600; }
.order-simple .site { margin-left: auto; font-size: 11px; color: var(--text-muted); }
