/**
 * WorldExportSmart - Unified B2B Design System
 * Enterprise-grade styles for Admin, Supplier, Buyer, and Public Marketplace
 */

:root {
    /* Brand & Primary Hierarchy */
    --brand-950: #070d18;
    --brand-900: #0b1329;
    --brand-850: #101a36;
    --brand-800: #172554;
    --brand-700: #1d4ed8;
    --brand-600: #2563eb;
    --brand-500: #3b82f6;
    --brand-400: #60a5fa;
    --brand-200: #bfdbfe;
    --brand-100: #dbeafe;
    --brand-50:  #eff6ff;

    /* High-Intent Accent Red */
    --accent-700: #991b1b;
    --accent-600: #b91c1c;
    --accent-500: #dc2626;
    --accent-400: #ef4444;
    --accent-100: #fee2e2;
    --accent-50:  #fef2f2;

    /* Slate Neutral Spectrum */
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50:  #f8fafc;
    --surface:   #ffffff;

    /* Semantics */
    --emerald-700: #047857;
    --emerald-600: #059669;
    --emerald-500: #10b981;
    --emerald-100: #d1fae5;
    --emerald-50:  #ecfdf5;

    --amber-700: #b45309;
    --amber-600: #d97706;
    --amber-500: #f59e0b;
    --amber-100: #fef3c7;
    --amber-50:  #fffbeb;

    --purple-600: #7c3aed;
    --purple-500: #8b5cf6;
    --purple-100: #ede9fe;
    --purple-50:  #f5f3ff;

    /* Elevation Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-card-hover: 0 12px 24px -4px rgba(15, 23, 42, 0.09), 0 4px 6px -2px rgba(15, 23, 42, 0.03);

    /* Radii */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transition */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================================
   SVG ICON HELPER SYSTEM
   ========================================================= */
.wes-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    line-height: 1;
}
.wes-icon-sm { width: 14px; height: 14px; }
.wes-icon-md { width: 18px; height: 18px; }
.wes-icon-lg { width: 22px; height: 22px; }
.wes-icon-xl { width: 28px; height: 28px; }

/* Status Badges */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
    white-space: nowrap;
}
.status::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.status.active,
.status.approved,
.status.accepted,
.status.verified,
.status.replied {
    background: var(--emerald-50);
    color: var(--emerald-700);
    border: 1px solid var(--emerald-100);
}
.status.pending,
.status.waiting,
.status.under_review {
    background: var(--amber-50);
    color: var(--amber-700);
    border: 1px solid var(--amber-100);
}
.status.inactive,
.status.suspended,
.status.rejected,
.status.cancelled,
.status.expired {
    background: var(--accent-50);
    color: var(--accent-700);
    border: 1px solid var(--accent-100);
}
.status.buyer {
    background: var(--brand-50);
    color: var(--brand-700);
    border: 1px solid var(--brand-100);
}
.status.supplier {
    background: var(--purple-50);
    color: var(--purple-600);
    border: 1px solid var(--purple-100);
}
.status.admin {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* =========================================================
   STANDARDIZED BUTTON HIERARCHY
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
}
.btn:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}
.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--brand-600);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover {
    background: var(--brand-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-accent {
    background: var(--accent-500);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
}
.btn-accent:hover {
    background: var(--accent-600);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-outline {
    background: #ffffff;
    border-color: var(--slate-300);
    color: var(--slate-700);
}
.btn-outline:hover {
    background: var(--slate-50);
    border-color: var(--slate-400);
    color: var(--slate-900);
}

.btn-ghost {
    background: transparent;
    color: var(--slate-600);
}
.btn-ghost:hover {
    background: var(--slate-100);
    color: var(--slate-900);
}

.btn-success {
    background: var(--emerald-600);
    color: #ffffff;
}
.btn-success:hover {
    background: var(--emerald-700);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--accent-500);
    color: #ffffff;
}
.btn-danger:hover {
    background: var(--accent-600);
}

.btn-warning {
    background: var(--amber-500);
    color: #ffffff;
}
.btn-warning:hover {
    background: var(--amber-600);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}
.btn-lg {
    padding: 0.75rem 1.6rem;
    font-size: 0.95rem;
    border-radius: var(--radius-lg);
}

.btn-icon-only {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   STANDARDIZED DATA TABLES
   ========================================================= */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
}
table.data-table,
.table-wrap table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
    text-align: left;
}
.table-wrap th {
    background: var(--slate-50);
    color: var(--slate-600);
    font-weight: 700;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--slate-200);
    white-space: nowrap;
}
.table-wrap td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--slate-100);
    color: var(--slate-700);
    vertical-align: middle;
}
.table-wrap tbody tr:last-child td {
    border-bottom: none;
}
.table-wrap tbody tr {
    transition: background-color var(--transition-fast);
}
.table-wrap tbody tr:hover td {
    background-color: #f8fafc;
}

/* =========================================================
   FORM INPUTS
   ========================================================= */
.form-group {
    margin-bottom: 1.2rem;
}
.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--slate-800);
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}
.form-control,
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.65rem 0.95rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--slate-900);
    background: #ffffff;
    border: 1.5px solid var(--slate-300);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
}
.form-control:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--brand-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-control::placeholder {
    color: var(--slate-400);
}

/* =========================================================
   EMPTY STATE & ERROR BOX
   ========================================================= */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--slate-500);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.empty-state-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--slate-100);
    color: var(--slate-400);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
}
.empty-state-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--slate-800);
    margin-bottom: 0.3rem;
}
.empty-state-desc {
    font-size: 0.85rem;
    color: var(--slate-500);
    max-width: 360px;
    line-height: 1.45;
}

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1.2rem;
    margin-top: 0.8rem;
    border-top: 1px solid var(--slate-200);
}
.pagination {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.pagination button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--slate-300);
    background: #ffffff;
    color: var(--slate-700);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.pagination button:hover:not(:disabled) {
    background: var(--slate-50);
    border-color: var(--slate-400);
    color: var(--brand-600);
}
.pagination button.active {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}
.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.pagination .dots {
    padding: 0 0.4rem;
    color: var(--slate-400);
    font-size: 0.9rem;
}
.pagination-info {
    font-size: 0.82rem;
    color: var(--slate-500);
}
.pagination-info strong {
    color: var(--slate-800);
}
