/* Estilos para la App Táctil de Recogidas en Tablet */

.ogr-tablet-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    background: #f1f5f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #0f172a;
    overflow: hidden;
    position: relative;
    user-select: none;
}

.ogr-tablet-app * {
    box-sizing: border-box;
}

/* Modal de Bloqueo por PIN */
.ogr-pin-modal {
    position: absolute;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ogr-pin-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.ogr-pin-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.ogr-pin-box h2 {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 10px 0;
    color: #1e293b;
}

.ogr-pin-box p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 25px 0;
}

.ogr-pin-inputs {
    display: flex;
    gap: 10px;
}

.ogr-pin-inputs input {
    flex: 1;
    padding: 14px;
    font-size: 22px;
    text-align: center;
    letter-spacing: 6px;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    outline: none;
}

.ogr-pin-inputs input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ogr-error-text {
    color: #dc2626;
    font-size: 13.5px;
    font-weight: 600;
    margin-top: 15px;
}

/* Cabecera Superior */
.ogr-header {
    background: #1e293b;
    color: #ffffff;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.ogr-header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.ogr-logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ogr-icon-box {
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #334155;
    border-radius: 10px;
}

.ogr-logo-title h1 {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    color: #ffffff;
    line-height: 1.2;
}

.ogr-subtitle {
    font-size: 12px;
    color: #94a3b8;
}

.ogr-date-selector-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #334155;
    padding: 6px 12px;
    border-radius: 8px;
}

.ogr-date-selector-group label {
    font-size: 13px;
    color: #cbd5e1;
    font-weight: 600;
}

.ogr-date-selector-group input[type="date"] {
    background: #1e293b;
    border: 1px solid #475569;
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.ogr-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ogr-stat-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #334155;
    padding: 4px 14px;
    border-radius: 8px;
}

.ogr-stat-num {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
    color: #f8fafc;
}

.ogr-stat-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
}

.ogr-stat-success .ogr-stat-num {
    color: #34d399;
}

.ogr-clock-badge {
    background: #0f172a;
    border: 1px solid #334155;
    padding: 6px 14px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 18px;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 1px;
}

/* Botones genéricos */
.ogr-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ogr-btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.ogr-btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.ogr-btn-primary:hover {
    background: #1d4ed8;
}

.ogr-btn-sync {
    background: #0891b2;
    color: #ffffff;
}

.ogr-btn-sync:hover {
    background: #0e7490;
}

.ogr-btn-cam {
    background: #7c3aed;
    color: #ffffff;
}

.ogr-btn-cam:hover {
    background: #6d28d9;
}

.ogr-btn-success {
    background: #059669;
    color: #ffffff;
}

.ogr-btn-success:hover {
    background: #047857;
}

.ogr-btn-lg {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 800;
}

/* Columnas de la App */
.ogr-main-columns {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Columna Izquierda: Lista de Alumnos */
.ogr-col-left {
    width: 380px;
    min-width: 340px;
    max-width: 420px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.ogr-search-box {
    padding: 14px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

.ogr-search-box input {
    width: 100%;
    padding: 10px 32px 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
}

.ogr-search-box input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ogr-search-box button {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
}

.ogr-students-list-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.ogr-student-item {
    padding: 12px 14px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.ogr-student-item:hover {
    border-color: #93c5fd;
    background: #f0f7ff;
}

.ogr-student-item.is-selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.15);
}

.ogr-student-item.is-suggested {
    border-left: 5px solid #f59e0b;
}

.ogr-student-item.is-delivered {
    opacity: 0.65;
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.ogr-student-item.is-delivered .ogr-item-status-pill {
    background: #dcfce7;
    color: #15803d;
}

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

.ogr-item-time {
    font-size: 12.5px;
    font-weight: 700;
    color: #2563eb;
    background: #dbeafe;
    padding: 2px 8px;
    border-radius: 6px;
}

.ogr-item-suggested-tag {
    font-size: 11px;
    font-weight: 700;
    color: #b45309;
    background: #fef3c7;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ogr-item-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.ogr-item-career {
    font-size: 12.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ogr-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.ogr-item-bultos-badge {
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
}

.ogr-item-auth-flag {
    font-size: 11px;
    font-weight: 700;
    color: #7c3aed;
    background: #ede9fe;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Columna Derecha: Panel del Turno Activo */
.ogr-col-right {
    flex: 1;
    background: #f8fafc;
    overflow-y: auto;
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
}

.ogr-turn-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #94a3b8;
}

.ogr-placeholder-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

/* Cabecera Turno Activo */
.ogr-active-header {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 24px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.ogr-student-main-info h2 {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 8px 0;
    color: #0f172a;
}

.ogr-meta-tags {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ogr-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
}

.ogr-badge-career { background: #e0f2fe; color: #0369a1; }
.ogr-badge-time { background: #fef3c7; color: #b45309; }
.ogr-badge-status { background: #fee2e2; color: #991b1b; }
.ogr-badge-status.is-ok { background: #dcfce7; color: #166534; }

.ogr-option-box {
    text-align: right;
}

.ogr-opt-title {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
}

.ogr-opt-details {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

/* Alerta de Autorizaciones */
.ogr-auth-alert-banner {
    background: #fffbeb;
    border: 2px solid #f59e0b;
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.1);
}

.ogr-auth-alert-icon {
    font-size: 32px;
}

.ogr-auth-alert-body h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 800;
    color: #92400e;
}

.ogr-auth-alert-body p {
    margin: 0 0 10px 0;
    font-size: 13.5px;
    color: #78350f;
}

.ogr-auth-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ogr-auth-companion-chip {
    background: #ffffff;
    border: 1px solid #fcd34d;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #78350f;
}

/* Bloque Bultos */
.ogr-packages-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 24px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.ogr-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.ogr-box-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
}

.ogr-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.ogr-pkg-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s ease;
}

.ogr-pkg-card.is-scanned {
    border-color: #10b981;
    background: #ecfdf5;
}

.ogr-pkg-left h5 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}

.ogr-pkg-left p {
    margin: 0;
    font-size: 12.5px;
    color: #64748b;
    font-family: monospace;
}

.ogr-pkg-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    background: #fee2e2;
    color: #991b1b;
}

.ogr-pkg-card.is-scanned .ogr-pkg-status-badge {
    background: #d1fae5;
    color: #065f46;
}

/* Visor de Cámara */
.ogr-cam-viewport {
    background: #0f172a;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ogr-cam-tools {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: #ffffff;
    font-size: 13px;
}

.ogr-video-wrapper {
    position: relative;
    width: 320px;
    height: 240px;
    background: #000000;
    border-radius: 10px;
    overflow: hidden;
}

.ogr-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ogr-scan-target-box {
    position: absolute;
    inset: 30px;
    border: 2px dashed #38bdf8;
    border-radius: 8px;
    pointer-events: none;
}

.ogr-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #ef4444;
    animation: scanAnim 1.8s infinite ease-in-out;
}

@keyframes scanAnim {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

.ogr-cam-feedback {
    color: #e2e8f0;
    font-size: 13px;
    margin-top: 8px;
    font-weight: 600;
}

/* Bloque Firma */
.ogr-signature-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 24px;
    border: 1px solid #e2e8f0;
}

.ogr-collector-selector {
    display: flex;
    gap: 15px;
    font-size: 14px;
    font-weight: 600;
}

.ogr-collector-details-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 14px;
}

.ogr-input-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}

.ogr-input-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.ogr-canvas-wrapper {
    position: relative;
    border: 2px dashed #94a3b8;
    border-radius: 12px;
    background: #fdfdfd;
    height: 160px;
    margin-bottom: 16px;
    touch-action: none;
}

.ogr-canvas-wrapper canvas {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    cursor: crosshair;
}

.ogr-btn-clear {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.ogr-btn-clear:hover {
    background: #e2e8f0;
}

.ogr-delivery-actions {
    text-align: right;
}

.ogr-delivery-actions .ogr-btn-success {
    width: 100%;
}
