:root {
    --primary: #4f46e5; --success: #10b981; --warning: #f59e0b;
    --danger: #ef4444; --dark: #1f2937; --light: #f3f4f6; --white: #ffffff;
}

* { box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 0; padding: 0; }
body { background-color: var(--light); color: var(--dark); display: flex; height: 100vh; overflow-x: hidden; }

.auth-container { display: flex; align-items: center; justify-content: center; width: 100%; height: 100vh; background: var(--primary); padding: 15px; }
.auth-box { background: var(--white); padding: 40px; border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); width: 100%; max-width: 400px; }
.auth-box h2 { margin-bottom: 20px; color: var(--dark); text-align: center; }
.toggle-auth { color: var(--primary); cursor: pointer; display: block; text-align: center; margin-top: 15px; font-size: 14px; text-decoration: underline; }
.link-muted { color: #6b7280; font-size: 13px; cursor: pointer; text-decoration: underline; }

.input-password-group { position: relative; display: flex; align-items: center; }
.input-password-group input { width: 100%; padding-right: 40px; }
.input-password-group .eye-icon { position: absolute; right: 12px; cursor: pointer; font-size: 18px; user-select: none; opacity: 0.7; }

.mobile-header { display: none; background-color: var(--primary); color: white; padding: 15px 20px; align-items: center; width: 100%; position: fixed; top: 0; z-index: 998; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.mobile-header h2 { font-size: 20px; font-weight: bold; margin-left: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-toggle { background: none; border: none; color: white; font-size: 24px; cursor: pointer; }
.mobile-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 999; }

.sidebar { width: 250px; background-color: var(--white); padding: 20px; box-shadow: 2px 0 5px rgba(0,0,0,0.05); display: flex; flex-direction: column; z-index: 1000; transition: transform 0.3s ease; }
.sidebar h2 { color: var(--primary); margin-bottom: 10px; font-size: 24px; }
.user-info { font-size: 14px; color: #6b7280; margin-bottom: 30px; padding-bottom: 15px; border-bottom: 1px solid #e5e7eb; }

.tenant-info-box { background-color: #f8fafc; border: 1px dashed #cbd5e1; padding: 10px; border-radius: 6px; margin-bottom: 15px; }
.tenant-label { font-size: 11px; color: #64748b; text-transform: uppercase; display: block; margin-bottom: 4px; }
.tenant-code-flex { display: flex; justify-content: space-between; align-items: center; }
.tenant-code-flex strong { color: var(--primary); letter-spacing: 1px; font-size: 14px; }
.tenant-code-flex button { background: none; border: none; cursor: pointer; opacity: 0.6; }

.nav-btn { display: block; width: 100%; padding: 12px; margin-bottom: 10px; background: none; border: none; text-align: left; font-size: 16px; cursor: pointer; border-radius: 6px; transition: 0.2s; }
.nav-btn:hover, .nav-btn.active { background-color: var(--primary); color: var(--white); }
.btn-logout { margin-top: auto; background-color: #fee2e2; color: var(--danger); }

.main-content { flex: 1; padding: 30px; overflow-y: auto; height: 100vh; }
.section { display: none; }
.section.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-flex { display: flex; gap: 15px; align-items: flex-end; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.charts-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.card, .chart-box { background: var(--white); padding: 20px; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); text-align: center; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 16px; }
.btn { padding: 12px 20px; background-color: var(--primary); color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: 500; }
.btn:hover { background-color: #4338ca; }
.btn-block { width: 100%; display: block; }
.btn-flex { margin-bottom: 15px; }
.btn-excluir { background-color: var(--danger); }

/* Cor bolinha na tabela */
.color-dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; vertical-align: middle; border: 1px solid rgba(0,0,0,0.1); }

.table-responsive { width: 100%; }
table { width: 100%; border-collapse: collapse; background: var(--white); margin-top: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); border-radius: 10px; overflow: hidden; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #e5e7eb; vertical-align: middle; }
th { background-color: #f9fafb; font-weight: 600; font-size: 14px; }
.status-badge { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: bold; color: white; }
.badge-aberto { background-color: var(--primary); }
.badge-vencido { background-color: var(--danger); }
.badge-concluido { background-color: var(--success); }
.obs-texto { font-size: 12px; color: #6b7280; display: block; margin-top: 4px; }
.action-btn { background: none; border: none; cursor: pointer; font-size: 18px; margin-right: 5px; padding: 5px; }

@media (max-width: 768px) {
    .mobile-header { display: flex; }
    .desktop-only { display: none; }
    .main-content { padding: 80px 15px 20px 15px; height: 100vh; overflow-y: auto; }
    .sidebar { position: fixed; top: 0; left: 0; height: 100%; transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .mobile-overlay.open { display: block; }
    .grid-form, .charts-container { grid-template-columns: 1fr; }
    .btn-flex { margin-bottom: 0; }
    table, thead, tbody, th, td, tr { display: block; }
    thead tr { display: none; }
    tr { margin-bottom: 15px; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); padding: 10px; }
    td { position: relative; padding-left: 40%; text-align: right; border-bottom: 1px solid #f3f4f6; min-height: 40px; }
    td:last-child { border-bottom: none; }
    td::before { content: attr(data-label); position: absolute; left: 10px; width: 35%; text-align: left; font-weight: bold; font-size: 12px; color: #6b7280; white-space: nowrap; top: 50%; transform: translateY(-50%); }
    td .obs-texto { text-align: right; margin-top: 5px; }
    td br { display: none; }
}