/* Reset e configurações gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --light-bg: #f8fafc;
    --lighter-bg: #ffffff;
    --dark-text: #1e293b;
    --light-text: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--dark-text);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 15px;
}

/* Header com logos */
.header {
    background: rgba(255, 255, 255, 0.98);
    padding: 0;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
}

.logos-container {
    text-align: center;
    padding: 0;
    width: 100%;
}

.logos-container img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.page-title {
    text-align: center;
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 20px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.3px;
}

/* Cards */
.card {
    background: var(--lighter-bg);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

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

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* Formulários */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--dark-text);
    font-size: 0.875rem;
}

.form-group label .optional {
    color: var(--light-text);
    font-weight: 400;
    font-size: 0.8rem;
    font-style: italic;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: var(--lighter-bg);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: white;
}

.form-control::placeholder {
    color: var(--light-text);
    font-size: 0.85rem;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

select.form-control {
    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='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 36px;
}

/* Botões */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    letter-spacing: 0.2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 2px 8px 0 rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(37, 99, 235, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #34d399);
    color: white;
    box-shadow: 0 2px 8px 0 rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #f87171);
    color: white;
    box-shadow: 0 2px 8px 0 rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #a78bfa);
    color: white;
    box-shadow: 0 2px 8px 0 rgba(139, 92, 246, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(139, 92, 246, 0.4);
}

.btn-outline {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* Alertas */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.alert::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 1px solid var(--success-color);
}

.alert-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2310b981'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 13l4 4L19 7'%3E%3C/path%3E%3C/svg%3E");
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border: 1px solid var(--danger-color);
}

.alert-error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ef4444'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 18L18 6M6 6l12 12'%3E%3C/path%3E%3C/svg%3E");
}

.alert-info {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    color: #164e63;
    border: 1px solid var(--info-color);
}

.alert-info::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2306b6d4'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'%3E%3C/path%3E%3C/svg%3E");
}

/* Protocolo */
.protocol-number {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
    border: 2px dashed var(--primary-color);
    box-shadow: var(--shadow);
}

.protocol-number strong {
    font-size: 1.3rem;
    color: var(--primary-dark);
    font-weight: 700;
    letter-spacing: 0.5px;
    display: block;
    margin: 8px 0;
}

.protocol-number p {
    font-size: 0.875rem;
}

/* Tabelas */
.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
    font-size: 0.85rem;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table th:first-child {
    border-top-left-radius: 10px;
}

.table th:last-child {
    border-top-right-radius: 10px;
}

.table tbody tr {
    background: white;
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: var(--light-bg);
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.badge-aberto {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.badge-em_atendimento {
    background: linear-gradient(135deg, #cffafe, #a5f3fc);
    color: #164e63;
}

.badge-finalizado {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

/* Links */
.link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Menu de navegação */
.nav-menu {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 0;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border-radius: 10px;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 25px;
    align-items: center;
}

.nav-menu a {
    color: var(--dark-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    padding: 8px 16px;
    border-radius: 6px;
}

.nav-menu a:hover {
    color: var(--primary-color);
    background: var(--light-bg);
}

/* Login page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    max-width: 420px;
    width: 100%;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, var(--lighter-bg), var(--light-bg));
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.stat-card h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-card p {
    color: var(--light-text);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* Detalhes do protocolo */
.protocol-details {
    background: var(--light-bg);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid var(--primary-color);
    font-size: 0.875rem;
}

.protocol-details p {
    margin-bottom: 8px;
    line-height: 1.6;
}

.protocol-details strong {
    color: var(--dark-text);
    font-weight: 600;
}

.protocol-message {
    background: white;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    font-size: 0.875rem;
}

.protocol-message h4 {
    color: var(--dark-text);
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 1rem;
}

.protocol-response {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    padding: 16px;
    border: 2px solid var(--success-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    font-size: 0.875rem;
}

.protocol-response h4 {
    color: var(--success-color);
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 1rem;
}

/* Filtros */
.filter-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

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

/* Botões de ação no topo */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    flex: 1;
    min-width: 180px;
}

/* Responsividade */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.4rem;
    }
    
    .card {
        padding: 18px;
        border-radius: 10px;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .nav-menu ul {
        flex-direction: column;
        gap: 8px;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 10px 6px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    .filter-form select,
    .filter-form input {
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .btn {
        padding: 10px 18px;
    }
}

/* Animações suaves */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.4s ease;
}

.stat-card {
    animation: fadeIn 0.4s ease;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Modal de encaminhamento */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

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

.modal-header {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body textarea.form-control {
    min-height: 150px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), #22d3ee);
    color: white;
    box-shadow: 0 2px 8px 0 rgba(6, 182, 212, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(6, 182, 212, 0.4);
}
