/* Cores da BioCare Ocupacional */
:root {
    --primary-teal: #1a7f8e;
    --primary-green: #7eb854;
    --dark-gray: #4a4a4a;
    --light-gray: #f5f7fa;
    --white: #ffffff;
    --border-color: #e1e8ed;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --shadow: rgba(26, 127, 142, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8f5e9 100%);
    color: var(--dark-gray);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 4px 20px var(--shadow);
}

.logo-section {
    margin-bottom: 20px;
}

.logo {
    max-width: 200px;
    height: auto;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-teal), var(--primary-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 400;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.tab-button {
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--primary-teal);
    background: var(--white);
    color: var(--primary-teal);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-button:hover {
    background: var(--primary-teal);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow);
}

.tab-button.active {
    background: linear-gradient(135deg, var(--primary-teal), var(--primary-green));
    color: var(--white);
    border-color: transparent;
}

.tab-button i {
    font-size: 1.2rem;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card */
.card {
    background: var(--white);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 30px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.card-title {
    font-size: 1.8rem;
    color: var(--primary-teal);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-title i {
    font-size: 1.5rem;
}

/* Form */
.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.form-group label i {
    color: var(--primary-teal);
}

.form-group input,
.form-group textarea {
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(26, 127, 142, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn {
    padding: 14px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-teal), var(--primary-green));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(26, 127, 142, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 127, 142, 0.4);
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--dark-gray);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--error);
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-info {
    background: var(--primary-teal);
    color: var(--white);
}

.btn-info:hover {
    background: #156670;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning);
    color: var(--dark-gray);
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

/* Mensagem */
.mensagem {
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

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

.mensagem.sucesso {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.mensagem.erro {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* Integration Info */
.integration-info {
    background: linear-gradient(135deg, #f0f9ff 0%, #e8f5e9 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    align-items: center;
}

.info-card h3 {
    color: var(--primary-teal);
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card p {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-gray);
}

.endpoint-code {
    display: block;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--primary-teal);
    word-break: break-all;
    margin-bottom: 10px;
}

.webhook-config {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.webhook-config p {
    margin-bottom: 8px;
}

.webhook-config small {
    display: block;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
}

.webhook-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
    color: var(--primary-teal);
}

.webhook-input:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(26, 127, 142, 0.1);
}

.webhook-buttons {
    display: flex;
    gap: 10px;
}

.btn-copy {
    padding: 8px 16px;
    background: var(--primary-teal);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-copy:hover {
    background: var(--primary-green);
    transform: translateY(-2px);
}

.info-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    min-width: 100px;
}

.stat-item i {
    font-size: 2rem;
    color: var(--primary-teal);
    margin-bottom: 10px;
}

.stat-item span {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-teal);
}

.stat-item small {
    color: #666;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Search Box */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-teal);
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(26, 127, 142, 0.1);
}

/* Table */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.table thead {
    background: linear-gradient(135deg, var(--primary-teal), var(--primary-green));
    color: var(--white);
}

.table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

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

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

.table td.loading {
    text-align: center;
    padding: 40px;
    color: var(--primary-teal);
    font-size: 1.1rem;
}

/* Action Buttons in Table */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 10px 16px;
    border: 2px solid var(--primary-teal);
    background: var(--white);
    color: var(--primary-teal);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-teal);
    color: var(--white);
}

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

.pagination button.active {
    background: linear-gradient(135deg, var(--primary-teal), var(--primary-green));
    color: var(--white);
    border-color: transparent;
}

.pagination span {
    color: var(--dark-gray);
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--white);
    margin: 5% auto;
    padding: 40px;
    border-radius: 15px;
    max-width: 600px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

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

.modal-title {
    color: var(--primary-teal);
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-gray);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--error);
}

.detalhes-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.detalhes-label {
    font-weight: 600;
    color: var(--primary-teal);
    display: block;
    margin-bottom: 5px;
}

.detalhes-value {
    color: var(--dark-gray);
}

/* Badges */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--dark-gray);
    font-size: 0.9rem;
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .card {
        padding: 25px;
    }

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

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .search-box {
        max-width: 100%;
        width: 100%;
    }

    .integration-info {
        grid-template-columns: 1fr;
    }

    .info-stats {
        flex-direction: column;
        width: 100%;
    }

    .stat-item {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-button {
        width: 100%;
        justify-content: center;
    }

    .table {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 10px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .modal-content {
        margin: 10% 15px;
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }

    .logo {
        max-width: 150px;
    }
}
