/* Warehouse EXP Date — ERP UI Architecture — maintained in v21.9
   Page-level design system. Dialogs stay isolated in dialog-system.css.
   No priority-override declarations are used in this layer. */
:root{
  --erp-space-1:4px;--erp-space-2:8px;--erp-space-3:12px;--erp-space-4:16px;--erp-space-5:20px;--erp-space-6:24px;--erp-space-8:32px;
  --erp-radius-sm:10px;--erp-radius-md:14px;--erp-radius-lg:20px;--erp-radius-xl:26px;
  --erp-control-h:46px;--erp-row-h:52px;
  --erp-border:color-mix(in srgb,var(--border) 92%,transparent);
  --erp-surface:var(--card-bg);--erp-surface-soft:color-mix(in srgb,var(--surface-soft) 86%,var(--card-bg));
  --erp-brand-soft:color-mix(in srgb,var(--brand) 8%,var(--card-bg));
  --erp-success-soft:color-mix(in srgb,var(--success) 9%,var(--card-bg));
  --erp-warning-soft:color-mix(in srgb,var(--warning) 10%,var(--card-bg));
  --erp-danger-soft:color-mix(in srgb,var(--danger) 9%,var(--card-bg));
  --erp-blue:#2563eb;--erp-blue-soft:color-mix(in srgb,#2563eb 8%,var(--card-bg));
  --erp-shadow-1:0 1px 2px rgba(45,26,39,.04),0 12px 30px -26px rgba(45,26,39,.30);
  --erp-shadow-2:0 18px 42px -34px rgba(45,26,39,.34);
}
[data-theme="dark"]{
  --erp-shadow-1:0 1px 2px rgba(0,0,0,.22),0 16px 34px -28px rgba(0,0,0,.72);
  --erp-shadow-2:0 22px 48px -36px rgba(0,0,0,.78);
  --erp-blue:#60a5fa;
}

/* Typography — Arabic gets comfortable rhythm without oversized bold weights. */
.warehouse-app{font-size:14px;line-height:1.65;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}
html[dir="rtl"] .warehouse-app{font-family:"Segoe UI Variable","Segoe UI",Tahoma,Arial,sans-serif;line-height:1.78}
.warehouse-app h1,.warehouse-app h2,.warehouse-app h3,.warehouse-app h4,.warehouse-app strong{letter-spacing:0}
html[dir="rtl"] .warehouse-app h1,html[dir="rtl"] .warehouse-app h2,html[dir="rtl"] .warehouse-app h3,html[dir="rtl"] .warehouse-app h4{font-weight:750}
.warehouse-app small{line-height:1.6}

/* App shell */
.warehouse-app .erp-container{max-width:1760px}
.warehouse-app .erp-header{min-height:124px;padding:24px 28px;border-radius:var(--erp-radius-xl);box-shadow:0 26px 64px -40px rgba(80,16,59,.62)}
.warehouse-app .brand-lockup{gap:16px}.warehouse-app .brand-lockup img{filter:drop-shadow(0 10px 18px rgba(0,0,0,.12))}
.warehouse-app .erp-header h1{font-size:26px;line-height:1.28}.warehouse-app .brand-subtitle{font-size:12.5px;line-height:1.6}
.warehouse-app .header-actions{gap:9px}.warehouse-app .header-actions .btn,.warehouse-app .header-select-with-icon,.warehouse-app .current-user-pill{min-height:46px;border-radius:13px}

/* Navigation becomes a calm ERP command rail. */
.warehouse-app .nav-tabs{position:sticky;top:8px;z-index:30;gap:4px;padding:6px;margin-bottom:20px;border-radius:16px;box-shadow:var(--erp-shadow-1);backdrop-filter:blur(14px)}
.warehouse-app .tab-btn{min-height:42px;padding:9px 16px;border-radius:11px;font-size:13px;font-weight:700}
.warehouse-app .tab-btn.active{box-shadow:0 10px 22px -18px color-mix(in srgb,var(--brand) 70%,transparent)}

/* Global controls */
.warehouse-app input:not([type="checkbox"]):not([type="radio"]),.warehouse-app select,.warehouse-app textarea{min-height:var(--erp-control-h);border-radius:12px;font-size:13px;font-weight:600}
.warehouse-app textarea{min-height:92px}.warehouse-app label{font-size:12px;font-weight:700;color:var(--text-muted)}
.warehouse-app .btn{min-height:44px;border-radius:12px;font-size:13px;font-weight:750;box-shadow:none}
.warehouse-app .btn:hover{transform:translateY(-1px)}

/* Scanner / page command surface */
.warehouse-app .barcode-scanner-bar{min-height:76px;padding:15px 20px;border-radius:18px;box-shadow:var(--erp-shadow-1)}
.warehouse-app .scanner-label{font-size:12.5px;font-weight:750}.warehouse-app .scanner-input-group{max-width:760px}

/* Cards and surfaces */
.warehouse-app .kpi-card,.warehouse-app .metric-card,.warehouse-app .chart-card,.warehouse-app .logs-card,.warehouse-app .erp-toolbar,.warehouse-app .erp-table-container,.warehouse-app .settings-card,.warehouse-app .reports-chart-card,.warehouse-app .reports-insight-card,.warehouse-app .reports-mode-card{border-color:var(--erp-border);box-shadow:var(--erp-shadow-1);border-radius:var(--erp-radius-lg)}
.warehouse-app .kpi-card,.warehouse-app .metric-card{position:relative;overflow:hidden}
.warehouse-app .kpi-card::before,.warehouse-app .metric-card::before{content:"";position:absolute;inset-inline-start:0;top:0;bottom:0;width:4px;background:var(--brand)}
.warehouse-app .kpi-card.blue::before{background:var(--erp-blue)}.warehouse-app .kpi-card.cyan::before{background:var(--success)}.warehouse-app .kpi-card.purple::before{background:var(--purple)}.warehouse-app .kpi-card.red::before{background:var(--danger)}
.warehouse-app .card-title,.warehouse-app .table-section-title strong,.warehouse-app .reports-card-head strong{font-size:14px;font-weight:760}

/* Toolbars: explicit hierarchy instead of many equal boxes. */
.warehouse-app .erp-toolbar{gap:14px;padding:16px;background:var(--erp-surface)}
.warehouse-app .toolbar-panel{border:1px solid var(--erp-border);background:var(--erp-surface-soft);border-radius:14px;padding:12px 13px;box-shadow:none}
.warehouse-app .toolbar-panel-title{font-size:11.5px;font-weight:760;color:var(--text-muted);margin-bottom:8px}
.warehouse-app .toolbar-search-wrap input{background:var(--card-bg)}
.warehouse-app .custom-file-card{border-radius:12px;background:var(--card-bg)}

/* Data tables — sticky, legible and visually scannable. */
.warehouse-app .erp-table-container{overflow:hidden;background:var(--erp-surface)}
.warehouse-app .table-section-header{min-height:68px;padding:14px 18px;border-bottom:1px solid var(--erp-border);background:linear-gradient(180deg,var(--erp-surface),var(--erp-surface-soft))}
.warehouse-app .table-section-subtitle{font-size:11.5px;line-height:1.6}.warehouse-app .table-count-chip{min-height:30px;padding:5px 10px;border-radius:999px;font-size:11px;font-weight:800}
.warehouse-app .table-scroll{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--text-muted) 35%,transparent) transparent}
.warehouse-app .inventory-table,.warehouse-app .master-table,.warehouse-app .reports-table,.warehouse-app .users-table,.warehouse-app .audit-table,.warehouse-app .movement-register-panel table{border-collapse:separate;border-spacing:0}
.warehouse-app table thead th{position:sticky;top:0;z-index:4;height:44px;padding:10px 12px;background:color-mix(in srgb,var(--surface-soft) 96%,var(--card-bg));border-bottom:1px solid var(--border-strong);font-size:11px;font-weight:780;color:var(--text-muted);white-space:nowrap}
.warehouse-app table tbody td{min-height:var(--erp-row-h);padding:11px 12px;border-bottom:1px solid color-mix(in srgb,var(--border) 82%,transparent);font-size:12.5px;vertical-align:middle}
.warehouse-app table tbody tr:nth-child(even){background:color-mix(in srgb,var(--surface-soft) 48%,transparent)}
.warehouse-app table tbody tr:hover{background:var(--erp-brand-soft)}
.warehouse-app table tbody tr:last-child td{border-bottom:0}
.warehouse-app .code-chip,.warehouse-app .qty-pill,.warehouse-app .category-badge,.warehouse-app .location-tag{min-height:28px;border-radius:8px;font-size:11.5px;font-weight:720}
.warehouse-app .table-action-btn{width:34px;height:34px;border-radius:9px}
.warehouse-app .table-empty-state{min-height:160px;font-size:13px;font-weight:650}

/* Dashboard */
.warehouse-app .dashboard-kpi-grid{gap:14px}.warehouse-app .dashboard-hero,.warehouse-app .dashboard-hero-pro{border-radius:var(--erp-radius-xl);box-shadow:var(--erp-shadow-2)}
.warehouse-app .dashboard-status-card{border-radius:16px;border:1px solid var(--erp-border);box-shadow:none}
.warehouse-app .dashboard-status-card.safe{background:var(--erp-success-soft)}.warehouse-app .dashboard-status-card.warning{background:var(--erp-warning-soft)}.warehouse-app .dashboard-status-card.danger{background:var(--erp-danger-soft)}

/* Reports — stronger semantic separation. */
.warehouse-app .reports-toolbar{gap:10px;padding:14px;border:1px solid var(--erp-border);border-radius:16px;background:var(--erp-surface-soft)}
.warehouse-app .reports-filter-block{min-width:150px}.warehouse-app .reports-filter-label{font-size:11px;font-weight:760}
.warehouse-app .reports-chart-card{border-top:4px solid var(--brand)}
.warehouse-app .reports-insight-card:nth-child(4n+1){border-top:4px solid var(--success)}
.warehouse-app .reports-insight-card:nth-child(4n+2){border-top:4px solid var(--erp-blue)}
.warehouse-app .reports-insight-card:nth-child(4n+3){border-top:4px solid var(--warning)}
.warehouse-app .reports-insight-card:nth-child(4n){border-top:4px solid var(--purple)}
.warehouse-app .report-kpi-in,.warehouse-app [data-report-tone="in"]{background:var(--erp-success-soft)}
.warehouse-app .report-kpi-out,.warehouse-app [data-report-tone="out"]{background:var(--erp-danger-soft)}

/* Settings */
.warehouse-app .settings-grid{gap:14px}.warehouse-app .settings-card{padding:17px 18px;background:var(--erp-surface)}
.warehouse-app .settings-card-head{gap:12px}.warehouse-app .settings-card-head strong{font-size:13.5px;font-weight:760}.warehouse-app .settings-card-head small{font-size:11.5px}
.warehouse-app .settings-group-heading{margin:26px 0 12px;padding:0 4px}.warehouse-app .settings-group-heading strong{font-size:14px}.warehouse-app .settings-group-index{width:30px;height:30px;border-radius:9px}
.warehouse-app .performance-note{border-radius:11px;line-height:1.65}

/* Movement engine / transfer surfaces */
.warehouse-app .movement-kpis-pro{gap:12px}.warehouse-app .movement-kpi{border-radius:15px;border:1px solid var(--erp-border);background:var(--erp-surface);box-shadow:var(--erp-shadow-1)}
.warehouse-app .movement-register-tabs-pro{gap:6px;padding:6px;border-radius:14px}.warehouse-app .movement-register-tabs-pro .movement-register-tab{min-height:58px;border-radius:10px}

/* Notifications */
.warehouse-app .notification-drawer{box-shadow:0 28px 80px -32px rgba(45,26,39,.45)}
.warehouse-app .notif-item{border-radius:14px;border:1px solid var(--erp-border);box-shadow:none}

/* Empty/loading states */
.warehouse-app .loading-state,.warehouse-app .empty-state,.warehouse-app .reports-empty,.warehouse-app .audit-empty-state{border-radius:14px;background:var(--erp-surface-soft);border:1px dashed var(--border-strong)}

/* Responsive: data-first, no cramped desktop layout. */
@media(max-width:1100px){
  .warehouse-app .erp-header{padding:20px}.warehouse-app .erp-header h1{font-size:22px}
  .warehouse-app .toolbar-panel{flex:1 1 320px}.warehouse-app .reports-filter-block{flex:1 1 180px}
}
@media(max-width:760px){
  .warehouse-app{font-size:13.5px}.warehouse-app .erp-container{width:100%}.warehouse-app .erp-header{min-height:auto;border-radius:20px;padding:16px}
  .warehouse-app .nav-tabs{top:4px;border-radius:14px;margin-bottom:14px}.warehouse-app .tab-btn{min-height:40px;padding:8px 12px;font-size:12px}
  .warehouse-app .barcode-scanner-bar{padding:13px 14px}.warehouse-app .scanner-input-group{min-width:100%}
  .warehouse-app .erp-toolbar{padding:11px}.warehouse-app .toolbar-panel{flex-basis:100%;padding:11px}
  .warehouse-app .table-section-header{padding:12px 13px;min-height:60px}
  .warehouse-app table.responsive-data-table tbody tr{margin-bottom:10px;border:1px solid var(--erp-border);border-radius:14px;background:var(--erp-surface);box-shadow:var(--erp-shadow-1);overflow:hidden}
  .warehouse-app table.responsive-data-table tbody td{min-height:42px;font-size:12px}
  .warehouse-app .settings-card{padding:14px}
}
@media(max-width:430px){
  .warehouse-app .erp-header h1{font-size:20px}.warehouse-app .brand-subtitle{font-size:11.5px}
  .warehouse-app .btn{min-height:42px}.warehouse-app input:not([type="checkbox"]):not([type="radio"]),.warehouse-app select{min-height:44px}
}
