/* ============================================================
   Smart Inventory — Supplier Portal & 3-Way Match Reskin (v32)
   Refonte UX/UI : cards modernes, hover, gradients, micro-anims.
   ============================================================ */

/* ---------- LANG PICKER (top right of supplier portal) ---------- */
.sp-lang-picker {
    position: relative;
    display: inline-block;
    font-family: inherit;
    z-index: 30;
}
.sp-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all .18s ease;
}
.sp-lang-btn:hover {
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.15);
}
.sp-lang-flag { font-size: 18px; line-height: 1; }
.sp-lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: sp-fade-down .18s ease-out;
}
[dir="rtl"] .sp-lang-menu { right: auto; left: 0; }
.sp-lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    color: #1e293b;
    text-align: left;
    transition: background .12s;
}
[dir="rtl"] .sp-lang-item { text-align: right; }
.sp-lang-item:hover { background: rgba(59, 130, 246, 0.08); }
.sp-lang-item.is-active { background: rgba(16, 185, 129, 0.08); color: #047857; }
@keyframes sp-fade-down { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- SUPPLIER PORTAL — refonte des priority cards ---------- */
.scc-portal { padding: 8px 0 24px; }
.scc-portal-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #0c4a6e 60%, #075985 100%);
    color: #fff;
    border-radius: 18px;
    padding: 28px 32px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 14px 40px rgba(12, 74, 110, 0.22);
}
.scc-portal-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 90% 10%, rgba(56,189,248,0.18), transparent 40%),
        radial-gradient(circle at 10% 90%, rgba(124,58,237,0.16), transparent 50%);
    pointer-events: none;
}
.scc-portal-eyebrow {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 8px;
    position: relative; z-index: 1;
}
.scc-portal-eyebrow i { margin-right: 8px; color: #67e8f9; }
[dir="rtl"] .scc-portal-eyebrow i { margin-right: 0; margin-left: 8px; }
.scc-portal-hero h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.015em;
    position: relative; z-index: 1;
}

/* KPI grid */
.scc-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.scc-kpi {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    padding: 16px 18px;
    transition: all .2s ease;
    position: relative;
    overflow: hidden;
}
.scc-kpi:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
    border-color: var(--kpi-color, #3b82f6);
}
.scc-kpi::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--kpi-color, #3b82f6);
}
[dir="rtl"] .scc-kpi::before { left: auto; right: 0; }
.scc-kpi-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--kpi-bg, rgba(59,130,246,0.08));
    color: var(--kpi-color, #3b82f6);
    display: grid;
    place-items: center;
    font-size: 16px;
    margin-bottom: 8px;
}
.scc-kpi-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.scc-kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

/* Priority orders section */
.scc-priority-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 14px;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}
.scc-priority-section h3 i { color: #ef4444; }

.scc-portal-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---- Portal Order Card (refonte) ---- */
.scc-portal-card {
    display: grid;
    grid-template-columns: 1.4fr 1.2fr auto;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-left: 4px solid var(--prio-color, #94a3b8);
    border-radius: 14px;
    padding: 16px 20px;
    transition: all .2s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.scc-portal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.10);
    border-left-color: var(--prio-color, #3b82f6);
}
[dir="rtl"] .scc-portal-card {
    grid-template-columns: auto 1.2fr 1.4fr;
    border-left: 1px solid rgba(15, 23, 42, 0.06);
    border-right: 4px solid var(--prio-color, #94a3b8);
}
.scc-portal-card.scc-row-high     { --prio-color: #ef4444; }
.scc-portal-card.scc-row-elevated { --prio-color: #f59e0b; }
.scc-portal-card.scc-row-normal   { --prio-color: #3b82f6; }
.scc-portal-card.scc-row-low      { --prio-color: #94a3b8; }

.scc-portal-card-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.scc-prio-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--prio-color, #94a3b8);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}
.scc-portal-card-l > div:last-child { min-width: 0; flex: 1; }
.scc-portal-card-l strong {
    display: block;
    font-size: 15.5px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.005em;
    margin-bottom: 2px;
}

.scc-portal-card-m {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    min-width: 0;
}
.scc-portal-card-m .badge { font-size: 11.5px; padding: 3px 10px; border-radius: 8px; }
.scc-time-high     { color: #dc2626; font-weight: 600; font-size: 12.5px; }
.scc-time-elevated { color: #d97706; font-weight: 600; font-size: 12.5px; }
.scc-time-normal   { color: #0369a1; font-weight: 500; font-size: 12.5px; }
.scc-time-low      { color: #64748b; font-weight: 500; font-size: 12.5px; }

.scc-portal-card-r {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.scc-portal-card-r .btn {
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 9px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
}
.scc-portal-card-r .btn-blue {
    background: rgba(59, 130, 246, 0.10);
    color: #1d4ed8;
}
.scc-portal-card-r .btn-blue:hover {
    background: #1d4ed8;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.30);
}
.scc-portal-card-r .btn-primary {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #fff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.20);
}
.scc-portal-card-r .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(59, 130, 246, 0.35);
}

@media (max-width: 720px) {
    .scc-portal-card { grid-template-columns: 1fr; align-items: stretch; }
    .scc-portal-card-r { justify-content: flex-end; flex-wrap: wrap; }
}

/* ============================================================
   3-WAY MATCH dashboard reskin
   ============================================================ */
.three-way-match-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 0;
}

/* Header */
.tw3-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #ede9fe, #dbeafe);
    border-radius: 18px;
    padding: 22px 28px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
}
.tw3-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 90% 10%, rgba(124,58,237,0.10), transparent 50%);
    pointer-events: none;
}
.tw3-hero-icon {
    width: 54px; height: 54px;
    border-radius: 14px;
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 22px;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.30);
    flex-shrink: 0;
}
.tw3-hero-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.tw3-hero h2 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1e1b4b;
}
.tw3-hero p {
    margin: 0;
    font-size: 13.5px;
    color: #475569;
}
.tw3-hero-actions {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 1;
}

/* Stats grid */
.tw3-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.tw3-stat {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
    transition: all .2s ease;
}
.tw3-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
.tw3-stat::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--stat-color, #3b82f6);
}
.tw3-stat-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--stat-color, #0f172a);
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.tw3-stat-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Filter pills */
.tw3-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    align-items: center;
}
.tw3-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-right: 6px;
}
.tw3-filter-pill {
    padding: 7px 14px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tw3-filter-pill:hover { border-color: #3b82f6; color: #3b82f6; }
.tw3-filter-pill.is-active {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

/* Result table card */
.tw3-table-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.tw3-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.tw3-table thead tr {
    background: #f8fafc;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.tw3-table th {
    padding: 12px 14px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
[dir="rtl"] .tw3-table th { text-align: right; }
.tw3-table tbody tr {
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
    transition: background .12s;
}
.tw3-table tbody tr:hover { background: #f8fafc; }
.tw3-table td { padding: 12px 14px; vertical-align: middle; }
.tw3-table .num { font-variant-numeric: tabular-nums; text-align: right; }

/* Score circle */
.tw3-score-circle {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 800;
    font-size: 14px;
    background: conic-gradient(var(--score-color, #10b981) calc(var(--score-pct, 0) * 1%), #e2e8f0 0);
    margin: 0 auto;
}
.tw3-score-circle::before {
    content: "";
    position: absolute;
    width: 38px; height: 38px;
    background: #fff;
    border-radius: 50%;
    z-index: 0;
}
.tw3-score-circle span {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 38px; height: 38px;
    background: #fff;
    border-radius: 50%;
    font-size: 13.5px;
    color: #0f172a;
}

/* Status badges */
.tw3-band {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.tw3-band-match    { background: rgba(16,185,129,0.12); color: #047857; }
.tw3-band-warning  { background: rgba(245,158,11,0.12); color: #b45309; }
.tw3-band-mismatch { background: rgba(239,68,68,0.12);  color: #b91c1c; }
.tw3-band-no_po    { background: rgba(148,163,184,0.18); color: #475569; }
.tw3-band-no_bl    { background: rgba(167,139,250,0.18); color: #6d28d9; }

/* Action buttons in table */
.tw3-row-actions {
    display: inline-flex;
    gap: 6px;
}
.tw3-row-actions button {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    color: #475569;
    transition: all .15s;
}
.tw3-row-actions button:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
}
.tw3-row-actions .is-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border-color: transparent;
}
.tw3-row-actions .is-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.30);
    color: #fff;
}

/* Generic primary button (used in hero) */
.tw3-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    color: #fff;
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.25);
}
.tw3-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.35);
}

/* ---------- RTL adjustments ---------- */
[dir="rtl"] .scc-portal-card-l { flex-direction: row-reverse; }
[dir="rtl"] .scc-kpi-icon { margin-left: 0; }
[dir="rtl"] .tw3-stat::before { left: auto; right: 0; }
[dir="rtl"] .tw3-row-actions { flex-direction: row-reverse; }
