@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Lexend:wght@500;600;700&display=swap');

:root{
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --border: #e5e7eb;
  --border-soft: #eef0f3;
  --text: #1a1d23;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --primary: #0f6e3f;
  --primary-soft: #e6f4ec;
  --navy: #0b1f3a;
  --gold: #f0b429;
  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04);
  --shadow-md: 0 4px 12px rgba(16,24,40,.06);
}

*{box-sizing:border-box;}
html{height:100%;}
body{
  margin:0;
  font-family:'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color:var(--text);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  min-height:100%;
  display:flex;
  flex-direction:column;
}
.app{display:flex; flex-direction:column; min-height:100vh;}
.main{flex:1; max-width:1040px; margin:0 auto; padding:24px 20px 60px; width:100%;}
.hidden{display:none!important;}
.muted{color:var(--text-muted);}
.small{font-size:12.5px;}

h1,h2,h3,h4{font-family:'Lexend', 'Inter', sans-serif; letter-spacing:-0.01em;}

/* ---------- Auth ---------- */
.auth-screen{
  min-height:100vh; display:flex; align-items:center; justify-content:center; padding:16px;
  background:linear-gradient(160deg, #f4f5f7 0%, #e6f4ec 100%);
}
.auth-card{
  background:var(--surface); border:1px solid var(--border); border-radius:16px;
  padding:32px; width:100%; max-width:400px; box-shadow:var(--shadow-md);
}
.auth-card h1{margin:0 0 6px; font-size:22px; font-weight:700;}
.auth-card .muted{font-size:13.5px; line-height:1.5;}
.auth-logo{width:100%; max-width:280px; display:block; margin:0 auto 14px;}
.tabs-auth{display:flex; gap:4px; margin:20px 0; background:var(--surface-soft); padding:4px; border-radius:10px;}
.tabs-auth button{flex:1; padding:8px; border-radius:8px; border:none; background:transparent; cursor:pointer; font-weight:500; font-size:13.5px; color:var(--text-muted); transition:all .15s;}
.tabs-auth button.active{background:var(--surface); color:var(--text); box-shadow:var(--shadow-sm);}
.auth-form label{display:block; font-size:12.5px; font-weight:500; color:var(--text-muted); margin:14px 0 6px;}
.auth-form input{width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:14px; transition:border-color .15s, box-shadow .15s;}
.auth-form input:focus{outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft);}
.auth-form button{width:100%; margin-top:20px; padding:11px; border-radius:var(--radius-sm); border:none; background:var(--primary); color:#fff; font-size:14px; font-weight:600; cursor:pointer; transition:background .15s;}
.auth-form button:hover{background:#372fa8;}
.erro{color:var(--danger); font-size:13px; margin:8px 0 0; min-height:18px; font-weight:500;}

/* ---------- Header ---------- */
.header{background:var(--surface); border-bottom:1px solid var(--border); position:sticky; top:0; z-index:5;}
.header-inner{max-width:1120px; margin:0 auto; padding:2px 20px; display:flex; align-items:center; justify-content:space-between; gap:16px;}
.brand{display:flex; align-items:center; flex-shrink:0;}
.brand-logo{height:84px; width:auto; display:block;}

.nav{display:flex; gap:2px; flex-wrap:wrap; padding:3px; flex:1; justify-content:center;}
.nav button{padding:6px 13px; border-radius:7px; border:none; background:transparent; color:var(--text-muted); font-size:13px; font-weight:500; cursor:pointer; transition:all .15s; white-space:nowrap;}
.nav button:hover{color:var(--text);}
.nav button.active{background:var(--surface); color:var(--primary); box-shadow:var(--shadow-sm); font-weight:600;}

/* hamburger */
.menu-toggle{
  width:40px; height:40px; border-radius:var(--radius-sm); border:1px solid var(--border);
  background:var(--surface); display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:4px; cursor:pointer; flex-shrink:0; transition:background .15s;
}
.menu-toggle:hover{background:var(--surface-soft);}
.menu-toggle span{display:block; width:18px; height:2px; background:var(--text); border-radius:2px;}

/* side menu */
.menu-overlay{position:fixed; inset:0; background:rgba(17,20,26,.4); z-index:30; backdrop-filter:blur(1px);}
.side-menu{
  position:fixed; top:0; right:0; height:100vh; width:260px; max-width:85vw;
  background:var(--surface); box-shadow:-8px 0 30px rgba(0,0,0,.12);
  transform:translateX(100%); transition:transform .2s ease;
  z-index:31; display:flex; flex-direction:column; padding:20px;
}
.side-menu.aberto{transform:translateX(0);}
.side-menu-header{display:flex; align-items:center; gap:12px; padding-bottom:18px; border-bottom:1px solid var(--border-soft); margin-bottom:14px; position:relative;}
.user-avatar{
  width:42px; height:42px; border-radius:50%; background:var(--primary-soft); color:var(--primary);
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:16px; flex-shrink:0;
  font-family:'Lexend', sans-serif;
}
.user-name{font-weight:600; font-size:14px; margin:0;}
.side-menu-header .icon-btn{position:absolute; top:-6px; right:-6px;}
.side-nav{display:flex; flex-direction:column; gap:2px; flex:1;}
.side-nav button{
  text-align:left; padding:11px 12px; border-radius:var(--radius-sm); border:none; background:transparent;
  color:var(--text-muted); font-size:14px; font-weight:500; cursor:pointer; transition:all .15s;
}
.side-nav button:hover{background:var(--surface-soft); color:var(--text);}
.side-nav button.active{background:var(--primary-soft); color:var(--primary); font-weight:600;}
.side-logout{
  width:100%; text-align:center; margin-top:14px;
  background:var(--danger-bg); color:var(--danger); border:1px solid var(--danger-border);
  border-radius:var(--radius-sm); padding:11px; font-size:14px; font-weight:600; cursor:pointer; transition:background .15s;
}
.side-logout:hover{background:#fee2e2;}

.perfil-card{display:flex; align-items:center; gap:16px;}
.perfil-avatar{width:56px; height:56px; font-size:22px;}

/* ---------- Main ---------- */
/* main definido no topo */
.tab-content.hidden{display:none;}

.stats{display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:14px; margin-bottom:18px;}
.stat{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; box-shadow:var(--shadow-sm);}
.stat-value{font-size:22px; font-weight:700; margin:4px 0 0; font-family:'Lexend', sans-serif;}
.stat-click{cursor:pointer; transition:box-shadow .15s, border-color .15s; position:relative;}
.stat-click:hover{box-shadow:var(--shadow-md); border-color:var(--primary);}
.stat-hint{font-size:11px; color:var(--primary); font-weight:600; margin:6px 0 0;}

.card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:20px 22px; margin-bottom:18px; box-shadow:var(--shadow-sm);}
.card h3{margin:0 0 10px; font-size:16px; font-weight:600;}
.card h4{font-size:14px; font-weight:600; margin:8px 0;}

.alert{border-radius:var(--radius-sm); padding:13px 16px; font-size:13.5px; margin-bottom:18px; border:1px solid; line-height:1.55;}
.alert-red{background:var(--danger-bg); border-color:var(--danger-border); color:#991b1b;}
.alert-amber{background:var(--warning-bg); border-color:var(--warning-border); color:#92400e;}

.list{list-style:none; padding:0; margin:0;}
.list li{padding:12px 0; border-bottom:1px solid var(--border-soft); display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:14px;}
.list li:last-child{border-bottom:none;}

.empty{text-align:center; padding:70px 20px;}
.empty h2{margin-bottom:8px; font-size:19px;}
.empty .muted{max-width:420px; margin:0 auto 20px; line-height:1.6;}

.primary{background:var(--primary); color:#fff; border:none; border-radius:var(--radius-sm); padding:10px 18px; cursor:pointer; font-size:13.5px; font-weight:600; transition:background .15s;}
.primary:hover{background:#372fa8;}
.secondary{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px 18px; cursor:pointer; font-size:13.5px; font-weight:500; color:var(--text); transition:background .15s;}
.secondary:hover{background:var(--surface-soft);}
.danger{background:var(--danger-bg); color:var(--danger); border:1px solid var(--danger-border); border-radius:var(--radius-sm); padding:10px 18px; cursor:pointer; font-size:13.5px; font-weight:600;}
.danger:hover{background:#fee2e2;}

.toolbar{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:16px;}
.filtros{display:flex; gap:6px; flex-wrap:wrap;}
.filtros button{font-size:12.5px; font-weight:500; padding:7px 14px; border-radius:999px; border:1px solid var(--border); background:var(--surface); color:var(--text-muted); cursor:pointer; transition:all .15s;}
.filtros button:hover{border-color:var(--primary); color:var(--primary);}
.filtros button.active{background:var(--text); color:#fff; border-color:var(--text);}

.cards-list{display:flex; flex-direction:column; gap:12px;}
.divida-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; box-shadow:var(--shadow-sm); transition:box-shadow .15s, border-color .15s;}
.divida-card:hover{box-shadow:var(--shadow-md);}
.divida-card.agenda-urgente{border-color:var(--danger-border); background:var(--danger-bg);}
.divida-card.agenda-atencao{border-color:var(--warning-border); background:var(--warning-bg);}

.evolucao-card{
  background:linear-gradient(135deg, var(--navy) 0%, #14532d 100%);
  border:none; color:#fff;
}
.evolucao-card h3{color:#fff;}
.evolucao-card .muted{color:rgba(255,255,255,.65);}
.evolucao-head{display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap;}
.evolucao-pct{font-size:34px; font-weight:700; font-family:'Lexend', sans-serif; margin:0; line-height:1; color:var(--gold);}
.evolucao-bar{height:10px; background:rgba(255,255,255,.12); border-radius:999px; overflow:hidden; margin-top:14px;}
.evolucao-bar-fill{height:100%; width:0%; background:linear-gradient(90deg, #22c55e, var(--gold)); border-radius:999px; transition:width .6s ease;}
.divida-card .top{display:flex; align-items:flex-start; justify-content:space-between; gap:10px;}
.divida-card h4{margin:0; font-size:14.5px; font-weight:600;}
.divida-card .meta{font-size:12.5px; color:var(--text-faint); margin-top:3px;}
.divida-card .grid4{display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); gap:12px; margin-top:14px; padding-top:14px; border-top:1px solid var(--border-soft); font-size:13.5px;}
.divida-card .grid4 p{margin:0; font-weight:600;}
.divida-card .grid4 .lbl{color:var(--text-faint); font-size:11px; font-weight:500; text-transform:uppercase; letter-spacing:.04em;}
.divida-card .obs{font-size:12.5px; color:var(--text-faint); font-style:italic; margin-top:10px;}
.divida-card .actions{display:flex; gap:2px;}
.divida-card .actions button{background:none; border:none; cursor:pointer; color:var(--text-faint); font-size:15px; padding:5px 8px; border-radius:6px; transition:all .15s;}
.divida-card .actions button:hover{color:var(--text); background:var(--surface-soft);}

.badge{font-size:11px; font-weight:600; padding:3px 9px; border-radius:999px; border:1px solid; white-space:nowrap; letter-spacing:.02em;}
.badge-em_dia{background:var(--success-bg); color:#047857; border-color:var(--success-border);}
.badge-atrasada{background:var(--danger-bg); color:#b91c1c; border-color:var(--danger-border);}
.badge-negociando{background:var(--warning-bg); color:#92400e; border-color:var(--warning-border);}
.badge-paga{background:#f3f4f6; color:#6b7280; border-color:var(--border);}
.badge-informal{background:var(--danger-bg); color:#b91c1c; border-color:var(--danger-border);}

.bar-bg{height:8px; background:#f1f1ef; border-radius:999px; overflow:hidden; margin-top:5px;}
.bar-fill{height:100%; background:var(--primary); border-radius:999px;}
.bar-fill.agiota{background:#f87171;}
.dist-row{margin-bottom:14px;}
.dist-row:last-child{margin-bottom:0;}
.dist-row .top{display:flex; justify-content:space-between; font-size:13.5px; margin-bottom:3px; font-weight:500;}

.methods{display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; margin-top:14px;}
.method-card{text-align:left; border:1px solid var(--border); border-radius:var(--radius-sm); padding:14px; cursor:pointer; background:var(--surface); transition:all .15s;}
.method-card:hover{border-color:var(--primary);}
.method-card.active{border-color:var(--primary); background:var(--primary-soft); box-shadow:0 0 0 1px var(--primary);}
.method-card p{margin:5px 0 0;}
.method-card .title{font-weight:600; font-size:14px;}
.method-card .desc{font-size:12.5px; color:var(--text-muted); line-height:1.5;}

.priority-item{display:flex; align-items:center; gap:14px; border:1px solid var(--border-soft); border-radius:var(--radius-sm); padding:12px 14px; margin-bottom:8px; transition:border-color .15s;}
.priority-item:hover{border-color:var(--border);}
.priority-num{width:28px; height:28px; border-radius:999px; background:var(--text); color:#fff; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:600; flex-shrink:0;}

#extra-input{width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:14px; margin-top:6px;}
#extra-input:focus{outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft);}
.result-box{background:var(--surface-soft); border-radius:var(--radius-sm); padding:16px; margin-top:14px; font-size:14px;}
.result-box p{margin:5px 0;}

/* ---------- Modal ---------- */
.modal-overlay{position:fixed; inset:0; background:rgba(17,20,26,.45); display:flex; align-items:center; justify-content:center; padding:16px; z-index:20; backdrop-filter:blur(2px);}
.modal{background:var(--surface); border-radius:16px; width:100%; max-width:520px; max-height:90vh; overflow-y:auto; box-shadow:0 12px 40px rgba(0,0,0,.18);}
.modal-header{display:flex; justify-content:space-between; align-items:center; padding:16px 22px; border-bottom:1px solid var(--border-soft); position:sticky; top:0; background:var(--surface); z-index:1;}
.modal-header h3{margin:0; font-size:16px; font-weight:600;}
.icon-btn{background:none; border:none; font-size:20px; cursor:pointer; color:var(--text-faint); line-height:1; padding:4px; border-radius:6px;}
.icon-btn:hover{background:var(--surface-soft); color:var(--text);}
.modal-body{padding:18px 22px;}
.modal-body label{display:block; font-size:12.5px; font-weight:500; color:var(--text-muted); margin:12px 0 6px;}
.modal-body input, .modal-body select, .modal-body textarea{width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:14px; font-family:inherit; transition:border-color .15s, box-shadow .15s;}
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus{outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft);}
.modal-body .row{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
.modal-footer{display:flex; justify-content:flex-end; gap:8px; padding:18px 0 4px; position:sticky; bottom:0; background:var(--surface);}

.radio-group{display:flex; flex-direction:column; gap:10px; margin-top:8px;}
.radio-option{display:flex; align-items:flex-start; gap:10px; font-size:13.5px; font-weight:400; color:var(--text); cursor:pointer; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); transition:border-color .15s, background .15s;}
.radio-option:hover{border-color:var(--primary);}
.radio-option input{width:auto; margin-top:3px; accent-color:var(--primary);}

.anexo-form{display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:12px 0;}
.anexo-form input[type="file"]{flex:1; min-width:160px; font-size:13px;}
.anexo-form input[type="text"]{flex:1; min-width:160px; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:13px;}
.anexo-form button{padding:10px 18px;}

@media (max-width:780px){
  .header-inner{flex-wrap:wrap;}
  .nav{order:3; width:100%; justify-content:flex-start; overflow-x:auto;}
  .brand-logo{height:42px;}
}
@media (max-width:640px){
  .side-menu{width:260px;}
}

/* ---------- XP / Gamificação ---------- */
.xp-bar-global{background:linear-gradient(135deg, var(--navy), #14532d); border-radius:var(--radius); padding:16px 20px; margin-bottom:18px; color:#fff;}
.xp-bar-info{display:flex; align-items:center; gap:10px; margin-bottom:8px; font-size:14px;}
.xp-nivel-nome{font-weight:700; font-family:'Lexend', sans-serif;}
.xp-bar-track{height:10px; background:rgba(255,255,255,.15); border-radius:999px; overflow:hidden; margin:4px 0;}
.xp-bar-fill{height:100%; background:linear-gradient(90deg, #22c55e, #f0b429); border-radius:999px; transition:width .5s ease;}
.xp-streak{font-size:13px; color:rgba(255,255,255,.8); margin-top:6px;}

.xp-dash-card{
  background:linear-gradient(135deg, var(--navy), #14532d); border-radius:var(--radius); padding:14px 18px;
  margin-bottom:18px; color:#fff; display:flex; align-items:center; gap:14px; cursor:pointer;
  transition:opacity .15s;
}
.xp-dash-card:hover{opacity:.9;}
.xp-dash-left{display:flex; align-items:center; gap:12px; flex-shrink:0;}

/* Boss cards */
.boss-mini-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:16px 18px; cursor:pointer; transition:box-shadow .15s, border-color .15s; margin-bottom:12px;
}
.boss-mini-card:hover{box-shadow:var(--shadow-md); border-color:var(--primary);}
.boss-mini-top{display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:12px;}
.boss-mini-arrow{font-size:22px; color:var(--text-faint);}
.boss-hp-label{display:flex; justify-content:space-between; font-size:12.5px; color:var(--text-muted); margin-bottom:4px;}
.boss-hp-track{height:12px; background:#f1f1ef; border-radius:999px; overflow:hidden; margin-bottom:4px;}
.boss-hp-fill{height:100%; border-radius:999px; transition:width .6s ease;}
.hp-alto{background:linear-gradient(90deg, #f87171, #ef4444);}
.hp-medio{background:linear-gradient(90deg, #fb923c, #f59e0b);}
.hp-baixo{background:linear-gradient(90deg, #4ade80, #22c55e);}

.boss-card{
  background:linear-gradient(135deg, #0b1f3a, #14532d);
  border-radius:var(--radius); padding:22px 24px; margin-bottom:18px; color:#fff;
}
.boss-header{display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:16px;}
.boss-card h2{margin:0; font-size:22px; font-family:'Lexend', sans-serif;}
.boss-xp-badge{font-size:12px; padding:5px 12px; border-radius:999px; font-weight:600; flex-shrink:0;}
.boss-hp-label{display:flex; justify-content:space-between; font-size:13px; color:rgba(255,255,255,.7); margin-bottom:6px;}
.boss-hp-track{height:16px; background:rgba(255,255,255,.1); border-radius:999px; overflow:hidden;}
.boss-hp-fill{height:100%; border-radius:999px; transition:width .8s ease;}
.boss-hp-sub{font-size:12.5px; color:rgba(255,255,255,.55); margin:8px 0 0;}

/* Diário */
.diario-input-area{display:flex; flex-direction:column; gap:10px; margin:14px 0;}
.diario-input-area textarea{
  width:100%; padding:12px; border:1px solid var(--border); border-radius:var(--radius-sm);
  font-family:inherit; font-size:14px; resize:vertical; min-height:80px;
  transition:border-color .15s, box-shadow .15s;
}
.diario-input-area textarea:focus{outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft);}
.btn-diario-salvar{
  background:linear-gradient(135deg, var(--primary), #166534); color:#fff; border:none;
  border-radius:var(--radius-sm); padding:12px 20px; font-size:14px; font-weight:700;
  cursor:pointer; transition:opacity .15s; align-self:flex-end;
}
.btn-diario-salvar:hover{opacity:.88;}

.diario-xp-feedback{
  background:linear-gradient(135deg, #052e16, #0b1f3a); color:#fff;
  padding:12px 16px; border-radius:var(--radius-sm); font-size:14px; font-weight:600;
  margin-bottom:12px; animation:slideIn .3s ease;
}
@keyframes slideIn{from{opacity:0; transform:translateY(-8px);}to{opacity:1; transform:translateY(0);}}

.diario-lista{display:flex; flex-direction:column; gap:10px; margin-top:14px;}
.diario-entry{background:var(--surface-soft); border:1px solid var(--border-soft); border-radius:var(--radius-sm); padding:12px 14px;}
.diario-entry-header{display:flex; align-items:center; gap:10px; margin-bottom:6px;}
.diario-entry-date{font-size:12px; color:var(--text-faint); font-weight:500;}
.diario-xp-tag{font-size:11px; font-weight:700; background:#dcfce7; color:#166534; border-radius:999px; padding:2px 9px; border:1px solid #bbf7d0;}
.diario-entry-text{font-size:14px; margin:0; line-height:1.6; color:var(--text);}

/* XP nav badge */
.nav-xp-badge{
  display:inline-block; background:var(--gold); color:#1a1d23;
  font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px;
  margin-left:4px; vertical-align:middle;
}

/* XP dashboard card */
.xp-dash-card{
  background:linear-gradient(135deg, var(--navy) 0%, #14532d 100%);
  border-radius:var(--radius); padding:18px 22px; margin-bottom:18px;
  color:#fff; cursor:pointer; transition:opacity .15s; border:none;
}
.xp-dash-card:hover{opacity:.93;}
.xp-dash-top{display:flex; align-items:center; gap:14px;}
.xp-dash-avatar{
  width:52px; height:52px; border-radius:50%; background:rgba(255,255,255,.12);
  display:flex; align-items:center; justify-content:center; font-size:26px; flex-shrink:0;
}
.xp-dash-info{flex:1;}
.xp-dash-titulo{font-size:12px; color:rgba(255,255,255,.6); margin:0; text-transform:uppercase; letter-spacing:.06em;}
.xp-dash-nivel{font-size:17px; font-weight:700; margin:2px 0 0; font-family:'Lexend', sans-serif;}
.xp-dash-right{text-align:right; flex-shrink:0;}
.xp-dash-pontos{font-size:22px; font-weight:700; color:var(--gold); margin:0; font-family:'Lexend', sans-serif;}
.xp-dash-streak{font-size:13px; color:rgba(255,255,255,.7); margin:2px 0 0;}

/* Boss card dupla barra */
.boss-hp-row{display:flex; gap:20px; margin:14px 0 8px;}
.boss-hp-side{flex:1; background:rgba(255,255,255,.08); border-radius:8px; padding:10px 14px;}
.boss-hp-side-pago{border-left:3px solid #22c55e;}
.boss-hp-side-falta{border-left:3px solid #f87171;}
.boss-hp-side-label{display:block; font-size:11px; color:rgba(255,255,255,.6); font-weight:600; text-transform:uppercase; letter-spacing:.05em; margin-bottom:4px;}
.boss-hp-side-val{font-size:18px; font-weight:700; font-family:'Lexend', sans-serif;}
.boss-hp-track-double{height:14px; background:rgba(255,255,255,.1); border-radius:999px; overflow:hidden; display:flex;}
.boss-hp-pago{height:100%; background:linear-gradient(90deg, #16a34a, #22c55e); transition:width .8s ease;}
.boss-hp-falta{height:100%; background:linear-gradient(90deg, #dc2626, #f87171); transition:width .8s ease;}

/* Grid da batalha */
.batalha-grid{display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-bottom:18px;}
@media(max-width:640px){.batalha-grid{grid-template-columns:1fr;}}
.batalha-grid .card{margin-bottom:0;}
.batalha-grid textarea, .batalha-grid input{width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:14px; font-family:inherit;}
.batalha-grid textarea{resize:vertical; min-height:80px;}

/* ---------- Mobile ---------- */
@media (max-width:780px) {
  .nav{display:none !important;}
  .side-nav-mobile{display:flex !important;}
  .header-inner{padding:8px 14px;}
  .main{padding:14px 12px 80px;}
  .stats{grid-template-columns:1fr 1fr;}
  .stat-value{font-size:17px;}
  .batalha-grid{grid-template-columns:1fr;}
  .boss-hp-row{flex-direction:column; gap:8px;}
  .modal{max-height:95vh;}
  .modal-body .row{grid-template-columns:1fr;}
  .footer-links{flex-direction:column; gap:16px;}
  .footer-inner{flex-direction:column; gap:20px;}
  .xp-dash-card{flex-direction:column; align-items:flex-start; gap:10px;}
}
.side-nav-mobile{display:none;}
@media (min-width:781px){
  .side-nav-mobile{display:none !important;}
}

/* ---------- Form labels padrao ---------- */
.form-label{display:block; font-size:12.5px; font-weight:500; color:var(--text-muted); margin:12px 0 5px;}
.form-input{width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:14px; font-family:inherit; transition:border-color .15s, box-shadow .15s;}
.form-input:focus{outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft);}
.secondary.small{padding:6px 12px; font-size:12.5px;}
.text-success{color:var(--success);}
.text-danger{color:var(--danger);}

/* ---------- Rodapé ---------- */
.footer{background:var(--navy); color:#fff; margin-top:40px;}
.footer-inner{max-width:1040px; margin:0 auto; padding:32px 20px 20px; display:flex; gap:40px; flex-wrap:wrap;}
.footer-brand{flex:1; min-width:200px;}
.footer-logo{height:48px; width:auto; margin-bottom:12px; display:block;}
.footer-links{display:flex; gap:32px; flex-wrap:wrap;}
.footer-links > div{display:flex; flex-direction:column; gap:8px;}
.footer-title{font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:rgba(255,255,255,.5); margin:0 0 4px;}
.footer-links a{color:rgba(255,255,255,.75); text-decoration:none; font-size:13.5px; transition:color .15s;}
.footer-links a:hover{color:#fff;}
.footer-bottom{max-width:1040px; margin:0 auto; padding:12px 20px 20px; border-top:1px solid rgba(255,255,255,.1);}

/* ---------- Extrato ---------- */
.extrato-upload{
  border:2px dashed var(--border); border-radius:var(--radius); padding:32px; text-align:center;
  transition:border-color .15s, background .15s; cursor:pointer; margin-top:12px;
}
.extrato-upload:hover, .extrato-upload.drag-over{border-color:var(--primary); background:var(--primary-soft);}
.extrato-upload-icon{font-size:36px; margin-bottom:8px;}
.extrato-upload p{margin:4px 0;}

.extrato-item{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid var(--border-soft); flex-wrap:wrap;}
.extrato-item:last-child{border-bottom:none;}
.extrato-item-info{display:flex; align-items:center; gap:12px; flex:1; min-width:0;}
.extrato-tipo{width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:16px; flex-shrink:0;}
.extrato-credito{background:#dcfce7; color:#166534;}
.extrato-debito{background:#fef2f2; color:#991b1b;}
.extrato-item-right{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
.extrato-valor{font-weight:700; font-size:14px; white-space:nowrap;}
.extrato-vincular{font-size:12.5px; padding:5px 8px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); max-width:180px;}

/* ---------- Perfil ---------- */
.perfil-card{display:flex; align-items:center; gap:16px; flex-wrap:wrap;}
.perfil-avatar{width:56px; height:56px; font-size:22px; flex-shrink:0;}

/* ---------- Busca ---------- */
.search-bar{display:flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:8px 12px; flex:1; max-width:360px;}
.search-icon{font-size:15px; flex-shrink:0;}
.search-bar input{border:none; outline:none; font-size:14px; width:100%; background:transparent; color:var(--text);}

/* ---------- Dica do dia ---------- */
.dica-toggle{
  position:fixed; bottom:24px; right:24px; width:52px; height:52px; border-radius:50%;
  background:linear-gradient(135deg, var(--primary), #166534); color:#fff; border:none;
  font-size:22px; cursor:pointer; box-shadow:0 4px 16px rgba(0,0,0,.2);
  z-index:50; transition:transform .2s;
}
.dica-toggle:hover{transform:scale(1.1);}

.dica-card{
  position:fixed; bottom:88px; right:24px; width:300px; max-width:calc(100vw - 32px);
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:0 8px 30px rgba(0,0,0,.12); z-index:50; padding:0; overflow:hidden;
  animation:slideUp .25s ease;
}
@keyframes slideUp{from{opacity:0;transform:translateY(12px);}to{opacity:1;transform:translateY(0);}}
.dica-header{background:linear-gradient(135deg, var(--primary), #166534); color:#fff; padding:12px 14px; display:flex; align-items:center; gap:8px;}
.dica-icon{font-size:18px;}
.dica-titulo{font-weight:600; font-size:14px; flex:1;}
.dica-fechar{background:none; border:none; color:#fff; font-size:20px; cursor:pointer; line-height:1; padding:0; opacity:.8;}
.dica-fechar:hover{opacity:1;}
.dica-texto{padding:14px; font-size:14px; line-height:1.6; color:var(--text); margin:0;}
.dica-footer{display:flex; justify-content:space-between; align-items:center; padding:10px 14px; border-top:1px solid var(--border-soft);}
.dica-btn{background:none; border:1px solid var(--border); border-radius:var(--radius-sm); padding:5px 12px; font-size:13px; cursor:pointer; color:var(--primary); font-weight:500;}
.dica-btn:hover{background:var(--primary-soft);}

/* ---------- Agenda calendário ---------- */
.agenda-mes-header{display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; gap:12px;}
.agenda-mes-header h3{font-size:18px;}
.agenda-mes-resumo{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px 16px; margin-bottom:14px; display:flex; justify-content:space-between; font-size:13.5px;}

.cal-bloco{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; margin-bottom:12px; box-shadow:var(--shadow-sm);}
.cal-bloco.cal-hoje{border-color:var(--primary); background:var(--primary-soft);}
.cal-bloco.cal-urgente{border-color:var(--danger-border); background:var(--danger-bg);}
.cal-bloco.cal-atencao{border-color:var(--warning-border); background:var(--warning-bg);}
.cal-bloco.cal-passado{opacity:.55;}

.cal-dia-header{display:flex; align-items:center; gap:12px; margin-bottom:12px;}
.cal-dia-num{text-align:center; flex-shrink:0;}
.cal-dia-n{display:block; font-size:24px; font-weight:700; font-family:'Lexend',sans-serif; line-height:1;}
.cal-dia-mes{display:block; font-size:11px; color:var(--text-faint); text-transform:uppercase;}
.cal-urgencia-badge{font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px;}
.cal-hoje .cal-urgencia-badge{background:var(--primary); color:#fff;}
.cal-urgente .cal-urgencia-badge{background:var(--danger); color:#fff;}
.cal-atencao .cal-urgencia-badge{background:var(--warning); color:#fff;}
.cal-total-dia{margin-left:auto; font-size:15px; font-weight:700; font-family:'Lexend',sans-serif;}

.cal-dividas-dia{display:flex; flex-direction:column; gap:8px;}
.cal-divida-item{display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:13.5px; padding:6px 10px; background:rgba(255,255,255,.7); border-radius:var(--radius-sm);}
.cal-divida-nome{flex:1; font-weight:500;}
.cal-divida-valor{font-weight:700; color:var(--primary); white-space:nowrap;}

/* ---------- Loading Screen ---------- */
.loading-screen{
  position:fixed; inset:0; background:linear-gradient(160deg, #f4f5f7 0%, #e6f4ec 100%);
  display:flex; align-items:center; justify-content:center; z-index:9999;
  transition:opacity .4s ease;
}
.loading-screen.loading-fade{opacity:0; pointer-events:none;}
.loading-content{text-align:center; width:220px;}
.loading-logo{
  width:100px; height:100px; object-fit:contain; display:block; margin:0 auto 20px;
  animation:pulse 1.4s ease-in-out infinite;
}
@keyframes pulse{0%,100%{transform:scale(1);}50%{transform:scale(1.06);}}
.loading-bar-track{height:5px; background:#d1fae5; border-radius:999px; overflow:hidden; margin-bottom:12px;}
.loading-bar-fill{height:100%; width:0%; background:linear-gradient(90deg, var(--primary), #22c55e); border-radius:999px; transition:width .3s ease;}
.loading-txt{font-size:13px; color:var(--text-muted); margin:0; font-weight:500;}

/* ---------- Histórico unificado (diário + pagamentos) ---------- */
.diario-entry-icon{font-size:14px;}
.diario-entry-tipo-pagamento{background:#ecfdf5; border-color:#a7f3d0;}
.diario-pag-tag{font-size:11px; font-weight:700; background:#dcfce7; color:#166534; border-radius:999px; padding:2px 9px; border:1px solid #bbf7d0; margin-left:auto;}
.diario-entry-tipo-anotacao{background:var(--surface-soft);}
