/**
 * Vendor dashboard: sidebar, status cards, stats and product table.
 *
 * Part of the vendor.css set - enqueued in order.
 * Order matters: later parts override earlier ones.
 */

/* ============================================
   SIDEBAR
   ============================================ */

.vendor-sidebar-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
}

.vendor-sidebar-card h3 {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--color-secondary);
    margin: 0 0 var(--space-4) 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.vendor-sidebar-card h3 i {
    color: var(--color-primary);
}

.vendor-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vendor-sidebar-list li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
    color: var(--color-gray-600);
    border-bottom: 1px solid var(--color-gray-100);
}

.vendor-sidebar-list li:last-child {
    border-bottom: none;
}

.vendor-sidebar-list li i {
    color: var(--color-success);
    font-size: 16px;
    flex-shrink: 0;
}

.vendor-sidebar-card p {
    font-size: var(--text-sm);
    color: var(--color-gray-600);
    line-height: var(--leading-relaxed);
    margin: 0 0 var(--space-2) 0;
}

.vendor-sidebar-card p i {
    color: var(--color-primary);
    margin-right: var(--space-1);
}

/* ============================================
   VENDOR DASHBOARD PAGE
   ============================================ */

.vendor-dashboard-page {
    padding: var(--space-8) 0 var(--space-16);
    min-height: 60vh;
    background: var(--bg-secondary);
}

.vendor-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-color);
}

.vendor-dashboard-header h1 {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--color-secondary);
    margin: 0;
}

.vendor-dashboard-header p {
    font-size: var(--text-base);
    color: var(--color-gray-600);
    margin: var(--space-1) 0 0 0;
}

.vendor-company-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: rgba(0, 153, 204, 0.1);
    color: var(--color-primary);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    border-radius: var(--border-radius-full);
    margin-left: var(--space-2);
}

/* ============================================
   STATUS CARDS
   ============================================ */

.vendor-status-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--space-12) var(--space-8);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}

.vendor-status-icon {
    font-size: 56px;
    margin-bottom: var(--space-4);
}

.vendor-status-pending .vendor-status-icon {
    color: #856404;
}

.vendor-status-rejected .vendor-status-icon {
    color: var(--color-danger);
}

.vendor-status-card h2 {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-secondary);
    margin: 0 0 var(--space-3) 0;
}

.vendor-status-card p {
    font-size: var(--text-base);
    color: var(--color-gray-600);
    line-height: var(--leading-relaxed);
    margin: 0 0 var(--space-4) 0;
}

.vendor-status-help {
    font-size: var(--text-sm) !important;
    color: var(--color-gray-500) !important;
    margin-top: var(--space-6) !important;
}

/* Progress Bar */
.vendor-progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: var(--space-8) 0;
}

.vendor-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.vendor-progress-dot {
    width: 20px;
    height: 20px;
    border-radius: var(--border-radius-full);
    background: var(--color-gray-200);
    border: 3px solid var(--color-gray-300);
    transition: all var(--transition-base);
}

.vendor-progress-step.completed .vendor-progress-dot {
    background: var(--color-success);
    border-color: var(--color-success);
}

.vendor-progress-step.active .vendor-progress-dot {
    background: var(--color-warning);
    border-color: #e0a800;
    animation: pulse 2s infinite;
}

.vendor-progress-step span {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.vendor-progress-step.completed span {
    color: var(--color-success);
}

.vendor-progress-step.active span {
    color: #856404;
}

.vendor-progress-line {
    width: 80px;
    height: 3px;
    background: var(--color-gray-200);
    margin-bottom: 24px;
}

.vendor-progress-line.half {
    background: linear-gradient(90deg, var(--color-success) 50%, var(--color-gray-200) 50%);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255, 193, 7, 0); }
}

/* ============================================
   VENDOR STATS ROW
   ============================================ */

.vendor-stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.vendor-stat-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--space-5) var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    box-shadow: var(--shadow-sm);
}

.vendor-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(0, 153, 204, 0.1);
    border-radius: var(--border-radius-md);
    font-size: 22px;
    color: var(--color-primary);
}

.vendor-stat-info {
    display: flex;
    flex-direction: column;
}

.vendor-stat-number {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-secondary);
    line-height: 1;
}

.vendor-stat-number.status-approved {
    color: var(--color-success);
    font-size: var(--text-lg);
}

.vendor-stat-label {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    margin-top: 2px;
}

/* ============================================
   DASHBOARD SECTIONS
   ============================================ */

.vendor-dashboard-section {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.vendor-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-color);
}

.vendor-section-header h2 {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.vendor-section-header h2 i {
    color: var(--color-primary);
}

/* ============================================
   SECTION HEADER ACTIONS
   ============================================ */

.vendor-section-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ============================================
   PRODUCT LIST FILTERS
   ============================================ */

.vendor-products-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--color-gray-50, #f8fafc);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.vendor-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vendor-filter-group label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.vendor-filter-group input,
.vendor-filter-group select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    background: #fff;
    color: var(--color-secondary);
}

.vendor-filter-group--search {
    flex: 1 1 220px;
}

.vendor-filter-group--search input {
    width: 100%;
}

.vendor-filter-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* A filter matching nothing is not an empty account — see vendor-dashboard.js. */
.vendor-products-empty-filtered {
    text-align: center;
    color: var(--color-gray-500);
    padding: var(--space-8) var(--space-4);
    margin: 0;
}

/* ============================================
   PRODUCT LIST PAGINATION
   ============================================ */

.vendor-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.vendor-pagination-info {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
}

.vendor-pagination-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.vendor-pagination-current {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-secondary);
}

/* ============================================
   VENDOR PRODUCTS TABLE
   ============================================ */

.vendor-products-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.vendor-products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.vendor-products-table thead th {
    text-align: left;
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-2) var(--space-3);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.vendor-products-table tbody tr {
    border-bottom: 1px solid var(--color-gray-100);
    transition: background var(--transition-fast);
}

.vendor-products-table tbody tr:last-child {
    border-bottom: none;
}

.vendor-products-table tbody tr:hover {
    background: var(--bg-secondary);
}

.vendor-products-table td {
    padding: var(--space-3);
    vertical-align: middle;
}

.table-product-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background: var(--color-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.table-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.table-placeholder-icon {
    font-size: 20px;
    color: var(--color-gray-300);
}

.table-product-name {
    font-weight: var(--font-semibold);
    color: var(--color-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* What a carga groups. Its pallets are not listed as rows of their own. */
.table-product-sub {
    display: block;
    color: var(--color-gray-500);
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
}

/* Where this manifest came from, under the Yes/No badge. */
.table-manifest-source {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 3px;
    color: var(--color-gray-500);
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
}

.table-manifest-file {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vendor-products-table .col-thumb {
    width: 56px;
}

.vendor-products-table .col-price {
    font-weight: var(--font-semibold);
    color: var(--color-primary);
    white-space: nowrap;
}


.vendor-products-table .col-date{
    white-space: nowrap;
    color: var(--color-gray-600);
}

/* Four controls live here (ver, re-subir, fotos, marcar vendido), so the old
   70px never fit them. Pinned to the right edge as well: the table is wider than
   the panel on narrow screens, and the actions were only reachable by scrolling
   sideways — the one column that always has to be in reach. */
.vendor-products-table .col-actions {
    position: sticky;
    right: 0;
    z-index: 1;
    width: 1%;
    white-space: nowrap;
    text-align: right;
    background: var(--color-white);
    box-shadow: -6px 0 6px -6px rgba(0, 0, 0, 0.18);
}

.vendor-products-table tbody tr:hover .col-actions {
    background: var(--bg-secondary);
}

.vendor-products-table thead .col-actions {
    background: var(--color-white);
}

.table-actions {
    display: flex;
    gap: var(--space-1);
    align-items: center;
    justify-content: flex-end;
}

/* Table status badges */
.table-status-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    border-radius: var(--border-radius-full);
    white-space: nowrap;
}

.table-status-badge.status-pending {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
}

.text-muted {
    color: var(--color-gray-400);
}

/* Button xs size */
.btn-xs {
    padding: 4px 12px;
    font-size: var(--text-xs);
}

/* Icon-only action: square, so four of them read as one control group instead
   of four differently-sized pills. The label lives in the title attribute. */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 1;
}

.btn-icon i {
    font-size: 14px;
}

/* `.btn` has no disabled state anywhere in the theme, so without this a blocked
   action looks exactly like an available one. Scoped to the icon buttons rather
   than added to `.btn` globally, which would restyle every button on the site. */
.btn-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: auto;   /* keep the tooltip reachable while blocked */
}

.btn-icon:disabled:hover {
    background: inherit;
    border-color: inherit;
}

