:root {
	--bg:#f4f6f8;
	--card:#ffffff;
	--border:#dcdcdc;
	--text:#1f2937;
	--muted:#6b7280;
	--accent:#2563eb;
}

/* ---------- BASE ---------- */
body {
	margin:0;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
	background:var(--bg);
	color:var(--text);
}

a { color:var(--accent); text-decoration:none; }

/* ---------- HEADER ---------- */
.app-header {
	position: sticky;
	top: 0;
	z-index: 1000;

	background: var(--card);
	border-bottom: 1px solid var(--border);
	padding: 14px 16px 10px;
}

.header-top {
	display:flex;
	justify-content:space-between;
	align-items:center;
}

.brand .title {
	font-size:18px;
	font-weight:600;
}

.brand .subtitle {
	font-size:11px;
	color:var(--muted);
	margin-top:-2px;
}

.header-events {
	display:flex;
	gap:6px;
}

.event-pill {
	padding:4px 10px;
	font-size:11px;
	border-radius:999px;
	border:1px solid;
	font-weight:600;
}

.event-alerta {
	background:#fef2f2;
	color:#991b1b;
	border-color:#fecaca;
}

.event-grave {
	background:#fff7ed;
	color:#9a3412;
	border-color:#fed7aa;
}

.event-leve {
	background:#f3f4f6;
	color:#374151;
	border-color:#d1d5db;
}

/* ---------- SEARCH ---------- */
.header-main {
	margin-top:10px;
}

.search {
	display:flex;
	gap:8px;
}

.search input {
	flex:1;
	padding:10px;
	font-size:14px;
	border-radius:8px;
	border:1px solid var(--border);
}

.search button {
	padding:10px 16px;
	border-radius:8px;
	border:none;
	background:var(--accent);
	color:#fff;
	font-size:14px;
}

/* ---------- NAV ---------- */
.header-nav {
	margin-top:10px;
	display:flex;
	gap:16px;
	font-size:13px;
}

.header-nav a {
	color:var(--muted);
	padding-bottom:6px;
	border-bottom:2px solid transparent;
}

.header-nav a.active {
	color:var(--text);
	border-color:var(--accent);
}

/* ---------- CARDS ---------- */
main {
	max-width:900px;
	margin:auto;
	padding:16px;
}

.card {
	background:var(--card);
	border:1px solid var(--border);
	border-radius:10px;
	padding:14px;
	margin-bottom:14px;
}

small { color:var(--muted); }

/* ---------- BADGES ---------- */
.badge {
	display:inline-block;
	padding:2px 8px;
	border-radius:999px;
	font-size:11px;
	border:1px solid var(--border);
}

.b-leve { background:#f3f4f6; color:#374151; }
.b-grave { background:#fff7ed; color:#9a3412; border-color:#fed7aa; }
.b-alerta { background:#fef2f2; color:#991b1b; border-color:#fecaca; }

.wave {
	margin: 10px 0;
}

.wave img {
	width: 100%;
	height: auto;
	border-radius: 6px;
	background: #eee;
}

.preview {
	font-size: 14px;
	margin: 8px 0;
}

.actions {
	display: flex;
	gap: 14px;
	font-size: 13px;
}

.actions a {
	color: var(--accent);
	text-decoration: none;
}

audio {
	width: 100%;
	margin-top: 8px;
}

.grid {
	display: grid;
	grid-template-columns: 1fr 140px 120px;
	gap: 10px;
	align-items: end;
}
label {
	display: block;
	font-size: 12px;
	color: var(--muted);
	margin-bottom: 6px;
}
input[type=text], select {
	width: 100%;
	padding: 10px;
	font-size: 14px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: #fff;
}
.btn {
	border: none;
	background: var(--accent);
	color: #fff;
	padding: 10px 14px;
	font-size: 14px;
	border-radius: 6px;
	cursor: pointer;
}
.btn-secondary {
	background: #e5e7eb;
	color: #111827;
}
.btn-danger {
	background: var(--danger);
}
.table {
	width: 100%;
	border-collapse: collapse;
}
.table th, .table td {
	padding: 10px;
	border-bottom: 1px solid #eee;
	text-align: left;
	font-size: 14px;
	vertical-align: middle;
}
.table th {
	font-size: 12px;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: .04em;
}
.b-text {
	background:#eef2ff;
	color:#3730a3;
	border-color:#c7d2fe;
}

#playlist-player button {
	padding:6px 10px;
	border-radius:6px;
	border:1px solid var(--border);
	background:#fff;
	cursor:pointer;
}

#playlist-player button:hover {
	background:#f3f4f6;
}

/* ---------- AUDIT ACTIONS ---------- */
.audit-actions {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	align-items: center;
}

/* Botón base (si no existe ya) */
.btn {
	font-size: 13px;
	padding: 6px 10px;
	border-radius: 6px;
	border: 1px solid var(--border);
	background: #fff;
	cursor: pointer;
	white-space: nowrap;
}

/* Botón secundario (descargas) */
.btn-secondary {
	color: var(--text);
}

.btn-secondary:hover {
	background: #f3f4f6;
}



/* ---------- FOOTER ---------- */
.app-footer {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;

	background: var(--card);
	border-top: 1px solid var(--border);
	padding: 6px 12px;

	display: flex;
	justify-content: space-between;
	align-items: center;

	font-size: 11px;
	color: var(--muted);
	z-index: 900;
}

/* Evitar que el footer tape contenido */
body {
	padding-bottom: 36px;
}

.footer-left,
.footer-center,
.footer-right {
	white-space: nowrap;
}

@media (max-width: 640px) {
	.header-nav {
		gap: 12px;
		font-size: 12px;
	}

	//.header-events {
	//	display: none; /* opcional: oculta pills en móvil */
	//}

	.brand .title {
		font-size: 16px;
	}

	.search input {
		font-size: 13px;
	}
}
/* ---------- FOOTER MOBILE COMPACT ---------- */
@media (max-width: 640px) {

	.app-footer {
		padding: 4px 8px;
		font-size: 10px;
	}

	.footer-left {
		max-width: 40%;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.footer-center {
		display: none; /* ocultamos fecha larga */
	}

	.footer-right {
		max-width: 60%;
		overflow: hidden;
		text-overflow: ellipsis;
		text-align: right;
	}

	/* Ajustar espacio inferior del body */
	body {
		padding-bottom: 28px;
	}
}
