/* ========== AGENDAMENTOS STYLES ========== */
body{
   --fundo-modal: rgba(0, 0, 0, 0.342);
   --fundo-modal-content:rgb(240, 240, 240);
   --fundo--modal-header: #f8fafc;
   --modal-header-border-butrton: 1px solid #e5e7eb;
   --color-modal-h3: #1f2937;
   --view-detalhes: #f8fafc;
   --color-modal-close: #64748b;
   --color-modal-close-hover: #f1f5f9;
   --card-bg: rgb(240, 240, 240);
   --border-color: #e5e7eb;
   --text-primary: #1f2937;
   --text-secondary: #64748b;
   --primary-color: #1e40af;
   --secondary-bg: #f8fafc;
   --hover-bg: #f1f5f9;
   --input-bg: #f8fafc;
   --input-border: #e5e7eb;
   --input-border-focus: #1e40af;
   --input-border-focus-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
   --input-color: #1f2937;
   --input-placeholder: #64748b;
   --input-placeholder-color: #64748b;
   --input-placeholder-color-focus: #1f2937;
}




.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.page-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-content h3 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number-agendamentos {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.filters-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.table-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: rgba(59, 130, 246, 0.05);
}

.table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
}

.table tbody tr:hover {
    background: rgba(59, 130, 246, 0.03);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pendente {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.badge-em_andamento {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge-reagendado {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.badge-concluido {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.badge-cancelado {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-success {
    background: #22c55e;
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-secondary {
    background: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-bg);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.342);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: rgb(240, 240, 240);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.445);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group .required {
    color: #ef4444;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background-color: rgb(240, 240, 240);
    color: rgb(0, 0, 0);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: var(--hover-bg);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Dark Theme */
body[data-theme="dark"] .stat-card {
    background: rgba(30, 41, 59, 0.5);
}

body[data-theme="dark"] .filters-section {
    background: rgba(30, 41, 59, 0.5);
}

body[data-theme="dark"] .stat-number-agendamentos {
    color: #f0eded;
}
body[data-theme="dark"] .table-container {
    background: rgba(30, 41, 59, 0.5);
}

body[data-theme="dark"] .modal-content {
    background: rgba(30, 41, 59, 0.98);
}

.ag-tecnicos-ajuda {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.tecnicos-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px 2px;
}

.agendamento-tecnico-row {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    background: var(--secondary-bg);
}

.agendamento-tecnico-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.agendamento-tecnico-row-header .btn {
    padding: 4px 10px;
}

.ag-btn-add-tec {
    margin-top: 8px;
}

.detalhe-tecnicos-lista {
    margin-top: 12px;
}

.detalhe-tecnico-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--view-detalhes);
}

.detalhe-tecnico-card strong.tec-titulo {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: auto;
    }

    .action-buttons {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }
}
