﻿* {
    box-sizing: border-box;
}

html { zoom: .9375; }

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: #111827;
    background: #f5f7fa;
}

button,
input,
select,
textarea {
    font: inherit;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f7fa;
}

.header {
    background: #1f2937;
    color: white;
    padding: 18px 30px;
}

    .header h2 {
        margin: 0;
        font-size: 22px;
    }

.content {
    flex: 1;
    padding: 30px;
}

.footer {
    background: #e5e7eb;
    color: #6b7280;
    padding: 12px;
    text-align: center;
}

.dashboard {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

    .dashboard h1 {
        margin-top: 0;
        margin-bottom: 8px;
    }

.subtitle {
    margin-top: 0;
    margin-bottom: 30px;
    color: #6b7280;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.card {
    display: flex;
    flex-direction: column;
    min-height: 250px;
    padding: 25px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

    .card h3 {
        margin-top: 0;
    }

    .card p {
        flex: 1;
    }

    /* Buttons & Links */
    .button,
    .card button {
        display: inline-block;
        width: fit-content;
        margin-top: auto;
        padding: 10px 20px;
        border: 0;
        border-radius: 8px;
        color: white;
        background: #1f2937;
        cursor: pointer;
        text-decoration: none;
    }

        .button:hover,
        .card button:hover {
            background: #374151;
        }


/* Dispatcher styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px
}

    .page-header h1 {
        margin: 0 0 8px
    }

    .page-header p {
        margin: 0;
        color: #6b7280
    }

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid #fb923c;
    border-radius: 11px;
    background: #f97316;
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .06);
    transition: .18s ease;
}

.back-link:hover {
    border-color: #ea580c;
    background: #ea580c;
    text-decoration: none;
    transform: translateY(-1px);
}

.workspace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(420px,1fr));
    gap: 20px;
    margin-bottom: 25px
}

.workspace-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,.08)
}

.workspace-card-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px
}

    .workspace-card-header h2 {
        margin: 0
    }

    .workspace-card-header p {
        margin: 5px 0 0;
        color: #6b7280
    }

.workspace-step {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #1f2937;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold
}

.file-status {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600
}

.success {
    background: #dcfce7;
    color: #166534
}

.workspace-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px
}

.primary-button, .danger-button {
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    color: #fff;
    font-weight: 600
}

.primary-button {
    background: #2563eb
}

    .primary-button:hover {
        background: #1d4ed8
    }

    .primary-button:disabled {
        background: #9ca3af;
        cursor: not-allowed
    }

.danger-button {
    background: #dc2626
}

    .danger-button:hover {
        background: #b91c1c
    }

.workspace-summary {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 5px 15px rgba(0,0,0,.08)
}

    .workspace-summary h2 {
        margin-top: 0
    }

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb
}

    .summary-row:last-child {
        border-bottom: none
    }


/* ===========================================
   Header & Language Switcher
=========================================== */

.header-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.language-button {
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    padding: 8px 14px;
    color: white;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    font-weight: 600;
}

    .language-button:hover {
        background: rgba(255, 255, 255, 0.16);
    }

[dir="rtl"] {
    text-align: right;
}

    [dir="rtl"] .header-content,
    [dir="rtl"] .page-header,
    [dir="rtl"] .summary-row {
        direction: rtl;
    }

    [dir="rtl"] .workspace-card-header {
        flex-direction: row;
    }

    [dir="rtl"] .back-link {
        direction: rtl;
    }

@media (max-width: 700px) {
    .header-content,
    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .language-button {
        width: fit-content;
    }

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

/* ===========================================
   Orders Preview
=========================================== */

.error {
    background: #fee2e2;
    color: #991b1b;
}

.orders-preview {
    margin-top: 30px;
    padding: 25px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

    .preview-header h2 {
        margin: 0 0 6px;
    }

    .preview-header p {
        margin: 0;
        color: #6b7280;
    }

.table-container {
    width: 100%;
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
    background: white;
}

    .orders-table th,
    .orders-table td {
        padding: 12px;
        border-bottom: 1px solid #e5e7eb;
        text-align: start;
        vertical-align: top;
        white-space: nowrap;
    }

    .orders-table th {
        background: #f3f4f6;
        color: #111827;
        font-weight: 700;
    }

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

.product-name-cell {
    min-width: 320px;
    max-width: 480px;
    white-space: normal !important;
}

.preview-note {
    margin: 15px 0 0;
    color: #6b7280;
    font-size: 14px;
}

[dir="rtl"] .preview-header {
    direction: rtl;
}

@media (max-width: 700px) {
    .preview-header {
        flex-direction: column;
    }
}

/* ===========================================
   Dispatcher Analysis
=========================================== */

.analysis-section {
    margin-top: 30px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
    padding: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

    .metric-card span {
        color: #6b7280;
        font-weight: 600;
    }

    .metric-card strong {
        font-size: 30px;
        color: #111827;
    }

.metric-success {
    border-color: #86efac;
    background: #f0fdf4;
}

.metric-warning {
    border-color: #fdba74;
    background: #fff7ed;
}

.analysis-table-block {
    margin-top: 24px;
    padding: 25px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.analysis-table {
    min-width: 1250px;
}

.issues-table {
    min-width: 850px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.status-ready {
    background: #dcfce7;
    color: #166534;
}

.status-warning {
    background: #ffedd5;
    color: #9a3412;
}

[dir="rtl"] .metric-grid,
[dir="rtl"] .analysis-table-block {
    direction: rtl;
}

/* Picking workspace */
.picking-page { padding: 30px; direction: rtl; }
.picking-page-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:24px; }
.picking-page-header h1 { margin:0 0 8px; font-size:2rem; }
.picking-page-header p { margin:0; color:#64748b; }
.picking-back-button,.picking-secondary-button,.picking-primary-button,.picking-complete-button { border:0; border-radius:12px; padding:13px 20px; font-weight:800; cursor:pointer; }
.picking-back-button { background:#f97316; color:#fff; }
.picking-secondary-button { background:#e2e8f0; color:#0f172a; }
.picking-primary-button,.picking-complete-button { background:#2563eb; color:#fff; }
.picking-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.picking-summary-card { background:#fff; border:1px solid #dbe3ec; border-radius:16px; padding:18px; box-shadow:0 8px 24px rgba(15,23,42,.05); }
.picking-summary-card span { display:block; color:#64748b; margin-bottom:8px; }
.picking-summary-card strong { font-size:1.8rem; }
.picking-progress-card { background:#eff6ff; border-color:#93c5fd; }
.picking-progress-shell { height:16px; background:#e2e8f0; border-radius:999px; overflow:hidden; margin:18px 0 24px; }
.picking-progress-bar { height:100%; background:#22c55e; transition:width .25s ease; }
.picking-state-card,.picking-message { padding:18px; border-radius:14px; background:#fff; border:1px solid #dbe3ec; }
.picking-message { margin-bottom:16px; font-weight:800; text-align:center; }
.picking-success { background:#dcfce7; border-color:#86efac; color:#166534; }
.picking-error { background:#fee2e2; border-color:#fca5a5; color:#991b1b; }
.picking-scan-panel,.picking-completion-panel { display:flex; justify-content:space-between; align-items:center; gap:20px; background:#fff; border:1px solid #dbe3ec; border-radius:16px; padding:20px; margin-bottom:22px; }
.picking-scan-panel h2,.picking-completion-panel h2 { margin:0 0 6px; }
.picking-scan-panel p,.picking-completion-panel p { margin:0; color:#64748b; }
.picking-scan-input { width:min(520px,100%); padding:16px 18px; border:2px solid #93c5fd; border-radius:13px; font-size:1.1rem; direction:ltr; }
.picking-products-layout { display:grid; grid-template-columns:320px minmax(0,1fr); gap:20px; align-items:start; }
.picking-product-list { background:#fff; border:1px solid #dbe3ec; border-radius:16px; padding:10px; display:flex; flex-direction:column; gap:8px; max-height:650px; overflow:auto; }
.picking-list-item { width:100%; display:grid; grid-template-columns:36px 1fr auto; gap:10px; align-items:center; border:1px solid #e2e8f0; border-radius:12px; background:#fff; padding:12px; text-align:right; cursor:pointer; }
.picking-list-item.active { border-color:#2563eb; background:#eff6ff; }
.picking-list-item.complete { border-color:#86efac; background:#f0fdf4; }
.picking-list-index { width:30px; height:30px; display:grid; place-items:center; border-radius:50%; background:#e2e8f0; font-weight:800; }
.picking-list-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.picking-active-card { background:#fff; border:1px solid #dbe3ec; border-radius:18px; padding:24px; display:grid; grid-template-columns:minmax(260px,38%) 1fr; gap:28px; box-shadow:0 12px 30px rgba(15,23,42,.06); }
.picking-product-visual { min-height:420px; display:grid; place-items:center; background:#f8fafc; border-radius:16px; overflow:hidden; }
.picking-product-visual img { width:100%; height:100%; max-height:480px; object-fit:contain; }
.picking-no-image { font-size:4rem; color:#94a3b8; }
.picking-step-label { color:#2563eb; font-weight:800; }
.picking-active-info h2 { font-size:1.7rem; margin:10px 0 20px; }
.picking-code-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.picking-code-grid div { background:#f8fafc; border-radius:12px; padding:13px; }
.picking-code-grid span { display:block; color:#64748b; margin-bottom:5px; }
.picking-counter-block { margin:24px 0 16px; text-align:center; background:#fff7ed; border:1px solid #fdba74; border-radius:16px; padding:18px; }
.picking-counter-block span,.picking-counter-block small { display:block; }
.picking-counter-block strong { font-size:3rem; color:#c2410c; }
.picking-counter-actions { display:flex; justify-content:center; align-items:center; gap:20px; margin-bottom:20px; }
.picking-counter-actions > strong { font-size:2rem; min-width:70px; text-align:center; }
.picking-counter-button { width:58px; height:58px; border:0; border-radius:14px; color:#fff; font-size:2rem; cursor:pointer; }
.picking-counter-button.plus { background:#16a34a; }
.picking-counter-button.minus { background:#dc2626; }
.picking-counter-button:disabled,.picking-primary-button:disabled,.picking-complete-button:disabled { opacity:.45; cursor:not-allowed; }
.picking-navigation-actions { display:flex; justify-content:space-between; gap:12px; }
.picking-completion-panel { margin-top:22px; }
.picking-complete-button { min-width:240px; background:#16a34a; }
.picking-label-details { margin-top:22px; background:#fff; border:1px solid #dbe3ec; border-radius:16px; padding:16px; }
.picking-label-details summary { font-weight:800; cursor:pointer; }
@media (max-width:1000px){.picking-summary-grid{grid-template-columns:repeat(2,1fr)}.picking-products-layout{grid-template-columns:1fr}.picking-product-list{max-height:260px}.picking-active-card{grid-template-columns:1fr}.picking-product-visual{min-height:300px}}
@media (max-width:650px){.picking-page{padding:16px}.picking-page-header,.picking-scan-panel,.picking-completion-panel{flex-direction:column;align-items:stretch}.picking-summary-grid{grid-template-columns:1fr}.picking-code-grid{grid-template-columns:1fr}}
.dispatch-action-button.picking { background:#16a34a; color:#fff; }
.dispatch-workflow-status.workflow-picked { background:#dcfce7; color:#166534; border-color:#86efac; }

/* Picking scanner mode */
.picking-scanner-box { width:min(560px,100%); display:flex; flex-direction:column; gap:8px; }
.picking-scanner-status { display:flex; align-items:center; gap:8px; font-weight:800; color:#475569; }
.picking-scanner-dot { width:11px; height:11px; border-radius:50%; background:#94a3b8; box-shadow:0 0 0 0 rgba(148,163,184,.35); }
.picking-scan-panel.scanner-ready { border-color:#22c55e; box-shadow:0 0 0 3px rgba(34,197,94,.10); }
.picking-scan-panel.scanner-ready .picking-scanner-status { color:#15803d; }
.picking-scan-panel.scanner-ready .picking-scanner-dot { background:#22c55e; animation:picking-scanner-pulse 1.4s infinite; }
.picking-scan-panel.scanner-idle .picking-scanner-dot { background:#f59e0b; }
.picking-scan-feedback { margin-bottom:18px; min-height:88px; display:flex; align-items:center; justify-content:center; gap:18px; border:2px solid; border-radius:18px; padding:18px 24px; text-align:center; box-shadow:0 10px 25px rgba(15,23,42,.08); }
.picking-scan-feedback.accepted { background:#dcfce7; border-color:#22c55e; color:#166534; }
.picking-scan-feedback.rejected { background:#fee2e2; border-color:#ef4444; color:#991b1b; }
.picking-scan-feedback-icon { width:52px; height:52px; display:grid; place-items:center; flex:0 0 auto; border-radius:50%; color:#fff; font-size:2rem; font-weight:900; }
.picking-scan-feedback.accepted .picking-scan-feedback-icon { background:#16a34a; }
.picking-scan-feedback.rejected .picking-scan-feedback-icon { background:#dc2626; }
.picking-scan-feedback strong { display:block; font-size:1.35rem; }
.picking-scan-feedback small { display:block; margin-top:5px; direction:ltr; font-weight:700; opacity:.8; }
.picking-screen-shake { animation:picking-screen-shake .32s linear; }
@keyframes picking-screen-shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-10px)} 40%{transform:translateX(10px)} 60%{transform:translateX(-7px)} 80%{transform:translateX(7px)} }
@keyframes picking-scanner-pulse { 0%{box-shadow:0 0 0 0 rgba(34,197,94,.45)} 70%{box-shadow:0 0 0 9px rgba(34,197,94,0)} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0)} }

/* Picking workflow automation */
.picking-shortcuts { display:flex; flex-wrap:wrap; gap:8px 14px; margin-top:12px; color:#64748b; font-size:.85rem; }
.picking-shortcuts span { display:inline-flex; align-items:center; gap:6px; }
.picking-shortcuts kbd { min-width:34px; padding:4px 7px; border:1px solid #cbd5e1; border-bottom-width:2px; border-radius:7px; background:#f8fafc; color:#0f172a; font:700 .75rem/1 system-ui,sans-serif; text-align:center; box-shadow:0 1px 0 rgba(15,23,42,.08); }
.picking-list-name { display:flex; flex-direction:column; gap:2px; }
.picking-list-name small { color:#64748b; font-size:.72rem; font-weight:700; }
.picking-list-item.active .picking-list-name small { color:#1d4ed8; }
.picking-list-item.complete .picking-list-name small { color:#15803d; }
.picking-list-item.active .picking-list-index { background:#2563eb; color:#fff; }
.picking-list-item.complete .picking-list-index { background:#16a34a; color:#fff; }
.picking-completion-celebration { position:relative; overflow:hidden; margin:0 0 22px; padding:34px 24px; border:2px solid #22c55e; border-radius:22px; background:linear-gradient(135deg,#dcfce7,#f0fdf4 55%,#ecfeff); color:#166534; text-align:center; box-shadow:0 18px 40px rgba(22,163,74,.16); animation:picking-celebration-in .35s ease-out; }
.picking-completion-celebration::before,.picking-completion-celebration::after { content:""; position:absolute; width:150px; height:150px; border-radius:50%; background:rgba(34,197,94,.10); }
.picking-completion-celebration::before { top:-80px; right:-35px; }
.picking-completion-celebration::after { bottom:-90px; left:-30px; }
.picking-celebration-check { width:74px; height:74px; display:grid; place-items:center; margin:0 auto 14px; border-radius:50%; background:#16a34a; color:#fff; font-size:2.8rem; font-weight:900; box-shadow:0 10px 24px rgba(22,163,74,.28); }
.picking-completion-celebration h2 { margin:0 0 8px; font-size:1.9rem; }
.picking-completion-celebration p { margin:0 0 8px; font-weight:700; }
.picking-completion-celebration small { display:block; color:#15803d; font-weight:800; }
.picking-activity-panel { margin-top:22px; padding:20px; border:1px solid #dbe3ec; border-radius:16px; background:#fff; box-shadow:0 8px 24px rgba(15,23,42,.04); }
.picking-activity-header { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; }
.picking-activity-header h2 { margin:0 0 5px; }
.picking-activity-header p { margin:0; color:#64748b; }
.picking-undo-button { border:0; border-radius:11px; padding:11px 15px; background:#ede9fe; color:#6d28d9; font-weight:800; cursor:pointer; }
.picking-undo-button:disabled { opacity:.45; cursor:not-allowed; }
.picking-empty-activity { padding:18px; border-radius:12px; background:#f8fafc; color:#64748b; text-align:center; }
.picking-activity-list { display:flex; flex-direction:column; gap:8px; }
.picking-activity-item { display:grid; grid-template-columns:82px minmax(140px,1fr) minmax(220px,2fr) 34px; align-items:center; gap:12px; padding:11px 13px; border:1px solid #e2e8f0; border-radius:12px; background:#f8fafc; }
.picking-activity-item.success { border-color:#bbf7d0; background:#f0fdf4; }
.picking-activity-item.error { border-color:#fecaca; background:#fef2f2; }
.picking-activity-item.warning { border-color:#fed7aa; background:#fff7ed; }
.picking-activity-item.undo { border-color:#ddd6fe; background:#f5f3ff; }
.picking-activity-time { direction:ltr; color:#64748b; font-variant-numeric:tabular-nums; }
.picking-activity-item b { width:30px; height:30px; display:grid; place-items:center; border-radius:50%; background:#fff; font-size:1.1rem; }
@keyframes picking-celebration-in { from{opacity:0;transform:scale(.96) translateY(8px)} to{opacity:1;transform:scale(1) translateY(0)} }
@media (max-width:760px){.picking-shortcuts{display:none}.picking-activity-header{align-items:stretch;flex-direction:column}.picking-activity-item{grid-template-columns:70px 1fr 30px}.picking-activity-item span:nth-child(3){grid-column:1/-1}}

/* ===========================================
   Compact desktop layout (optimized for 100% browser zoom)
   Added in Phase 1
=========================================== */
:root {
    --wm-page-padding: 18px;
    --wm-section-gap: 16px;
    --wm-card-padding: 17px;
    --wm-control-height: 38px;
    --wm-radius: 10px;
}

html {
    font-size: 14px;
}

body {
    line-height: 1.42;
}

.header {
    padding: 12px 22px;
}

.header h2,
.header .header-content h2 {
    font-size: 1.28rem;
}

.content {
    padding: var(--wm-page-padding);
}

.footer {
    padding: 8px 12px;
    font-size: .86rem;
}

.dashboard {
    max-width: 1320px;
}

.dashboard h1,
.page-header h1,
.catalog-page-header h1,
.picking-page-header h1 {
    font-size: 1.72rem;
    line-height: 1.2;
}

.subtitle {
    margin-bottom: 20px;
}

.cards {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.card {
    min-height: 205px;
    padding: 18px;
    border-radius: var(--wm-radius);
    box-shadow: 0 3px 11px rgba(0, 0, 0, .065);
}

.card h3 {
    margin-bottom: 8px;
    font-size: 1.17rem;
}

.card p {
    margin-top: 4px;
}

.button,
.card button,
.primary-button,
.danger-button,
.back-link,
.back-button,
.language-button,
.catalog-secondary-button,
.dispatch-action-button,
.dispatch-export-button,
.dispatch-print-button {
    min-height: var(--wm-control-height);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: .93rem;
}

.page-header,
.catalog-page-header,
.picking-page-header {
    margin-bottom: 18px;
    gap: 14px;
}

.page-header h1,
.catalog-page-header h1,
.picking-page-header h1 {
    margin-bottom: 5px;
}

.workspace-grid {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.workspace-card,
.workspace-summary,
.analysis-table-block,
.catalog-panel,
.catalog-import-card,
.catalog-list-section,
.packing-scan-card,
.packing-order-card {
    padding: var(--wm-card-padding);
    border-radius: var(--wm-radius);
    box-shadow: 0 3px 11px rgba(0, 0, 0, .06);
}

.workspace-card-header {
    gap: 11px;
    margin-bottom: 13px;
}

.workspace-card-header h2,
.workspace-summary h2,
.analysis-table-block h2,
.catalog-panel h2,
.catalog-list-heading h2 {
    font-size: 1.24rem;
}

.workspace-step {
    width: 32px;
    height: 32px;
}

.workspace-actions,
.catalog-actions,
.catalog-action-row,
.dispatch-pdf-actions {
    gap: 10px;
    margin-bottom: 17px;
}

.file-status {
    margin-top: 10px;
    padding: 8px 11px;
}

.summary-row {
    padding: 8px 0;
}

.metric-grid,
.catalog-metric-grid,
.catalog-metrics,
.dispatcher-match-metrics {
    gap: 11px;
    margin-bottom: 16px;
}

.metric-card,
.catalog-metric-card {
    min-height: 92px;
    padding: 14px;
    gap: 6px;
    border-radius: var(--wm-radius);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .05);
}

.metric-card strong,
.catalog-metric-card strong,
.catalog-metric strong {
    font-size: 1.65rem;
}

.analysis-section {
    margin-top: 18px;
}

.analysis-table-block {
    margin-top: 16px;
}

.orders-table th,
.orders-table td,
.analysis-table th,
.analysis-table td,
.catalog-table th,
.catalog-table td,
.compact-table th,
.compact-table td,
.issues-table th,
.issues-table td {
    padding: 8px 9px;
}

.status-badge,
.dispatch-type-badge,
.dispatch-workflow-status,
.catalog-filter-chip,
.dispatch-filter-chip {
    font-size: .82rem;
    padding: 4px 8px;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.packing-scan-input,
.picking-scan-input {
    min-height: var(--wm-control-height);
    padding: 8px 11px;
    border-radius: 8px;
}

/* Dispatcher / smart grouping */
.dispatch-filter-panel {
    padding: 14px;
    margin-bottom: 15px;
    border-radius: var(--wm-radius);
}

.dispatch-filter-row {
    gap: 8px;
}

.dispatch-batch-list {
    gap: 14px;
}

.dispatch-batch-card {
    border-radius: 11px;
}

.dispatch-batch-header,
.batch-details,
.dispatch-label-details {
    padding: 13px 15px;
}

.dispatch-product-grid {
    gap: 11px;
    padding: 13px 15px 15px;
}

.dispatch-product-card {
    padding: 12px;
    border-radius: 10px;
}

.dispatch-product-image {
    min-height: 180px;
    max-height: 230px;
}

/* Packing */
.packing-products-grid {
    gap: 14px;
}

.packing-product-card {
    border-radius: 12px;
}

.packing-product-image {
    min-height: 220px;
    max-height: 270px;
}

.packing-product-details {
    padding: 14px;
}

.packing-product-meta {
    gap: 6px;
}

.packing-price,
.packing-quantity {
    padding: 10px 12px;
}

/* Catalog */
.catalog-import-layout,
.catalog-import-grid {
    gap: 14px;
}

.catalog-upload-area {
    padding: 18px;
}

.catalog-search-row,
.catalog-filter-area {
    gap: 9px;
}

.catalog-product-image {
    width: 76px;
    height: 76px;
}

.catalog-pagination {
    margin-top: 15px;
}

/* Picking */
.picking-page {
    padding: var(--wm-page-padding);
}

.picking-summary-grid {
    gap: 10px;
}

.picking-summary-card {
    padding: 13px;
    border-radius: 11px;
}

.picking-summary-card strong {
    font-size: 1.45rem;
}

.picking-scan-panel,
.picking-completion-panel {
    padding: 14px;
    margin-bottom: 15px;
    border-radius: 11px;
}

.picking-products-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 14px;
}

.picking-active-card {
    padding: 17px;
    gap: 18px;
    border-radius: 13px;
}

.picking-product-visual {
    min-height: 330px;
}

.picking-active-info h2 {
    font-size: 1.42rem;
    margin: 7px 0 13px;
}

.picking-counter-block {
    margin: 16px 0 12px;
    padding: 13px;
}

.picking-counter-block strong {
    font-size: 2.25rem;
}

.picking-counter-button {
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
}

.picking-activity-panel,
.picking-label-details {
    margin-top: 15px;
    padding: 14px;
    border-radius: 11px;
}

@media (min-width: 1500px) {
    .content {
        padding-left: 26px;
        padding-right: 26px;
    }
}

@media (max-width: 900px) {
    html {
        font-size: 14px;
    }

    .content,
    .picking-page {
        padding: 14px;
    }

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


/* ===========================================
   V31 UI balance refinement
   Pages: +25% from previous compact scale
   Dashboard: +50% from previous compact scale
=========================================== */
.dashboard {
    max-width: 1580px;
}

.dashboard h1 {
    font-size: 2.05rem;
}

.dashboard .subtitle {
    margin-bottom: 24px;
    font-size: 1.08rem;
}

.dashboard .cards {
    grid-template-columns: repeat(auto-fit, minmax(264px, 1fr));
    gap: 17px;
}

.dashboard .card {
    min-height: 246px;
    padding: 22px;
    border-radius: 12px;
}

.dashboard .card h3 {
    margin-bottom: 10px;
    font-size: 1.40rem;
}

.dashboard .card p {
    font-size: 1.08rem;
}

.dashboard .button,
.dashboard .card button {
    min-height: 46px;
    padding: 10px 18px;
    font-size: 1.05rem;
}


/* V31 Dashboard icon size x2 */
.dashboard .card h3 .fa,
.dashboard .card h3 i,
.dashboard .card h3 svg,
.dashboard .card h3 .bi,
.dashboard-card-title i,
.dashboard-card-title svg{
    font-size:2em !important;
    width:2em !important;
    height:2em !important;
    vertical-align:middle;
}

/* ===========================================
   Production UI Motion System
   Subtle, fast and warehouse-friendly
=========================================== */

:root {
    --wm-motion-fast: 150ms;
    --wm-motion-normal: 220ms;
    --wm-motion-slow: 360ms;
    --wm-motion-ease: cubic-bezier(.2, .8, .2, 1);
    --wm-hover-lift: -4px;
    --wm-hover-shadow: 0 14px 34px rgba(15, 23, 42, .12);
    --wm-active-scale: .975;
}

/* Page entrance */
.dashboard,
.page-header,
.picking-page,
.reports-page,
.database-page-scale,
.catalog-list-section,
.product-import-layout {
    animation: wm-page-enter var(--wm-motion-slow) var(--wm-motion-ease) both;
}

/* Main cards and panels */
.card,
.workspace-card,
.workspace-summary,
.metric-card,
.analysis-table-block,
.orders-preview,
.dispatcher-overview,
.dispatch-filter-panel,
.dispatch-batch-card,
.dispatch-product-card,
.picking-summary-card,
.picking-state-card,
.picking-scan-panel,
.picking-active-card,
.picking-product-list,
.picking-list-item,
.picking-activity-panel,
.picking-label-details,
.packing-summary-card,
.packing-toolbar-card,
.packing-order-card,
.packing-product-card,
.reports-hero,
.reports-meta-strip,
.kpi-card,
.progress-card,
.chart-card,
.report-card,
.database-intro,
.database-maintenance,
.database-day-summary,
.import-card,
.result-card,
.catalog-overview-banner,
.catalog-list-section,
.catalog-metric-card {
    transition:
        transform var(--wm-motion-normal) var(--wm-motion-ease),
        box-shadow var(--wm-motion-normal) var(--wm-motion-ease),
        border-color var(--wm-motion-normal) ease,
        background-color var(--wm-motion-normal) ease;
}

/* Lift cards that are naturally interactive */
.card:hover,
.workspace-card:hover,
.metric-card:hover,
.dispatch-batch-card:hover,
.dispatch-product-card:hover,
.picking-summary-card:hover,
.picking-list-item:hover,
.packing-summary-card:hover,
.packing-product-card:hover,
.kpi-card:hover,
.progress-card:hover,
.chart-card:hover,
.report-card:hover,
.import-card:hover,
.result-card:hover,
.catalog-metric-card:hover {
    transform: translateY(var(--wm-hover-lift));
    box-shadow: var(--wm-hover-shadow);
}

/* Keep selected/active operational cards stable */
.picking-list-item.active:hover,
.picking-list-item.complete:hover,
.dispatch-batch-card.batch-opened:hover {
    transform: translateY(-2px);
}

/* Home page cards */
.dashboard .card {
    position: relative;
    overflow: hidden;
}

.dashboard .card::after {
    content: "";
    position: absolute;
    inset: auto -35% -65% auto;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(37, 99, 235, .055);
    transform: scale(.8);
    transition: transform var(--wm-motion-slow) var(--wm-motion-ease);
    pointer-events: none;
}

.dashboard .card:hover::after {
    transform: scale(1.35);
}

.home-card-icon,
.report-card-icon,
.kpi-icon,
.catalog-metric-icon,
.dispatcher-overview-icon,
.database-maintenance-icon,
.catalog-overview-icon {
    transition:
        transform var(--wm-motion-normal) var(--wm-motion-ease),
        filter var(--wm-motion-normal) ease;
    transform-origin: center;
}

.dashboard .card:hover .home-card-icon,
.report-card:hover .report-card-icon,
.kpi-card:hover .kpi-icon,
.catalog-metric-card:hover .catalog-metric-icon,
.dispatcher-overview:hover .dispatcher-overview-icon,
.database-maintenance:hover .database-maintenance-icon,
.catalog-overview-banner:hover .catalog-overview-icon {
    transform: translateY(-2px) scale(1.08) rotate(-2deg);
    filter: saturate(1.12);
}

/* Buttons and links */
button,
.button,
.back-link,
.back-button,
.primary-button,
.secondary-button,
.danger-button,
.refresh-button,
.pdf-button,
.excel-button,
.dispatch-action-button,
.dispatch-export-button,
.dispatch-print-button,
.catalog-export-button,
.catalog-filter-chip,
.dispatch-filter-chip,
.result-tab,
.picking-back-button,
.picking-secondary-button,
.picking-primary-button,
.picking-complete-button,
.picking-counter-button,
.picking-undo-button,
.packing-list-button,
.packing-gallery-arrow,
.gallery-arrow,
.gallery-close-button,
.catalog-image-button {
    transition:
        transform var(--wm-motion-fast) var(--wm-motion-ease),
        box-shadow var(--wm-motion-fast) ease,
        filter var(--wm-motion-fast) ease,
        background-color var(--wm-motion-fast) ease,
        border-color var(--wm-motion-fast) ease;
}

button:not(:disabled):hover,
.button:hover,
.back-link:hover,
.back-button:hover,
.primary-button:not(:disabled):hover,
.secondary-button:not(:disabled):hover,
.danger-button:not(:disabled):hover,
.refresh-button:not(:disabled):hover,
.pdf-button:not(:disabled):hover,
.excel-button:not(:disabled):hover,
.dispatch-action-button:not(:disabled):hover,
.dispatch-export-button:not(:disabled):hover,
.dispatch-print-button:not(:disabled):hover,
.catalog-export-button:not(:disabled):hover,
.picking-back-button:not(:disabled):hover,
.picking-secondary-button:not(:disabled):hover,
.picking-primary-button:not(:disabled):hover,
.picking-complete-button:not(:disabled):hover,
.picking-counter-button:not(:disabled):hover,
.picking-undo-button:not(:disabled):hover,
.packing-list-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .14);
    filter: brightness(1.025);
}

button:not(:disabled):active,
.button:active,
.back-link:active,
.back-button:active,
.primary-button:not(:disabled):active,
.secondary-button:not(:disabled):active,
.danger-button:not(:disabled):active,
.pdf-button:not(:disabled):active,
.excel-button:not(:disabled):active,
.dispatch-action-button:not(:disabled):active,
.picking-counter-button:not(:disabled):active {
    transform: translateY(0) scale(var(--wm-active-scale));
    box-shadow: 0 3px 8px rgba(15, 23, 42, .11);
}

/* Inputs */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    transition:
        border-color var(--wm-motion-fast) ease,
        box-shadow var(--wm-motion-fast) ease,
        background-color var(--wm-motion-fast) ease;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .12);
}

/* Tables */
.orders-table tbody tr,
.analysis-table tbody tr,
.catalog-table tbody tr,
.compact-table tbody tr,
.packing-list-table tbody tr {
    transition:
        background-color var(--wm-motion-fast) ease,
        transform var(--wm-motion-fast) var(--wm-motion-ease);
}

.orders-table tbody tr:hover,
.analysis-table tbody tr:hover,
.catalog-table tbody tr:hover,
.compact-table tbody tr:hover,
.packing-list-table tbody tr:hover {
    background: #f8fafc;
}

/* Progress bars animate smoothly */
.picking-progress-bar,
.progress-track > *,
.bar-value,
.mini-bars span {
    transition:
        width var(--wm-motion-slow) var(--wm-motion-ease),
        transform var(--wm-motion-normal) var(--wm-motion-ease);
}

/* Modal/dialog entrance */
.packing-list-dialog,
.packing-gallery-dialog,
.image-gallery-dialog {
    animation: wm-dialog-enter var(--wm-motion-normal) var(--wm-motion-ease) both;
}

.packing-list-overlay,
.packing-gallery-overlay,
.image-gallery-overlay {
    animation: wm-fade-in var(--wm-motion-fast) ease both;
}

/* Toasts and messages */
.toast,
.file-status,
.packing-message,
.picking-message,
.picking-scan-feedback,
.dispatcher-success-message,
.database-global-message {
    animation: wm-message-enter var(--wm-motion-normal) var(--wm-motion-ease) both;
}

/* Stagger the home cards and report cards */
.dashboard .card:nth-child(1),
.report-card:nth-child(1),
.kpi-card:nth-child(1) { animation-delay: 20ms; }

.dashboard .card:nth-child(2),
.report-card:nth-child(2),
.kpi-card:nth-child(2) { animation-delay: 55ms; }

.dashboard .card:nth-child(3),
.report-card:nth-child(3),
.kpi-card:nth-child(3) { animation-delay: 90ms; }

.dashboard .card:nth-child(4),
.report-card:nth-child(4),
.kpi-card:nth-child(4) { animation-delay: 125ms; }

.dashboard .card:nth-child(n+5),
.report-card:nth-child(n+5),
.kpi-card:nth-child(n+5) { animation-delay: 160ms; }

.dashboard .card,
.report-card,
.kpi-card {
    animation: wm-card-enter var(--wm-motion-slow) var(--wm-motion-ease) both;
}

/* Keyframes */
@keyframes wm-page-enter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wm-card-enter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes wm-dialog-enter {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.975);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes wm-message-enter {
    from {
        opacity: 0;
        transform: translateY(-7px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wm-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Accessibility: respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

