:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #F9FAFB;
    --card-bg: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --sidebar-bg: #111827;
    --sidebar-text: #F9FAFB;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

/* Typography */
h1, h2, h3 {
    font-weight: 600;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* Forms & Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

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

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Layouts */
.portal-container {
    max-width: 800px;
    margin: 3rem auto;
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.admin-header {
    background-color: #333333; /* Dark header like in the templates */
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-main);
    gap: 10px;
    font-weight: 500;
}

.nav-item:hover, .nav-item.active {
    background-color: var(--bg-color);
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    height: 60px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    justify-content: space-between;
}

.admin-content {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.table th {
    background-color: var(--bg-color);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }

/* Timeline for history */
.timeline {
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border-color);
    margin: 2rem 0;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.85rem;
    top: 0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: var(--primary-color);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-content {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}

/* ===================================================
   COOKIE CONSENT BANNER
   =================================================== */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1F2937;
    color: #F9FAFB;
    z-index: 9998;
    padding: 1.25rem 2rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.35s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}

.cookie-banner-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    min-width: 220px;
}

.cookie-banner-text strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.cookie-banner-text p {
    font-size: 0.875rem;
    color: #D1D5DB;
    line-height: 1.5;
    margin: 0;
}

.cookie-banner-text a {
    color: #A5B4FC;
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.btn-cookie-accept {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-cookie-accept:hover {
    background: var(--primary-hover);
}

.btn-cookie-pref {
    background: transparent;
    color: #D1D5DB;
    border: 1px solid #4B5563;
    padding: 0.6rem 1.25rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.btn-cookie-pref:hover {
    border-color: #9CA3AF;
    color: #F9FAFB;
}

/* ===================================================
   COOKIE PREFERENCES MODAL
   =================================================== */
#cookie-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cookie-modal {
    background: white;
    border-radius: 0.75rem;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    animation: fadeInScale 0.25s ease;
    outline: none;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cookie-modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0 0.25rem;
    transition: color 0.15s;
}

.cookie-modal-close:hover {
    color: var(--text-main);
}

.cookie-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-category {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
    background: white;
}

.cookie-category-disabled {
    background: var(--bg-color);
    opacity: 0.75;
}

.cookie-category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-category strong {
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.35rem;
}

.cookie-category-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.cookie-toggle-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.cookie-always-on {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
    white-space: nowrap;
    background: #D1FAE5;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}

.cookie-not-used {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    background: var(--border-color);
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}

.cookie-details {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cookie-tag {
    font-family: monospace;
    font-size: 0.78rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    color: var(--text-muted);
}

.cookie-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ===================================================
   PORTAL NAV (movido de portal/header.php)
   =================================================== */
.portal-nav {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.portal-nav a {
    margin-left: 1.5rem;
    font-weight: 500;
}

/* Estilos da tela de login estão em src/Views/admin/login.php
   via bloco <style> local — necessário para isolar o layout
   desta página standalone do CSS geral. */
