/* ══════════════════════════════════════════════════════════════════════════
   Orfeo — ajustes móviles de contenido (la navegación y el tema viven en orfeo-theme.css).
   Controles táctiles, tablas en tarjetas y la pantalla de fichaje.
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ── Controles táctiles ── */
    input.form-control, select.form-control, textarea.form-control, .rz-textbox, .rz-dropdown,
    input[type=date], input[type=text], input[type=email], input[type=password], input[type=number] {
        font-size: 16px !important;   /* evita el zoom automático de iOS al enfocar */
        min-height: 44px;
    }
    .btn, button.btn { min-height: 42px; padding-left: 1rem; padding-right: 1rem; touch-action: manipulation; }
    .btn-sm { min-height: 38px; }
    a, button { touch-action: manipulation; }

    h3 { font-size: 1.3rem !important; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }

    /* ── Tablas: desplazamiento lateral suave; las marcadas con .m-tarjetas se muestran como lista de tarjetas ── */
    .table-responsive { -webkit-overflow-scrolling: touch; }
    table.m-tarjetas, table.m-tarjetas tbody, table.m-tarjetas tr, table.m-tarjetas td { display: block; width: 100%; }
    table.m-tarjetas thead { display: none; }
    table.m-tarjetas tr { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .85rem; margin-bottom: .6rem; box-shadow: var(--shadow-xs); }
    table.m-tarjetas td { border: 0 !important; padding: .22rem 0 !important; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    table.m-tarjetas td::before { content: attr(data-label); color: var(--text-muted); font-size: .75rem; font-weight: 600; text-align: left; flex-shrink: 0; align-self: center; }
    table.m-tarjetas td:not([data-label])::before { content: none; }
    table.m-tarjetas td:empty { display: none; }
    table.table-striped.m-tarjetas tbody tr:nth-of-type(odd) { background: #fff; }
    table.m-tarjetas td.m-acciones { justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-top: .4rem !important; }
    table.m-tarjetas td.m-acciones .btn { flex: 1 1 auto; }
    table.m-tarjetas td[colspan] { display: block; }

    /* Diálogos de Radzen casi a pantalla completa */
    .rz-dialog { width: 96vw !important; max-width: 96vw !important; left: 2vw !important; max-height: 88dvh; }

    /* Avisos emergentes por encima de la barra inferior */
    .ck-banner { bottom: calc(var(--m-bar) + var(--m-safe-b) + 8px) !important; }

    .jor-page-wrapper img, .jor-page-wrapper video, .jor-page-wrapper canvas { max-width: 100%; height: auto; }
}

/* Instalada como app: sin cromo del navegador */
@media (display-mode: standalone) {
    body { user-select: none; -webkit-user-select: none; }
    input, textarea, [contenteditable] { user-select: text; -webkit-user-select: text; }
}

/* Panel lateral de envío de mensajes: pantalla completa en móvil */
@media (max-width: 768px) {
    .envio-panel { width: 100vw; right: -105vw; padding-top: var(--m-safe-t); padding-bottom: var(--m-safe-b); }
    .envio-panel--open { right: 0; }
}

/* ══ Pantalla de fichaje (Principal) ══ */
.pic-et { display: none; }

@media (max-width: 768px) {
    .container-fluid { padding-left: 0; padding-right: 0; }
    .pic-card { padding: 1rem !important; }
    .pic-titulo { font-size: .75rem; letter-spacing: .14em; color: var(--text-muted); margin: 0 0 .25rem; font-weight: 600; }
    .pic-empleado { margin: 0 !important; padding: 0 !important; }
    .pic-empleado .rz-stack { padding: .25rem 0 !important; align-items: center; }
    .pic-foto { width: 56px !important; height: 56px !important; }
    .pic-estado { font-weight: 600; margin: .75rem 0 0; color: var(--primary-dark); }
    .pic-panel { height: auto !important; }
    .pic-reloj { flex: 0 0 100%; font-size: 3rem; font-variant-numeric: tabular-nums; margin: .15rem 0 .9rem; font-weight: 600; }
    .pic-card .text-center { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
    .pic-card .btn.btn-circle.btn-xl {
        width: auto; flex: 1 1 0; min-width: 0; max-width: 112px; height: 88px; padding: 8px 14px; border-radius: 16px;
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
        font-size: 24px; line-height: 1; box-shadow: var(--shadow-sm);
    }
    .pic-card .btn.btn-circle.btn-xl:active { transform: scale(.97); }
    .pic-card .btn.btn-circle > span.pic-et { display: block; font-size: .72rem; font-weight: 600; }
    /* Iniciar / Reanudar: botón principal a todo el ancho */
    .pic-card .btn.btn-circle.btn-success.btn-xl { width: 100%; max-width: none; height: 76px; flex-direction: row; gap: 12px; font-size: 1.6rem; border-radius: 14px; background: var(--success); border-color: var(--success); }
    .pic-card .btn.btn-circle.btn-success.btn-xl .pic-et { font-size: 1.1rem; }
    .pic-final .btn { width: 100%; min-height: 52px; font-size: 1rem; border-radius: 12px !important; }
}
