/* ══════════════════════════════════════════════════════════════════
   CECO FLEET v32 — COMPONENTS.CSS
   Piezas reutilizables: botones, formularios, tarjetas, ventanas,
   avisos, chips, fotos, chat y tablas.
   ══════════════════════════════════════════════════════════════════ */

/* ── 1. BOTONES ──────────────────────────────────────────────── */

.ceco-app .btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	width: 100%;
	padding: 13px 18px;
	border: none;
	border-radius: var(--radius-sm);
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 800;
	cursor: pointer;
	transition: transform var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
}
.ceco-app .btn:active { transform: scale(.97); }
.ceco-app .btn:disabled { opacity: .6; cursor: not-allowed; }

.ceco-app .btn-primary {
	/* Naranja de obra, igual que los botones de la web publica. */
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #1a1209;
	box-shadow: 0 8px 24px rgba(255, 140, 26, .28);
}
.ceco-app .btn-primary.danger {
	background: linear-gradient(135deg, var(--red), var(--amber));
	color: #fff;
	box-shadow: 0 8px 24px rgba(230, 95, 58, .3);
}
.ceco-app .btn-secondary {
	background: var(--bg-2);
	color: var(--text);
	border: 1px solid var(--stroke);
}
.ceco-app .btn-danger {
	background: var(--red-soft);
	color: #fca5a5;
	border: 1px solid rgba(230, 95, 58, .35);
}

.ceco-app .mini-btn {
	background: var(--bg-2);
	border: 1px solid var(--stroke);
	color: var(--text-2);
	border-radius: 2px;
	padding: 5px 9px;
	font-size: 11px;
	font-family: inherit;
	cursor: pointer;
}
.ceco-app .mini-btn:hover { border-color: var(--stroke-2); color: #fff; }

.ceco-app .chip-btn {
	background: var(--bg-2);
	border: 1px solid var(--stroke);
	color: var(--text);
	border-radius: 999px;
	padding: 8px 13px;
	font-size: 11.5px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	white-space: nowrap;
}
.ceco-app .chip-btn:hover { background: var(--bg-3); border-color: var(--stroke-2); }

.ceco-app .url-img-btn {
	width: 100%;
	margin-top: 8px;
	background: var(--blue-soft);
	border: 1px dashed rgba(255, 140, 26, .4);
	color: #93c5fd;
	border-radius: var(--radius-sm);
	padding: 9px;
	font-size: 11.5px;
	font-family: inherit;
	cursor: pointer;
}

.ceco-app .btn-danger.small,
.ceco-app .activity-card .btn-danger {
	width: auto;
	padding: 5px 9px;
	font-size: 12px;
	border-radius: 2px;
}

/* ── 2. FORMULARIOS ──────────────────────────────────────────── */

.ceco-app .field { margin-bottom: 12px; }
.ceco-app .field label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	color: var(--text-2);
	margin-bottom: 5px;
	letter-spacing: .3px;
}

.ceco-app input[type="text"],
.ceco-app input[type="number"],
.ceco-app input[type="tel"],
.ceco-app input[type="email"],
.ceco-app input[type="date"],
.ceco-app input[type="password"],
.ceco-app input[type="search"],
.ceco-app select,
.ceco-app textarea {
	width: 100%;
	padding: 12px 13px;
	background: var(--bg-2);
	border: 1px solid var(--stroke);
	border-radius: var(--radius-sm);
	color: var(--text);
	font-family: inherit;
	/* 16px evita que iOS haga zoom al tocar el campo. */
	font-size: 16px;
	transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.ceco-app textarea { resize: vertical; min-height: 62px; }

.ceco-app input:focus,
.ceco-app select:focus,
.ceco-app textarea:focus {
	outline: none;
	border-color: var(--emerald);
	box-shadow: 0 0 0 3px var(--emerald-soft);
}
.ceco-app input::placeholder,
.ceco-app textarea::placeholder { color: var(--muted); }

.ceco-app select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
		linear-gradient(135deg, var(--muted) 50%, transparent 50%);
	background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 34px;
}

.ceco-app .grid-2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 0 12px;
}

.ceco-app .hint {
	background: var(--blue-soft);
	border-left: 3px solid var(--blue);
	border-radius: 2px;
	padding: 10px 12px;
	font-size: 11.5px;
	color: var(--text-2);
	margin-bottom: 12px;
	line-height: 1.6;
}

/* Buscador de cada vista */
.ceco-app .search-box { position: relative; flex: 1; min-width: 180px; }
.ceco-app .search-box input { padding-left: 36px; font-size: 14px; }
.ceco-app .search-box::before {
	content: '🔍';
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 13px;
	opacity: .6;
	pointer-events: none;
}

/* Casillas de verificación */
.ceco-app .check-grid { display: grid; gap: 6px; margin-bottom: 12px; }
.ceco-app .check-item {
	display: flex;
	align-items: center;
	gap: 9px;
	background: var(--bg-2);
	border: 1px solid var(--stroke);
	border-radius: var(--radius-sm);
	padding: 11px 12px;
	font-size: 12.5px;
	cursor: pointer;
}
.ceco-app .check-item input { width: 18px; height: 18px; accent-color: var(--emerald); }
.ceco-app .check-item:has(input:checked) {
	background: var(--emerald-soft);
	border-color: var(--emerald);
	color: var(--emerald);
}

.ceco-app .danger-check {
	display: flex;
	align-items: center;
	gap: 9px;
	background: var(--red-soft);
	border: 1px solid rgba(230, 95, 58, .35);
	border-radius: var(--radius-sm);
	padding: 11px 12px;
	font-size: 12px;
	color: #fca5a5;
	margin-bottom: 12px;
	cursor: pointer;
}
.ceco-app .danger-check input { width: 18px; height: 18px; accent-color: var(--red); }

.ceco-app .chip-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ceco-app .chip-check {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--bg-2);
	border: 1px solid var(--stroke);
	border-radius: 999px;
	padding: 7px 12px;
	font-size: 11px;
	cursor: pointer;
}
.ceco-app .chip-check input { accent-color: var(--emerald); }
.ceco-app .chip-check:has(input:checked) { background: var(--emerald-soft); border-color: var(--emerald); }

/* Deslizadores de nivel (aceite, diesel, hidraulico...) */
.ceco-app .range-row { margin-bottom: 12px; }
.ceco-app .range-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 11.5px;
	color: var(--text-2);
	margin-bottom: 5px;
}
.ceco-app .range-head b { color: var(--emerald); font-size: 12.5px; }

.ceco-app .ceco-range {
	width: 100%;
	height: 26px;
	background: transparent;
	appearance: none;
	cursor: pointer;
}
.ceco-app .ceco-range::-webkit-slider-runnable-track {
	height: 7px;
	border-radius: 4px;
	background: linear-gradient(90deg, var(--red), var(--amber) 40%, var(--emerald));
}
.ceco-app .ceco-range::-moz-range-track {
	height: 7px;
	border-radius: 4px;
	background: linear-gradient(90deg, var(--red), var(--amber) 40%, var(--emerald));
}
.ceco-app .ceco-range::-webkit-slider-thumb {
	appearance: none;
	width: 24px;
	height: 24px;
	margin-top: -9px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--emerald);
	box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
}
.ceco-app .ceco-range::-moz-range-thumb {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--emerald);
}

/* ── 3. FOTOS ────────────────────────────────────────────────── */

.ceco-app .photo-upload {
	display: block;
	background: var(--bg-2);
	border: 2px dashed var(--stroke-2);
	border-radius: var(--radius);
	padding: 20px 14px;
	text-align: center;
	cursor: pointer;
	transition: border-color var(--t-fast), background var(--t-fast);
	margin-bottom: 10px;
}
.ceco-app .photo-upload:hover { border-color: var(--emerald); background: var(--bg-3); }
.ceco-app .photo-upload p { margin: 0; font-size: 13px; font-weight: 700; color: #fff; }
.ceco-app .photo-upload small { font-size: 10.5px; color: var(--muted); }

.ceco-app .thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ceco-app .thumb-wrap { position: relative; }
.ceco-app .thumbs img {
	width: 62px;
	height: 62px;
	object-fit: cover;
	border-radius: 2px;
	border: 2px solid var(--emerald);
	cursor: pointer;
}
.ceco-app .thumb-remove {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--red);
	color: #fff;
	font-size: 11px;
	display: grid;
	place-items: center;
	cursor: pointer;
}

.ceco-app .gallery { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ceco-app .gallery img {
	width: 58px;
	height: 58px;
	object-fit: cover;
	border-radius: 2px;
	border: 1px solid var(--stroke);
	cursor: pointer;
}
.ceco-app .gallery.big img { width: 110px; height: 110px; }

/* Visor de fotos */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(2, 6, 15, .95);
	display: none;
	place-items: center;
	padding: 20px;
}
.lightbox.active { display: grid; }
.lightbox img { max-width: 96vw; max-height: 90vh; border-radius: 2px; }
.lightbox-x {
	position: absolute;
	top: 18px;
	right: 18px;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 1px solid var(--stroke-2);
	background: var(--bg-1);
	color: #fff;
	font-size: 17px;
	cursor: pointer;
}

/* ── 4. VENTANAS (modales) ───────────────────────────────────── */

.modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 9500;
	background: rgba(2, 6, 15, .8);
	backdrop-filter: blur(6px);
	display: flex;
	align-items: flex-end;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--t), visibility var(--t);
	padding: 0;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-box {
	width: 100%;
	max-width: 560px;
	max-height: 92vh;
	overflow-y: auto;
	background: var(--bg-1);
	border: 1px solid var(--stroke-2);
	border-radius: 2px 2px 0 0;
	padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
	box-shadow: var(--shadow);
	transform: translateY(24px);
	transition: transform var(--t);
}
.modal-overlay.active .modal-box { transform: translateY(0); }
.modal-box.modal-lg { max-width: 860px; }
.modal-box.modal-sm { max-width: 420px; }

.modal-head {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--stroke);
}
.modal-head h3 { font-size: 17px; margin: 0 0 3px; }
.modal-head p { font-size: 11.5px; color: var(--muted); margin: 0; }
.modal-head > div { flex: 1; min-width: 0; }

.modal-close {
	width: 34px;
	height: 34px;
	flex-shrink: 0;
	border-radius: 2px;
	border: 1px solid var(--stroke);
	background: var(--bg-2);
	color: var(--text);
	font-size: 15px;
	cursor: pointer;
}
.modal-close:hover { background: var(--red-soft); color: #fca5a5; }

.modal-actions {
	display: flex;
	gap: 9px;
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid var(--stroke);
}
.modal-actions .btn { width: auto; flex: 1; }

.confirm-msg { font-size: 13px; color: var(--text-2); line-height: 1.7; }

/* Cabecera con foto dentro de una ficha */
.machine-hero {
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--stroke);
	margin-bottom: 14px;
	background: var(--bg-2);
}
.machine-photo { width: 100%; height: 190px; object-fit: cover; }

.machine-actions {
	display: flex;
	gap: 7px;
	overflow-x: auto;
	padding-bottom: 6px;
	margin-bottom: 14px;
	-webkit-overflow-scrolling: touch;
}

.machine-specs {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
	gap: 8px;
}
.spec {
	background: var(--bg-2);
	border: 1px solid var(--stroke);
	border-radius: var(--radius-sm);
	padding: 9px 11px;
}
.spec span { display: block; font-size: 9.5px; color: var(--muted); letter-spacing: .5px; }
.spec b { font-size: 12.5px; color: #fff; word-break: break-word; }

.mini-history {
	background: var(--bg-2);
	border: 1px solid var(--stroke);
	border-radius: var(--radius-sm);
	padding: 10px 12px;
	font-size: 11.5px;
	color: var(--text-2);
	max-height: 230px;
	overflow-y: auto;
}
.mini-history div { padding: 5px 0; border-bottom: 1px solid var(--stroke); }
.mini-history div:last-child { border-bottom: none; }

.task-list { margin: 0; padding-left: 20px; font-size: 12.5px; color: var(--text-2); line-height: 1.9; }
.task-list.small { font-size: 11.5px; line-height: 1.7; }

/* Pantalla de agradecimiento del operario */
.thanks { text-align: center; padding: 16px 4px; }
.thanks-icon {
	width: 84px;
	height: 84px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: var(--emerald-soft);
	border: 3px solid var(--emerald);
	display: grid;
	place-items: center;
	font-size: 38px;
}
.thanks h3 { font-size: 22px; }

/* ── 5. AVISOS (toasts) ──────────────────────────────────────── */

.toast-wrap {
	position: fixed;
	top: 14px;
	right: 14px;
	left: 14px;
	z-index: 99000;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 9px;
	pointer-events: none;
}

.toast {
	position: relative;
	width: 100%;
	max-width: 380px;
	pointer-events: auto;
	background: var(--bg-2);
	border: 1px solid var(--stroke-2);
	border-left: 4px solid var(--blue);
	border-radius: var(--radius-sm);
	padding: 12px 38px 12px 14px;
	box-shadow: var(--shadow);
	animation: cecoToastIn .3s ease;
}
.toast.out { animation: cecoToastOut .4s ease forwards; }
.toast b { display: block; font-size: 12.5px; color: #fff; }
.toast span { display: block; font-size: 11.5px; color: var(--text-2); margin-top: 2px; word-break: break-word; }

.toast.success { border-left-color: var(--emerald); }
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
.toast.info { border-left-color: var(--blue); }

.toast-x {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 22px;
	height: 22px;
	border: none;
	border-radius: 2px;
	background: transparent;
	color: var(--muted);
	font-size: 12px;
	cursor: pointer;
}
.toast-retry {
	display: block;
	margin-top: 9px;
	background: var(--red-soft);
	border: 1px solid rgba(230, 95, 58, .4);
	color: #fca5a5;
	border-radius: 2px;
	padding: 7px 12px;
	font-size: 11.5px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
}

@keyframes cecoToastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes cecoToastOut { to { opacity: 0; transform: translateX(40px); } }

/* ── 6. CHIPS, BADGES Y PESTANAS ─────────────────────────────── */

.ceco-app .chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ceco-app .chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--bg-2);
	border: 1px solid var(--stroke);
	border-radius: 999px;
	padding: 6px 11px;
	font-size: 11px;
	color: var(--text-2);
	cursor: pointer;
}
.ceco-app .chip i { font-style: normal; color: var(--muted); font-size: 10px; }
.ceco-app .chip:hover { border-color: var(--stroke-2); color: #fff; }
.ceco-app .chip.link { color: #93c5fd; }
.ceco-app .chip.low { background: var(--red-soft); border-color: rgba(230, 95, 58, .35); color: #fca5a5; }
.ceco-app .chip.lost { background: var(--amber-soft); border-color: rgba(232, 181, 60, .35); color: var(--amber); }
.ceco-app .chip.ok { background: var(--emerald-soft); border-color: rgba(255, 140, 26, .3); color: var(--emerald); }
.ceco-app .chip.small { font-size: 10px; padding: 4px 9px; }
.ceco-app .chip.muted { color: var(--muted); cursor: default; }

.ceco-app .badge {
	display: inline-block;
	border-radius: 999px;
	padding: 3px 9px;
	font-size: 9px;
	font-weight: 800;
	letter-spacing: .6px;
	vertical-align: middle;
}
.ceco-app .badge.ok { background: var(--emerald-soft); color: var(--emerald); }
.ceco-app .badge.soon { background: var(--amber-soft); color: var(--amber); }
.ceco-app .badge.overdue,
.ceco-app .badge.critical { background: var(--red-soft); color: #fca5a5; }
.ceco-app .badge.lost { background: var(--amber-soft); color: var(--amber); }
.ceco-app .badge.un { background: var(--bg-3); color: var(--muted); }

.ceco-app .tabs {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	padding-bottom: 6px;
	margin-bottom: 12px;
	-webkit-overflow-scrolling: touch;
}
.ceco-app .tab {
	background: var(--bg-2);
	border: 1px solid var(--stroke);
	color: var(--text-2);
	border-radius: 999px;
	padding: 7px 13px;
	font-size: 11.5px;
	font-family: inherit;
	font-weight: 700;
	white-space: nowrap;
	cursor: pointer;
}
.ceco-app .tab.active {
	background: var(--emerald-soft);
	border-color: var(--emerald);
	color: var(--emerald);
}

.ceco-app .tag {
	font-size: 9px;
	color: var(--emerald);
	background: var(--emerald-soft);
	border-radius: 4px;
	padding: 1px 5px;
}

.ceco-app .load-more { text-align: center; margin-top: 16px; }
.ceco-app .load-more .btn { width: auto; padding: 10px 20px; }

/* ── 7. TABLAS ───────────────────────────────────────────────── */

.ceco-app .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ceco-app .data-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
	min-width: 560px;
}
.ceco-app .data-table th {
	text-align: left;
	padding: 10px 11px;
	background: var(--bg-2);
	color: var(--muted);
	font-size: 10px;
	letter-spacing: .8px;
	border-bottom: 1px solid var(--stroke);
	position: sticky;
	top: 0;
}
.ceco-app .data-table td {
	padding: 10px 11px;
	border-bottom: 1px solid var(--stroke);
	color: var(--text-2);
}
.ceco-app .data-table tr:hover td { background: var(--bg-2); cursor: pointer; }

/* ── 8. CHAT DEL ASISTENTE ───────────────────────────────────── */

.chat-fab {
	position: fixed;
	right: 16px;
	bottom: 78px;
	z-index: 8000;
	width: 54px;
	height: 54px;
	border: none;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #fff;
	font-size: 24px;
	cursor: pointer;
	box-shadow: 0 10px 30px rgba(255, 140, 26, .45);
}
.chat-fab:active { transform: scale(.92); }

/* Con una ventana abierta el boton del chat estorba: se transparenta
   justo encima de "Si, guardar igual" y confunde. Fuera mientras tanto. */
body.modal-open .chat-fab { display: none; }

.chat-panel {
	position: fixed;
	right: 14px;
	bottom: 142px;
	z-index: 8001;
	width: min(370px, calc(100vw - 28px));
	height: min(520px, calc(100vh - 200px));
	background: var(--bg-1);
	border: 1px solid var(--stroke-2);
	border-radius: 2px;
	box-shadow: var(--shadow);
	display: none;
	flex-direction: column;
	overflow: hidden;
}
.chat-panel.open { display: flex; }

.chat-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 13px 14px;
	border-bottom: 1px solid var(--stroke);
	background: var(--bg-2);
}
.chat-head b { font-size: 13px; }
.chat-head span { font-size: 10px; color: var(--muted); flex: 1; }
.chat-head button {
	width: 28px;
	height: 28px;
	border: none;
	border-radius: 2px;
	background: var(--bg-3);
	color: var(--text);
	cursor: pointer;
}

.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg {
	max-width: 88%;
	padding: 10px 13px;
	border-radius: 2px;
	font-size: 12.5px;
	line-height: 1.65;
	word-break: break-word;
}
.chat-msg.ai { background: var(--bg-2); border: 1px solid var(--stroke); align-self: flex-start; }
.chat-msg.me {
	/* Naranja de obra, igual que los botones de la web publica. */
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #1a1209;
	align-self: flex-end;
	font-weight: 600;
}
.chat-msg details { margin-bottom: 6px; font-size: 11px; color: var(--muted); }
.chat-msg summary { cursor: pointer; }
.chat-offline { display: block; margin-top: 6px; font-size: 9.5px; color: var(--amber); }

.chat-typing { display: flex; gap: 4px; padding: 10px 14px; }
.chat-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--muted);
	animation: cecoBlink 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes cecoBlink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

.chat-input { display: flex; gap: 7px; padding: 11px; border-top: 1px solid var(--stroke); }
.chat-input input { flex: 1; padding: 10px 12px; font-size: 14px; }
.chat-input button {
	width: 42px;
	border: none;
	border-radius: var(--radius-sm);
	/* Naranja de obra, igual que los botones de la web publica. */
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #1a1209;
	font-size: 15px;
	cursor: pointer;
}

.suggest {
	background: var(--blue-soft);
	border: 1px solid rgba(255, 140, 26, .3);
	border-radius: var(--radius-sm);
	padding: 9px 12px;
	font-size: 11.5px;
	color: #93c5fd;
	margin-bottom: 10px;
	cursor: pointer;
}

/* ── 9. RESPONSIVE DE COMPONENTES ────────────────────────────── */

@media (min-width: 768px) {
	.modal-overlay { align-items: center; padding: 20px; }
	.modal-box { border-radius: 2px; padding: 24px; }
	.toast-wrap { left: auto; width: 380px; }
}

@media (max-width: 767px) {
	.chat-panel { bottom: 140px; height: min(60vh, 460px); }
	.chat-fab { bottom: 76px; right: 14px; }
	.modal-actions { flex-direction: column-reverse; }
	.modal-actions .btn { width: 100%; }
}

/* ══════════════════════════════════════════════════════════════════
   HISTORIAL DE SERVICIOS DE UNA MAQUINA  (v40)
   ──────────────────────────────────────────────────────────────────
   Una ficha por servicio en vez de una linea apretada: fecha,
   contador, quien lo hizo, las notas completas y las fotos. Es lo
   que se mira para saber que se le hizo a la troca y cuando.
   ══════════════════════════════════════════════════════════════════ */

.svc-log { display: flex; flex-direction: column; gap: 8px; }

.svc-row {
	background: var(--bg-2);
	border: 1px solid var(--stroke);
	border-left: 3px solid var(--accent);
	border-radius: var(--radius-sm);
	padding: 10px 12px;
}

.svc-top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
}
.svc-top b { font-size: 12.5px; color: #fff; }
.svc-date {
	flex: 0 0 auto;
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	color: var(--text-2);
}

.svc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.svc-meta span {
	font-size: 10.5px;
	color: var(--muted);
	background: var(--bg-3, rgba(255, 255, 255, .04));
	border: 1px solid var(--stroke);
	border-radius: 4px;
	padding: 2px 7px;
}

/* Las notas son lo mas importante de la ficha: se leen enteras y
   se respetan los saltos de linea que escribio el mecanico. */
.svc-note {
	margin: 7px 0 0;
	font-size: 11.5px;
	line-height: 1.55;
	color: var(--text-2);
	white-space: pre-wrap;
	word-break: break-word;
}

.svc-shots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.svc-shots img {
	width: 54px;
	height: 54px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid var(--stroke);
	cursor: pointer;
}

/* Sello de "esto lo dedujo el sistema". Se ve distinto a proposito:
   nunca se puede confundir con un apunte escrito por una persona. */
.svc-auto {
	color: var(--accent) !important;
	border-color: var(--accent) !important;
	background: rgba(255, 140, 26, .1) !important;
}
.svc-row.is-auto { border-left-style: dashed; }

.ceco-app .btn.svc-more { width: auto; margin-top: 10px; padding: 8px 14px; font-size: 11.5px; }
