/* ========================================
   SGND - Page-specific Styles
   ======================================== */

/* === Dashboard Home === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.chart-card .card-body {
    height: 280px;
}

.chart-filter {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
}

.activity-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.activity-content {
    flex: 1;
}

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

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Ujier Performance */
.ujier-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.ujier-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
}

.ujier-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 600;
}

.ujier-info {
    flex: 1;
}

.ujier-name {
    font-size: 0.9375rem;
    font-weight: 500;
}

.ujier-stats {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ujier-progress {
    width: 80px;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

/* === Form Container === */
.form-container {
    max-width: 900px;
}

.notification-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.form-section {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    font-size: 1.125rem;
    font-weight: 600;
}

.section-icon {
    font-size: 1.25rem;
}

.section-subtitle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    font-size: 1rem;
    font-weight: 500;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* === Notifications List === */
.list-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.search-bar {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
}

.search-input {
    width: 100%;
    padding: var(--space-2) var(--space-4) var(--space-2) 38px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    /* Un poco más pequeño para móviles */
}


.filter-bar {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    /* Allow wrapping on smaller screens */
}

/* Responsive filter bar for smaller screens */
.filter-bar-responsive {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select,
.filter-input {
    padding: var(--space-2) var(--space-3);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8rem;
    min-width: 120px;
    /* Minimum width for readability */
    flex-shrink: 0;
    /* Prevent shrinking below min-width */
}

/* Text-based refresh button */
.btn-refresh-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-refresh-text:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-400);
    transform: translateY(-1px);
}

.btn-refresh-text:active {
    transform: translateY(0);
}

.notifications-table-container {
    overflow-x: scroll;
    /* Force the scrollbar to always exist */
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Improved native scrollbar for Firefox - explicitly forced visible */
    scrollbar-width: auto;
    scrollbar-color: var(--primary-500) rgba(255, 255, 255, 0.1);
    margin-bottom: var(--space-4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Webkit scrollbar styling - Always visible and forced */
.notifications-table-container::-webkit-scrollbar {
    height: 12px;
    display: block !important;
}

.notifications-table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    /* Increased contrast specifically for the track */
    border-radius: 10px;
    margin: 4px;
}

.notifications-table-container::-webkit-scrollbar-thumb {
    background: var(--primary-500);
    border-radius: 10px;
    border: 2px solid var(--bg-card);
    /* Reduced border to show more of the thumb */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease;
}

.notifications-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-400);
    /* Lighter on hover */
    cursor: grab;
}

.notifications-table-container::-webkit-scrollbar-thumb:active {
    cursor: grabbing;
}


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

.notifications-table tbody tr.row-is-deleted {
    background-color: #fee2e2 !important;
    /* Stronger red background */
    border-left: 4px solid #ef4444;
}

.notifications-table tbody tr.row-is-deleted:hover {
    background-color: #fecaca !important;
}

.notifications-table tbody tr.row-is-deleted td {
    color: #991b1b !important;
    /* Red text to highlight status */
    text-decoration: line-through;
    /* Strikethrough for deleted items */
}

.status-deleted {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-weight: 800;
}

.notifications-table th,
.notifications-table td {
    padding: var(--space-2) var(--space-3);
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.notifications-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.02);
}

.notifications-table td {
    font-size: 0.875rem;
}

.notifications-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table-actions {
    display: flex;
    gap: var(--space-2);
}

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.pagination-btn {
    padding: var(--space-2) var(--space-4);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

/* Greeting box for Ujier */
.ujier-greeting-box {
    margin-bottom: var(--space-4);
    padding: var(--space-2) 0;
}

.ujier-greeting-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Header de ujier más compacto */
.ujier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-4);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-md);
}

.date-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1rem;
    font-weight: 500;
}

.route-stats {
    display: flex;
    gap: var(--space-6);
}

.route-stat {
    text-align: center;
}

.route-stat .stat-number {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

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

.btn-refresh {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 5px;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(180deg);
}

.btn-refresh:active {
    transform: scale(0.9) rotate(180deg);
}

.btn-refresh.spinning span {
    display: inline-block;
    animation: spin 1s linear infinite;
}

.view-toggle {
    margin-bottom: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    /* Permitir que baje si no entra */
}

.view-mode-btns {
    display: flex;
    background: rgba(49, 130, 206, 0.05);
    padding: 2px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(49, 130, 206, 0.1);
}

.toggle-btn {
    padding: 6px 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-reorder-toggle {
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reorder-toggle.active {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-400);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.toggle-btn {
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.toggle-btn.active {
    background: var(--gradient-primary);
    color: white;
}

.assignments-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.assignment-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-fast);
}

.assignment-card:active {
    transform: scale(0.98);
    background: rgba(59, 130, 246, 0.05);
}

.assignment-number {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.assignment-number.is-pre-aviso {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.assignment-info {
    flex: 1;
    min-width: 0;
}

.assignment-header-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    margin-bottom: var(--space-2);
}

.assignment-type {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.7rem;
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-400);
    border-radius: var(--radius-full);
    font-weight: 600;
}

.assignment-zona {
    font-size: 0.65rem;
    padding: 2px 8px;
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border-radius: var(--radius-full);
}

.badge-special {
    font-size: 0.65rem;
    padding: 2px 8px;
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.assignment-actions-quick {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.btn-quick-deliver {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-quick-deliver:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4);
    filter: brightness(1.1);
}

.btn-quick-deliver:active {
    transform: translateY(0);
}

.reorder-position-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-400);
    white-space: nowrap;
    margin-left: var(--space-2);
}

.assignment-caratula {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.assignment-recipient {
    font-size: 0.9rem;
    margin-bottom: var(--space-1);
    line-height: 1.3;
}

.assignment-address {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.assignment-arrow {
    font-size: 1.5rem;
    color: var(--primary-400);
    font-weight: 300;
}

.map-container {
    height: 500px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* === Devolución / Asignaciones View - Compact Cards === */
.zones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    /* Smaller min-width */
    gap: var(--space-4);
    /* Reduced gap */
    margin-top: var(--space-6);
    padding: var(--space-2);
}

@media (min-width: 1200px) {
    .zones-grid {
        grid-template-columns: repeat(5, 1fr);
        /* More columns on large screens */
    }
}

.zone-premium-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    /* Thinner border */
    border-radius: var(--radius-lg);
    /* Smaller radius */
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 160px;
    /* Reduced height */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    /* Softer shadow */
    position: relative;
    background: linear-gradient(145deg, var(--bg-card), rgba(255, 255, 255, 0.02));
}

.zone-premium-card:hover {
    border-color: var(--primary-500);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    z-index: 5;
}

.zone-icon {
    font-size: 2rem;
    /* Smaller icon */
    margin-bottom: var(--space-2);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    transition: transform 0.2s ease;
}

.zone-premium-card:hover .zone-icon {
    transform: scale(1.1);
}

.zone-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-600);
    color: white;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--bg-card);
}

.zone-name {
    font-size: 1rem;
    /* Smaller count/name */
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.zone-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.zone-card-footer {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    font-size: 0.7rem;
    color: var(--primary-400);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Fix selection in the table */
.data-table tbody tr.row-selected {
    background-color: rgba(49, 130, 206, 0.15) !important;
    border-left: 6px solid var(--primary-500) !important;
    box-shadow: inset 2px 0 0 rgba(49, 130, 206, 0.3);
}

.data-table tbody tr.row-selected td {
    color: var(--text-primary) !important;
    font-weight: 700;
}

.data-table tbody tr.row-selected .cell-recipient {
    color: var(--primary-600);
}

.badge-mini {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

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

.status-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

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

.status-secondary {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Responsiveness - Smart Table Layout */
.notifications-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    /* Crucial for strict column control */
}

.notifications-table th,
.notifications-table td {
    padding: 6px 8px;
    /* Compact padding */
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Zebra Striping - Professional Contrast */
.notifications-table tbody tr {
    background-color: var(--bg-card);
    /* Base */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    /* Visible line separation */
    transition: background-color 0.2s;
}

.notifications-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03);
    /* Moderate contrast */
}

/* Hover Effect - Highlight */
.notifications-table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.15) !important;
    /* Stronger blue highlight */
    border-bottom-color: rgba(59, 130, 246, 0.3);
}

.notifications-table th {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: rgba(255, 255, 255, 0.05);
    /* Slightly lighter header */
    white-space: nowrap;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

/* Specific Column Widths - Optimized */
.col-date {
    width: 90px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.col-status {
    width: 130px;
    text-align: center;
}

/* Wider for badge */
.col-zona {
    width: 70px;
    text-align: center;
}

.col-ujier {
    width: 90px;
    font-size: 0.8rem;
    font-weight: 500;
}

.col-letrado {
    width: 110px;
    font-size: 0.8rem;
}

.col-caratula {
    width: 150px;
    font-size: 0.8rem;
}

.col-exp {
    width: 90px;
    font-size: 0.85rem;
    text-align: center;
}

.col-dest {
    width: 150px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.col-dom {
    width: 160px;
    font-size: 0.8rem;
}

.col-troquel {
    width: 80px;
    font-size: 0.75rem;
    text-align: center;
    font-family: monospace;
}


/* Responsive adjustments for smaller screens - hide lower priority columns? 
   Or just let them be consistent. User wants "compact".
   The total above is ~1125px.
   If screen is smaller, horizontal scroll is inevitable but controlled.
*/

.notifications-table td {
    font-size: 0.8rem;
}

/* Base Truncate Class - Mobile Optimized */
.cell-truncate {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
    /* Default small screens */
    transition: max-width 0.3s ease;
}

/* Tablet / Small Desktop */
@media (min-width: 1024px) {
    .cell-truncate {
        max-width: 120px;
    }
}

/* Standard Desktop */
@media (min-width: 1366px) {
    .cell-truncate {
        max-width: 180px;
    }
}

/* Large Monitors */
@media (min-width: 1600px) {
    .cell-truncate {
        max-width: 250px;
    }
}

/* Ultra Wide */
@media (min-width: 1920px) {
    .cell-truncate {
        max-width: 350px;
    }
}

/* Specific Column Tuning (Optional) */
/* Allow Caratula/Recipient/Domicilio more space relative to others? */
/* Not necessary if all use generic .cell-truncate, simpler is better for now */

.cell-recipient {
    font-weight: 600;
    color: var(--text-primary);
}

.cell-ujier-brief {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.selected-msg {
    font-weight: 600;
    color: var(--primary-400);
    font-size: 1rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-500);
    color: var(--primary-400);
}

.btn-outline:hover {
    background: rgba(59, 130, 246, 0.1);
}

.dashboard-card.hidden {
    display: none;
}

/* === Reports === */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.report-card {
    padding: var(--space-6);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    text-align: center;
}

.report-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-3);
}

.report-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.report-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.report-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.report-date-input,
.report-select {
    width: 100%;
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-align: center;
}

.assignment-arrow {
    color: var(--text-muted);
    font-size: 1.5rem;
    opacity: 0.5;
}

/* Reorder Controls Vertical */
.reorder-controls-vertical {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: var(--space-2);
}

.reorder-btn-mini {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.reorder-btn-mini:hover:not(:disabled) {
    background: var(--primary-500);
    color: white;
}

.reorder-btn-mini:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.assignment-card.selected {
    border-color: var(--primary-500);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.05);
}

/* === Diligencia Modal Specific === */
.notification-summary {
    padding: 0;
    margin-bottom: var(--space-4);
}

.notif-summary-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: rgba(59, 130, 246, 0.15);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.summary-tipo {
    font-weight: 600;
    color: var(--primary-400);
    font-size: 0.9rem;
}

.summary-zona {
    font-size: 0.75rem;
    padding: 2px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--text-muted);
}

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

.summary-row {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 110px;
    flex-shrink: 0;
}

.summary-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-word;
}

.summary-obs {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-obs p {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-top: var(--space-1);
}

/* GPS Section Redesign */
.gps-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.gps-info {
    display: flex;
    flex-direction: column;
    background: rgba(34, 197, 94, 0.1);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.gps-coords {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 600;
}

.gps-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    display: inline-block;
}

.gps-status.captured {
    color: var(--success);
    opacity: 1;
}

.gps-status.captured .status-dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse-success 2s infinite;
}

@keyframes pulse-success {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* GPS Map Container */
.gps-map-container {
    margin-top: var(--space-2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: #1a1a1a;
    box-shadow: var(--shadow-lg);
}

.gps-map-header {
    display: flex;
    flex-direction: column;
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.15), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.gps-map-header span:first-child {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-400);
}

.gps-map-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.gps-map {
    height: 250px !important;
    width: 100%;
    background: #1a1a1a;
    z-index: 1;
}

.gps-map-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: rgba(0, 0, 0, 0.3);
}

.gps-distance {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.gps-distance.ok {
    background: rgba(34, 197, 94, 0.1);
    color: rgb(74, 222, 128);
}

.gps-distance.warning {
    background: rgba(234, 179, 8, 0.1);
    color: rgb(250, 204, 21);
}

/* Leaflet Overrides */
.leaflet-tile {
    filter: brightness(0.6) invert(1) contrast(3) hue-rotate(200deg) brightness(0.3) saturate(0.3);
}

.leaflet-container {
    background: #1a1a1a !important;
    font-family: var(--font-sans);
}

.gps-radius-circle {
    fill: rgba(59, 130, 246, 0.15);
    stroke: rgba(59, 130, 246, 0.5);
    stroke-width: 2;
}

.original-marker {
    background: var(--primary-500);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.photo-container {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.photo-upload-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-6);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-fast);
}

.photo-upload-btn:hover {
    border-color: var(--primary-500);
    background: rgba(59, 130, 246, 0.05);
}

.upload-icon {
    font-size: 2rem;
}

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

.photo-preview {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Photo Preview Grid */
.photo-preview-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 15px;
}

.photo-preview-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-item .btn-remove-photo {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.audio-container {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.btn-audio {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border-radius: var(--radius-lg);
}

.btn-audio:hover {
    background: rgba(139, 92, 246, 0.25);
}

.audio-recording {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--error);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.btn-stop {
    padding: var(--space-2) var(--space-4);
    background: var(--error);
    color: white;
    border-radius: var(--radius-md);
}

.audio-playback {
    width: 100%;
    margin-top: var(--space-3);
}

/* === Responsive === */
@media (max-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .reports-grid {
        grid-template-columns: 1fr;
    }
}

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

    .form-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-wrap: wrap;
        width: 100%;
    }

    .filter-select,
    .filter-input {
        flex: 1;
        min-width: 120px;
    }

    .ujier-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: var(--space-4);
        gap: var(--space-3);
    }

    .route-stats {
        width: 100%;
        justify-content: center;
        gap: var(--space-4);
    }
}

/* ========================================
   ASIGNACIONES VIEW
   ======================================== */
.asignaciones-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
}

.asignaciones-panel {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    max-height: 600px;
}

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

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.panel-count {
    background: var(--primary-600);
    color: white;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
}

.panel-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.asignacion-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    cursor: pointer;
    transition: var(--transition-fast);
}

.asignacion-item:hover {
    border-color: var(--primary-500);
}

.asignacion-item.selected {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-500);
}

.asignacion-info {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.asignacion-expediente {
    font-weight: 600;
    font-size: 0.9375rem;
}

.asignacion-tipo {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.asignacion-destinatario {
    font-size: 0.875rem;
}

.badge-zona {
    font-size: 0.6875rem;
    padding: 2px 6px;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border-radius: var(--radius-sm);
}

/* Ujier cards for assignment */
.ujieres-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
}

.ujier-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.ujier-card.selected {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary-500);
    box-shadow: var(--shadow-glow);
}

.ujier-card .ujier-avatar {
    font-size: 1.5rem;
}

.ujier-card .ujier-info {
    flex: 1;
}

.ujier-card .ujier-nombre {
    font-weight: 600;
    font-size: 1rem;
    display: block;
}

.ujier-card .ujier-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ujier-card .ujier-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ========================================
   USUARIOS VIEW
   ======================================== */
.usuarios-table-container {
    overflow-x: auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.usuarios-table th,
.usuarios-table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.usuarios-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.02);
}

.usuarios-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-ujier {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge-auditor {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.actions-cell {
    display: flex;
    gap: var(--space-2);
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

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

/* Tabs de navegación */
.view-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    background: var(--bg-card);
    padding: var(--space-1);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: fit-content;
}

.tab-btn {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--primary-600);
    color: white;
    box-shadow: var(--shadow-sm);
}

.tab-badge {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    min-width: 20px;
}

/* Modal full screen on desktop */
@media (min-width: 1024px) {
    .modal-lg {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .modal-lg .modal-body {
        max-height: calc(100vh - 120px) !important;
        padding: var(--space-8);
    }

    .details-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.filter-select.highlight {
    border-color: var(--primary-500);
    color: var(--primary-300);
    font-weight: 700;
}

/* Tabla administrativa optimizada */
.notifications-table-container {
    width: 100%;
    overflow-x: auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: var(--space-2);
}

.notifications-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
    /* Asegura espacio para todas las columnas */
}

.notifications-table th {
    background: rgba(255, 255, 255, 0.02);
    text-align: left;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-4) var(--space-2);
}

.notifications-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.1s;
}

/* Zebra striping para diferenciar mejor las filas */
.notifications-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

.notifications-table tr:hover {
    background: rgba(59, 130, 246, 0.05) !important;
}

.notifications-table td {
    padding: var(--space-4) var(--space-2);
    font-size: 0.825rem;
    color: var(--text-base);
    line-height: 1.4;
    vertical-align: middle;
}

.date-group-row td {
    background: rgba(59, 130, 246, 0.1) !important;
    color: var(--primary-300) !important;
    font-weight: 700;
    font-size: 0.75rem !important;
    padding: 8px 16px !important;
    border-left: 4px solid var(--primary-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.view {
    padding: var(--space-2) var(--space-4);
    max-width: 100%;
}

.action-btn-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-card);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.action-btn-circle:hover {
    background: var(--primary-600);
    transform: scale(1.05);
}

.action-btn-circle.rotating span {
    animation: rotate 1s linear infinite;
    display: inline-block;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.search-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* === Historial Ujier === */
.filter-input-date,
.filter-input-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    color: var(--text-primary);
    font-size: 0.875rem;
    height: 42px;
    outline: none;
    transition: all 0.2s;
    flex: 1;
    min-width: 120px;
}

.filter-input-date:focus,
.filter-input-select:focus {
    border-color: var(--primary-500);
    background: rgba(255, 255, 255, 0.08);
}

.filter-group {
    display: flex;
    gap: var(--space-2);
    width: 100%;
}

.historial-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.historial-card {
    align-items: flex-start;
}

.historial-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

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

.historial-expediente {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

.historial-resultado {
    margin-top: var(--space-2);
}

.resultado-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.resultado-atiende {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.resultado-no_atiende {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.resultado-pre_aviso {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-400);
}

.resultado-estrados {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.resultado-domicilio_inexistente,
.resultado-diligenciador_ausente {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.historial-obs {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-muted);
    margin-top: var(--space-2);
}

.historial-foto {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.historial-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.historial-zona {
    font-size: 0.65rem;
    padding: 1px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-weight: 500;
}

/* Visitas Historial en Modal */
.visitas-historial-compact {
    margin-top: var(--space-4);
    padding: var(--space-3);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.visitas-title {
    font-size: 0.8rem;
    color: var(--primary-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.visita-item-mini {
    padding: var(--space-2) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.visita-item-mini:last-child {
    border-bottom: none;
}

.visita-adjuntos-mini {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

.modal-image-content {
    max-width: 90vw;
    width: 500px;
}

.visita-trans-mini {
    font-size: 0.8rem;
    color: var(--primary-300);
    margin-top: 4px;
    background: rgba(59, 130, 246, 0.05);
    padding: 6px;
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--primary-500);
}

.visita-gps-link {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--primary-400);
    text-decoration: none;
    font-weight: 600;
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-full);
    width: fit-content;
    transition: all 0.2s;
}

.visita-gps-link:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.visita-foto-mini {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.visita-foto-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.visita-gps-link {
    font-size: 0.75rem;
    color: var(--primary-400);
    text-decoration: underline;
    font-weight: 500;
}

.visita-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

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

.visita-resultado-mini {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}

.visita-obs-mini {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    margin: 4px 0 0 0;
}

/* Responsive for new views */
@media (max-width: 1024px) {
    .asignaciones-grid {
        grid-template-columns: 1fr;
    }

    .asignaciones-panel {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .actions-cell {
        flex-direction: column;
    }

    .usuarios-table th:nth-child(5),
    .usuarios-table td:nth-child(5) {
        display: none;
    }

    .view-toggle {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }

    .search-bar {
        min-width: 100%;
    }

    .filter-group {
        flex-direction: column;
    }

    .filter-input-date,
    .filter-input-select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .view-toggle {
        flex-direction: column;
        align-items: stretch;
    }

    .view-mode-btns {
        justify-content: center;
    }

    .btn-reorder-toggle {
        width: 100%;
        text-align: center;
    }
}

/* Map Fullscreen */
body.map-fullscreen {
    overflow: hidden !important;
}

#admin-map-container.fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    /* Above everything */
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
}

.btn-close-map-fs {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000000;
    /* Above the map */
    background: rgba(15, 23, 42, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    transition: all 0.2s;
}

.btn-close-map-fs:hover {
    background: #ef4444;
    transform: scale(1.05);
    border-color: #ef4444;
}

/* Image Viewer Modal */
.image-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 5000000;
    /* Higher than map fullscreen (999999) */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.image-viewer-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.image-viewer-content {
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.image-viewer-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.image-viewer-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.image-viewer-caption {
    color: #e2e8f0;
    text-align: center;
    margin-top: 15px;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Ensure mandatory password reset modal is always visible when active */
#modal-password-reset.modal:not(.hidden) {
    display: flex !important;
    z-index: 2500000;
}

/* Bulk Groups List */
.bulk-groups-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bulk-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.bulk-group-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.bulk-group-item .group-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bulk-group-item .group-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1rem;
}

.bulk-group-item .group-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bulk-group-item .group-arrow {
    font-size: 1.5rem;
    color: var(--primary);
    opacity: 0.5;
}

/* Bulk Deliver Button */
.btn-bulk-deliver-open {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    transition: all 0.2s ease;
}

.btn-bulk-deliver-open:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* === SKELETON LOADING === */
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    height: 100px;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    overflow: hidden;
    position: relative;
    margin-bottom: var(--space-3);
}

.skeleton-pulse {
    animation: pulse-bg 1.5s infinite ease-in-out;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
}

@keyframes pulse-bg {
    0% {
        background-color: rgba(255, 255, 255, 0.05);
    }

    50% {
        background-color: rgba(255, 255, 255, 0.08);
    }

    100% {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

.skeleton-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

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

.skeleton-text-lg {
    height: 16px;
    width: 70%;
    border-radius: 4px;
}

.skeleton-text-md {
    height: 12px;
    width: 40%;
    border-radius: 4px;
}

.skeleton-text-sm {
    height: 10px;
    width: 25%;
    border-radius: 4px;
}

/* === Reference Explorer Carousel === */
.reference-photo-container {
    position: relative;
    overflow: hidden;
    height: 180px;
    /* Fixed height for the photo area */
    background: #f1f5f9;
}

.reference-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0;
    height: 100%;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.reference-carousel::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.reference-slide-img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    scroll-snap-align: start;
    cursor: pointer;
}

.reference-photo-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.65rem;
    z-index: 2;
}

.reference-badge-zona {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    z-index: 2;
}

.reference-no-photo {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.reference-no-photo span {
    font-size: 2rem;
    margin-bottom: 8px;
}