/* ============================================
   Panel de Pedidos — Gas Las Naciones
   Estilo: Clean dashboard, colores no invasivos
   ============================================ */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8f9fa;
    color: #2d3436;
    font-size: 14px;
    line-height: 1.5;
}

/* ---- HEADER ---- */
.header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-left .logo { font-size: 1.5rem; }
.header-left h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3436;
}
.header-subtitle {
    font-size: 0.75rem;
    color: #636e72;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.header-date {
    font-size: 0.8rem;
    color: #636e72;
}
.connection {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #636e72;
}
.connection .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e17055;
    transition: background 0.3s;
}
.connection.connected .dot { background: #00b894; }
.connection.connected .label { color: #00b894; }

/* ---- TABS ---- */
.tabs-nav {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 0 32px;
    display: flex;
    gap: 0;
}
.tab {
    padding: 14px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #636e72;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tab:hover { color: #2d3436; }
.tab.active {
    color: #2d3436;
    border-bottom-color: #e17055;
    font-weight: 600;
}
.badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.badge.red { background: #ffeaea; color: #e17055; }
.badge.green { background: #e6fff6; color: #00b894; }
.badge.gray { background: #f1f3f5; color: #636e72; }

/* ---- STATS ---- */
.stats-row {
    display: flex;
    gap: 16px;
    padding: 20px 32px;
    flex-wrap: wrap;
}
.stat-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px 24px;
    min-width: 160px;
    flex: 1;
}
.stat-card .stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #636e72;
    margin-bottom: 4px;
}
.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
}
.stat-card .stat-sub {
    font-size: 0.72rem;
    color: #b2bec3;
    margin-top: 2px;
}
.stat-value.red { color: #e17055; }
.stat-value.green { color: #00b894; }
.stat-value.blue { color: #0984e3; }
.stat-value.dark { color: #2d3436; }

/* ---- FILTERS ---- */
.filters-row {
    padding: 0 32px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.filter-input, .filter-select {
    padding: 8px 14px;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    font-size: 0.83rem;
    font-family: inherit;
    outline: none;
    background: white;
    transition: border-color 0.2s;
}
.filter-input { width: 280px; }
.filter-input:focus, .filter-select:focus {
    border-color: #74b9ff;
}

/* ---- BUTTONS ---- */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.83rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.15s;
}
.btn-primary { background: #00b894; color: white; }
.btn-primary:hover { background: #00a381; }
.btn-danger { background: #ffeaea; color: #e17055; }
.btn-danger:hover { background: #ffdbdb; }
.btn-outline {
    background: white;
    border: 1px solid #dfe6e9;
    color: #636e72;
}
.btn-outline:hover { background: #f8f9fa; border-color: #b2bec3; }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; }

/* ---- TABLE ---- */
.main-content {
    padding: 0 32px 100px;
}
.table-container {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}
.orders-table {
    width: 100%;
    border-collapse: collapse;
}
.orders-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #636e72;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}
.orders-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.84rem;
    vertical-align: middle;
}
.orders-table tr:last-child td { border-bottom: none; }
.orders-table tr:hover td { background: #f8f9fa; }
.orders-table .col-check { width: 40px; text-align: center; }
.orders-table .col-number { width: 80px; }
.orders-table .col-time { width: 100px; }
.orders-table .col-total { width: 100px; text-align: right; }
.orders-table .col-actions { width: 160px; text-align: right; }

.order-number { font-weight: 600; color: #2d3436; }
.customer-name { font-weight: 500; }
.customer-phone { font-size: 0.75rem; color: #636e72; }
.address-text { max-width: 200px; }
.address-ref { font-size: 0.75rem; color: #b2bec3; font-style: italic; }
.product-pill {
    display: inline-block;
    background: #f1f3f5;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 500;
    margin: 1px 3px 1px 0;
    color: #2d3436;
}
.payment-badge {
    display: inline-block;
    background: #f1f3f5;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #636e72;
}
.time-queue { font-size: 0.8rem; color: #636e72; }
.time-queue.urgent { color: #e17055; font-weight: 600; }
.total-amount { font-weight: 600; color: #2d3436; }

.checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0984e3;
}

/* ---- BATCH BAR ---- */
.batch-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e9ecef;
    padding: 12px 32px;
    display: none;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}
.batch-bar.visible { display: flex; }
.batch-bar span { font-size: 0.85rem; color: #636e72; }

/* ---- TOAST ---- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #2d3436;
    color: white;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.85rem;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #b2bec3;
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 0.95rem; }
.empty-state .empty-sub { font-size: 0.8rem; margin-top: 4px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    .header { padding: 12px 16px; }
    .tabs-nav { padding: 0 16px; }
    .stats-row { padding: 16px; }
    .filters-row { padding: 0 16px 12px; }
    .main-content { padding: 0 16px 100px; }
    .filter-input { width: 200px; }
}
@media (max-width: 768px) {
    .stats-row { flex-direction: column; }
    .stat-card { min-width: auto; }
    .orders-table { font-size: 0.8rem; }
    .address-text { max-width: 140px; }
}
