.m-val {
    font-family: var(--mono);
    background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chart-section {
    background: var(--white); border-radius: var(--radius-md, 16px); border: 1px solid var(--g200);
    padding: 24px; margin-bottom: 24px;
    animation: fu .5s var(--ease) .3s both;
    position: relative; overflow: hidden;
    transition: box-shadow .4s var(--ease), border-color .4s;
}
.chart-section::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--navy-400), var(--red-400), var(--navy-300));
    background-size: 200% 100%; animation: lf 4s linear infinite;
    opacity: .6;
}
.chart-section:hover {
    box-shadow: var(--shadow-md, 0 4px 16px rgba(0,0,0,.05));
    border-color: var(--navy-100);
}
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.chart-title-text { font-size: 1rem; font-weight: 700; color: var(--navy-800); }
.chart-legend { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--g400); }
.chart-legend-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--navy-400);
    box-shadow: 0 0 0 3px rgba(42,109,168,.15);
    animation: legendPulse 2.5s ease-in-out infinite;
}
@keyframes legendPulse { 0%,100%{box-shadow:0 0 0 3px rgba(42,109,168,.15)}50%{box-shadow:0 0 0 6px rgba(42,109,168,.08)} }
.chart-wrap { position: relative; height: 220px; }

/* ─── FILTERS BAR ─────────────────────────────────── */
.filters-section {
    background: var(--white); border-radius: var(--radius-md, 16px); border: 1px solid var(--g200);
    padding: 20px; margin-bottom: 24px;
    animation: fu .5s var(--ease) .35s both;
    transition: box-shadow .4s var(--ease), border-color .4s;
}
.filters-section:hover {
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,.04));
}
.filters-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.filters-title { font-size: .95rem; font-weight: 700; color: var(--navy-800); }
.filters-actions { display: flex; gap: 8px; align-items: center; }

.btn-refresh {
    width: 36px; height: 36px; border-radius: var(--radius-sm, 10px); display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--g200); color: var(--g500); transition: all .3s var(--ease);
}
.btn-refresh:hover { background: var(--navy-50); color: var(--navy-500); border-color: var(--navy-200); transform: rotate(45deg); }
.btn-refresh svg { width: 16px; height: 16px; transition: transform .6s var(--ease); }
.btn-refresh.spinning svg { transform: rotate(360deg); }

.btn-filter-clear {
    padding: 8px 14px; border-radius: var(--radius-sm, 10px); font-size: .78rem; font-weight: 600;
    color: var(--g500); border: 1px solid var(--g200); transition: all .25s var(--ease);
}
.btn-filter-clear:hover { background: #fef2f2; color: var(--red-500); border-color: rgba(239,68,68,.2); transform: translateY(-1px); }

.filters-grid {
    display: grid; grid-template-columns: 1fr; gap: 10px;
}
.filter-input-wrap {
    position: relative; display: flex; align-items: center;
    background: var(--g50); border: 1px solid var(--g200); border-radius: var(--radius-sm, 10px);
    transition: all .3s var(--ease);
}
.filter-input-wrap:focus-within { border-color: var(--navy-400); background: var(--white); box-shadow: 0 0 0 3px rgba(42,109,168,.06), 0 4px 12px rgba(42,109,168,.04); transform: translateY(-1px); }
.filter-input-wrap svg { width: 16px; height: 16px; color: var(--g400); margin-left: 12px; flex-shrink: 0; transition: color .3s; }
.filter-input-wrap:focus-within svg { color: var(--navy-400); }
.filter-input, .filter-select {
    width: 100%; padding: 10px 12px; font-size: .85rem; font-weight: 500;
    color: var(--g700); background: transparent; border: none; outline: none; font-family: var(--font);
}
.filter-select { cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 32px; }
.filter-input-wrap.select-wrap::after {
    content: ''; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--g400);
    pointer-events: none; transition: border-top-color .3s;
}
.filter-input-wrap.select-wrap:focus-within::after { border-top-color: var(--navy-400); }
.filter-input::placeholder { color: var(--g400); font-weight: 400; }

/* ─── SHIPMENTS TABLE ─────────────────────────────── */
.table-section {
    background: var(--white); border-radius: var(--radius-md, 16px); border: 1px solid var(--g200);
    overflow: hidden; animation: fu .5s var(--ease) .4s both;
    transition: box-shadow .4s var(--ease), border-color .4s;
}
.table-section:hover {
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,.04));
}
.table-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--g100); }
.table-header h3 { font-size: 1rem; font-weight: 700; color: var(--navy-800); }
.table-count { font-size: .82rem; color: var(--g400); font-weight: 500; }

.table-wrap { overflow-x: auto; }
.table-wrap::-webkit-scrollbar { height: 4px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--g300); border-radius: 10px; }

.ship-table { width: 100%; border-collapse: collapse; }
.ship-table th {
    padding: 12px 16px; text-align: left; font-size: .72rem; font-weight: 700;
    color: var(--g500); text-transform: uppercase; letter-spacing: .08em;
    background: linear-gradient(180deg, var(--g50), rgba(241,245,249,.6));
    border-bottom: 1px solid var(--g200); white-space: nowrap;
    position: sticky; top: 0; z-index: 1;
}
.ship-table td {
    padding: 14px 16px; font-size: .85rem; color: var(--g700); border-bottom: 1px solid var(--g100);
    white-space: nowrap; transition: background .15s;
}
.ship-table tbody tr { transition: all .2s var(--ease); }
.ship-table tbody tr:hover { background: linear-gradient(90deg, rgba(234,243,251,.3), var(--g50)); }
.ship-table tbody tr:hover td { color: var(--navy-800); }
.ship-table tbody tr:last-child td { border-bottom: none; }

.guia-number {
    font-family: var(--mono); font-weight: 700; font-size: .82rem; color: var(--navy-600);
    padding: 3px 8px; background: var(--navy-50); border-radius: 6px;
    display: inline-block; transition: all .2s;
}
.ship-table tbody tr:hover .guia-number { background: var(--navy-100); color: var(--navy-700); }

/* Status Badges */
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: 20px; font-size: .72rem; font-weight: 700;
    transition: all .2s var(--ease);
}
.ship-table tbody tr:hover .status-badge { transform: scale(1.03); }
.st-created   { background: #f0f9ff; color: #0369a1; }
.st-picked    { background: #fefce8; color: #a16207; }
.st-transit   { background: #fff7ed; color: #c2410c; }
.st-route     { background: #faf5ff; color: #7c3aed; }
.st-delivered { background: #ecfdf5; color: #059669; }
.st-incident  { background: #fef2f2; color: #dc2626; }
.st-cancelled { background: #f8fafc; color: #64748b; }

.st-transit::before, .st-route::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    animation: bk 1.2s ease-in-out infinite;
}
.st-transit::before { background: #f97316; }
.st-route::before   { background: #8b5cf6; }
.st-incident::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%; background: #ef4444;
    animation: bk .8s ease-in-out infinite;
}

/* Clickable badge for local guides */
.status-clickable {
    cursor: pointer; user-select: none;
}
.status-clickable:hover {
    filter: brightness(0.92); box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.status-badge-wrap { position: relative; display: inline-block; }

/* Manual Status Dropdown */
.status-dropdown {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.15), 0 2px 8px rgba(0,0,0,.08);
    min-width: 200px; padding: 6px; overflow: hidden;
    animation: dropIn .15s ease-out;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.status-dropdown-item {
    padding: 10px 14px; border-radius: 8px; font-size: .85rem; font-weight: 600;
    cursor: pointer; transition: all .15s; color: #334155;
}
.status-dropdown-item:hover {
    background: #f1f5f9; transform: translateX(4px);
}

/* Service Badges */
.service-badge {
    display: inline-block; padding: 3px 8px; border-radius: 6px;
    font-size: .72rem; font-weight: 700; transition: all .2s;
}
.sv-local { background: var(--navy-50); color: var(--navy-500); }
.sv-dhl   { background: #fef9c3; color: #a16207; }
.sv-paq   { background: #fce7f3; color: #be185d; }
.sv-1kg   { background: #fef3c7; color: #92400e; position: relative; }
.sv-1kg::after { content: '⚡'; margin-left: 3px; font-size: .65rem; }

/* Table action btn */
.btn-table-action {
    width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    color: var(--g400); transition: all .25s var(--ease);
}
.btn-table-action:hover { background: var(--navy-50); color: var(--navy-500); transform: scale(1.1); }
.btn-table-action svg { width: 16px; height: 16px; }
.td-actions { text-align: center; }

/* ─── PAGINATION ──────────────────────────────────── */
.pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-top: 1px solid var(--g100);
    background: linear-gradient(180deg, transparent, rgba(248,250,252,.5));
}
.page-info { font-size: .82rem; color: var(--g400); font-weight: 500; }
.page-btns { display: flex; gap: 6px; }
.page-btn {
    width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--g200); color: var(--g500); font-size: .82rem; font-weight: 600;
    transition: all .25s var(--ease);
}
.page-btn:hover:not(:disabled) { background: var(--navy-50); color: var(--navy-500); border-color: var(--navy-200); transform: translateY(-1px); box-shadow: var(--shadow-xs, 0 1px 2px rgba(0,0,0,.04)); }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
.page-btn svg { width: 14px; height: 14px; }

/* ─── EMPTY STATE ─────────────────────────────────── */
.table-empty {
    display: flex; flex-direction: column; align-items: center; padding: 48px 24px; text-align: center;
}
.te-icon { font-size: 3rem; opacity: .4; margin-bottom: 8px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)} }
.te-title { font-weight: 700; color: var(--g500); margin-bottom: 4px; }
.te-desc { color: var(--g400); font-size: .85rem; }

/* ─── CLIENT WELCOME CARD ─────────────────────────── */
.client-welcome {
    background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
    border-radius: var(--radius-md, 16px); padding: 28px; color: white; margin-bottom: 24px;
    position: relative; overflow: hidden;
    animation: fu .5s var(--ease) .15s both;
    transition: transform .4s var(--ease), box-shadow .4s;
}
.client-welcome:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 50px rgba(5,13,24,.3);
}
.client-welcome::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--navy-400), var(--red-400), var(--navy-300));
    background-size: 200% 100%; animation: lf 3s linear infinite;
}
.client-welcome::after {
    content: ''; position: absolute; top: -50%; right: -20%; width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(211,47,47,.12), transparent 70%);
    border-radius: 50%;
    transition: transform .6s var(--ease);
}
.client-welcome:hover::after { transform: scale(1.1) translate(-5%, 5%); }
.cw-greeting { font-size: 1.1rem; font-weight: 600; opacity: .8; }
.cw-name { font-size: 1.6rem; font-weight: 800; margin: 4px 0 8px; position: relative; z-index: 1; }
.cw-detail { font-size: .85rem; opacity: .6; position: relative; z-index: 1; }
.cw-detail span { font-weight: 700; opacity: 1; color: var(--navy-200); }

/* ─── RESPONSIVE ──────────────────────────────────── */
@media (min-width: 480px) {
    .filters-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
    .filters-grid { grid-template-columns: 2fr 1fr 1fr; }
    .chart-wrap { height: 260px; }
}
@media (min-width: 1024px) {
    .filters-grid { grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; }
}