/* --- GridView Modern Styles --- */

:root {
    --gv-primary: #01468b;
    /* Vibrant Indigo */
    --gv-primary-hover: #2473c3;
    --gv-success: #10b981;
    --gv-success-bg: #ecfdf5;
    --gv-ready: #6366f1;
    --gv-ready-bg: #eef2ff;
    --gv-text-main: #1e293b;
    --gv-text-muted: #64748b;
    --gv-border: #f1f5f9;
}

/* Table Card Container */
.table-card {
    flex: 1 1 0 !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0 !important;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--gv-border);
    overflow: hidden;
}

.table-scroll {
    flex: 1 1 0 !important;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0 !important;
}

/* Ensure headers and filter bars don't shrink */
.gv-page-header, .filter-bar {
    flex: 0 0 auto !important;
}

/* Table Design */
.table {
    margin-bottom: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead {
    background-color: #fafafa;
}

.table thead th {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gv-border);
    padding: 14px 20px;
    vertical-align: middle;
    white-space: nowrap;
}

.table tbody td {
    color: var(--gv-text-main);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 14px 20px;
    vertical-align: middle;
    border-bottom: 1px solid var(--gv-border);
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: #fcfcfc;
}

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

/* Order ID Link */
.order-id-link {
    color: var(--gv-primary) !important;
    font-weight: 700;
    text-decoration: none;
    font-size: 13px;
}

/* --- Avatar Styles --- */
.avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    color: #ffffff;
    flex-shrink: 0;
    text-transform: uppercase;
    background: var(--gv-primary);
}

/* Customer Column Layout */
.customer-col {
    display: flex;
    align-items: center;
    gap: 12px;
}

.customer-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 13px;
}

/* --- Status Badge Styles --- */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-confirmed,
.badge-paid,
.badge-available {
    background: var(--gv-success-bg);
    color: var(--gv-success);
}

.badge-confirmed::before,
.badge-paid::before,
.badge-available::before {
    background: var(--gv-success);
}

.badge-ready {
    background: var(--gv-ready-bg);
    color: var(--gv-ready);
}

.badge-ready::before {
    background: var(--gv-ready);
}

.badge-pending,
.badge-partial {
    background: #fff7ed;
    color: #ea580c;
}

.badge-pending::before,
.badge-partial::before {
    background: #ea580c;
}

.badge-late,
.badge-unpaid {
    background: #fef2f2;
    color: #dc2626;
}

.badge-late::before,
.badge-unpaid::before {
    background: #dc2626;
}

.badge-picked-up,
.badge-picked\ up {
    background: #ecfeff;
    color: #0891b2;
}

.badge-picked-up::before,
.badge-picked\ up::before {
    background: #0891b2;
}

/* --- Action Icons --- */
.action-btns {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-action {
    color: #cbd5e1;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    transition: color 0.15s;
    font-size: 1rem;
}

.btn-action:hover {
    color: #94a3b8;
}

/* --- Pagination Styles --- */
.table-pagination {
    flex: 0 0 auto !important;
    border-top: 1px solid var(--gv-border);
    background: #fff;
    padding: 12px 20px;
}

.pagination-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

.btn-pagination {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-pagination:hover:not(:disabled) {
    background: #f8fafc;
    color: var(--gv-text-main);
}

.btn-pagination.active {
    background: #f5f3ff;
    color: var(--gv-primary);
    border-color: var(--gv-primary);
}

/* --- Primary Button Modernization --- */
.btn-primary-ch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--gv-primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary-ch:hover {
    background-color: var(--gv-primary-hover);
}

/* --- Filter Bar Styles --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.gv-search-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: #f1f5f9;
    /* Light gray background */
    border-radius: 10px;
    padding: 2px 12px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.gv-search-wrap:focus-within {
    background: #ffffff;
    border-color: var(--gv-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.gv-search-icon {
    color: #94a3b8;
    font-size: 0.9rem;
}

.gv-search-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--gv-text-main);
    outline: none;
}

.gv-search-input::placeholder {
    color: #94a3b8;
}

.gv-filter-icon {
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
    margin-left: 8px;
}

.gv-filter-icon:hover {
    color: var(--gv-primary);
}

/* Custom Dropdown (Select) */
.gv-select {
    appearance: none;
    background-color: #f1f5f9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 32px 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 130px;
}

.gv-select:hover {
    background-color: #e2e8f0;
}

.gv-select:focus {
    background-color: #ffffff;
    border-color: var(--gv-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.gv-btn-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.gv-btn-clear:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

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

/* Page Header */
.gv-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.gv-header-icon {
    width: 42px;
    height: 42px;
    background: #f5f3ff;
    color: var(--gv-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.gv-header-title h1 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
}

.gv-header-title span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
}