/* ======================================================
   HEALTH PREVI - TEMA SUAVE (DARK PREMIUM)
   + Correção segura: clareia painel de tarefas SEM derrubar layout
   ====================================================== */

:root{
  /* Fundo (mais claro e suave) */
  --bg1:#0f172a;
  --bg2:#111827;
  --bg3:#0b1220;

  /* Superfícies (base) */
  --card: rgba(255,255,255,0.040);
  --card2: rgba(255,255,255,0.055);
  --input: rgba(255,255,255,0.035);

  /* Texto */
  --text:#edf2ff;
  --muted:#b6c2da;

  /* Linhas */
  --line: rgba(255,255,255,0.085);
  --line2: rgba(255,255,255,0.065);

  /* Cores de ação */
  --primary:#3b82f6;   /* azul suave */
  --primary2:#60a5fa;  /* azul claro */
  --danger:#fb7185;    /* rosa/vermelho suave */
  --warn:#fbbf24;      /* amarelo suave */

  /* Shadow */
  --shadow: 0 14px 34px rgba(0,0,0,0.22);
  --shadow2: 0 10px 26px rgba(0,0,0,0.18);

  /* Radius */
  --r-xl:18px;
  --r-lg:16px;
  --r-md:12px;
  --r-sm:10px;

  /* Transitions */
  --t-fast: .12s ease;
  --t: .18s ease;
}

/* Base */
*{box-sizing:border-box}
html, body{min-height:100%}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Arial;
  color:var(--text);

  /* Fundo suave, sem “mancha pesada” */
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 55%, var(--bg3) 100%);
  background-attachment: fixed;

  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

a{color:inherit}
.muted{color:var(--muted)}
.small{font-size:13px}
.tiny{font-size:12px}
.pre{white-space:pre-wrap; line-height:1.35}

/* Topbar */
.topbar{
  position:sticky; top:0;
  background: rgba(15,23,42,.70);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom:1px solid var(--line2);
  padding:12px 18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  z-index:10;
}

.brand{display:flex; gap:12px; align-items:center}

.logo{
  width:38px; height:38px; border-radius:12px;
  background:linear-gradient(135deg, var(--primary), var(--primary2));
  display:flex; align-items:center; justify-content:center;
  font-weight:900;
  box-shadow: 0 10px 22px rgba(59,130,246,.18);
}

.brandname{font-weight:900; letter-spacing:.2px}
.brandsub{font-size:12px;color:var(--muted)}

.toplinks{display:flex; gap:14px; align-items:center}
.link{color:rgba(237,242,255,.72); text-decoration:none; transition:color var(--t-fast)}
.link:hover{color:var(--text)}

/* Layout */
.container{max-width:1100px; margin:20px auto; padding:0 18px 40px}
.footer{
  border-top:1px solid var(--line2);
  color:rgba(237,242,255,.65);
  padding:14px 18px;
  text-align:center;
  font-size:12px
}

.h1{margin:10px 0 6px; font-size:26px}
.row{display:flex; justify-content:space-between; align-items:flex-end; gap:12px; flex-wrap:wrap}
.row-right{display:flex; gap:10px; align-items:center}

/* Cards */
.card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius:var(--r-xl);
  padding:16px;
  box-shadow: var(--shadow);
  margin-top:14px;
}

.cardtitle{font-weight:900; margin-bottom:6px}

.cardlink{
  text-decoration:none;
  display:block;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.cardlink:hover{
  transform: translateY(-1px);
  border-color: rgba(59,130,246,.22);
  box-shadow: 0 18px 38px rgba(0,0,0,.26);
}

/* Grid */
.grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}
@media(max-width:900px){ .grid{grid-template-columns:repeat(2, minmax(0,1fr));}}
@media(max-width:600px){ .grid{grid-template-columns:repeat(1, minmax(0,1fr));}}

.grid2{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
}
@media(max-width:700px){ .grid2{grid-template-columns:repeat(1, minmax(0,1fr));}}

/* Forms */
.form{display:flex; flex-direction:column; gap:10px; margin-top:10px}
.label{font-size:12px; color:rgba(237,242,255,.70); margin-top:6px}

/* Inputs */
.input, select, input[type="file"], input[type="text"], input[type="password"], input[type="email"]{
  width:100%;
  padding:11px 12px;
  border-radius:var(--r-md);
  border:1px solid var(--line2);
  background: var(--input);
  color:var(--text);
  outline:none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

input[type="file"]{padding:8px 10px}

.input:focus, select:focus,
input[type="file"]:focus, input[type="text"]:focus,
input[type="password"]:focus, input[type="email"]:focus{
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 3px rgba(59,130,246,.14);
  background: rgba(255,255,255,0.045);
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:var(--r-md);
  border:1px solid var(--line2);
  background: rgba(255,255,255,0.03);
  color:var(--text);
  text-decoration:none;
  cursor:pointer;
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.btn:hover{
  border-color: rgba(59,130,246,.28);
  background: rgba(255,255,255,0.045);
  transform: translateY(-1px);
}

.btn:active{transform: translateY(0)}

.btn.primary{
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(59,130,246,.16);
}

.btn.primary:hover{
  box-shadow: 0 14px 26px rgba(59,130,246,.20);
}

.btn.danger{
  background: rgba(251,113,133,.12);
  border-color: rgba(251,113,133,.32);
  color: #ffd5dc;
}

.btn.small{padding:7px 10px; border-radius:var(--r-sm); font-size:13px}
.btn.ghost{background:transparent}

/* Messages */
.messages{margin:12px 0}
.msg{
  padding:10px 12px;
  border-radius:var(--r-md);
  border:1px solid var(--line2);
  background: rgba(255,255,255,0.03);
  margin-top:8px;
}
.msg.error{border-color:rgba(251,113,133,.34); background:rgba(251,113,133,.10)}
.msg.success{border-color:rgba(59,130,246,.30); background:rgba(59,130,246,.10)}

/* Table/List */
.table{margin-top:10px}
.thead, .trow{
  display:grid;
  grid-template-columns: 1.5fr .8fr 1fr;
  gap:10px;
  padding:10px 0;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.thead{font-size:12px; color:rgba(237,242,255,.72); font-weight:900}
.actions{display:flex; gap:8px; align-items:center; justify-content:flex-start; flex-wrap:wrap}

/* Readonly fields */
.field{margin-bottom:10px;}
.readonly{
  padding:10px 12px;
  border:1px solid var(--line2);
  border-radius:14px;
  background: rgba(255,255,255,0.03);
  color:var(--text);
}

/* Auth */
.authbg{
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 55%, var(--bg3) 100%);
  background-attachment: fixed;
}
.authwrap{min-height:100vh; display:flex; align-items:center; justify-content:center; padding:18px}
.authcard{max-width:420px; width:100%}
.authtitle{font-size:26px; font-weight:950; letter-spacing:.4px}
.authsubtitle{color:rgba(237,242,255,.70); margin-top:2px}
.authnote{margin-top:10px; font-size:12px; color:rgba(237,242,255,.62)}
.searchbar{align-items:center}

/* Tasks */
.taskcard{
  border:1px solid var(--line2);
  border-radius:var(--r-lg);
  padding:12px;
  margin-bottom:10px;
  background: rgba(255,255,255,0.035);
  box-shadow: var(--shadow2);
}
.taskcard.overdue{
  border-color: rgba(251,113,133,0.55);
  box-shadow: 0 0 0 1px rgba(251,113,133,0.16) inset;
}
.taskcard.today{
  border-color: rgba(251,191,36,0.55);
  box-shadow: 0 0 0 1px rgba(251,191,36,0.16) inset;
}

.badge{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--line2);
  color:rgba(237,242,255,.72);
  background: rgba(255,255,255,0.02);
}
.badge.overdue{border-color:rgba(251,113,133,0.60); color: #ffb3bf}
.badge.today{border-color:rgba(251,191,36,0.70); color: #ffd88a}

/* Extras */
::selection{background: rgba(59,130,246,.28)}
hr{border:0; border-top:1px solid rgba(255,255,255,.06); margin:14px 0}

/* ======================================================
   ✅ MELHORIA PEDIDA (SEGURA):
   Clareia o painel de tarefas SEM mexer no layout.
   NÃO altera .grid2, display, position, colunas, etc.
   Só ajusta cor/borda dos cards relacionados a tarefas.
   ====================================================== */

.card{
  /* deixa um pouco mais claro em geral (inclusive tarefas) */
  background: rgba(255,255,255,0.055) !important;
  border-color: rgba(255,255,255,0.10) !important;
}

/* tarefas internas (cards dentro do painel) ainda mais claras */
.taskcard{
  background: rgba(255,255,255,0.070) !important;
  border-color: rgba(255,255,255,0.12) !important;
}

.taskcard.success{border-color: rgba(34,197,94,0.55); box-shadow: 0 0 0 1px rgba(34,197,94,0.16) inset;}
.badge.success{border-color:rgba(34,197,94,0.70); color:#bff0cf}
