/* Supplier Portal v9.4 - WordPress Admin Style (20% larger) */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #3b82f6;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #dbeafe;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 5px;
    --radius-lg: 7px;
    --sidebar-width: 190px;
    --topbar-height: 38px;
    --transition: all 0.15s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Top Bar */
.wp-admin-bar {
    background: var(--bg-secondary);
    height: var(--topbar-height);
    position: fixed;
    top: 0; left: var(--sidebar-width); right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-bottom: 1px solid var(--border);
}
.wp-admin-bar .logo {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 7px;
}
.wp-admin-bar .logo:hover { color: var(--accent); }
.wp-admin-bar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.wp-admin-bar-right span {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}
.wp-admin-bar-right a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    padding: 5px 10px;
    border-radius: var(--radius);
    transition: var(--transition);
}
.wp-admin-bar-right a:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* Sidebar */
.wp-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999;
    display: flex;
    flex-direction: column;
}
.wp-sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    min-height: 38px;
}
.sidebar-logo {
    font-size: 19px;
    flex-shrink: 0;
}
.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-toggle { display: none; }
.wp-sidebar-menu { list-style: none; padding: 10px 7px; flex: 1; }
.wp-sidebar-menu li { margin-bottom: 2px; }
.wp-sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    border-radius: var(--radius);
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
}
.wp-sidebar-menu li a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.wp-sidebar-menu li a.active {
    background: var(--accent);
    color: #fff;
}
.wp-sidebar-menu .menu-icon {
    width: 22px;
    text-align: center;
    font-size: 17px;
    opacity: 0.9;
    flex-shrink: 0;
}
.wp-sidebar-menu .menu-text {
    font-size: 14px;
}
.wp-sidebar-menu .menu-separator {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 10px 5px;
}

/* Main Content */
.wp-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 14px;
    min-height: calc(100vh - var(--topbar-height));
}

.wp-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.wp-page-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Boxes */
.wp-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}
.wp-box-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.wp-box-title { font-size: 14px; font-weight: 600; }
.wp-box-content { padding: 14px; }

/* Buttons */
.wp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 12px;
    height: 34px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    border: none;
    white-space: nowrap;
    transition: var(--transition);
}
.wp-button-primary {
    background: var(--accent);
    color: #fff;
}
.wp-button-primary:hover {
    background: var(--accent-hover);
}
.wp-button-secondary {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.wp-button-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
    color: var(--text-primary);
}
.wp-button-success {
    background: var(--success);
    color: #fff;
}
.wp-button-success:hover {
    background: #059669;
}
.wp-button-danger {
    background: var(--danger);
    color: #fff;
}
.wp-button-danger:hover {
    background: #dc2626;
}
.wp-button-small { height: 29px; padding: 0 10px; font-size: 12px; }

/* Forms */
.wp-form-row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; align-items: flex-end; }
.wp-form-group { display: flex; flex-direction: column; gap: 5px; }
.wp-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }

.wp-input, .wp-select {
    height: 34px;
    padding: 0 10px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    width: 100%;
    transition: var(--transition);
}
.wp-input:focus, .wp-select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 1px var(--accent-light);
}

/* Tables */
.wp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wp-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.wp-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.wp-table tbody tr:hover td { background: var(--bg-tertiary); }

/* Notices */
.wp-notice {
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.wp-notice-success { background: var(--success-light); color: #065f46; }
.wp-notice-warning { background: var(--warning-light); color: #92400e; }
.wp-notice-error { background: var(--danger-light); color: #991b1b; }

/* Stats */
.wp-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 14px; }
.wp-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}
.wp-stat-value { font-size: 26px; font-weight: 700; color: var(--text-primary); }
.wp-stat-value.positive { color: var(--success); }
.wp-stat-value.negative { color: var(--danger); }
.wp-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }

/* ORDER CARDS */
.wp-orders-list { display: flex; flex-direction: column; gap: 12px; }
.wp-order-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}
.wp-order-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--accent);
}
.wp-order-header {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}
.wp-order-checkbox {
    width: 19px;
    height: 19px;
    cursor: pointer;
    accent-color: var(--accent);
}
.wp-order-id {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}
.wp-order-id:hover { color: var(--accent-hover); }
.wp-order-meta { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.wp-order-date {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 10px;
    border-radius: 100px;
    border: 1px solid var(--border);
}
.wp-site-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Order Body */
.wp-order-body {
    display: grid;
    grid-template-columns: 240px 1fr 310px;
    gap: 14px;
    padding: 14px;
}
@media (max-width: 1200px) { .wp-order-body { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px) { .wp-order-body { grid-template-columns: 1fr; } }

.wp-order-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
}
.wp-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 5px;
}
.wp-customer-info { font-size: 13px; line-height: 1.5; }
.wp-customer-info p { margin-bottom: 2px; }
.wp-customer-info strong { color: var(--text-muted); font-weight: 500; font-size: 12px; }

/* Product Items */
.wp-product-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    margin-bottom: 7px;
    align-items: center;
    border-radius: var(--radius);
    transition: var(--transition);
}
.wp-product-item:hover {
    border-color: var(--accent);
}
.wp-product-image {
    width: 48px;
    height: 48px;
    object-fit: cover;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    flex-shrink: 0;
    border-radius: var(--radius);
}
.wp-product-details { flex: 1; min-width: 0; overflow: hidden; }
.wp-product-name {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}
.wp-product-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.wp-product-variant { font-size: 11px; color: var(--accent); margin-top: 2px; font-weight: 500; }
.wp-product-qty {
    background: var(--accent);
    color: #fff;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius);
}

/* Tracking Form */
.wp-tracking-form { display: flex; flex-direction: column; gap: 7px; }
.wp-tracking-row { display: flex; align-items: center; gap: 10px; }
.wp-tracking-row label {
    width: 84px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.wp-tracking-row select, .wp-tracking-row input[type="text"], .wp-tracking-row input[type="date"] {
    height: 31px;
    padding: 0 10px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex: 1;
    background: var(--bg-secondary);
    transition: var(--transition);
}
.wp-tracking-row select:focus, .wp-tracking-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-light);
    outline: none;
}
.wp-tracking-row .track-provider { max-width: 132px; }
.wp-tracking-row .track-number { min-width: 120px; }
.wp-tracking-row .track-date { max-width: 144px; }
.wp-tracking-actions {
    display: flex;
    gap: 7px;
    margin-top: 5px;
}
.wp-tracking-actions-main {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.wp-button-wide {
    width: 100%;
    height: 36px;
    font-size: 13px;
}
.wp-button-danger-outline {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    width: 100%;
}
.wp-button-danger-outline:hover {
    background: var(--danger-light);
}

/* Profit Row */
.wp-profit-row {
    display: flex;
    gap: 19px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.wp-profit-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.wp-profit-label {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}
.wp-profit-value { font-weight: 600; font-size: 13px; }
.wp-profit-value.positive { color: var(--success); }
.wp-profit-value.negative { color: var(--danger); }

/* Filter Bar */
.wp-filter-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* Badges */
.wp-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 100px;
}
.wp-badge-admin { background: var(--danger-light); color: var(--danger); }
.wp-badge-user { background: var(--accent-light); color: var(--accent); }

/* Pagination */
.wp-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.wp-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}
.wp-page-link:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    color: var(--accent);
}
.wp-page-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.wp-page-link.disabled { opacity: 0.4; pointer-events: none; }

.wp-customer-note {
    background: var(--warning-light);
    border: 1px solid var(--warning);
    padding: 7px 10px;
    margin-top: 10px;
    font-size: 12px;
    border-radius: var(--radius);
    color: #92400e;
}

code {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 11px;
    background: var(--bg-tertiary);
    padding: 1px 5px;
    border-radius: 4px;
    color: var(--accent);
    border: 1px solid var(--border);
}

.wp-admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .wp-admin-grid { grid-template-columns: 1fr; } }

.wp-changelog-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}
.wp-changelog-item:hover { background: var(--bg-tertiary); }
.wp-changelog-action { font-weight: 600; color: var(--accent); }
.wp-changelog-time { font-size: 11px; color: var(--text-muted); }

.wp-empty-state { text-align: center; padding: 48px 29px; color: var(--text-muted); }
.wp-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

.wp-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1e293b 100%);
}
.wp-login-box {
    width: 100%;
    max-width: 384px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 29px;
    box-shadow: var(--shadow-lg);
}
.wp-login-logo { text-align: center; margin-bottom: 24px; font-size: 24px; }

.wp-export-bar {
    background: var(--accent);
    color: white;
    padding: 10px 14px;
    margin-bottom: 12px;
    display: none;
    align-items: center;
    gap: 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
}
.wp-export-bar.show { display: flex; }

.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.loading-overlay.show { display: flex; }
.loading-spinner {
    background: var(--bg-secondary);
    padding: 19px 29px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 782px) {
    .wp-sidebar { width: 60px; }
    .wp-sidebar-header { justify-content: center; padding: 10px; }
    .sidebar-title { display: none; }
    .wp-sidebar-menu li a .menu-text { display: none; }
    .wp-sidebar-menu li a { justify-content: center; padding: 10px; }
    .wp-content { margin-left: 60px; }
    .wp-admin-bar { left: 60px; }
}

.wp-toast {
    position: fixed;
    bottom: 19px;
    right: 19px;
    background: var(--success);
    color: white;
    padding: 12px 19px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    z-index: 10000;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 7px;
}
.wp-toast.error { background: var(--danger); }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--bg-tertiary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Completed order tracking display */
.wp-tracking-info {
    padding: 7px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    margin-bottom: 7px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
}
.wp-tracking-info strong {
    color: var(--text-primary);
    font-weight: 600;
}
.wp-tracking-info a {
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
}
.wp-tracking-info a:hover {
    text-decoration: underline;
}
