/* ============================================================
   AZ Guidance Avaliacao — Design System
   Premium dark theme with glassmorphism
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1e2538;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(17, 24, 39, 0.7);
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #22d3ee;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
  --accent-gradient-hover: linear-gradient(135deg, #818cf8, #a78bfa);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.12);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-xs: 0.75rem;
  --font-sm: 0.8125rem;
  --font-base: 0.875rem;
  --font-md: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 1.875rem;
  --font-4xl: 2.25rem;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  --shadow-glow-strong: 0 0 40px rgba(99, 102, 241, 0.25);
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --sidebar-width: 260px;
  --header-height: 64px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-family); background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; min-height: 100vh; overflow-x: hidden; }
a { color: var(--accent-primary); text-decoration: none; }
a:hover { color: var(--accent-secondary); }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* LOGIN */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-primary); position: relative; overflow: hidden; }
.login-screen::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%), radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%); animation: loginBgPulse 8s ease-in-out infinite alternate; }
@keyframes loginBgPulse { 0% { opacity: 0.6; transform: scale(1); } 100% { opacity: 1; transform: scale(1.05); } }
.login-container { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: var(--space-lg); }
.login-card { background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: var(--space-2xl) var(--space-xl); box-shadow: var(--shadow-lg), var(--shadow-glow); animation: loginCardIn 0.6s ease-out; }
@keyframes loginCardIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.login-logo { text-align: center; margin-bottom: var(--space-xl); }
.login-logo-img { max-height: 64px; max-width: 220px; width: auto; object-fit: contain; margin-bottom: var(--space-md); }
.logo-icon { display: inline-block; margin-bottom: var(--space-md); animation: logoPulse 2s ease-in-out infinite; }
@keyframes logoPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.login-subtitle { font-size: var(--font-sm); color: var(--text-secondary); margin-top: var(--space-xs); }
.login-form { display: flex; flex-direction: column; gap: var(--space-lg); }
.login-error { color: var(--danger); font-size: var(--font-sm); text-align: center; min-height: 20px; }

.form-group label { display: block; font-size: var(--font-sm); font-weight: 500; color: var(--text-secondary); margin-bottom: var(--space-sm); }
.input-wrapper { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; transition: color var(--transition-base); }
.input-wrapper input { width: 100%; padding: 12px 14px 12px 44px !important; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-primary); font-size: var(--font-base); transition: all var(--transition-base); outline: none; }
.input-wrapper input::placeholder { color: var(--text-muted); }
.input-wrapper input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); background: rgba(255, 255, 255, 0.07); }
.input-wrapper:focus-within .input-icon { color: var(--accent-primary); }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm); padding: 10px 20px; border-radius: var(--radius-md); font-size: var(--font-base); font-weight: 500; border: none; transition: all var(--transition-base); white-space: nowrap; }
.btn-primary { background: var(--accent-gradient); color: white; box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3); }
.btn-primary:hover { background: var(--accent-gradient-hover); box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4); transform: translateY(-1px); }
.btn-secondary { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--border-strong); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text-secondary); padding: 6px 12px; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.btn-sm { padding: 6px 14px; font-size: var(--font-sm); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* LAYOUT */
.main-app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); height: 100vh; position: fixed; left: 0; top: 0; z-index: 100; display: flex; flex-direction: column; background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-right: 1px solid var(--border); transition: transform var(--transition-base); }
.sidebar-header { padding: var(--space-lg) var(--space-lg) var(--space-md); border-bottom: 1px solid var(--border); }
.sidebar-logo { display: flex; align-items: center; justify-content: center; }
.sidebar-logo-img { max-height: 40px; max-width: 180px; width: auto; object-fit: contain; }
.sidebar-nav { flex: 1; padding: var(--space-md); overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: var(--space-md); padding: 10px 14px; border-radius: var(--radius-md); color: var(--text-secondary); font-size: var(--font-base); font-weight: 400; transition: all var(--transition-fast); cursor: pointer; border: none; background: none; width: 100%; text-align: left; text-decoration: none; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.nav-item.active { background: rgba(99, 102, 241, 0.12); color: var(--accent-primary); font-weight: 500; }
.nav-section-title { padding: var(--space-md) var(--space-md) var(--space-xs); font-size: var(--font-xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.sidebar-footer { padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--border); }
.sidebar-user-info { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-md); overflow: hidden; }
.sidebar-user-info > div:not(.user-avatar) { min-width: 0; overflow: hidden; }
.user-avatar { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--accent-gradient); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: var(--font-sm); color: white; flex-shrink: 0; }
.user-name { font-size: var(--font-sm); font-weight: 500; color: var(--text-primary); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: var(--font-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout { width: 100%; background: rgba(239, 68, 68, 0.08); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.15); padding: 8px 14px; border-radius: var(--radius-md); display: flex; align-items: center; gap: var(--space-sm); font-size: var(--font-sm); transition: all var(--transition-base); }
.btn-logout:hover { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3); }

.content { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.page-header { padding: var(--space-lg) var(--space-xl); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; min-height: var(--header-height); background: var(--bg-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 50; }
.page-title { font-size: var(--font-xl); font-weight: 700; }
.page-subtitle { font-size: var(--font-sm); color: var(--text-secondary); margin-top: 2px; }
.page-content { padding: var(--space-xl); flex: 1; }

/* CARDS */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-lg); margin-bottom: var(--space-xl); }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-lg); transition: all var(--transition-base); }
.card:hover { background: var(--bg-card-hover); border-color: var(--border-strong); box-shadow: var(--shadow-glow); }
.card-icon { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-md); }
.card-icon.indigo { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.card-icon.cyan { background: rgba(34, 211, 238, 0.15); color: var(--accent-cyan); }
.card-icon.emerald { background: var(--success-bg); color: var(--success); }
.card-icon.amber { background: var(--warning-bg); color: var(--warning); }
.card-icon.rose { background: var(--danger-bg); color: var(--danger); }
.card-label { font-size: var(--font-sm); color: var(--text-secondary); margin-bottom: var(--space-xs); }
.card-value { font-size: var(--font-3xl); font-weight: 700; line-height: 1.2; }
.card-value.gradient { background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.card-detail { font-size: var(--font-xs); color: var(--text-muted); margin-top: var(--space-sm); }
.card-alert { background: rgba(245, 158, 11, 0.06); border-color: rgba(245, 158, 11, 0.2); }
.card-alert .card-value { color: var(--warning); }

/* TABLES */
.table-container { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--space-xl); }
.table-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-lg); border-bottom: 1px solid var(--border); }
.table-title { font-size: var(--font-md); font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 12px 16px; text-align: left; font-size: var(--font-xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); }
tbody td { padding: 12px 16px; font-size: var(--font-base); border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: middle; }
tbody td .flex { align-items: center; flex-wrap: wrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
tbody tr.clickable-row { cursor: pointer; transition: background var(--transition-fast); }
tbody tr.clickable-row:hover { background: rgba(99, 102, 241, 0.06); }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-full); font-size: var(--font-xs); font-weight: 500; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-purple { background: rgba(139, 92, 246, 0.12); color: var(--accent-secondary); }

/* FORMS */
.form-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-xl); margin-bottom: var(--space-lg); }
.form-section-title { font-size: var(--font-lg); font-weight: 600; margin-bottom: var(--space-lg); padding-bottom: var(--space-md); border-bottom: 1px solid var(--border); }
.form-row { display: flex; gap: var(--space-lg); margin-bottom: var(--space-lg); }
.form-row > .form-group { flex: 1; }
.form-group { margin-bottom: var(--space-lg); }
.form-group:last-child { margin-bottom: 0; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-primary); font-size: var(--font-base); transition: all var(--transition-base); outline: none; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.form-group select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.form-group textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.form-group select option { background: var(--bg-secondary); color: var(--text-primary); }

/* RATING */
.rating-group { margin-bottom: var(--space-xl); padding: var(--space-lg); background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); border-radius: var(--radius-md); transition: all var(--transition-base); }
.rating-group:hover { border-color: var(--border-strong); }
.rating-category { font-size: var(--font-base); font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-md); }
.rating-stars { display: flex; gap: var(--space-sm); margin-bottom: var(--space-md); }
.star-btn { width: 44px; height: 44px; border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: var(--font-lg); font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all var(--transition-fast); }
.star-btn:hover { background: rgba(99, 102, 241, 0.1); border-color: var(--accent-primary); color: var(--accent-primary); }
.star-btn.selected { background: var(--accent-gradient); border-color: transparent; color: white; box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3); }
.nps-scale { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-md); }
.nps-btn { width: 40px; height: 40px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: var(--font-sm); font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all var(--transition-fast); }
.nps-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.nps-btn.selected { background: var(--accent-gradient); border-color: transparent; color: white; }
.rating-justify textarea { width: 100%; padding: 10px 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-primary); font-size: var(--font-sm); min-height: 60px; resize: vertical; outline: none; transition: all var(--transition-base); }
.rating-justify textarea:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.rating-justify label { font-size: var(--font-xs); color: var(--text-muted); margin-bottom: var(--space-xs); display: block; }

/* CHARTS */
.chart-container { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-lg); margin-bottom: var(--space-xl); }
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-lg); }
.chart-title { font-size: var(--font-md); font-weight: 600; }
.chart-wrapper { position: relative; height: 300px; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: var(--space-lg); animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-container { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-xl); max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; animation: modalSlideUp 0.3s ease-out; box-shadow: var(--shadow-lg); }
@keyframes modalSlideUp { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { padding: var(--space-lg) var(--space-xl); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: var(--font-lg); font-weight: 600; }
.modal-close { width: 32px; height: 32px; border-radius: var(--radius-sm); background: transparent; border: none; color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--transition-fast); font-size: 1.2rem; }
.modal-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.modal-body { padding: var(--space-xl); }
.modal-footer { padding: var(--space-md) var(--space-xl) var(--space-xl); display: flex; justify-content: flex-end; gap: var(--space-md); }

/* TOGGLE/SWITCH */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: rgba(255,255,255,0.1); border-radius: 26px; border: 1px solid var(--border); transition: all 0.3s; }
.slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; bottom: 2px; background: var(--text-secondary); border-radius: 50%; transition: all 0.3s; }
.switch input:checked + .slider { background: var(--accent-primary); border-color: var(--accent-primary); }
.switch input:checked + .slider::before { transform: translateX(20px); background: white; }

/* CONFIG SECTIONS */
.config-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: var(--space-xl); overflow: hidden; }
.config-section-header { padding: var(--space-lg); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.config-section-title { font-size: var(--font-md); font-weight: 600; }
.config-section-body { padding: var(--space-lg); }

/* AREA BLOCKS */
.area-block { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: var(--space-lg); overflow: hidden; }
.area-block-header { padding: var(--space-md) var(--space-lg); background: rgba(99, 102, 241, 0.06); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.area-block-title { font-weight: 600; color: var(--accent-primary); }

/* EVAL STATUS */
.eval-status-card { display: flex; align-items: center; gap: var(--space-lg); padding: var(--space-lg); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: var(--space-md); cursor: pointer; transition: all var(--transition-base); }
.eval-status-card:hover { background: var(--bg-card-hover); border-color: var(--accent-primary); transform: translateX(4px); }

/* SCORE */
.score-display { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--radius-full); font-weight: 700; font-size: var(--font-md); }
.score-excellent { background: var(--success-bg); color: var(--success); }
.score-good { background: var(--info-bg); color: var(--info); }
.score-average { background: var(--warning-bg); color: var(--warning); }
.score-poor { background: var(--danger-bg); color: var(--danger); }

/* FILTER */
.filter-bar { display: flex; gap: var(--space-md); align-items: center; flex-wrap: wrap; margin-bottom: var(--space-xl); }
.filter-bar select, .filter-bar input { padding: 8px 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-primary); font-size: var(--font-sm); outline: none; min-width: 140px; }
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--accent-primary); }
.filter-bar select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.filter-bar select option { background: var(--bg-secondary); }

/* EDITABLE CELLS */
.editable-cell input { width: 80px; padding: 4px 8px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--accent-primary); border-radius: var(--radius-sm); color: var(--text-primary); font-size: var(--font-sm); text-align: right; outline: none; }
.editable-cell input:focus { box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); }

/* INPUT MONEY */
.input-money { position: relative; }
.input-money::before { content: 'R$'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: var(--font-sm); font-weight: 600; z-index: 1; }
.input-money input { padding-left: 44px !important; }

/* UTILITIES */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent-primary); }
.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.font-bold { font-weight: 700; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ALERT */
.alert { display: flex; align-items: flex-start; gap: var(--space-sm); padding: 12px 16px; border-radius: var(--radius-md); border: 1px solid; font-size: var(--font-sm); margin-bottom: var(--space-lg); }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.alert-warning { background: color-mix(in srgb, var(--warning) 12%, transparent); border-color: var(--warning); color: var(--text-primary); }
.alert-danger  { background: color-mix(in srgb, var(--danger)  12%, transparent); border-color: var(--danger);  color: var(--text-primary); }
.alert-info    { background: color-mix(in srgb, var(--accent-primary) 10%, transparent); border-color: var(--accent-primary); color: var(--text-primary); }

/* TOAST */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-primary); font-size: var(--font-sm); box-shadow: var(--shadow-lg); z-index: 2000; animation: toastIn 0.3s ease-out; display: flex; align-items: center; gap: var(--space-sm); }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* SPINNER */
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent-primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.empty-state { text-align: center; padding: var(--space-3xl) var(--space-xl); color: var(--text-muted); }
.empty-state svg { margin-bottom: var(--space-lg); opacity: 0.3; }
.empty-state p { font-size: var(--font-base); }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; }
  .cards-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
@media (max-width: 640px) {
  .page-content { padding: var(--space-md); }
  .form-row { flex-direction: column; }
  .cards-grid { grid-template-columns: 1fr; }
}
