:root { --ag-bg: #f8fafc; --card-bg: #ffffff; --muted: #64748b; --accent: #3b82f6; --success: #10b981; }

/* Report / Frontend */
.ag-report-wrap { max-width:1100px; margin:18px auto; padding:18px; background:var(--ag-bg); border-radius:12px; font-family:Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; }
.ag-filters { margin-bottom:14px; display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.ag-filters label { font-size:13px; color:#0f172a; }
.ag-stats-container { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap:14px; margin:16px 0; }
.stat-card { background: var(--card-bg); padding:18px; border-radius:12px; border:1px solid #eef2f6; text-align:center; box-shadow:0 6px 18px rgba(16,24,40,0.04); }
.stat-val { display:block; font-size:30px; font-weight:800; color:#0f172a; margin-bottom:6px; }
.stat-label { font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; }
.icon-circ { width:38px; height:38px; background:#f1f5f9; border-radius:50%; display:flex; align-items:center; justify-content:center; margin:0 auto 10px; font-size:16px; }
.card-recibido { border-bottom:5px solid var(--accent); }
.card-entrega { border-bottom:5px solid var(--success); }

.ag-orders-table { width:100%; border-collapse:collapse; background:var(--card-bg); border-radius:8px; overflow:hidden; box-shadow:0 6px 18px rgba(2,6,23,0.04); }
.ag-orders-table thead th { text-align:left; padding:12px 14px; font-size:13px; color:#0f172a; border-bottom:1px solid #eef2f6; }
.ag-orders-table tbody td { padding:12px 14px; border-bottom:1px solid #f3f6f8; font-size:14px; color:#0f172a; }
.ag-orders-table tbody tr:nth-child(even) { background:#fbfdff; }
.ag-orders-table a { color:var(--accent); text-decoration:none; }

.ag-pagination { margin-top:12px; display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.ag-pagination a, .ag-pagination strong { display:inline-block; padding:6px 10px; border-radius:6px; text-decoration:none; color:#0f172a; }
.ag-pagination a { background:#fff; border:1px solid #e6eef6; }
.ag-pagination strong { background:var(--accent); color:#fff; font-weight:700; }

/* Responsive: allow table horizontal scroll on small devices */
.ag-table-wrap { overflow:auto; -webkit-overflow-scrolling:touch; }
@media (max-width:600px) {
    .ag-filters { gap:6px; }
    .stat-val { font-size:24px; }
    .ag-filters label input, .ag-filters select { font-size:13px; }
}

/* Repartidor panel */
.tk-log-container { max-width: 450px; margin: auto; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; padding: 15px; }
.tk-card { background: #fff; border-radius: 20px; padding: 25px; box-shadow: 0 8px 30px rgba(0,0,0,0.05); border: 1px solid #eef0f2; }
.tk-input-group { margin-bottom: 15px; }
.tk-label { font-size: 11px; font-weight: 800; color: #64748b; text-transform: uppercase; margin-bottom: 5px; display: block; }
.tk-input { width: 100%; padding: 14px; border: 2px solid #e2e8f0; border-radius: 12px; font-size: 16px; background: #f8fafc; transition: 0.3s; box-sizing: border-box; }
.tk-input:focus { border-color: #1e293b; outline: none; background: #fff; }
.tk-btn { width: 100%; padding: 18px; background: #1e293b; color: #fff; border: none; border-radius: 12px; font-weight: 800; cursor: pointer; text-transform: uppercase; margin-top: 10px; font-size: 14px; }
.flete-box { background: #fff7ed; border: 1px solid #ffedd5; padding: 15px; border-radius: 12px; margin-bottom: 15px; }

/* Repartidor: título y mensajes */
.tk-title { text-align: center; font-weight: 900; margin-bottom: 20px; color: #1e293b; font-size: 20px; }
.tk-message { padding:15px; border-radius:12px; margin-bottom:20px; text-align:center; font-weight:700; font-size:14px; }
.tk-message.success { background:#dcfce7; color:#166534; }
.tk-message.error { background:#fee2e2; color:#991b1b; }
.tk-flete-note { font-size:10px; color:#9a3412; display:block; margin-top:5px; font-weight:600; }

/* Admin styles for Logística panel */
.tk-admin-wrap { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; background: #f0f0f1; padding: 20px; }
.tablenav { background: #fff; padding: 15px; border: 1px solid #ccd0d4; border-radius: 4px; margin-bottom: 20px; display: flex; gap: 10px; align-items: flex-end; }
.wp-list-table { background: #fff; border: 1px solid #ccd0d4; width: 100%; border-collapse: collapse; box-shadow: 0 1px 1px rgba(0,0,0,0.04); }
.wp-list-table th, .wp-list-table td { padding: 12px; text-align: left; border-bottom: 1px solid #f0f0f1; }
.wp-list-table th { background: #f8fafc; }
.u-email { display: block; color: #64748b; font-size: 11px; font-weight: normal; }
.badge-count { background: #f1f5f9; padding: 2px 8px; border-radius: 10px; font-weight: bold; border: 1px solid #cbd5e1; }
.sec-code { font-family: monospace; background: #2271b1; color: #fff; padding: 3px 6px; border-radius: 3px; font-size: 11px; }

/* Map styles */
.map-container-tukitask { width: 100%; position: relative; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 1px solid #eee; }
#map-tukitask-red { width: 100%; height: 500px; }
@media (max-width:1024px) { #map-tukitask-red { height: 450px; } }
@media (max-width:768px) { #map-tukitask-red { height: 400px; } .mapboxgl-popup { max-width:200px !important; } .mapboxgl-popup-content { padding:10px; font-size:12px; } }

/* Marker styles for agencies */
.marker-tukitask { display:flex; flex-direction:column; align-items:center; transform: translateY(-6px); }
.marker-tukitask .pin { width: 32px; height: 32px; background:#22c55e; border-radius:50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 6px 18px rgba(16,24,40,0.12); display:flex; align-items:center; justify-content:center; }
.marker-tukitask .pin::after { content: ''; width:10px; height:10px; background:#fff; border-radius:50%; transform: rotate(45deg); }
.marker-tukitask .label { margin-top:6px; background: rgba(255,255,255,0.95); padding:4px 8px; border-radius:8px; font-weight:700; color:#0f172a; font-size:12px; box-shadow:0 6px 12px rgba(2,6,23,0.06); white-space:nowrap; max-width:140px; overflow:hidden; text-overflow:ellipsis; }
.marker-tukitask .pulse { position:absolute; width:34px; height:34px; border-radius:50%; background: rgba(34,197,94,0.18); animation: tk-pulse 2s infinite; z-index: -1; }
@keyframes tk-pulse { 0% { transform: scale(1); opacity: 0.9 } 100% { transform: scale(2.6); opacity: 0 } }

/* Popup content styling */
.tk-popup { padding:12px 14px; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; }
.tk-popup .title { font-weight:800; color:#16a34a; margin-bottom:6px; font-size:14px; }
.tk-popup .address { display:block; color:#64748b; font-size:12px; margin-bottom:8px; }
.tk-popup .btn-row { display:flex; gap:8px; }
.tk-popup .btn { flex:1; display:inline-block; text-align:center; padding:8px 10px; border-radius:8px; text-decoration:none; font-weight:700; font-size:13px; }
.tk-popup .btn-primary { background:#22c55e; color:#fff; }
.tk-popup .btn-secondary { background:#0f172a; color:#fff; }

/* Small hint overlay inside map (used when no markers) */
.map-hint { opacity: 0.98; }
