/* public/css/shared-components.css */
/* Componentes CSS compartilhados entre paginas do sistema */
/* Elimina duplicacao de modal, badge, card, empty-state, etc */

/* ==========================================
   MODAL OVERLAY
   ========================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: white;
    border-radius: 12px;
    padding: 32px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.2s ease-out;
}

.modal-box.wide {
    max-width: 640px;
}

.modal-box h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 20px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   BADGES
   ========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-purple { background: #f3e8ff; color: #7c3aed; }
.badge-gray { background: #f3f4f6; color: #6b7280; }

/* Status badges especificos */
.badge-aguardando { background: #dbeafe; color: #1d4ed8; }
.badge-chamado { background: #fef3c7; color: #92400e; }
.badge-em_atendimento { background: #dcfce7; color: #166534; }
.badge-finalizado { background: #f3f4f6; color: #6b7280; }
.badge-cancelado { background: #fee2e2; color: #dc2626; }
.badge-agendado { background: #dbeafe; color: #1d4ed8; }
.badge-confirmado { background: #dcfce7; color: #166534; }

/* ==========================================
   CARD PANEL
   ========================================== */
.card-panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card-panel h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 16px;
}

/* ==========================================
   KPI CARDS
   ========================================== */
.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 16px;
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.kpi-icon.blue { background: #dbeafe; color: #2563eb; }
.kpi-icon.red { background: #fee2e2; color: #dc2626; }
.kpi-icon.green { background: #dcfce7; color: #16a34a; }
.kpi-icon.purple { background: #f3e8ff; color: #7c3aed; }
.kpi-icon.yellow { background: #fef3c7; color: #d97706; }

.kpi-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
}

.kpi-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 2px;
}

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* ==========================================
   DATA TABLE
   ========================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f9fafb;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
}

.data-table tr:hover {
    background: #f9fafb;
}

/* ==========================================
   TABS
   ========================================== */
.tabs-bar {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    color: #2563eb;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==========================================
   LOADING SPINNER
   ========================================== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #9ca3af;
}

.loading-spinner::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 12px;
}

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