/* Terceira Camada da Monetização - CSS */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #059669;
    --success-light: #ecfdf5;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 280px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: 'DM Sans', sans-serif; font-size: 0.9375rem; line-height: 1.6; color: var(--gray-800); background: var(--gray-50); min-height: 100vh; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; color: var(--gray-900); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

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

/* Sidebar */
.sidebar { width: var(--sidebar-width); background: var(--white); border-right: 1px solid var(--gray-200); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-200); }
.sidebar-logo { display: flex; align-items: center; gap: 0.75rem; }
.sidebar-logo-icon { width: 36px; height: 36px; background: linear-gradient(135deg, var(--primary), #7c3aed); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; }
.sidebar-logo-text { font-size: 0.9375rem; font-weight: 600; color: var(--gray-900); line-height: 1.3; }
.sidebar-logo-text span { display: block; font-size: 0.75rem; font-weight: 500; color: var(--gray-500); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 1rem 0; }
.sidebar-section { margin-bottom: 0.5rem; }
.sidebar-section-title { padding: 0.5rem 1.5rem; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400); }
.sidebar-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1.5rem; color: var(--gray-600); font-size: 0.875rem; font-weight: 500; border-left: 3px solid transparent; transition: all 0.15s; }
.sidebar-link:hover { background: var(--gray-50); color: var(--gray-900); }
.sidebar-link.active { background: var(--primary-light); color: var(--primary); border-left-color: var(--primary); }
.sidebar-link.locked { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.sidebar-link.pending { opacity: 0.8; cursor: not-allowed; pointer-events: none; background: var(--warning-light); }
.sidebar-link-icon { width: 18px; text-align: center; }
.sidebar-link-badge { margin-left: auto; padding: 0.125rem 0.5rem; font-size: 0.6875rem; font-weight: 600; border-radius: 9999px; background: var(--success-light); color: var(--success); }
.sidebar-link-badge.locked { background: var(--gray-100); color: var(--gray-500); }
.sidebar-link-badge.pending { background: var(--warning-light); color: var(--warning); }
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-200); }
.sidebar-user { display: flex; align-items: center; gap: 0.75rem; }
.sidebar-user-avatar { width: 36px; height: 36px; background: var(--gray-200); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.875rem; color: var(--gray-600); }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.875rem; font-weight: 600; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.75rem; color: var(--gray-500); }
.sidebar-logout { background: none; border: none; padding: 0.5rem; cursor: pointer; color: var(--gray-400); }
.sidebar-logout:hover { color: var(--danger); }

/* Main Content */
.main-content { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.main-header { height: 64px; background: var(--white); border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; position: sticky; top: 0; z-index: 50; }
.main-header-title { font-size: 1.125rem; font-weight: 600; }
.main-body { flex: 1; padding: 2rem; }

/* Cards */
.card { background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px; overflow: hidden; }
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-200); }
.card-title { font-size: 1rem; font-weight: 600; margin: 0; }
.card-description { font-size: 0.875rem; color: var(--gray-500); margin-top: 0.25rem; }
.card-body { padding: 1.5rem; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--gray-700); margin-bottom: 0.5rem; }
.form-input, .form-select { width: 100%; padding: 0.625rem 0.875rem; font-family: inherit; font-size: 0.9375rem; color: var(--gray-900); background: var(--white); border: 1px solid var(--gray-300); border-radius: 8px; transition: all 0.15s; }
.form-input:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-input::placeholder { color: var(--gray-400); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.625rem 1.25rem; font-family: inherit; font-size: 0.9375rem; font-weight: 500; border: none; border-radius: 8px; cursor: pointer; transition: all 0.15s; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-200); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover:not(:disabled) { background: #047857; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

/* Tables */
.table-container { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
.table th { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); background: var(--gray-50); }
.table td { font-size: 0.875rem; }
.table tbody tr:hover { background: var(--gray-50); }
.table-input { width: 100%; padding: 0.5rem 0.625rem; font-family: inherit; font-size: 0.8125rem; color: var(--gray-900); background: var(--white); border: 1px solid var(--gray-200); border-radius: 6px; transition: all 0.15s; }
.table-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.table-input.filled { border-color: var(--success); background: var(--success-light); }

/* Alerts */
.alert { padding: 1rem 1.25rem; border-radius: 8px; font-size: 0.875rem; margin-bottom: 1rem; }
.alert-info { background: var(--primary-light); color: var(--primary); border: 1px solid #bfdbfe; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #a7f3d0; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fde68a; }
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }

/* Badge */
.badge { display: inline-flex; align-items: center; padding: 0.25rem 0.625rem; font-size: 0.75rem; font-weight: 500; border-radius: 9999px; }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-primary { background: var(--primary-light); color: var(--primary); }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%); }
.login-container { width: 100%; max-width: 400px; }
.login-card { background: var(--white); border-radius: 12px; box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1); padding: 2.5rem; }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-logo { width: 56px; height: 56px; background: linear-gradient(135deg, var(--primary), #7c3aed); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 1.5rem; margin: 0 auto 1rem; }
.login-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.25rem; }
.login-subtitle { color: var(--gray-500); font-size: 0.875rem; }

/* Task Section */
.task-section { margin-bottom: 2rem; }
.task-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.task-section-title { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.task-section-badge { font-size: 0.75rem; font-weight: 500; padding: 0.25rem 0.5rem; border-radius: 6px; background: var(--gray-100); color: var(--gray-600); }

/* Progress Bar */
.progress-bar { height: 8px; background: var(--gray-200); border-radius: 9999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #7c3aed); border-radius: 9999px; transition: width 0.3s; }

/* Toast */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1000; }
.toast { background: var(--gray-900); color: var(--white); padding: 0.875rem 1.25rem; border-radius: 8px; box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1); font-size: 0.875rem; margin-top: 0.5rem; animation: slideIn 0.2s ease; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }

/* Save Indicator */
.save-indicator { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--gray-500); }
.save-indicator.saving { color: var(--warning); }
.save-indicator.saved { color: var(--success); }

/* Welcome */
.welcome-hero { background: linear-gradient(135deg, var(--primary), #7c3aed); color: white; padding: 3rem; border-radius: 12px; margin-bottom: 2rem; }
.welcome-hero h1 { color: white; font-size: 2rem; margin-bottom: 1rem; }
.welcome-hero p { font-size: 1.125rem; opacity: 0.9; margin-bottom: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.feature-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px; padding: 1.5rem; transition: all 0.2s; }
.feature-card:hover { border-color: var(--primary); box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1); }
.feature-icon { width: 48px; height: 48px; background: var(--primary-light); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--primary); margin-bottom: 1rem; }
.feature-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.feature-description { font-size: 0.875rem; color: var(--gray-600); margin: 0; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: var(--white); border-radius: 12px; width: 100%; max-width: 480px; margin: 1rem; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-200); }
.modal-header h3 { margin: 0; font-size: 1.125rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--gray-400); line-height: 1; }
.modal-close:hover { color: var(--gray-600); }
.modal-body { padding: 1.5rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--gray-200); }

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 0.875rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.hidden { display: none !important; }

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
}
@media (max-width: 640px) {
    .main-body { padding: 1rem; }
    .card-body { padding: 1rem; }
    .welcome-hero { padding: 1.5rem; }
    .welcome-hero h1 { font-size: 1.5rem; }
}
