@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --nead-dark: #013a20;
    --nead-primary: #026537;
    --nead-light: #78bb6c;

    --bg-primary: #013a20;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-glow: rgba(120, 187, 108, 0.4);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --primary: #026537;
    --primary-hover: #014224;
    --primary-glow: rgba(2, 101, 55, 0.25);
    
    --accent: #78bb6c;
    --success: #10b981;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --info: #2563eb;
    --info-bg: #dbeafe;
    --danger: #ef4444;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;
    
    --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(120, 187, 108, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: radial-gradient(circle at top left, #026537, #013a20 70%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
/* Sidebar Layout Premium (Menu do Lado Esquerdo - UX Redesign) */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: #01311b;
}

.sidebar {
    width: 270px;
    background: linear-gradient(180deg, #012415 0%, #011b10 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    box-shadow: 6px 0 25px rgba(0, 0, 0, 0.3);
    z-index: 100;
    overflow-x: hidden;
}

/* Scrollbar elegante e discreta para a Sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-header {
    padding: 1.25rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    padding: 1rem 0.85rem 0.35rem 0.85rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem 0.75rem 1.5rem 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    width: 100%;
    white-space: nowrap;
    text-decoration: none;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(4px);
}

.sidebar-nav .nav-item.active {
    background: linear-gradient(135deg, #026537 0%, #014d29 100%);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    border-left: 4px solid #facc15;
}

.sidebar-nav .nav-item.active span {
    color: #ffffff;
}

.sidebar-footer {
    padding: 0.85rem 1.15rem;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-content {
    flex: 1;
    padding: 2rem 2.5rem;
    overflow-y: auto;
}

/* Header Component */
.header, .app-header {
    background: var(--nead-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-group, .header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.title-group h1 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #ffffff;
}

.title-group p {
    font-size: 0.85rem;
    color: var(--nead-light);
    font-weight: 500;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.95rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--nead-light);
    box-shadow: 0 0 10px var(--nead-light);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* Container Main */
.main-wrapper {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Top Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-main);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    background: rgba(2, 101, 55, 0.06);
    color: var(--nead-primary);
}

.stat-info .stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--nead-dark);
}

.stat-info .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    gap: 0.5rem;
    background: rgba(1, 42, 23, 0.5);
    padding: 0.4rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    color: var(--nead-dark);
    background: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Tab Panels */
.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Card Sections - PURE WHITE CARDS WITH INSTITUTIONAL TOP BORDER */
.content-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-top: 5px solid var(--nead-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-main);
    color: var(--text-primary);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--nead-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rule-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-top: 3px solid var(--nead-light) !important;
    border-radius: var(--radius-md) !important;
    padding: 1.5rem !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05) !important;
}

.rule-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--nead-dark) !important;
    margin-bottom: 1rem;
}

/* Forms & Inputs */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--nead-dark);
}

.form-control {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: #0f172a;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--nead-primary);
    box-shadow: 0 0 0 3px rgba(2, 101, 55, 0.15);
}

.filter-bar {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: var(--radius-md) !important;
    padding: 1.25rem !important;
}

/* Drag & Drop Upload Zone */
.upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--nead-primary);
    background: rgba(2, 101, 55, 0.04);
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--nead-primary);
    margin-bottom: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.btn-primary {
    background: var(--nead-primary);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(2, 101, 55, 0.3);
}

.btn-primary:hover {
    background: #014224;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 101, 55, 0.4);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Tables - UX Best Practices & Alternating Zebra Rows */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid #cbd5e1;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
    color: #0f172a;
}

.custom-table th {
    background: #e2e8f0;
    color: var(--nead-dark);
    font-weight: 800;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.95rem 1.1rem;
    border-bottom: 2px solid #cbd5e1;
    border-right: 1px solid #cbd5e1;
}

.custom-table th:last-child {
    border-right: none;
}

.custom-table td {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #f1f5f9;
    font-weight: 500;
}

.custom-table td:last-child {
    border-right: none;
}

/* Zebra Striping (Linhas Alternadas para visualização de alta legibilidade) */
.custom-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.custom-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.custom-table tbody tr:hover {
    background-color: #e6f4ea !important;
    transition: background-color 0.15s ease;
}

code {
    background: #e6f4ea;
    color: #026537;
    font-family: monospace;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.875rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-info { background: #dbeafe; color: #1e40af; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-primary { background: #e6f4ea; color: #026537; }

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.pagination-btns {
    display: flex;
    gap: 0.5rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: #ffffff;
    color: #0f172a;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    border: 1px solid #e2e8f0;
    border-left: 5px solid var(--nead-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(1, 30, 16, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--nead-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}
