﻿/* ========================================
   SGND - Component Styles
   ======================================== */

.hidden-important {
    display: none !important;
}

/* === Loading Overlay === */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.loading-text {
    font-weight: 500;
    letter-spacing: 0.5px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: #edf2f7;
    color: var(--text-primary);
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: var(--primary-500);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: white;
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
}

.btn-login {
    width: 100%;
    padding: var(--space-4);
    font-size: 1rem;
}

/* === Form Elements === */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.label-icon {
    font-size: 1rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px;
    opacity: 0.7;
}

.password-toggle:hover {
    opacity: 1;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #64748b;
    border-radius: 4px;
    transition: all var(--transition-fast);
    position: relative;
    background: #ffffff;
}

.checkbox-wrapper input:checked+.checkbox-custom {
    background: var(--primary-600);
    border-color: var(--primary-600);
}

.checkbox-wrapper input:checked+.checkbox-custom::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    transition: var(--transition-base);
}

.slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition-base);
}

.switch input:checked+.slider {
    background: var(--warning);
    border-color: var(--warning);
}

.switch input:checked+.slider::before {
    transform: translateX(24px);
    background: white;
}

/* Input with prefix */
.input-with-prefix {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 500;
}

.input-with-prefix .form-input {
    padding-left: 32px;
}

/* === Cards === */
.glass-card {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-link {
    font-size: 0.875rem;
    color: var(--primary-500);
}

.card-link:hover {
    color: var(--primary-400);
}

.card-body {
    padding: var(--space-4) var(--space-6);
}

/* === Stat Cards === */
.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-6);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-primary::before {
    background: var(--primary-500);
}

.stat-success::before {
    background: var(--success);
}

.stat-warning::before {
    background: var(--warning);
}

.stat-info::before {
    background: var(--info);
}

.stat-icon {
    font-size: 2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
}

.stat-content {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.stat-trend {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: var(--radius-full);
}

.trend-up {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* === Badges === */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-600);
    color: white;
    border-radius: var(--radius-full);
}

.sync-badge {
    background: var(--warning);
}

/* === Status Badge === */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.status-completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-deferred {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.status-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.status-error {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

/* === Error Message === */
.error-message {
    margin-top: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.875rem;
    text-align: center;
}

/* === Modal === */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000000;
    /* Higher than map fullscreen (999999) */
    /* Aumentado para estar sobre todo */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    pointer-events: auto;
    /* Asegurar que capture eventos */
}

.modal.hidden,
.hidden-important {
    display: none !important;
}

.modal>.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: -1;
}

.modal>.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: var(--shadow-xl);
    z-index: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-6);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding-top: var(--space-6);
    padding-bottom: var(--space-4);
    /* Asegura espacio extra */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: var(--space-6);
}

/* === Modal Overlay Full Screen === */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    animation: fadeIn 0.2s ease;
}

.modal-overlay.fade-out {
    animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.modal-lg {
    max-width: 800px;
    width: 100%;
}

/* === Modal === */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
    background: var(--gradient-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    color: white;
}

.modal-header h2,
.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: white !important;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    background: var(--bg-tertiary);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* === Detail Sections === */
.detail-section {
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-section h4 {
    margin: 0 0 var(--space-4) 0;
    font-size: 0.95rem;
    color: var(--primary-400);
    font-weight: 600;
}

/* === Detail Status Banner === */
.detail-status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
}

.detail-status-banner.status-success {
    background: rgba(16, 185, 129, 0.15);
}

.detail-status-banner.status-pending {
    background: rgba(245, 158, 11, 0.15);
}

.detail-status-banner.status-warning {
    background: rgba(239, 68, 68, 0.15);
}

.status-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === Details Grid === */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3) var(--space-6);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.detail-obs {
    padding: var(--space-3);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: var(--space-2);
}

.detail-meta {
    background: var(--bg-tertiary);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    color: var(--text-muted);
}

.badge-migrated {
    display: inline-block;
    margin-top: var(--space-2);
    padding: var(--space-1) var(--space-2);
    background: rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

/* === Evidence Photo === */
.evidencia-foto {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: transform 0.2s;
}

.evidencia-foto:hover {
    transform: scale(1.02);
}

/* === Visitas List === */
.visitas-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.visita-item {
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-500);
    transition: background 0.2s;
}

.visita-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.visita-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.visita-fecha {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.visita-obs {
    font-size: 0.9rem;
    margin: var(--space-2) 0;
    color: var(--text-secondary);
}

.visita-foto {
    max-width: 150px;
    max-height: 100px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-top: var(--space-2);
}

.visita-ubicacion {
    display: inline-block;
    padding: var(--space-2) var(--space-3);
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-400);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    text-decoration: none;
    margin-top: var(--space-2);
    transition: background 0.2s;
}

.visita-ubicacion:hover {
    background: rgba(59, 130, 246, 0.25);
}

/* Premium Visit History Actions */
.btn-visit-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-visit-action:active {
    transform: translateY(0);
}

.sidebar-timeline-box .timeline-steps {
    position: relative;
    padding-left: 0;
}

.sidebar-timeline-box .timeline-steps::before {
    content: '';
    position: absolute;
    left: 14px;
    /* Center of 28px marker */
    top: 10px;
    bottom: 40px;
    width: 2px;
    background: rgba(var(--primary-rgb), 0.1);
    z-index: 0;
}

.sidebar-timeline-box .timeline-step {
    position: relative;
    z-index: 1;
}

/* Responsive - Mobile improvements */
@media (max-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-lg {
        max-width: 100%;
        max-height: 95vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        animation: slideUp 0.3s ease;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-body {
        padding: var(--space-4);
        max-height: calc(95vh - 140px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-header {
        padding: var(--space-4);
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    .modal-footer {
        padding: var(--space-3) var(--space-4);
        position: sticky;
        bottom: 0;
        z-index: 10;
    }

    .detail-section h4 {
        font-size: 0.9rem;
    }

    .detail-label {
        font-size: 0.7rem;
    }

    .detail-value {
        font-size: 0.85rem;
    }

    .visita-item {
        padding: var(--space-3);
    }

    .visita-foto {
        max-width: 120px;
        max-height: 80px;
    }

    .evidencia-foto {
        max-height: 200px;
    }

    .detail-status-banner {
        padding: var(--space-3);
        flex-direction: column;
        gap: var(--space-2);
        text-align: center;
    }
}

/* Tablet improvements */
@media (min-width: 769px) and (max-width: 1024px) {
    .modal-lg {
        max-width: 90%;
    }
}

/* Desktop improvements */
@media (min-width: 1025px) {
    .modal-lg {
        max-width: 800px;
    }

    .modal-body {
        max-height: 70vh;
        overflow-y: auto;
    }

    .modal-body::-webkit-scrollbar {
        width: 6px;
    }

    .modal-body::-webkit-scrollbar-track {
        background: var(--bg-tertiary);
        border-radius: 3px;
    }

    .modal-body::-webkit-scrollbar-thumb {
        background: var(--primary-500);
        border-radius: 3px;
    }
}

/* === Toast === */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000000;
    /* Always on top */
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-info {
    border-left: 4px solid var(--info);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   MOBILE UX OPTIMIZATIONS
   Touch targets min 48px, comfortable spacing
   ======================================== */

/* Larger touch targets for mobile */
@media (max-width: 768px) {

    /* All buttons minimum 48px height for easy tapping */
    .btn {
        min-height: 48px;
        padding: var(--space-4) var(--space-6);
        font-size: 1rem;
    }

    /* Form inputs larger for mobile */
    .form-input,
    .form-select,
    .form-textarea {
        min-height: 48px;
        padding: var(--space-4);
        font-size: 1rem;
    }

    /* Action buttons for Ujier - extra large and prominent */
    .btn-action-mobile {
        width: 100%;
        min-height: 56px;
        font-size: 1.1rem;
        font-weight: 600;
        border-radius: var(--radius-xl);
        margin-bottom: var(--space-3);
    }

    /* Primary action button (GPS, Photo, Submit) */
    .btn-action-primary {
        background: var(--gradient-primary);
        color: white;
        box-shadow: var(--shadow-lg), var(--shadow-glow);
    }

    .btn-action-primary:active {
        transform: scale(0.98);
        box-shadow: var(--shadow-md);
    }

    /* Secondary action button */
    .btn-action-secondary {
        background: var(--bg-card);
        border: 2px solid var(--primary-500);
        color: var(--primary-500);
    }

    /* Success action button (Confirm/Save) */
    .btn-action-success {
        background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
        color: white;
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    }

    /* Danger action button */
    .btn-action-danger {
        background: linear-gradient(135deg, var(--error) 0%, #dc2626 100%);
        color: white;
    }

    /* Assignment cards - larger tap area */
    .assignment-card {
        padding: var(--space-5);
        margin-bottom: var(--space-4);
        border-radius: var(--radius-xl);
    }

    /* Status select in diligencia form */
    .form-select-large {
        min-height: 56px;
        font-size: 1.1rem;
        font-weight: 500;
    }

    /* Sticky bottom action bar for mobile */
    .mobile-action-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: var(--space-4);
        background: var(--bg-darker);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        gap: var(--space-3);
        z-index: 100;
        padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
    }

    .mobile-action-bar .btn {
        flex: 1;
    }

    /* Extra padding at bottom to account for fixed action bar */
    .has-mobile-action-bar {
        padding-bottom: 100px;
    }

    /* Toast at top on mobile for better visibility */
    .toast-container {
        top: 24px;
        bottom: auto;
        right: 16px;
        left: 16px;
    }

    .toast {
        width: 100%;
    }

    /* Larger checkboxes for mobile */
    .checkbox-custom {
        width: 24px;
        height: 24px;
    }

    /* Photo capture button - very prominent */
    .btn-capture-photo {
        width: 100%;
        min-height: 64px;
        font-size: 1.2rem;
        background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
        color: white;
        border-radius: var(--radius-xl);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-3);
        box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
    }

    .btn-capture-photo .icon {
        font-size: 1.5rem;
    }

    /* GPS capture button */
    .btn-capture-gps {
        width: 100%;
        min-height: 56px;
        font-size: 1.1rem;
        background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
        color: white;
        border-radius: var(--radius-xl);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-3);
        box-shadow: 0 0 20px rgba(20, 184, 166, 0.3);
    }

    /* Audio record button */
    .btn-record-audio {
        width: 100%;
        min-height: 56px;
        font-size: 1.1rem;
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        color: white;
        border-radius: var(--radius-xl);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-3);
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
    }

    /* Confirmation dialog - larger buttons */
    .confirm-dialog-actions {
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
    }

    .confirm-dialog-actions .btn {
        width: 100%;
        min-height: 52px;
    }
}

/* Tap feedback animation */
.tap-feedback {
    transition: transform 0.1s ease;
}

.tap-feedback:active {
    transform: scale(0.97);
}

/* ========================================
   SEARCHABLE SELECT COMPONENT
   ======================================== */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: #ffffff;
    border: 1.5px solid var(--primary-500);
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.searchable-select-dropdown.show {
    display: block;
}

.searchable-select-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
}

.searchable-select-item:last-child {
    border-bottom: none;
}

.searchable-select-item:hover,
.searchable-select-item.highlighted {
    background: #eff6ff;
    color: var(--primary-700);
    font-weight: 600;
}

.searchable-select-item mark {
    background: #fef08a;
    /* Soft bright yellow mark */
    color: #854d0e;
    padding: 0 1px;
    border-radius: 2px;
    font-weight: 700;
}

.searchable-select-empty {
    padding: var(--space-4);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Light theme adjustments */
[data-theme="light"] .searchable-select-dropdown {
    background: #ffffff;
    border-color: var(--primary-500);
}

[data-theme="light"] .searchable-select-item {
    border-bottom-color: #edf2f7;
}

[data-theme="light"] .searchable-select-item:hover,
[data-theme="light"] .searchable-select-item.highlighted {
    background: var(--primary-500);
}

/* ========================================
   MEJORAS UX MOBILE - Mi Ruta y Modal
   ======================================== */

/* Reducir gap en lista de asignaciones para mÃ³vil */
@media (max-width: 768px) {
    .assignments-list {
        gap: var(--space-3);
    }

    .assignment-card {
        padding: var(--space-3);
    }

    .assignment-reorder-bar {
        padding-top: var(--space-2);
        margin-top: var(--space-2);
    }

    .reorder-btn {
        padding: var(--space-2);
        font-size: 0.7rem;
    }

    /* Modal mejorado para mÃ³vil */
    .modal-body .form-section {
        padding: var(--space-3);
        margin-bottom: var(--space-3);
        background: rgba(255, 255, 255, 0.02);
        border-radius: var(--radius-md);
    }

    .modal-body .section-subtitle {
        font-size: 0.9rem;
        margin-bottom: var(--space-2);
    }

    /* BotÃ³n GPS mÃ¡s destacado */
    .btn-gps {
        width: 100%;
        padding: var(--space-4);
        font-size: 1rem;
        justify-content: center;
    }

    .gps-info {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-2);
        padding: var(--space-3);
        background: rgba(34, 197, 94, 0.15);
        border-radius: var(--radius-md);
        color: #22c55e;
        font-weight: 500;
    }

    /* Resumen de notificaciÃ³n en modal */
    .notif-summary-card {
        background: rgba(255, 255, 255, 0.03);
        border-radius: var(--radius-md);
        padding: var(--space-3);
        margin-bottom: var(--space-4);
    }

    .summary-header {
        display: flex;
        gap: var(--space-2);
        margin-bottom: var(--space-3);
        flex-wrap: wrap;
    }

    .summary-tipo {
        padding: var(--space-1) var(--space-3);
        background: var(--gradient-primary);
        border-radius: var(--radius-full);
        font-size: 0.75rem;
        font-weight: 600;
    }

    .summary-zona {
        padding: var(--space-1) var(--space-2);
        background: rgba(139, 92, 246, 0.2);
        color: #a78bfa;
        border-radius: var(--radius-full);
        font-size: 0.7rem;
    }

    .summary-body {
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
    }

    .summary-row {
        display: flex;
        gap: var(--space-2);
        font-size: 0.85rem;
    }

    .summary-label {
        color: var(--text-muted);
        flex-shrink: 0;
    }

    .summary-value {
        flex: 1;
        word-break: break-word;
    }

    /* Select de resultado mÃ¡s grande */
    #resultado-diligencia {
        min-height: 52px;
        font-size: 1rem;
    }

    /* Botones de acciÃ³n mÃ¡s grandes */
    .modal-actions .btn {
        padding: var(--space-4);
        font-size: 1rem;
    }
}

/* === Panoramic Modal v37.0 (Ultra-Compact Executive) === */
.modal-panoramic-v2.light-theme {
    max-width: 1500px;
    width: 99vw;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.25), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header-v2 {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    padding: 8px 20px;
    border-bottom: 1px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.modal-header-v2 h2 {
    color: #0f172a !important;
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.2px;
}

.header-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 0;
}

.badge-type-pill-v2 {
    background: var(--gradient-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.header-id-pill {
    background: #e2e8f0;
    color: #475569;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.modal-close-v2 {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-close-v2:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Compact Master Bar - No Hover Animations */
.master-premium-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    padding: 12px 20px;
    background: #fafbfc;
    border-bottom: 1px solid #e2e8f0;
}

.premium-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-icon {
    font-size: 1.1rem;
}

.card-avatar {
    width: 28px;
    height: 28px;
    background: var(--gradient-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.75rem;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.card-label {
    font-size: 0.55rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 0.8rem;
    color: #1e293b;
    font-weight: 600;
    line-height: 1.2;
}

.card-value.highlight {
    color: #4f46e5;
    font-weight: 700;
}

/* Compact Dashboard Grid */
.modal-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 380px;
    background: #f8fafc;
    gap: 1px;
}

.dashboard-col {
    padding: 16px 20px;
    background: #ffffff;
    overflow-y: auto;
    max-height: 58vh;
}

.section-container {
    margin-bottom: 16px;
}

.section-title {
    font-size: 0.6rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #f1f5f9;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-table th {
    text-align: left;
    padding: 6px 0;
    color: #94a3b8;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    width: 120px;
}

.dashboard-table td {
    padding: 6px 0;
    color: #334155;
    font-size: 0.8rem;
    border-bottom: 1px solid #f8fafc;
    line-height: 1.3;
}

.val-xl {
    font-size: 1.3rem !important;
    font-weight: 800;
    color: #0f172a !important;
    letter-spacing: -0.5px;
}

.val-caratula {
    font-size: 0.75rem !important;
    line-height: 1.4;
    color: #475569 !important;
}

.val-highlight {
    color: #ea580c !important;
    font-weight: 700;
}

.val-money {
    font-weight: 800;
    color: #059669 !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem !important;
}

.badge-dest-esp {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

.dashboard-notes {
    background: #fffbeb;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #92400e;
    line-height: 1.5;
    border-left: 3px solid #f59e0b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Compact Sidebar */
.dashboard-sidebar {
    background: #fafbfc;
    padding: 16px;
    overflow-y: auto;
    max-height: 58vh;
    border-left: 1px solid #e2e8f0;
}

.sidebar-photo-box {
    margin-bottom: 16px;
}

.sidebar-title {
    font-size: 0.6rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.8px;
}

.photo-container {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.photo-container img {
    width: 100%;
    height: auto;
}

.photo-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s;
}

.photo-container:hover .photo-hint {
    opacity: 1;
}

/* Professional Visit Log */
.logistics-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.timeline-item-tactical {
    display: flex;
    gap: 10px;
    position: relative;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.timeline-item-tactical:last-child {
    border-bottom: none;
}

.timeline-dot-tactical {
    width: 8px;
    height: 8px;
    background: #4f46e5;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.timeline-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.timeline-header-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.timeline-step {
    font-size: 0.65rem;
    color: #4f46e5;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.timeline-time {
    font-size: 0.6rem;
    color: #94a3b8;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.timeline-ujier-info {
    margin-top: 0;
}

.ujier-badge-mini {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    color: #475569;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
}

.timeline-status {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.visit-notes-box {
    font-size: 0.7rem;
    color: #475569;
    margin: 4px 0 0 0;
    padding: 6px 8px;
    background: #f8fafc;
    border-radius: 4px;
    border-left: 2px solid #cbd5e1;
    line-height: 1.4;
}

/* Compact Audio Box */
.audio-transcription-box {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    border-radius: 6px;
    margin-top: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.audio-icon {
    font-size: 1rem;
}

.audio-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.audio-label {
    font-size: 0.55rem;
    color: #059669;
    font-weight: 700;
    text-transform: uppercase;
}

.transcription-text {
    font-size: 0.7rem;
    color: #065f46;
    font-style: italic;
    margin: 0;
    line-height: 1.4;
    font-weight: 500;
}

.timeline-footer {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.timeline-link {
    font-size: 0.65rem;
    font-weight: 600;
    text-decoration: none;
    color: #4f46e5;
}

.timeline-link:hover {
    text-decoration: underline;
}

.timeline-empty {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Compact Footer */
.modal-footer-v2 {
    background: linear-gradient(to top, #f8fafc, #ffffff);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #cbd5e1;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.03);
}

.footer-info-strip {
    display: flex;
    gap: 16px;
    align-items: center;
}

.info-tag {
    font-size: 0.65rem;
    color: #64748b;
}

.info-tag strong {
    color: #1e293b;
    font-weight: 600;
}

.badge-migrated-v2 {
    background: #eef2ff;
    color: #4f46e5;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    border: 1px solid #c7d2fe;
}

.footer-main-actions {
    display: flex;
    gap: 8px;
}

.btn-light-glass {
    background: white;
    color: #64748b;
    border: 1px solid #cbd5e1;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.15s;
}

.btn-light-glass:hover {
    background: #f8fafc;
    color: #475569;
    border-color: #94a3b8;
}

.btn-action-main {
    padding: 6px 14px !important;
    font-size: 0.75rem !important;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

@media (max-width: 1280px) {
    .modal-dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-sidebar {
        grid-column: span 2;
        border-left: none;
        border-top: 1px solid #e2e8f0;
        max-height: none;
    }

    .dashboard-col {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .modal-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        grid-column: span 1;
    }

    .master-premium-bar {
        grid-template-columns: 1fr;
    }

    .modal-footer-v2 {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}



.timeline-detail {
    flex: 1;
    background: white;
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.timeline-header {
    margin-bottom: 12px;
}

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

.timeline-step {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.timeline-time {
    font-size: 0.7rem;
    color: #cbd5e1;
    font-weight: 600;
}

.timeline-ujier-info {
    margin-top: 4px;
}

.ujier-badge-mini {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.timeline-status {
    font-size: 1rem;
    font-weight: 800;
    color: #1e293b;
    margin: 4px 0;
}

.visit-notes-box {
    font-size: 0.9rem;
    color: #475569;
    margin: 10px 0;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #cbd5e1;
}

/* Audio Box Light */
.audio-transcription-box {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    border-radius: 12px;
    margin-top: 10px;
}

.audio-icon {
    font-size: 1.4rem;
}

.audio-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.audio-label {
    font-size: 0.65rem;
    color: #059669;
    font-weight: 800;
    text-transform: uppercase;
}

.transcription-text {
    font-size: 0.9rem;
    color: #065f46;
    font-style: italic;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

.timeline-footer {
    display: flex;
    gap: 20px;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    margin-top: 12px;
}

.timeline-link {
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    color: #4f46e5;
    transition: color 0.2s;
}

.timeline-link:hover {
    color: #3730a3;
    text-decoration: underline;
}

/* Footer Light Premium */
.modal-footer-v2 {
    background: #f8fafc;
    padding: var(--space-5) var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
}

.footer-info-strip {
    display: flex;
    gap: var(--space-10);
}

.info-tag {
    font-size: 0.82rem;
    color: #64748b;
}

.info-tag strong {
    color: #1e293b;
    font-weight: 700;
}

.badge-migrated-v2 {
    background: #eef2ff;
    color: #4f46e5;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 900;
    border: 1px solid #c7d2fe;
}

.btn-light-glass {
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 12px 28px;
    border-radius: var(--radius-lg);
    font-weight: 800;
    transition: all 0.2s;
}

.btn-light-glass:hover {
    background: #f8fafc;
    color: #1e293b;
}

@media (max-width: 1280px) {
    .modal-dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-sidebar {
        grid-column: span 2;
        border-left: none;
        border-top: 1px solid #e2e8f0;
        max-height: none;
    }

    .dashboard-col {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .modal-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        grid-column: span 1;
    }

    .master-premium-bar {
        grid-template-columns: 1fr;
    }

    .modal-footer-v2 {
        flex-direction: column;
        gap: var(--space-5);
        text-align: center;
    }
}

/* === Tabs for Asignaciones === */
.tabs-container {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
    padding: 8px 20px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.tab-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.asignacion-ujier-actual {
    font-size: 0.75rem;
    color: #4f46e5;
    font-weight: 600;
    padding: 2px 8px;
    background: #eef2ff;
    border-radius: 4px;
}


/* === Asignaciones Panel Actions === */
.panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.btn-select-action {
    padding: 4px 12px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-select-action:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #334155;
}

.btn-select-action:active {
    transform: scale(0.98);
}

.selection-counter {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6366f1;
    padding: 4px 12px;
    background: #eef2ff;
    border-radius: 6px;
}


/* === Asignaciones Header Improvements === */
.asignaciones-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
    padding: 10px 16px;
    border-bottom: 2px solid #f1f5f9;
}

.asignaciones-panel .panel-header h3 {
    margin: 0;
    font-size: 0.9rem;
    white-space: nowrap;
}

.asignacion-info strong {
    color: #64748b;
    font-weight: 600;
    margin-right: 4px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* === Modal System === */
.modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.modal-container {
    position: relative;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-2xl), 0 0 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-xl {
    width: 95%;
    max-width: 1100px;
}

@keyframes modalAppear {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Modal override for consistency */
.modal-header {
    background: var(--gradient-primary) !important;
    color: white !important;
}

.modal-header h2,
.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white !important;
    margin: 0;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: var(--error);
}

.modal-body {
    padding: var(--space-4);
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1.5px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
}

/* === Compact Form & Grid === */
.persistent-settings-bar {
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 12px;
    padding: 10px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.p-setting {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.8125rem;
    font-weight: 500;
}

.select-mini {
    padding: 2px 10px;
    font-size: 0.85rem;
    height: 38px;
    min-width: 220px;
    border-radius: var(--radius-sm);
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #1e293b;
    font-weight: 500;
}

.p-info {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
}

.form-grid-compact {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.f-row {
    display: flex;
    gap: var(--space-3);
    width: 100%;
}

.f-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.f-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.f-group input,
.f-group select {
    padding: 10px 14px;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #1e293b;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.f-group input:focus,
.f-group select:focus {
    outline: none;
    border-color: var(--primary-500);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.checkbox-wrapper-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Modal sizing adjustments for small screens */
@media (max-width: 768px) {
    .f-row {
        flex-direction: column;
    }

    .f-group {
        width: 100% !important;
    }

    .modal-container {
        max-height: 98vh;
        border-radius: var(--radius-lg);
    }
}

/* === Compact Form Improvements === */
.compact-form .f-group label {
    display: block !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
    margin-bottom: 4px !important;
    text-transform: uppercase !important;
}

.compact-form input,
.compact-form select,
.compact-form textarea {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1.5px solid #cbd5e1 !important;
    /* Visible borders */
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    transition: all 0.2s !important;
}

.compact-form input:focus,
.compact-form select:focus {
    border-color: var(--primary-500) !important;
    background-color: #f8fafc !important;
    outline: none !important;
}

.compact-form .f-row {
    display: flex !important;
    gap: 15px !important;
    margin-bottom: 12px !important;
    align-items: flex-start !important;
}

.p-info {
    font-size: 0.75rem;
    color: #475569;
    font-style: italic;
    margin-left: auto;
}

.view-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0 !important;
}

.compact-tabs .tab-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.list-header {
    margin-top: 5px !important;
    padding-top: 0 !important;
}

/* === Photo Mobile === */
.photo-actions-row {
    display: flex;
    gap: 12px;
}

@media (max-width: 600px) {
    .photo-actions-row {
        flex-direction: column;
    }

    .photo-actions-row label {
        width: 100%;
        padding: 15px !important;
        font-size: 1.1rem !important;
    }
}

/* === Bulk Notice === */
.bulk-deliver-notice-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.notice-icon {
    font-size: 1.8rem;
    background: #fff;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.notice-content {
    flex-grow: 1;
}

.notice-content strong {
    display: block;
    color: #1e40af;
}

.btn-notice-action {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
}
/* Global Form Validation Feedback (requested by UX) */
input:required:valid,
select:required:valid,
textarea:required:valid,
.form-input:required:valid,
.form-select:required:valid,
.form-textarea:required:valid {
    border-color: #15803d !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2315803d' width='24px' height='24px'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 20px !important;
    padding-right: 35px !important; /* Ensure text doesn't overlap icon */
}
