:root {
    --eco-primary: #0d9488;
    --eco-primary-light: #14b8a6;
    --eco-primary-dark: #0f766e;
    --eco-secondary: #6366f1;
    --eco-accent: #f59e0b;
    --eco-success: #10b981;
    --eco-warning: #f59e0b;
    --eco-danger: #ef4444;
    --eco-info: #3b82f6;
    --priority-urgent: #ef4444;
    --priority-medium: #f59e0b;
    --priority-normal: #3b82f6;
    --eco-dark: #0f172a;
    --eco-gray-900: #1e293b;
    --eco-gray-800: #334155;
    --eco-gray-700: #475569;
    --eco-gray-600: #64748b;
    --eco-gray-500: #94a3b8;
    --eco-gray-400: #cbd5e1;
    --eco-gray-300: #e2e8f0;
    --eco-gray-200: #f1f5f9;
    --eco-gray-100: #f8fafc;
    --eco-gray-50: #fafbfc;
    --eco-white: #ffffff;
    --gradient-primary: linear-gradient(135deg, var(--eco-primary) 0%, var(--eco-secondary) 100%);
    --gradient-dark: linear-gradient(135deg, var(--eco-dark) 0%, var(--eco-gray-800) 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 40px -10px var(--eco-primary);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 280px;
    --header-height: 70px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--eco-gray-800);
    background: var(--eco-gray-100);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--eco-gray-200);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--eco-primary) 0%, var(--eco-primary-dark) 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--eco-primary-light) 0%, var(--eco-primary) 100%);
}

::-webkit-scrollbar-corner {
    background: var(--eco-gray-200);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--eco-primary) var(--eco-gray-200);
}

.app-container { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--gradient-dark);
    color: var(--eco-white);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width var(--transition);
    box-shadow:
        4px 0 15px rgba(0, 0, 0, 0.15),
        8px 0 30px rgba(0, 0, 0, 0.1);
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--eco-primary) 0%, var(--eco-primary-dark) 100%);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--eco-primary-light) 0%, var(--eco-primary) 100%);
}

.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: var(--eco-primary) rgba(255, 255, 255, 0.05);
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header-logo {
    background: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
}

.sidebar-header-logo img {
    height: 55px;
    width: auto;
    object-fit: contain;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    box-shadow: var(--shadow-lg);
}

.sidebar-brand h1 {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.sidebar-brand span {
    font-size: 0.75rem;
    color: var(--eco-gray-400);
}

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }

.nav-section-title {
    padding: 0.75rem 1.5rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--eco-gray-500);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    gap: 0.875rem;
    color: var(--eco-gray-400);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--eco-white);
}

.nav-item.active {
    background: rgba(13, 148, 136, 0.15);
    color: var(--eco-primary-light);
    border-left-color: var(--eco-primary-light);
}

.nav-item i { width: 22px; font-size: 1.125rem; text-align: center; }
.nav-item span { font-weight: 500; }

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.user-details {
    flex: 1;
}

.btn-logout-sidebar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-logout-sidebar:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-name { font-weight: 600; font-size: 0.875rem; }
.user-role { font-size: 0.75rem; color: var(--eco-gray-400); }
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-footer .user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

.user-avatar:hover {
    transform: scale(2.5);
    z-index: 99999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-lg);
    position: relative;
}

.user-name { font-weight: 600; font-size: 0.875rem; }
.user-role { font-size: 0.75rem; color: var(--eco-gray-400); }

.avatar-hover-expand {
    position: relative;
}

.avatar-hover-expand .user-avatar:hover,
.data-table .user-avatar:hover,
[id^="avatar-"]:hover,
[id^="dash-avatar"]:hover {
    transform: scale(3);
    z-index: 99999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    position: relative;
}

.table-container,
.data-table,
.data-table tbody,
.data-table tr,
.data-table td,
.card,
.card-body {
    overflow: visible !important;
}

.user-avatar[data-name]:hover::after {
    content: attr(data-name);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--eco-dark);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 100000;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    background: var(--eco-white);
    height: var(--header-height);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--eco-gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left { display: flex; align-items: center; gap: 1.5rem; }
.header-right { display: flex; align-items: center; gap: 1rem; }

.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--eco-dark);
}

.header-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    border: 1px solid var(--eco-gray-200);
    background: var(--eco-white);
    color: var(--eco-gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-btn:hover {
    background: var(--eco-gray-100);
    color: var(--eco-gray-800);
}

.content-area {
    flex: 1;
    padding: 2rem;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.content-area.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.content-area.fade-in {
    opacity: 0;
    transform: translateY(10px);
}

.card {
    background: var(--eco-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all var(--transition);
}

.card:hover { box-shadow: var(--shadow-lg); }

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

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--eco-dark);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.card-title i { color: var(--eco-primary); }
.card-body { padding: 1.5rem; }

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--eco-gray-200);
    background: var(--eco-gray-50);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--eco-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
}

.stat-icon.primary { background: rgba(13, 148, 136, 0.1); color: var(--eco-primary); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--eco-warning); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--eco-danger); }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--eco-success); }
.stat-icon.info { background: rgba(59, 130, 246, 0.1); color: var(--eco-info); }

.stat-label { font-size: 0.8125rem; color: var(--eco-gray-500); font-weight: 500; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--eco-dark); letter-spacing: -0.025em; }

.table-container { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--eco-gray-500);
    background: var(--eco-gray-50);
    border-bottom: 1px solid var(--eco-gray-200);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--eco-gray-100);
    vertical-align: middle;
}

.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover { background: var(--eco-gray-50); }

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

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--eco-gray-700);
    margin-bottom: 0.5rem;
}

.form-label.required::after { content: '*'; color: var(--eco-danger); margin-left: 0.25rem; }

.form-control {
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--eco-gray-700);
    background: var(--eco-white);
    border: 1px solid var(--eco-gray-300);
    border-radius: 8px;
    transition: all 0.2s ease;
    outline: none;
}

.form-control:hover {
    border-color: #0891b2;
}

.form-control:focus {
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.form-control::placeholder {
    color: var(--eco-gray-400);
    font-weight: 400;
}

select.form-control,
.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230891b2' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2.5rem;
    cursor: pointer;
}

select.form-control:disabled,
.form-select:disabled,
.form-control:disabled {
    background-color: var(--eco-gray-100);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-hint { font-size: 0.75rem; color: var(--eco-gray-500); margin-top: 0.375rem; }
.form-error { font-size: 0.75rem; color: var(--eco-danger); margin-top: 0.375rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

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

.btn-primary { background: var(--gradient-primary); color: var(--eco-white); box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-md), var(--shadow-glow); }

.btn-secondary { background: var(--eco-gray-100); color: var(--eco-gray-700); border: 1.5px solid var(--eco-gray-300); }
.btn-secondary:hover:not(:disabled) { background: var(--eco-gray-200); }

.btn-success { background: var(--eco-success); color: var(--eco-white); }
.btn-success:hover:not(:disabled) { background: #059669; }

.btn-danger { background: var(--eco-danger); color: var(--eco-white); }
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-warning { background: var(--eco-warning); color: var(--eco-white); }
.btn-warning:hover:not(:disabled) { background: #d97706; }

.btn-outline { background: transparent; border: 1.5px solid var(--eco-primary); color: var(--eco-primary); }
.btn-outline:hover:not(:disabled) { background: var(--eco-primary); color: var(--eco-white); }

.btn-ghost { background: transparent; color: var(--eco-gray-600); }
.btn-ghost:hover:not(:disabled) { background: var(--eco-gray-100); }

.btn-sm { padding: 0.5rem 0.875rem; font-size: 0.8125rem; }
.btn-lg { padding: 1rem 1.75rem; font-size: 1rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; height: 32px; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-radius: var(--radius-full);
}

.badge-primary { background: rgba(13, 148, 136, 0.1); color: var(--eco-primary-dark); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: #059669; }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.badge-info { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.badge-gray { background: var(--eco-gray-100); color: var(--eco-gray-600); }

.status-dot { width: 8px; height: 8px; border-radius: var(--radius-full); display: inline-block; }
.status-dot.active { background: var(--eco-success); }
.status-dot.inactive { background: var(--eco-gray-400); }

.status-indicator { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; }

.service-color {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--eco-white);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-overlay:not(.hidden) { opacity: 1; visibility: visible; }
.modal-overlay.hidden { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }

.modal {
    background: var(--eco-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition);
}

.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-overlay:not(.hidden) .modal { transform: scale(1) translateY(0); }
.modal.modal-lg { max-width: 700px; }
.modal.modal-xl { max-width: 900px; }

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

.modal-title { font-size: 1.125rem; font-weight: 700; color: var(--eco-dark); }

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    color: var(--eco-gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover { background: var(--eco-gray-100); color: var(--eco-gray-800); }

.modal-body { padding: 1.5rem; overflow-y: auto; max-height: calc(90vh - 140px); }

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--eco-gray-200);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--eco-gray-50);
}

.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    min-width: 320px;
    max-width: 420px;
    transform: translateX(120%);
    transition: all var(--transition);
    border: none;
    backdrop-filter: blur(10px);
}

.toast.show { transform: translateX(0); }

/* Toast Success - Verde */
.toast.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

/* Toast Error - Vermelho */
.toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* Toast Warning - Amarelo/Laranja */
.toast.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

/* Toast Info - Azul */
.toast.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

/* Toast Default */
.toast:not(.success):not(.error):not(.warning):not(.info) {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
}

.toast-icon { font-size: 1.25rem; }
.toast.success .toast-icon,
.toast.error .toast-icon,
.toast.warning .toast-icon,
.toast.info .toast-icon { color: rgba(255, 255, 255, 0.95); }

.toast-title { font-weight: 600; font-size: 0.875rem; color: white; }
.toast-message { font-size: 0.8125rem; color: rgba(255, 255, 255, 0.9); }

.tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--eco-gray-200);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--eco-gray-500);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.tab:hover { color: var(--eco-gray-700); }
.tab.active { color: var(--eco-primary); }
.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--eco-primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; gap: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }

.switch-slider {
    width: 44px;
    height: 24px;
    background: var(--eco-gray-300);
    border-radius: 9999px;
    transition: background 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.switch-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.switch input:checked + .switch-slider { background: var(--eco-primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch-label { margin-left: 0.75rem; font-size: 0.875rem; color: var(--eco-gray-700); }

.empty-state { text-align: center; padding: 3rem 2rem; }

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--eco-gray-100);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--eco-gray-400);
}

.empty-state-title { font-size: 1.125rem; font-weight: 700; color: var(--eco-dark); margin-bottom: 0.5rem; }
.empty-state-text { font-size: 0.875rem; color: var(--eco-gray-500); max-width: 300px; margin: 0 auto 1.5rem; }

.loading { display: flex; align-items: center; justify-content: center; padding: 3rem; }

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--eco-gray-200);
    border-top-color: var(--eco-primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.chart-container { position: relative; height: 300px; }

.text-primary { color: var(--eco-primary) !important; }
.text-success { color: var(--eco-success) !important; }
.text-warning { color: var(--eco-warning) !important; }
.text-danger { color: var(--eco-danger) !important; }
.text-muted { color: var(--eco-gray-500) !important; }

.bg-primary { background: var(--eco-primary) !important; }
.bg-success { background: var(--eco-success) !important; }
.bg-warning { background: var(--eco-warning) !important; }
.bg-danger { background: var(--eco-danger) !important; }

.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }

.text-center { text-align: center !important; }
.d-flex { display: flex !important; }
.d-none { display: none !important; }
.align-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }

.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }

.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-5 { margin-bottom: 1.5rem !important; }

.p-0 { padding: 0 !important; }
.w-100 { width: 100% !important; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.priority-urgente { background: var(--priority-urgent); }
.priority-medio { background: var(--priority-medium); }
.priority-normal { background: var(--priority-normal); }

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    border: 2px solid var(--eco-gray-200);
    cursor: pointer;
}

.color-input { position: absolute; opacity: 0; width: 0; height: 0; }

.action-buttons { display: flex; gap: 0.5rem; }
.action-buttons .btn-ghost { color: var(--eco-gray-600); transition: all 0.2s ease; }
.action-buttons .btn-ghost:hover { color: var(--eco-primary); background: var(--eco-gray-100); }
.action-buttons .btn-ghost.text-danger { color: var(--eco-gray-600); }
.action-buttons .btn-ghost.text-danger:hover { color: var(--eco-danger); background: #fee2e2; }
.action-buttons .btn-ghost.btn-clone { color: var(--eco-gray-600); }
.action-buttons .btn-ghost.btn-clone:hover { color: #8b5cf6; background: #f3e8ff; }
.action-buttons .btn-ghost.btn-sync { color: var(--eco-gray-600); }
.action-buttons .btn-ghost.btn-sync:hover { color: #0891b2; background: #e0f2fe; }
.action-buttons .btn-ghost.btn-link { color: var(--eco-gray-600); }
.action-buttons .btn-ghost.btn-link:hover { color: #059669; background: #d1fae5; }
.action-buttons .btn-ghost.btn-view { color: var(--eco-gray-600); }
.action-buttons .btn-ghost.btn-view:hover { color: #6366f1; background: #e0e7ff; }

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .content-area { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .modal { margin: 1rem; }
}

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

.animate-fadeIn { animation: fadeIn 0.3s ease-out; }

.tabs-container {
    width: 100%;
}

.tabs-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--eco-gray-100);
    padding: 0.5rem;
    border-radius: var(--radius);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--eco-gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--eco-primary);
}

.tab-btn.active {
    background: white;
    color: var(--eco-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn i {
    font-size: 1rem;
}

.dashboard-filters {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--eco-gray-600);
    font-size: 0.875rem;
}

.filter-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--eco-primary);
    font-weight: 500;
}

.btn-group {
    display: flex;
    gap: 0.25rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.kpi-icon.primary { background: var(--gradient-primary); }
.kpi-icon.success { background: linear-gradient(135deg, #10b981, #059669); }
.kpi-icon.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.kpi-icon.danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.kpi-icon.info { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.kpi-icon.secondary { background: linear-gradient(135deg, #6366f1, #4f46e5); }

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--eco-dark);
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--eco-gray-500);
    font-weight: 500;
}

.kpi-sublabel {
    font-size: 0.7rem;
    color: var(--eco-gray-400);
    margin-top: 0.25rem;
}

.kpi-change {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.kpi-change.positive { color: #10b981; }
.kpi-change.negative { color: #ef4444; }
.kpi-change.neutral { color: var(--eco-gray-500); }

.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.charts-row:has(.chart-card:only-child) {
    grid-template-columns: 1fr;
}

.chart-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.chart-card.chart-large {
    grid-column: span 1;
}

.chart-card.chart-full {
    grid-column: span 2;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--eco-gray-100);
}

.chart-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--eco-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-header h3 i {
    color: var(--eco-primary);
}

.chart-type-selector {
    display: flex;
    gap: 0.25rem;
}

.chart-body {
    padding: 1rem;
    height: 280px;
    position: relative;
}

.empty-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--eco-gray-400);
    font-style: italic;
}

.rankings-section {
    margin: 2rem 0;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--eco-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--eco-primary);
}

.rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.ranking-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.ranking-header {
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

.ranking-header.success { background: linear-gradient(135deg, #10b981, #059669); }
.ranking-header.danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.ranking-header.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.ranking-header.info { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.ranking-header.primary { background: var(--gradient-primary); }
.ranking-header.secondary { background: linear-gradient(135deg, #6366f1, #4f46e5); }

.ranking-body {
    padding: 0.75rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.ranking-item:hover {
    background: var(--eco-gray-50);
}

.ranking-position {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--eco-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--eco-gray-600);
}

.ranking-position.top {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.ranking-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.ranking-avatar:hover {
    transform: scale(2.5);
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.ranking-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--eco-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-stats {
    font-size: 0.7rem;
    color: var(--eco-gray-500);
}

.ranking-value {
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ranking-value.success { color: #10b981; }
.ranking-value.danger { color: #ef4444; }

.ranking-value .emoji {
    font-size: 1.1rem;
}

.empty-text {
    text-align: center;
    color: var(--eco-gray-400);
    padding: 1rem;
    font-size: 0.85rem;
}

.progress-bar {
    height: 8px;
    background: var(--eco-gray-100);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-fill.success { background: #10b981; }
.progress-fill.warning { background: #f59e0b; }
.progress-fill.danger { background: #ef4444; }

.text-success { color: #10b981 !important; }
.text-warning { color: #f59e0b !important; }
.text-danger { color: #ef4444 !important; }

.emoji {
    font-size: 1.2rem;
}

.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-4 { margin-top: 1.5rem; }

@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
    .chart-card.chart-full {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .dashboard-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    .filter-info {
        margin-left: 0;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .rankings-grid {
        grid-template-columns: 1fr;
    }
}

.drag-handle {
    cursor: grab;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

tr[draggable="true"] {
    transition: background-color 0.2s ease;
}

tr.drag-over {
    background-color: rgba(13, 148, 136, 0.1) !important;
    border-top: 2px solid var(--eco-primary) !important;
}

tr[draggable="true"]:hover .drag-handle {
    color: var(--eco-primary);
}


.tooltip-avaliacao {
    position: relative;
    display: inline-block;
    cursor: default;
}

.tooltip-avaliacao::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
}

.tooltip-avaliacao::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(30, 30, 30, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.tooltip-avaliacao:hover::after,
.tooltip-avaliacao:hover::before {
    opacity: 1;
    visibility: visible;
}

.connector-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    background: var(--eco-gray-50);
    cursor: pointer;
    transition: all 0.3s ease;
}

.connector-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.connector-card[data-status="inactive"] {
    background: #F3F4F6;
}
.connector-card[data-status="inactive"] .connector-icon {
    background: #E5E7EB;
    color: #6B7280;
}
.connector-card[data-status="inactive"] .connector-status {
    color: #6B7280;
}

.connector-card[data-status="pending"] {
    background: #FFFBEB;
}
.connector-card[data-status="pending"] .connector-icon {
    background: #FEF3C7;
    color: #D97706;
}
.connector-card[data-status="pending"] .connector-status {
    color: #D97706;
}

.connector-card[data-status="connected"] {
    background: #b7f6d8;
}
.connector-card[data-status="connected"] .connector-icon {
    background: #D1FAE5;
    color: #059669;
}
.connector-card[data-status="connected"] .connector-status {
    color: #059669;
}

.connector-card[data-status="error"] {
    background: #FEF2F2;
}
.connector-card[data-status="error"] .connector-icon {
    background: #FEE2E2;
    color: #DC2626;
}
.connector-card[data-status="error"] .connector-status {
    color: #DC2626;
}

.connector-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.connector-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.connector-info strong {
    font-size: 0.875rem;
    color: var(--eco-gray-800);
}

.connector-status {
    font-size: 0.75rem;
    font-weight: 500;
}

.module-blocked-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}

.module-blocked-card {
    text-align: center;
    max-width: 480px;
    padding: 3rem 2.5rem;
    background: linear-gradient(180deg, #FFFBEB 0%, #FEF3C7 100%);
    border-radius: 24px;
    border: 1px solid #FDE68A;
    box-shadow: 0 10px 40px rgba(180, 83, 9, 0.1),
                0 4px 12px rgba(180, 83, 9, 0.05);
}

.module-blocked-icon {
    width: 110px;
    height: 110px;
    background: linear-gradient(145deg, #FDE68A 0%, #FCD34D 50%, #F59E0B 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.75rem;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35),
                inset 0 -4px 8px rgba(180, 83, 9, 0.15),
                inset 0 4px 8px rgba(255, 255, 255, 0.4);
    animation: pulse-blocked 2s ease-in-out infinite;
}

@keyframes pulse-blocked {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35),
                    inset 0 -4px 8px rgba(180, 83, 9, 0.15),
                    inset 0 4px 8px rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 12px 32px rgba(245, 158, 11, 0.45),
                    inset 0 -4px 8px rgba(180, 83, 9, 0.15),
                    inset 0 4px 8px rgba(255, 255, 255, 0.4);
    }
}

.module-blocked-icon i {
    font-size: 2.75rem;
    color: #78350F;
    text-shadow: 0 2px 4px rgba(120, 53, 15, 0.2);
}

.module-blocked-title {
    color: #92400E;
    margin-bottom: 1rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.module-blocked-message {
    color: #78350F;
    margin-bottom: 0;
    line-height: 1.7;
    font-size: 1rem;
}

.module-blocked-message strong {
    color: #92400E;
    font-weight: 600;
}

.module-blocked-container.compact {
    min-height: 50vh;
}

.module-blocked-container.compact .module-blocked-card {
    padding: 2rem 2rem;
}

.module-blocked-container.compact .module-blocked-icon {
    width: 90px;
    height: 90px;
    margin-bottom: 1.25rem;
}

.module-blocked-container.compact .module-blocked-icon i {
    font-size: 2.25rem;
}

.module-blocked-container.compact .module-blocked-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.module-blocked-container.compact .module-blocked-message {
    font-size: 0.95rem;
}
