/* ==========================================================================
   El Aljibe — Gestión de Repartos (panel para empresas tercerizadas)
   Misma paleta que appTransporte_v2 / appRelevoGeo (navy real del logo).
   ========================================================================== */

:root {
	--navy-900: #1B2447;
	--navy-800: #212C56;
	--navy-700: #2F3F79;
	--navy-600: #3C4F94;
	--navy-100: #E8EBF6;

	--aqua-600: #0FA3A3;
	--aqua-100: #DFF7F5;

	--success-600: #1C9A6C;
	--success-100: #DDF5EA;
	--warning-600: #DB8A15;
	--warning-100: #FBEBD3;
	--danger-600: #D64545;
	--danger-100: #FBE2E2;

	--surface: #FFFFFF;
	--bg: #F2F4F9;
	--border: #E2E6F0;
	--text: #1B2340;
	--text-muted: #66708A;
	--text-soft: #99A1B8;

	--radius-sm: 10px;
	--radius-md: 16px;
	--radius-lg: 22px;
	--shadow-sm: 0 1px 3px rgba(27, 35, 71, 0.08);
	--shadow-md: 0 8px 24px rgba(27, 35, 71, 0.12);
	--shadow-lg: 0 16px 40px rgba(27, 35, 71, 0.18);

	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	min-height: 100%;
	background: var(--bg);
	font-family: var(--font);
	color: var(--text);
}

img { max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- login ---------- */

.login-screen {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 32px 20px;
	background: radial-gradient(circle at 20% 0%, var(--navy-600) 0%, var(--navy-800) 45%, var(--navy-900) 100%);
}

.login-brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }
.login-brand img { height: 56px; filter: drop-shadow(0 6px 16px rgba(0,0,0,0.25)); }
.login-brand .tag {
	margin-top: 14px; color: rgba(255,255,255,0.75); font-size: 13px;
	letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600;
}

.login-card {
	width: 100%; max-width: 380px; background: var(--surface);
	border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 30px 26px 26px;
}
.login-card h1 { font-size: 19px; font-weight: 800; margin: 0 0 22px; text-align: center; color: var(--navy-800); }

.field { margin-bottom: 18px; }
.field label {
	display: block; font-size: 12px; font-weight: 700; text-transform: uppercase;
	letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 8px;
}
.field input {
	width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
	background: var(--bg); padding: 14px; font-size: 16px; color: var(--text); outline: none;
}
.field input:focus { border-color: var(--navy-600); background: var(--surface); }

.login-error {
	background: var(--danger-100); color: #7A1F1F; border-radius: var(--radius-sm);
	padding: 12px 14px; font-size: 13px; font-weight: 600; margin-bottom: 16px;
}

.login-foot { margin-top: 22px; text-align: center; color: rgba(255,255,255,0.55); font-size: 13px; }
.login-foot a { color: rgba(255,255,255,0.85); font-weight: 700; text-decoration: none; }
.login-foot a:hover { text-decoration: underline; }

.page-footer {
	text-align: center;
	padding: 30px 20px 10px;
	font-size: 12px;
	color: var(--text-soft);
}
.page-footer a { color: var(--navy-700); font-weight: 700; text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }

/* ---------- botones ---------- */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	border: none; border-radius: var(--radius-md); padding: 14px 20px; font-size: 15px;
	font-weight: 700; cursor: pointer; box-shadow: var(--shadow-sm); color: #fff;
	transition: transform 0.08s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn-block { width: 100%; }
.btn-lg { padding: 20px 24px; font-size: 17px; }
.btn-primary { background: var(--navy-700); }
.btn-success { background: var(--success-600); }
.btn-outline { background: var(--surface); color: var(--navy-700); border: 1.5px solid var(--border); box-shadow: none; }

/* ---------- shell del panel ---------- */

.panel-topbar {
	background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
	color: #fff; padding: 16px 24px; display: flex; align-items: center;
	justify-content: space-between; box-shadow: var(--shadow-md); position: sticky; top: 0; z-index: 10;
}
.panel-topbar .brand { display: flex; align-items: center; gap: 12px; }
.panel-topbar .brand img { height: 26px; }
.panel-topbar .brand .empresa { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.75); }
.panel-topbar .logout {
	background: rgba(255,255,255,0.12); padding: 8px 14px; border-radius: 999px;
	font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px;
}
.panel-topbar .logout svg { width: 16px; height: 16px; fill: currentColor; }

.panel-body { max-width: 960px; margin: 0 auto; padding: 24px 20px 60px; }

.panel-title { font-size: 20px; font-weight: 800; color: var(--navy-800); margin: 0 0 4px; }
.panel-subtitle { color: var(--text-muted); font-size: 14px; margin: 0 0 24px; }

.back-link {
	display: inline-flex; align-items: center; gap: 6px; color: var(--navy-700);
	font-weight: 700; font-size: 13px; margin-bottom: 16px;
}
.back-link svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- dashboard: resumen + cards de reparto ---------- */

.summary-row {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px; margin-bottom: 24px;
}
.summary-tile {
	background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
	padding: 16px; text-align: center;
}
.summary-tile .num { font-size: 28px; font-weight: 800; color: var(--navy-800); }
.summary-tile .lbl { font-size: 12px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }
.summary-tile.warn .num { color: var(--warning-600); }

.reparto-grid {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 14px; margin-bottom: 28px;
}
.reparto-card {
	background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
	padding: 18px 20px; text-align: center;
}
.reparto-card .distid { font-size: 13px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.reparto-card .distid strong { color: var(--navy-700); font-size: 15px; }
.reparto-card .stats { display: flex; justify-content: center; gap: 18px; margin-top: 12px; }
.reparto-card .stat .num { font-size: 24px; font-weight: 800; color: var(--navy-800); }
.reparto-card .stat.pend .num { color: var(--warning-600); }
.reparto-card .stat .lbl { font-size: 11px; color: var(--text-muted); font-weight: 700; }

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.action-card {
	background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
	padding: 26px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.action-card .ico {
	width: 56px; height: 56px; border-radius: 50%; background: var(--navy-100); color: var(--navy-700);
	display: flex; align-items: center; justify-content: center;
}
.action-card .ico svg { width: 28px; height: 28px; fill: currentColor; }
.action-card h3 { margin: 0; font-size: 16px; color: var(--navy-800); }
.action-card p { margin: 0; font-size: 13px; color: var(--text-muted); }

/* ---------- filtros + tabla de pendientes ---------- */

.filter-bar {
	background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
	padding: 16px 18px; margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
}
.filter-bar .field-inline { display: flex; flex-direction: column; gap: 6px; }
.filter-bar label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.filter-bar select {
	border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px;
	font-size: 14px; background: var(--bg); min-width: 160px; outline: none;
}

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
	padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
	background: var(--surface); color: var(--text-muted); box-shadow: var(--shadow-sm);
}
.tab.active { background: var(--navy-700); color: #fff; }

.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.data-table th {
	background: var(--navy-100); color: var(--navy-800); text-align: left; font-size: 12px;
	text-transform: uppercase; letter-spacing: 0.4px; padding: 12px 14px;
}
.data-table td { padding: 12px 14px; border-top: 1px solid var(--border); font-size: 14px; }
.data-table tr:hover td { background: var(--bg); }

.badge-dia {
	display: inline-block; background: var(--aqua-100); color: #0A6B6B; font-size: 11px;
	font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: capitalize;
}

.table-empty { text-align: center; color: var(--text-muted); padding: 40px 10px; font-size: 14px; }

/* ---------- paginación ---------- */

.pagination {
	display: flex; align-items: center; justify-content: space-between;
	gap: 12px; margin-top: 18px; flex-wrap: wrap;
}
.page-btn {
	display: inline-flex; align-items: center; gap: 6px;
	background: var(--surface); color: var(--navy-700); font-weight: 700; font-size: 13px;
	padding: 9px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.page-btn svg { width: 16px; height: 16px; fill: currentColor; }
.page-btn.disabled { color: var(--text-soft); pointer-events: none; opacity: 0.6; }

.page-numbers { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; }
.page-num {
	min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
	border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; color: var(--text-muted);
	background: var(--surface); box-shadow: var(--shadow-sm);
}
.page-num.active { background: var(--navy-700); color: #fff; }
.page-dots { color: var(--text-soft); font-size: 13px; padding: 0 2px; }

.pagination-info { text-align: center; color: var(--text-soft); font-size: 12px; margin-top: 10px; }

@media (max-width: 560px) {
	.pagination { justify-content: center; }
	.page-btn { flex: 1; justify-content: center; }
}

.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }

@media (max-width: 560px) {
	.data-table { font-size: 13px; }
	.filter-bar { flex-direction: column; align-items: stretch; }
	.filter-bar select { min-width: 0; width: 100%; }
}
