@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
    --primary: #0f766e;
    --primary-dark: #0d6460;
    --primary-light: #14b8a6;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --light: #f8fafc;
    --light-2: #f1f5f9;
    --border: #e2e8f0;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.25s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--dark-2);
    background: var(--light);
    -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--light-2); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }

/* ── Container ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Header ── */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 20px rgba(15,118,110,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary-light);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

.header-title {
    text-align: center;
    flex: 1;
}

.header-title h1 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    opacity: 0.95;
}

.header-title p {
    font-size: 0.8rem;
    opacity: 0.75;
    margin: 0;
}

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

/* ── Animações ── */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes countUp {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-up { animation: fadeInUp 0.5s ease forwards; }
.animate-fade { animation: fadeIn 0.4s ease forwards; }

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 5rem 0 3rem;
    animation: fadeInUp 0.6s ease;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15,118,110,0.1);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(15,118,110,0.2);
}

.hero h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
    line-height: 1.2;
}

.hero h2 span {
    color: var(--primary);
}

.hero p {
    font-size: 1.1rem;
    color: var(--secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

/* ── Cards de Ação ── */
.actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 4rem;
}

.card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.card-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(15,118,110,0.1), rgba(20,184,166,0.15));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
}

.card h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.card p {
    color: var(--secondary);
    font-size: 0.9rem;
    margin-bottom: 0;
    line-height: 1.6;
}

/* ── Botões ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.7rem 1.6rem;
    margin-top: 1.2rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(15,118,110,0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #0a5450);
    box-shadow: 0 6px 20px rgba(15,118,110,0.4);
    transform: translateY(-1px);
}

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

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

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

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

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

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    margin-top: 0;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Seção Info ── */
.info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.info, .garantias {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.5s ease 0.4s forwards;
    opacity: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--light-2);
}

.section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

.info ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.info ul li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--secondary);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--light-2);
}

.info ul li::before {
    content: '→';
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Garantias ── */
.garantias-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

.garantia-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.garantia-item:hover {
    background: rgba(15,118,110,0.05);
}

.garantia-item .icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.garantia-item h4 {
    color: var(--dark);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.garantia-item p {
    color: var(--secondary);
    font-size: 0.8rem;
}

/* ── Formulários ── */
.form-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    max-width: 800px;
    margin: 2rem auto;
    animation: fadeInUp 0.5s ease;
}

.form-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.3rem;
}

.form-subtitle {
    color: var(--secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.5rem;
}

.form-group {
    margin-bottom: 1.4rem;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--dark-2);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,118,110,0.1);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--primary-light);
}

.form-group textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.form-check:hover {
    border-color: var(--primary);
    background: rgba(15,118,110,0.04);
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check label {
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--dark-2);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ── Alertas ── */
.alert {
    padding: 1rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #f0fdfa;
    color: #134e4a;
    border: 1px solid #99f6e4;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ── Tabela ── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    background: var(--light-2);
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--light-2);
    color: var(--dark-2);
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: rgba(15,118,110,0.03);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-success { background: #ecfdf5; color: #059669; }
.badge-warning { background: #fffbeb; color: #d97706; }
.badge-danger  { background: #fef2f2; color: #dc2626; }
.badge-info    { background: #f0fdfa; color: #0f766e; }
.badge-gray    { background: var(--light-2); color: var(--secondary); }

/* ── Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: var(--transition);
    animation: countUp 0.5s ease forwards;
    opacity: 0;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

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

.stat-card .stat-icon {
    font-size: 1.5rem;
}

.stat-card h3 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-card p {
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

/* ── Dashboard Header ── */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2rem 0 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
}

/* ── Filtros ── */
.filters-card {
    background: var(--white);
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filters-card label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filters-card select {
    padding: 0.5rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--dark-2);
    background: var(--light);
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.filters-card select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,118,110,0.1);
}

/* ── Login ── */
.login-wrapper {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.5s ease;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo .brand {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--primary);
}

.login-logo p {
    color: var(--secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}

.restricted-notice {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid var(--warning);
    padding: 0.9rem 1.2rem;
    margin-bottom: 1.8rem;
    border-radius: var(--radius-sm);
    color: #92400e;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Protocolo resultado ── */
.protocolo-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
    animation: fadeInUp 0.4s ease;
}

.protocolo-card .protocolo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.protocolo-card .protocolo-numero {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    font-family: monospace;
    letter-spacing: 1px;
}

.protocolo-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.protocolo-info-item label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 3px;
}

.protocolo-info-item span {
    font-size: 0.9rem;
    color: var(--dark-2);
    font-weight: 500;
}

/* ── Seção de dados identificação ── */
.identificacao-section {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-top: 0.5rem;
    animation: fadeInUp 0.3s ease;
}

.identificacao-section .section-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

/* ── Footer ── */
footer {
    background: var(--dark);
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 5rem;
    font-size: 0.85rem;
}

footer span {
    color: var(--primary-light);
    font-weight: 600;
}

/* ── Loading skeleton ── */
.skeleton {
    background: linear-gradient(90deg, var(--light-2) 25%, var(--border) 50%, var(--light-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--secondary);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ── Divider ── */
.divider {
    height: 1px;
    background: var(--border);
    margin: 1.5rem 0;
}

/* ── Tooltip ── */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.tooltip:hover::after { opacity: 1; }

/* ── Responsivo ── */
@media (max-width: 768px) {
    .hero h2 { font-size: 2rem; }
    .actions { grid-template-columns: 1fr; }
    .info-section { grid-template-columns: 1fr; }
    .garantias-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .form-group.full { grid-column: 1; }
    .protocolo-info { grid-template-columns: 1fr; }
    .header-title h1 { font-size: 1rem; }
    .header-title p { display: none; }
    .login-card { padding: 2rem; }
    .filters-card { flex-direction: column; align-items: flex-start; }
    .dashboard-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .hero { padding: 3rem 0 2rem; }
    .hero h2 { font-size: 1.6rem; }
    .form-card { padding: 1.5rem; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }
}
