/* ===================================================================
   ESCALAS DASHBOARD - STYLES
   =================================================================== */

.escalas-dashboard {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Section */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 32px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-header h1 i {
    color: #3498db;
}

.subtitle {
    margin: 5px 0 0 0;
    color: #7f8c8d;
    font-size: 14px;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #34495e;
    font-size: 13px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Stats Cards */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-primary .stat-icon {
    background: #e3f2fd;
    color: #2196f3;
}

.stat-success .stat-icon {
    background: #e8f5e9;
    color: #4caf50;
}

.stat-info .stat-icon {
    background: #e0f7fa;
    color: #00bcd4;
}

.stat-warning .stat-icon {
    background: #fff3e0;
    color: #ff9800;
}

.stat-content h3 {
    margin: 0;
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-content p {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

.view-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover {
    background: #f5f5f5;
}

.view-btn.active {
    background: #2196f3;
    color: white;
    border-color: #2196f3;
}

/* Grid View */
.escalas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.escala-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s;
}

.escala-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-4px);
}

.card-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h4 {
    margin: 0;
    font-size: 18px;
}

.card-body {
    padding: 20px;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #34495e;
}

.info-item i {
    width: 20px;
    text-align: center;
}

.card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    display: flex;
    gap: 10px;
    border-top: 1px solid #e0e0e0;
}

/* State Badges */
.state-active {
    background: #4caf50;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.state-inactive {
    background: #9e9e9e;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.state-draft {
    background: #ff9800;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

/* Table View */
.escalas-table {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.escalas-table table {
    width: 100%;
    margin: 0;
}

.escalas-table th {
    background: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    color: #7f8c8d;
}

/* Calendar View */
.calendar-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.calendar-header h3 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day-header {
    text-align: center;
    font-weight: bold;
    padding: 10px;
    background: #f8f9fa;
    color: #7f8c8d;
    font-size: 14px;
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid #e0e0e0;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    background: white;
}

.calendar-day:hover {
    background: #f0f7ff;
    border-color: #2196f3;
}

.calendar-day.empty {
    background: #fafafa;
    cursor: default;
}

.calendar-day.today {
    background: #e3f2fd;
    border-color: #2196f3;
    font-weight: bold;
}

.day-number {
    font-size: 16px;
    color: #2c3e50;
}

.day-escalas {
    margin-top: auto;
    display: flex;
    justify-content: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.empty-state i {
    color: #bdc3c7;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #7f8c8d;
    margin: 15px 0 5px 0;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    text-align: center;
}

.spinner i {
    color: #2196f3;
    margin-bottom: 15px;
}

.spinner p {
    color: #7f8c8d;
    font-size: 16px;
}

/* Vigilantes List (in modal) */
.vigilantes-list {
    max-height: 400px;
    overflow-y: auto;
}

.vigilante-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

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

.vigilante-item strong {
    display: block;
    color: #2c3e50;
}

.vigilante-item small {
    color: #7f8c8d;
    display: block;
    font-size: 12px;
}

/* Day Details (in modal) */
.day-details {
    max-height: 300px;
    overflow-y: auto;
}

.day-escala-item {
    padding: 12px;
    border-left: 3px solid #2196f3;
    background: #f8f9fa;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-escala-item strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 3px;
}

.day-escala-item small {
    color: #7f8c8d;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .escalas-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
}

/* Postos Grid View */
.postos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.posto-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.posto-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.posto-card .card-header h4 {
    margin: 0;
    font-size: 18px;
}

.posto-card .card-header small {
    display: block;
    margin-top: 5px;
    opacity: 0.9;
    font-size: 13px;
}

.vigilante-row {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
}

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

.vigilante-info strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 5px;
}

.vigilante-details {
    display: flex;
    gap: 8px;
    align-items: center;
}

.vigilante-details .badge {
    font-size: 11px;
}

/* SVG Icon Sizes */
.icon-xs {
    width: 14px;
    height: 14px;
}

.icon-sm {
    width: 18px;
    height: 18px;
}

.icon-md {
    width: 24px;
    height: 24px;
}

.icon-lg {
    width: 32px;
    height: 32px;
}

.icon-xxl {
    width: 64px;
    height: 64px;
}

/* Icon alignment */
.dashboard-header h1 svg {
    vertical-align: middle;
    margin-right: 10px;
}

.stat-icon svg {
    display: block;
}

.view-btn svg,
.btn svg {
    vertical-align: middle;
    margin-right: 4px;
}

table th svg {
    margin-right: 5px;
    vertical-align: middle;
}

/* Rotating animation for spinner */
.rotating {
    animation: rotate 1s linear infinite;
}

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

/* Date column styling */
.date-cell {
    white-space: nowrap;
    font-weight: 600;
    color: #5e72e4;
    background-color: #f8f9fe;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.empty-state svg {
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #7f8c8d;
    margin: 15px 0 5px 0;
}

/* Center align columns */
.text-center {
    text-align: center !important;
}

/* Posto card icons */
.posto-card .card-header h4 svg {
    vertical-align: middle;
    margin-right: 8px;
}

.posto-card .card-header small svg {
    vertical-align: middle;
    margin-right: 4px;
}

/* Badge styling */
.badge {
    font-size: 11px;
    padding: 4px 8px;
    font-weight: 600;
}

/* Table action buttons */
.escalas-table .btn-xs {
    padding: 4px 8px;
    margin: 0 2px;
}

.escalas-table .btn-xs svg {
    margin: 0;
}