/* =========================================================
   Airbox Panel — estilos del panel de cliente (front-end)
   Usa la misma identidad visual del sitio: navy + sage + hexágonos.
   Todo queda dentro de .airbox-panel para no pisar el tema de WP.

   Nota: varias reglas usan !important a propósito. El shortcode se
   inserta dentro de un widget de Elementor, y los estilos globales del
   Kit de Elementor (colores/tipografía "globales" del sitio) se generan
   con !important y cargan después de esta hoja de estilos — sin esto,
   terminan pisando el color de la barra lateral y de los botones.
   ========================================================= */

.airbox-panel {
	--ap-navy: #0C3050;
	--ap-navy-deep: #071F35;
	--ap-sage: #8FBB82;
	--ap-sage-light: #C3DEBB;
	--ap-sage-pale: #EAF3E6;
	--ap-paper: #F7F8F5;
	--ap-ink: #14213B;
	--ap-ink-soft: #4A5568;
	--ap-red: #B3261E;
	--ap-hex: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);

	font-family: 'Open Sans', sans-serif;
	color: var(--ap-ink);
	max-width: none !important;
	width: 100% !important;
	min-width: 0;
	margin: 0 !important;
	box-sizing: border-box;
}
.airbox-panel *, .airbox-panel *::before, .airbox-panel *::after { box-sizing: border-box; }
.airbox-panel h1, .airbox-panel h2, .airbox-panel h3 { font-family: 'Montserrat', sans-serif; font-weight: 700; color: var(--ap-navy); margin: 0; }
.airbox-panel a { color: var(--ap-navy); text-decoration: none; }
.airbox-panel table { border-collapse: collapse; }

/* ---------- layout ---------- */
.ap-shell {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 24px;
	align-items: start;
	padding: 24px 0 64px;
	width: 100%;
	min-width: 0;
}

.ap-sidebar {
	background: var(--ap-navy-deep);
	color: #fff;
	padding: 24px 18px;
	border-radius: 8px;
	position: sticky;
	top: 16px;
	/* Sin esto, un grid item con contenido que no puede achicarse (los
	   links de la nav en fila, en mobile) fuerza a toda la columna del
	   grid a crecer para acompañarlo ("grid blowout"), sacando la
	   sidebar afuera del panel en vez de dejar que el scroll horizontal
	   interno (overflow-x) haga su trabajo. */
	min-width: 0;
}
.ap-sidebar-brand { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: .04em; color: var(--ap-sage-light) !important; text-transform: uppercase; margin-bottom: 22px; }
.ap-sidebar-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.62) !important; margin: 18px 0 10px; }
.ap-sidebar-label:first-of-type { margin-top: 0; }

.ap-nav { display: flex; flex-direction: column; gap: 4px; }
.ap-nav-link {
	display: block; padding: 11px 12px; border-radius: 6px;
	font-size: 14px; font-weight: 600; color: rgba(255,255,255,.9) !important;
	transition: background .15s, color .15s;
}
.ap-nav-link:hover { background: rgba(255,255,255,.1); color: #fff !important; }
.ap-nav-link.is-active { background: var(--ap-sage) !important; color: var(--ap-navy-deep) !important; }

.ap-deposito-filters { display: flex; flex-direction: column; gap: 6px; }
.ap-deposito-pill {
	display: block; padding: 8px 12px; border-radius: 6px;
	font-size: 13px; font-weight: 600; color: rgba(255,255,255,.78) !important;
	border: 1px solid rgba(255,255,255,.18);
}
.ap-deposito-pill:hover { border-color: var(--ap-sage); color: #fff !important; }
.ap-deposito-pill.is-active { border-color: var(--ap-sage); background: rgba(143,187,130,.2); color: #fff !important; }

.ap-logout { display: inline-block; margin-top: 26px; font-size: 13px; color: rgba(255,255,255,.68) !important; }
.ap-logout:hover { color: #fff !important; }

.ap-main { min-width: 0; }
.ap-header { margin-bottom: 22px; }
.ap-header h2 { font-size: 1.5rem; }
.ap-header p { margin-top: 4px; color: var(--ap-ink-soft); font-size: .9rem; text-transform: capitalize; }

/* ---------- flash / mensajes ---------- */
.ap-flash { padding: 12px 16px; border-radius: 6px; font-size: 14px; margin-bottom: 20px; }
.ap-flash-ok { background: var(--ap-sage-pale); color: #2b5a1f; border: 1px solid var(--ap-sage); }
.ap-flash-error { background: #FBEAE9; color: var(--ap-red); border: 1px solid #F1B9B5; }

/* ---------- stats ---------- */
.ap-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.ap-stats-grid-1 { grid-template-columns: 1fr; max-width: 320px; }
.ap-stat {
	background: #fff; border: 1px solid rgba(12,48,80,.1); border-radius: 8px;
	padding: 18px 20px;
}
.ap-stat-dark { background: var(--ap-navy-deep); border-color: var(--ap-navy-deep); }
.ap-stat-dark .ap-stat-label, .ap-stat-dark .ap-stat-sub { color: rgba(255,255,255,.68) !important; }
.ap-stat-dark b { color: #fff !important; }
.ap-stat-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ap-ink-soft); margin-bottom: 8px; }
.ap-stat b { display: block; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1.6rem; color: var(--ap-navy); }
.ap-stat-sub { display: block; font-size: 12px; color: var(--ap-ink-soft); margin-top: 4px; }

/* ---------- cards ---------- */
.ap-card { background: #fff; border: 1px solid rgba(12,48,80,.1); border-radius: 8px; padding: 22px; margin-bottom: 20px; }
.ap-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.ap-card h3 { font-size: 1.05rem; margin-bottom: 16px; }
.ap-card-head h3 { margin-bottom: 0; }
.ap-link-btn { font-size: 13px; font-weight: 600; color: var(--ap-navy); border-bottom: 1px solid var(--ap-sage); }
.ap-empty { color: var(--ap-ink-soft); font-size: 14px; }
.ap-note { color: var(--ap-ink-soft); font-size: 13px; margin-top: 14px; }

.ap-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ---------- tabla ---------- */
.ap-table-wrap { overflow-x: auto; }
.ap-table { width: 100%; font-size: 13.5px; }
.ap-table thead th {
	text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
	color: var(--ap-ink-soft); padding: 0 10px 10px; border-bottom: 1px solid var(--ap-sage-pale);
}
.ap-table tbody td { padding: 12px 10px; border-bottom: 1px solid var(--ap-sage-pale); vertical-align: middle; }
.ap-table tbody tr:last-child td { border-bottom: none; }

/* ---------- badges / tags ---------- */
.ap-badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; background: var(--ap-sage-pale); color: #2b5a1f; }
.ap-badge-entregado { background: var(--ap-sage); color: var(--ap-navy-deep); }
.ap-badge-registrado { background: #EAF0F7; color: var(--ap-navy); }
.ap-badge-transito, .ap-badge-camino { background: #FCEFDC; color: #8A5A00; }
.ap-badge-deposito, .ap-badge-clasificando { background: #E9E3F7; color: #4B3A8C; }
.ap-badge-cargo { background: #FBEAE9; color: var(--ap-red); }
.ap-badge-pago { background: var(--ap-sage-pale); color: #2b5a1f; }

.ap-tag { display: inline-block; padding: 3px 9px; border-radius: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; background: var(--ap-navy); color: #fff; }

.is-cargo { color: var(--ap-red); font-weight: 700; }
.is-pago { color: #2b5a1f; font-weight: 700; }

.ap-deposito-list, .ap-movimientos-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 10px; }
.ap-deposito-list li, .ap-movimientos-list li { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.ap-deposito-list li span { color: var(--ap-ink-soft); }
.ap-balance-amount { display: block; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1.7rem; color: var(--ap-navy); margin-top: 6px; }

.ap-doc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.ap-doc-list li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--ap-sage-pale); flex-wrap: wrap; }
.ap-doc-list li:last-child { border-bottom: none; }
.ap-doc-titulo { font-weight: 600; flex: 1; min-width: 160px; }
.ap-doc-fecha { color: var(--ap-ink-soft); font-size: 12.5px; }

/* ---------- formularios ---------- */
.ap-form-row { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.ap-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ap-form-grid .ap-form-row { margin-bottom: 0; }
.ap-form label { font-size: 13px; font-weight: 600; color: var(--ap-navy); }
.ap-form input, .ap-form select, .ap-form textarea {
	padding: 11px 12px !important; border: 1px solid rgba(12,48,80,.18) !important; border-radius: 5px !important;
	font-family: 'Open Sans', sans-serif !important; font-size: 14.5px !important; background: var(--ap-paper) !important; color: var(--ap-ink) !important;
	width: 100%;
}
.ap-form input:focus, .ap-form select:focus, .ap-form textarea:focus { outline: 2px solid var(--ap-sage); outline-offset: 1px; }

.ap-btn-primary {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	background: var(--ap-sage) !important; color: var(--ap-navy-deep) !important; font-weight: 700; font-size: 14.5px;
	padding: 12px 22px !important; border: none !important; border-radius: 5px !important; cursor: pointer; text-decoration: none;
}
.ap-btn-primary:hover { background: var(--ap-sage-light) !important; color: var(--ap-navy-deep) !important; }
.ap-btn-secondary {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	background: transparent !important; color: var(--ap-navy) !important; font-weight: 700; font-size: 14.5px;
	padding: 11px 22px !important; border: 1px solid var(--ap-navy) !important; border-radius: 5px !important; cursor: pointer; text-decoration: none;
}
.ap-btn-block { width: 100%; margin-top: 4px; }

/* ---------- gate / login / registro ---------- */
.airbox-panel-gate, .airbox-panel-auth { display: flex; justify-content: center; padding: 40px 16px; }
.ap-gate-card, .ap-auth-card {
	background: #fff; border: 1px solid rgba(12,48,80,.1); border-radius: 10px;
	padding: 40px 36px; max-width: 420px; width: 100%; text-align: center;
}
.ap-auth-card { text-align: left; }
.ap-gate-hex { width: 44px; height: 50px; margin: 0 auto 20px; background: var(--ap-sage); clip-path: var(--ap-hex); position: relative; }
.ap-auth-card .ap-gate-hex { margin: 0 0 20px; }
.ap-gate-hex::after { content: ''; position: absolute; inset: 2px; background: var(--ap-navy-deep); clip-path: var(--ap-hex); }
.ap-gate-card h3, .ap-auth-card h3 { margin-bottom: 10px; }
.ap-gate-card p, .ap-auth-card p { color: var(--ap-ink-soft); font-size: 14px; line-height: 1.6; margin-bottom: 22px; }
.ap-gate-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ap-auth-switch { text-align: center; font-size: 13.5px; color: var(--ap-ink-soft); margin: 14px 0 0; }
.ap-auth-switch a { font-weight: 600; }

/* ---------- responsive ---------- */
/* En mobile la barra lateral deja de ser un panel off-canvas escondido
   detrás de un botón: se muestra siempre, arriba del contenido, con la
   navegación y los filtros de depósito como tiras horizontales con
   scroll (tipo pestañas). Todo queda accesible con un toque, sin
   necesidad de ningún botón extra para abrir/cerrar nada. */
@media (max-width: 880px) {
	.ap-shell { grid-template-columns: 1fr; gap: 14px; padding: 12px 0 48px; }

	.ap-sidebar {
		position: static;
		padding: 16px 14px 14px;
		border-radius: 10px;
	}
	.ap-sidebar-brand { margin-bottom: 14px; font-size: 12px; }

	.ap-sidebar-label { margin: 14px 0 8px; }

	.ap-nav {
		flex-direction: row;
		flex-wrap: nowrap;
		overflow-x: auto;
		gap: 8px;
		padding-bottom: 4px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		min-width: 0;
		max-width: 100%;
	}
	.ap-nav::-webkit-scrollbar { display: none; }
	.ap-nav-link {
		flex: none;
		white-space: nowrap;
		padding: 10px 16px;
	}

	.ap-deposito-filters {
		flex-direction: row;
		flex-wrap: nowrap;
		overflow-x: auto;
		gap: 8px;
		padding-bottom: 2px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		min-width: 0;
		max-width: 100%;
	}
	.ap-deposito-filters::-webkit-scrollbar { display: none; }
	.ap-deposito-pill { flex: none; white-space: nowrap; }

	.ap-logout { margin-top: 16px; }

	.ap-header h2 { font-size: 1.25rem; }

	.ap-stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
	.ap-two-col { grid-template-columns: 1fr; }
	.ap-form-grid { grid-template-columns: 1fr; }
	.ap-card { padding: 16px; }

	.ap-table thead { display: none; }
	.ap-table, .ap-table tbody, .ap-table tr, .ap-table td { display: block; width: 100%; }
	.ap-table tr { border: 1px solid var(--ap-sage-pale); border-radius: 8px; margin-bottom: 12px; padding: 6px 12px; }
	.ap-table td { border-bottom: 1px dashed rgba(12,48,80,.08); display: flex; justify-content: space-between; gap: 12px; text-align: right; }
	.ap-table td:last-child { border-bottom: none; }
	.ap-table td::before { content: attr(data-label); font-weight: 600; color: var(--ap-ink-soft); text-align: left; }
}

@media (max-width: 480px) {
	.ap-stats-grid { grid-template-columns: 1fr; }
	.ap-gate-card, .ap-auth-card { padding: 28px 22px; }
}
