/* ==========================================================
   Pendências — design system
   ========================================================== */

:root{
  --bg:#f7f8fa;
  --surface:#ffffff;
  --surface-2:#f9fafb;
  --surface-hover:#f3f4f6;
  --sidebar:#fbfbfc;
  --text:#111827;
  --text-2:#374151;
  --muted:#6b7280;
  --faint:#9ca3af;
  --border:#e5e7eb;
  --border-strong:#d1d5db;

  --primary:#0047eb;
  --primary-hover:#003bc4;
  --primary-soft:#eef3ff;
  --primary-text:#0040d6;
  --ring:rgba(0,71,235,.2);

  --success:#059669;  --success-soft:#ecfdf5; --success-text:#047857;
  --warning:#d97706;  --warning-soft:#fffbeb; --warning-text:#b45309;
  --danger:#dc2626;   --danger-soft:#fef2f2;  --danger-text:#b91c1c;
  --info:#2563eb;     --info-soft:#eff6ff;    --info-text:#1d4ed8;

  --radius-sm:6px;
  --radius:10px;
  --radius-lg:14px;
  --shadow-xs:0 1px 2px rgba(16,24,40,.05);
  --shadow-sm:0 1px 3px rgba(16,24,40,.06),0 1px 2px rgba(16,24,40,.04);
  --shadow-lg:0 20px 40px -12px rgba(16,24,40,.18);
  --sidebar-w:248px;
}

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0b0d12;
    --surface:#12151c;
    --surface-2:#161a22;
    --surface-hover:#1b2029;
    --sidebar:#0e1117;
    --text:#f3f4f6;
    --text-2:#d1d5db;
    --muted:#9ca3af;
    --faint:#6b7280;
    --border:#232833;
    --border-strong:#2f3542;
    --primary:#2563ff;
    --primary-hover:#4d82ff;
    --primary-soft:rgba(37,99,255,.15);
    --primary-text:#8fb0ff;
    --ring:rgba(77,130,255,.32);
    --success-soft:rgba(16,185,129,.12); --success-text:#34d399;
    --warning-soft:rgba(245,158,11,.12); --warning-text:#fbbf24;
    --danger-soft:rgba(239,68,68,.12);   --danger-text:#f87171;
    --info-soft:rgba(59,130,246,.12);    --info-text:#60a5fa;
    --shadow-xs:none;
    --shadow-sm:0 1px 2px rgba(0,0,0,.4);
    --shadow-lg:0 20px 40px -12px rgba(0,0,0,.6);
  }
}

:root[data-theme="dark"]{
  --bg:#0b0d12;
  --surface:#12151c;
  --surface-2:#161a22;
  --surface-hover:#1b2029;
  --sidebar:#0e1117;
  --text:#f3f4f6;
  --text-2:#d1d5db;
  --muted:#9ca3af;
  --faint:#6b7280;
  --border:#232833;
  --border-strong:#2f3542;
  --primary:#2563ff;
  --primary-hover:#4d82ff;
  --primary-soft:rgba(37,99,255,.15);
  --primary-text:#8fb0ff;
  --ring:rgba(77,130,255,.32);
  --success-soft:rgba(16,185,129,.12); --success-text:#34d399;
  --warning-soft:rgba(245,158,11,.12); --warning-text:#fbbf24;
  --danger-soft:rgba(239,68,68,.12);   --danger-text:#f87171;
  --info-soft:rgba(59,130,246,.12);    --info-text:#60a5fa;
  --shadow-xs:none;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow-lg:0 20px 40px -12px rgba(0,0,0,.6);
}

/* ---------- Base ---------- */

*,*::before,*::after{box-sizing:border-box}

html{-webkit-text-size-adjust:100%}

body{
  margin:0;
  font-family:"Inter",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:14px;
  line-height:1.5;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  font-feature-settings:"cv11","ss01";
}

a{color:inherit}

h1,h2,h3,h4{margin:0;letter-spacing:-.01em}

.ico{width:18px;height:18px;flex:none}

/* ---------- App shell ---------- */

.app{
  display:grid;
  grid-template-columns:var(--sidebar-w) minmax(0,1fr);
  min-height:100vh;
}

.sidebar{
  position:sticky;top:0;
  height:100vh;
  background:var(--sidebar);
  border-right:1px solid var(--border);
  padding:16px 12px;
  display:flex;
  flex-direction:column;
  gap:20px;
}

.brand{
  display:flex;align-items:center;gap:10px;
  padding:6px 8px;
  text-decoration:none;
}

.logo{
  width:32px;height:32px;
  display:grid;place-items:center;
  border-radius:8px;
  background:linear-gradient(135deg,#6366f1 0%,#4338ca 100%);
  color:#fff;
  box-shadow:0 1px 2px rgba(67,56,202,.4),inset 0 1px 0 rgba(255,255,255,.18);
}
.logo .ico{width:17px;height:17px;stroke-width:2.2}

.brand-text{display:flex;flex-direction:column;line-height:1.2}
.brand-text strong{font-size:14px;font-weight:650}
.brand-text small{font-size:12px;color:var(--muted)}

.nav{display:flex;flex-direction:column;gap:2px}

.nav-label{
  font-size:11px;font-weight:600;
  color:var(--faint);
  text-transform:uppercase;
  letter-spacing:.06em;
  padding:14px 10px 6px;
}
.nav-label:first-child{padding-top:0}

.nav a{
  display:flex;align-items:center;gap:10px;
  padding:7px 10px;
  border-radius:var(--radius-sm);
  color:var(--text-2);
  text-decoration:none;
  font-weight:500;
  transition:background .12s,color .12s;
}
.nav a .ico{color:var(--muted)}
.nav a:hover{background:var(--surface-hover);color:var(--text)}
.nav a.active{
  background:var(--surface);
  color:var(--text);
  box-shadow:var(--shadow-sm),0 0 0 1px var(--border);
}
.nav a.active .ico{color:var(--primary)}

.sidebar-footer{margin-top:auto}

.user-card{
  display:flex;align-items:center;gap:10px;
  padding:10px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface);
}

.user-meta{display:flex;flex-direction:column;min-width:0;flex:1;line-height:1.25}
.user-meta strong{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-meta small{font-size:12px;color:var(--muted)}

.avatar{
  width:32px;height:32px;flex:none;
  display:grid;place-items:center;
  border-radius:50%;
  background:linear-gradient(135deg,#dbe6ff,#b3c8ff);
  color:#0036b3;
  font-size:12px;font-weight:700;
}
.avatar.sm{width:28px;height:28px;font-size:11px}

.content{min-width:0;display:flex;flex-direction:column}

.appbar{
  position:sticky;top:0;z-index:20;
  height:56px;
  display:flex;align-items:center;gap:12px;
  padding:0 28px;
  background:color-mix(in srgb,var(--bg) 85%,transparent);
  backdrop-filter:saturate(180%) blur(10px);
  -webkit-backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid var(--border);
}

.crumbs{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:13px;min-width:0}
.crumbs strong{color:var(--text);font-weight:500}
.crumbs .sep{color:var(--faint)}

.appbar-right{margin-left:auto;display:flex;align-items:center;gap:8px}

.icon-btn{
  width:32px;height:32px;
  display:inline-grid;place-items:center;
  border:none;border-radius:var(--radius-sm);
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  text-decoration:none;
  transition:background .12s,color .12s;
}
.icon-btn:hover{background:var(--surface-hover);color:var(--text)}
.icon-btn:focus-visible{outline:none;box-shadow:0 0 0 3px var(--ring)}

.menu-btn{display:none}
.sidebar-overlay{display:none}

.main{
  width:100%;
  max-width:1280px;
  padding:28px 28px 64px;
}

.page-head{
  display:flex;justify-content:space-between;align-items:flex-end;
  gap:16px;flex-wrap:wrap;
  margin-bottom:24px;
}
.page-head h1{font-size:22px;font-weight:650;letter-spacing:-.02em}
.page-head p{margin:4px 0 0;color:var(--muted)}
.page-actions{display:flex;gap:8px;flex-wrap:wrap}

/* ---------- KPIs ---------- */

.kpis{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:12px;
  margin-bottom:24px;
}

.kpi{
  position:relative;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:16px 18px;
  box-shadow:var(--shadow-xs);
}

.kpi-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.kpi small{color:var(--muted);font-size:13px;font-weight:500}

.kpi-ico{
  width:30px;height:30px;
  display:grid;place-items:center;
  border-radius:8px;
  background:var(--surface-2);
  color:var(--muted);
  border:1px solid var(--border);
}
.kpi-ico .ico{width:16px;height:16px}

.kpi strong{
  display:block;
  font-size:28px;font-weight:650;
  letter-spacing:-.03em;
  margin-top:10px;
  font-variant-numeric:tabular-nums;
}

.kpi-bar{
  height:4px;margin-top:12px;
  border-radius:999px;
  background:var(--surface-hover);
  overflow:hidden;
}
.kpi-bar span{display:block;height:100%;border-radius:inherit;background:var(--primary)}

.kpi.info .kpi-ico{background:var(--info-soft);color:var(--info-text);border-color:transparent}
.kpi.warning .kpi-ico{background:var(--warning-soft);color:var(--warning-text);border-color:transparent}
.kpi.success .kpi-ico{background:var(--success-soft);color:var(--success-text);border-color:transparent}
.kpi.danger .kpi-ico{background:var(--danger-soft);color:var(--danger-text);border-color:transparent}
.kpi.danger strong{color:var(--danger-text)}
.kpi.info .kpi-bar span{background:var(--info)}
.kpi.warning .kpi-bar span{background:var(--warning)}
.kpi.success .kpi-bar span{background:var(--success)}
.kpi.danger .kpi-bar span{background:var(--danger)}

/* ---------- Panels ---------- */

.panel{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-xs);
  margin-bottom:20px;
  overflow:hidden;
}

.panel-head{
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  padding:16px 20px;
  border-bottom:1px solid var(--border);
}
.panel-head h3{font-size:15px;font-weight:600}
.panel-head p{margin:2px 0 0;color:var(--muted);font-size:13px}
.panel-head a.link{
  display:inline-flex;align-items:center;gap:4px;
  color:var(--primary-text);
  text-decoration:none;
  font-size:13px;font-weight:500;
}
.panel-head a.link .ico{width:15px;height:15px}
.panel-head a.link:hover{text-decoration:underline}

.panel-body{padding:20px}
.panel-body.flush{padding:0}

.grid-2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px}
.grid-main{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:20px;align-items:start}

/* ---------- Forms ---------- */

.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px 18px;
}

.field{display:flex;flex-direction:column;gap:6px}
.field.full,.full{grid-column:1/-1}

label{font-size:13px;font-weight:500;color:var(--text-2)}
.req{color:var(--danger)}
.hint{font-size:12px;color:var(--muted)}

input,select,textarea{
  width:100%;
  padding:8px 11px;
  font:inherit;
  color:var(--text);
  background:var(--surface);
  border:1px solid var(--border-strong);
  border-radius:var(--radius-sm);
  box-shadow:var(--shadow-xs);
  transition:border-color .12s,box-shadow .12s;
}
input,select{height:38px}
input::placeholder,textarea::placeholder{color:var(--faint)}
input:hover,select:hover,textarea:hover{border-color:var(--faint)}
input:focus,select:focus,textarea:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 3px var(--ring);
}

select{
  appearance:none;
  padding-right:34px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 10px center;
  background-size:16px;
}

textarea{min-height:96px;resize:vertical}

.form-actions{
  display:flex;gap:8px;align-items:center;flex-wrap:wrap;
  padding-top:4px;
}

.form-footer{
  display:flex;justify-content:flex-end;gap:8px;
  margin:20px -20px -20px;
  padding:14px 20px;
  background:var(--surface-2);
  border-top:1px solid var(--border);
}

/* ---------- Buttons ---------- */

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  height:36px;
  padding:0 14px;
  border:1px solid transparent;
  border-radius:var(--radius-sm);
  font:inherit;font-size:13.5px;font-weight:550;
  text-decoration:none;
  white-space:nowrap;
  cursor:pointer;
  transition:background .12s,border-color .12s,box-shadow .12s,color .12s;
}
.btn .ico{width:16px;height:16px}
.btn:focus-visible{outline:none;box-shadow:0 0 0 3px var(--ring)}

.btn.primary{
  background:var(--primary);
  color:#fff;
  box-shadow:0 1px 2px rgba(16,24,40,.12),inset 0 1px 0 rgba(255,255,255,.12);
}
.btn.primary:hover{background:var(--primary-hover)}

.btn.ghost{
  background:var(--surface);
  border-color:var(--border-strong);
  color:var(--text-2);
  box-shadow:var(--shadow-xs);
}
.btn.ghost:hover{background:var(--surface-hover);color:var(--text)}

.btn.danger{background:transparent;color:var(--danger-text)}
.btn.danger:hover{background:var(--danger-soft)}

.btn.small{height:30px;padding:0 10px;font-size:12.5px}
.btn.small .ico{width:14px;height:14px}
.btn.full{width:100%}
.btn.lg{height:42px;font-size:14.5px}

/* ---------- Filters ---------- */

.toolbar{
  display:flex;gap:8px;flex-wrap:wrap;align-items:center;
  padding:12px 20px;
  border-bottom:1px solid var(--border);
  background:var(--surface-2);
}
.toolbar .search{position:relative;flex:1;min-width:200px}
.toolbar .search .ico{
  position:absolute;left:10px;top:50%;transform:translateY(-50%);
  width:16px;height:16px;color:var(--faint);pointer-events:none;
}
.toolbar .search input{padding-left:34px}
.toolbar select{width:auto;min-width:170px}

/* ---------- Tables ---------- */

.table-wrap{overflow-x:auto}

table{width:100%;border-collapse:collapse}

th,td{
  text-align:left;
  padding:12px 20px;
  border-bottom:1px solid var(--border);
  vertical-align:middle;
}

th{
  font-size:12px;font-weight:500;
  color:var(--muted);
  background:var(--surface-2);
  white-space:nowrap;
}

tbody tr{transition:background .1s}
tbody tr:hover{background:var(--surface-2)}
tbody tr:last-child td{border-bottom:none}

td strong{font-weight:550}
td .sub{display:block;color:var(--muted);font-size:12.5px;margin-top:2px}
td.muted{color:var(--muted)}
td.num{font-variant-numeric:tabular-nums;white-space:nowrap}

.cell-user{display:flex;align-items:center;gap:10px}

.actions{display:flex;gap:4px;align-items:center;justify-content:flex-end}
.actions form{margin:0}
th.right,td.right{text-align:right}

/* ---------- Badges ---------- */

.tag{
  display:inline-flex;align-items:center;gap:6px;
  height:22px;
  padding:0 8px;
  border-radius:999px;
  font-size:12px;font-weight:500;
  white-space:nowrap;
  background:var(--surface-hover);
  color:var(--text-2);
}
.tag::before{
  content:"";
  width:6px;height:6px;border-radius:50%;
  background:currentColor;
  opacity:.85;
}
.tag.alta{background:var(--danger-soft);color:var(--danger-text)}
.tag.media{background:var(--warning-soft);color:var(--warning-text)}
.tag.baixa{background:var(--success-soft);color:var(--success-text)}
.tag.info{background:var(--info-soft);color:var(--info-text)}
.tag.primary{background:var(--primary-soft);color:var(--primary-text)}
.tag.neutro{background:var(--surface-hover);color:var(--muted)}
.tag.plain::before{display:none}

/* ---------- Alerts ---------- */

.alert{
  display:flex;align-items:center;gap:10px;
  padding:11px 14px;
  border-radius:var(--radius);
  margin-bottom:20px;
  font-weight:500;
  border:1px solid transparent;
}
.alert .ico{width:18px;height:18px}
.alert.sucesso{background:var(--success-soft);color:var(--success-text);border-color:color-mix(in srgb,var(--success) 25%,transparent)}
.alert.erro{background:var(--danger-soft);color:var(--danger-text);border-color:color-mix(in srgb,var(--danger) 25%,transparent)}

/* ---------- Empty / list ---------- */

.empty{
  margin:0;
  text-align:center;
  color:var(--muted);
  padding:44px 20px;
}
.empty .empty-ico{
  width:44px;height:44px;margin:0 auto 12px;
  display:grid;place-items:center;
  border-radius:12px;
  background:var(--surface-2);
  border:1px solid var(--border);
}
.empty strong{display:block;color:var(--text);font-weight:600;margin-bottom:2px}

.list{display:flex;flex-direction:column}

.list-item{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:13px 20px;
  border-bottom:1px solid var(--border);
  text-decoration:none;
  color:var(--text);
  transition:background .1s;
}
.list-item:last-child{border-bottom:none}
.list-item:hover{background:var(--surface-2)}
.list-item .li-main{min-width:0}
.list-item .li-main strong{display:block;font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.list-item .li-main span{color:var(--muted);font-size:12.5px}
.list-item .li-tags{display:flex;gap:6px;flex:none}

.breakdown{display:flex;flex-direction:column;gap:14px}
.breakdown-row{display:flex;flex-direction:column;gap:6px}
.breakdown-row .top{display:flex;justify-content:space-between;font-size:13px}
.breakdown-row .top span{color:var(--muted);font-variant-numeric:tabular-nums}
.bar{height:6px;border-radius:999px;background:var(--surface-hover);overflow:hidden}
.bar span{display:block;height:100%;border-radius:inherit}

.checkbox{
  display:flex;align-items:center;gap:10px;
  height:38px;
  font-weight:500;color:var(--text);
}
.checkbox input{width:16px;height:16px;padding:0;box-shadow:none;accent-color:var(--primary)}

/* ---------- Login ---------- */

.auth{
  min-height:100vh;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  background:var(--surface);
}

.auth-aside{
  position:relative;
  overflow:hidden;
  display:flex;flex-direction:column;justify-content:space-between;
  padding:40px 48px;
  color:#dbe6ff;
  background:
    radial-gradient(1200px 600px at -10% -10%,rgba(0,71,235,.45),transparent 60%),
    radial-gradient(800px 500px at 110% 110%,rgba(56,189,248,.16),transparent 60%),
    linear-gradient(160deg,#071a4d 0%,#030b24 100%);
}
.auth-aside::after{
  content:"";
  position:absolute;inset:0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.04) 1px,transparent 1px);
  background-size:40px 40px;
  mask-image:radial-gradient(ellipse at center,#000 30%,transparent 75%);
  pointer-events:none;
}
.auth-aside > *{position:relative;z-index:1}
.auth-aside .brand-text strong{color:#fff}
.auth-aside .brand-text small{color:#8fb0ff}
.auth-aside h2{font-size:34px;line-height:1.15;font-weight:650;letter-spacing:-.03em;color:#fff;max-width:440px}
.auth-aside p{color:#c3d4ff;max-width:420px;font-size:15px;margin:14px 0 0}

.auth-features{display:flex;flex-direction:column;gap:12px;margin-top:32px;padding:0;list-style:none}
.auth-features li{display:flex;align-items:center;gap:10px;color:#dbe6ff}
.auth-features .ico{width:18px;height:18px;color:#6f9bff}

.auth-foot{font-size:12.5px;color:#8fb0ff}

.auth-main{display:grid;place-items:center;padding:40px 24px}

.auth-card{width:min(380px,100%)}
.auth-card h1{font-size:24px;font-weight:650;letter-spacing:-.02em}
.auth-card > p{margin:6px 0 28px;color:var(--muted)}
.auth-card form{display:flex;flex-direction:column;gap:16px}
.auth-card .btn{margin-top:4px}
.auth-mobile-brand{display:none;margin-bottom:28px}

/* ---------- Responsive ---------- */

@media (max-width:1100px){
  .grid-main{grid-template-columns:1fr}
}

@media (max-width:900px){
  .app{grid-template-columns:1fr}
  .sidebar{
    position:fixed;left:0;top:0;z-index:50;
    width:var(--sidebar-w);
    transform:translateX(-100%);
    transition:transform .2s ease;
    box-shadow:var(--shadow-lg);
  }
  .nav-open .sidebar{transform:none}
  .nav-open .sidebar-overlay{
    display:block;position:fixed;inset:0;z-index:40;
    background:rgba(15,23,42,.4);
  }
  .menu-btn{display:inline-grid}
  .appbar{padding:0 16px}
  .main{padding:20px 16px 48px}
  .form-grid,.grid-2{grid-template-columns:1fr}
  .auth{grid-template-columns:1fr}
  .auth-aside{display:none}
  .auth-mobile-brand{display:flex}
  th,td{padding:11px 14px}
  .panel-head,.toolbar{padding-left:16px;padding-right:16px}
  .panel-body{padding:16px}
  .form-footer{margin:16px -16px -16px;padding:12px 16px}
}

@media (max-width:560px){
  .crumbs span,.crumbs .sep{display:none}
  .toolbar select{flex:1;min-width:0}
  .toolbar .btn{flex:1}
}
.tag .ico{width:13px;height:13px}

/* ---------- Features v2 ---------- */

.user-meta{text-decoration:none;color:inherit}
a.avatar{text-decoration:none}
.btn.icon-only{width:30px;padding:0}
.text-danger{color:var(--danger-text) !important}
.muted-text{margin:0;color:var(--muted)}
.muted{color:var(--muted)}
.row-link{text-decoration:none;color:var(--text)}
.row-link:hover strong{color:var(--primary-text);text-decoration:underline}
.link-plain{color:var(--primary-text);text-decoration:none;font-weight:500}
.link-plain:hover{text-decoration:underline}
td a[href^="mailto"],td a[href^="tel"],.props a{color:var(--primary-text);text-decoration:none}
td a[href^="mailto"]:hover,td a[href^="tel"]:hover,.props a:hover{text-decoration:underline}
tr.row-done td strong{color:var(--muted);font-weight:500}
.clamp{max-width:280px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.toolbar .checkbox.toggle{height:38px;padding:0 4px;font-size:13px;color:var(--text-2);white-space:nowrap}
.panel-head .link{display:inline-flex;align-items:center;gap:4px;color:var(--primary-text);text-decoration:none;font-size:13px;font-weight:500}
.panel-head .link:hover{text-decoration:underline}

.prose{color:var(--text-2);line-height:1.65;white-space:normal;overflow-wrap:anywhere}

.props{display:grid;grid-template-columns:auto 1fr;gap:12px 16px;margin:0;padding:18px 20px}
.props dt{color:var(--muted);font-size:13px}
.props dd{margin:0;font-weight:500;text-align:right;overflow-wrap:anywhere}
.props dd .sub{display:block;color:var(--muted);font-weight:400;font-size:12.5px}

.status-switch{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.status-switch button{
  display:flex;align-items:center;justify-content:center;
  height:40px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  background:var(--surface);
  cursor:pointer;
  transition:border-color .12s,background .12s;
}
.status-switch button:hover:not(:disabled){border-color:var(--border-strong);background:var(--surface-2)}
.status-switch button.active{border-color:var(--primary);box-shadow:0 0 0 3px var(--ring);cursor:default}

.note-form{display:flex;gap:12px;align-items:flex-start;margin-bottom:24px}
.note-input{flex:1;display:flex;flex-direction:column;gap:8px}
.note-input textarea{min-height:72px}
.note-actions{display:flex;justify-content:flex-end}

.timeline{list-style:none;margin:0;padding:0;position:relative}
.timeline::before{content:"";position:absolute;left:15px;top:8px;bottom:8px;width:1px;background:var(--border)}
.timeline li{position:relative;display:flex;gap:12px;padding-bottom:18px}
.timeline li:last-child{padding-bottom:0}
.tl-dot{
  position:relative;z-index:1;
  width:32px;height:32px;flex:none;
  display:grid;place-items:center;
  border-radius:50%;
  background:var(--surface);
  border:1px solid var(--border);
  color:var(--muted);
}
.tl-dot .ico{width:15px;height:15px}
.timeline li.is-note .tl-dot{background:var(--primary-soft);border-color:transparent;color:var(--primary-text)}
.tl-body{flex:1;min-width:0;padding-top:5px}
.tl-meta{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap;font-size:13px}
.tl-meta span{color:var(--faint);font-size:12px}
.tl-text{margin-top:3px;color:var(--text-2);overflow-wrap:anywhere}
.timeline li.is-note .tl-text{
  margin-top:6px;padding:10px 12px;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--radius);
}
.timeline li.is-system .tl-text{color:var(--muted);font-size:13px}

.deadline-list .list-item{align-items:center}
.date-chip{
  width:44px;flex:none;
  display:flex;flex-direction:column;align-items:center;
  padding:4px 0;
  border-radius:8px;
  background:var(--surface-2);
  border:1px solid var(--border);
  line-height:1.15;
}
.date-chip b{font-size:15px;font-weight:650}
.date-chip small{font-size:10.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.date-chip.late{background:var(--danger-soft);border-color:transparent;color:var(--danger-text)}
.date-chip.late small{color:inherit}
.deadline-list .li-main{flex:1}
.deadline-list .left{display:flex;align-items:center;gap:12px;min-width:0;flex:1}

.avatar.xl{width:64px;height:64px;font-size:22px}
.profile-hero .panel-body{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.profile-hero h3{font-size:18px}
.profile-hero p{margin:2px 0 8px;color:var(--muted)}
.li-tags{display:flex;gap:6px;flex-wrap:wrap}
.profile-stats{margin-left:auto;display:flex;gap:28px}
.profile-stats div{display:flex;flex-direction:column;align-items:flex-end}
.profile-stats strong{font-size:22px;font-weight:650;font-variant-numeric:tabular-nums}
.profile-stats small{color:var(--muted);font-size:12px}

a.kpi{text-decoration:none;color:inherit;transition:border-color .12s,box-shadow .12s}
a.kpi:hover{border-color:var(--border-strong);box-shadow:var(--shadow-sm)}

@media (max-width:900px){
  .props{padding:16px}
  .profile-stats{margin-left:0;width:100%}
  .profile-stats div{align-items:flex-start}
  .clamp{max-width:180px}
}

/* ---------- Brand: Active Workspace ---------- */

.brand-link{display:block;text-decoration:none;color:inherit;border-radius:var(--radius-sm)}
.brand-link:focus-visible{outline:none;box-shadow:0 0 0 3px var(--ring)}
.brand{gap:11px}
.logo-img{width:32px;height:32px;flex:none;object-fit:contain}
.brand-text strong{
  font-size:15px;font-weight:600;
  letter-spacing:.32em;
  text-transform:uppercase;
  line-height:1.1;
}
.brand-text small{
  font-size:9.5px;font-weight:600;
  letter-spacing:.42em;
  text-transform:uppercase;
  color:var(--muted);
  margin-top:3px;
}
.brand.on-dark .brand-text strong{color:#fff}
.brand.on-dark .brand-text small{color:#8fb0ff}
.auth-aside .logo-img{filter:brightness(1.35) saturate(1.1)}

/* ==========================================================
   Ferramentas: tarefas, quadro, calendário, relatórios
   ========================================================== */

.nav-badge{
  margin-left:auto;
  min-width:20px;height:20px;padding:0 6px;
  display:inline-grid;place-items:center;
  border-radius:999px;
  background:var(--primary);color:#fff;
  font-size:11px;font-weight:600;
}
.icon-btn.danger:hover{background:var(--danger-soft);color:var(--danger-text)}
.unit{font-size:15px;font-weight:500;color:var(--muted);margin-left:3px;letter-spacing:0}

/* ---------- Tarefas ---------- */

.todo-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:20px;align-items:start}

.quick-add{display:flex;flex-direction:column;gap:10px;padding:14px 16px}
.quick-add-main{position:relative}
.quick-add-ico{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--primary);display:flex}
.quick-add-main input{height:44px;padding-left:40px;font-size:15px;border-color:var(--border)}
.quick-add-opts{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.quick-add-opts input[type=date]{width:auto}
.quick-add-opts select{width:auto;max-width:280px;flex:1}
.quick-add-opts .btn.primary{margin-left:auto}

.star-toggle{
  position:relative;
  width:38px;height:38px;flex:none;
  display:inline-grid;place-items:center;
  border:1px solid var(--border-strong);
  border-radius:var(--radius-sm);
  color:var(--faint);
  cursor:pointer;
  background:var(--surface);
}
.star-toggle input{position:absolute;opacity:0;pointer-events:none}
.star-toggle:has(input:checked){color:#f59e0b;border-color:#f59e0b;background:var(--warning-soft)}
.star-toggle:has(input:checked) .ico{fill:currentColor}
.star-toggle:has(input:focus-visible){box-shadow:0 0 0 3px var(--ring)}

.tabs{display:flex;gap:2px;padding:0 12px;border-bottom:1px solid var(--border);overflow-x:auto}
.tabs a{
  display:flex;align-items:center;gap:7px;
  padding:12px 10px;
  color:var(--muted);text-decoration:none;font-weight:500;white-space:nowrap;
  border-bottom:2px solid transparent;margin-bottom:-1px;
}
.tabs a:hover{color:var(--text)}
.tabs a.active{color:var(--text);border-bottom-color:var(--primary)}
.tabs .count{
  min-width:20px;height:18px;padding:0 6px;
  display:inline-grid;place-items:center;
  border-radius:999px;background:var(--surface-hover);
  font-size:11px;font-weight:600;color:var(--muted);
}
.tabs a.active .count{background:var(--primary-soft);color:var(--primary-text)}

.filter-note{padding:10px 20px;font-size:13px;color:var(--muted);background:var(--surface-2);border-bottom:1px solid var(--border)}
.filter-note a{color:var(--primary-text)}

.todo-group + .todo-group{border-top:1px solid var(--border)}
.todo-group-head{
  display:flex;align-items:center;gap:8px;
  padding:14px 20px 6px;
  font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);
}
.todo-group-head span{color:var(--faint);font-weight:500}

.todo-list{list-style:none;margin:0;padding:0 8px 8px}
.todo{
  display:flex;align-items:flex-start;gap:10px;
  padding:8px 12px;
  border-radius:var(--radius);
  transition:background .1s;
}
.todo:hover{background:var(--surface-2)}
.todo form{margin:0}

.check{
  width:20px;height:20px;margin-top:1px;flex:none;
  display:grid;place-items:center;
  padding:0;
  border:1.5px solid var(--border-strong);
  border-radius:50%;
  background:var(--surface);
  color:transparent;
  cursor:pointer;
  transition:border-color .12s,background .12s,color .12s;
}
.check .ico{width:12px;height:12px;stroke-width:3}
.check:hover{border-color:var(--success);color:var(--success)}
.check:focus-visible{outline:none;box-shadow:0 0 0 3px var(--ring)}
.todo.done .check{background:var(--success);border-color:var(--success);color:#fff}
.todo.starred:not(.done) .check{border-color:#f59e0b}

.todo-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.todo-title{overflow-wrap:anywhere;color:var(--text)}
.todo.done .todo-title{color:var(--faint);text-decoration:line-through}
.todo-meta{display:flex;gap:12px;flex-wrap:wrap;font-size:12.5px;color:var(--muted)}
.todo-meta > *{display:inline-flex;align-items:center;gap:4px}
.todo-meta .ico{width:13px;height:13px}
.todo-meta a{color:var(--muted);text-decoration:none}
.todo-meta a:hover{color:var(--primary-text);text-decoration:underline}

.todo-actions{display:flex;gap:2px;opacity:0;transition:opacity .12s}
.todo:hover .todo-actions,.todo:focus-within .todo-actions{opacity:1}
.todo-actions .icon-btn{width:28px;height:28px}
.todo-actions .ico{width:16px;height:16px}
.icon-btn.star.on{color:#f59e0b;opacity:1}
.icon-btn.star.on .ico{fill:currentColor}
.todo.starred .todo-actions{opacity:1}
.todo.starred .todo-actions > :not(:first-child){opacity:0;transition:opacity .12s}
.todo.starred:hover .todo-actions > *,.todo.starred:focus-within .todo-actions > *{opacity:1}

.todo-edit{flex:1;display:flex;flex-direction:column;gap:8px;padding:4px 0}
.todo-footer{display:flex;justify-content:flex-end;padding:10px 16px;border-top:1px solid var(--border)}

.todo-list.compact{padding:4px 8px 4px}
.checklist-progress{padding:12px 20px 4px}
.checklist-add{display:flex;gap:8px;padding:12px 20px 16px;border-top:1px solid var(--border);margin-top:4px}
.checklist-add input[name=titulo]{flex:1}
.checklist-add input[type=date]{width:auto}

.ring{
  --p:0;
  width:150px;height:150px;margin:0 auto;
  display:grid;place-items:center;
  border-radius:50%;
  background:conic-gradient(var(--success) calc(var(--p) * 1%),var(--surface-hover) 0);
}
.ring > div{
  width:118px;height:118px;border-radius:50%;
  background:var(--surface);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
}
.ring strong{font-size:28px;font-weight:650;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.ring small{color:var(--muted);font-size:12px}
.ring-caption{text-align:center;color:var(--muted);margin:14px 0 0;font-size:13px}

/* ---------- Quadro (kanban) ---------- */

.board-filters{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:16px}
.board-filters .search{position:relative;flex:1;min-width:200px;max-width:340px}
.board-filters .search .ico{position:absolute;left:10px;top:50%;transform:translateY(-50%);width:16px;height:16px;color:var(--faint)}
.board-filters .search input{padding-left:34px}
.board-filters select{width:auto}
.board-filters .hint{margin-left:auto}

.board{
  display:grid;
  grid-template-columns:repeat(4,minmax(240px,1fr));
  gap:14px;
  overflow-x:auto;
  padding-bottom:8px;
  align-items:start;
}
.board-col{
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  display:flex;flex-direction:column;
  min-height:200px;
}
.board-col-head{display:flex;align-items:center;gap:8px;padding:12px 14px}
.board-col-head h3{font-size:13.5px;font-weight:600}
.board-col-head .dot{width:8px;height:8px;border-radius:50%}
.board-col-head .count{
  margin-left:auto;
  min-width:22px;height:20px;padding:0 7px;
  display:inline-grid;place-items:center;
  border-radius:999px;background:var(--surface);border:1px solid var(--border);
  font-size:11.5px;font-weight:600;color:var(--muted);
}
.board-cards{
  flex:1;
  display:flex;flex-direction:column;gap:8px;
  padding:0 10px 10px;
  min-height:120px;
  border-radius:0 0 var(--radius-lg) var(--radius-lg);
  transition:background .12s;
}
.board-cards.drag-over{background:var(--primary-soft);outline:2px dashed var(--primary);outline-offset:-4px}
.board-empty{
  display:none;
  padding:20px 10px;text-align:center;
  color:var(--faint);font-size:12.5px;
  border:1.5px dashed var(--border-strong);border-radius:var(--radius);
}
.board-cards:not(:has(.card)) .board-empty,.board-cards.drag-over .board-empty{display:block}

.card{
  display:flex;flex-direction:column;gap:8px;
  padding:12px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-xs);
  cursor:grab;
  transition:box-shadow .12s,border-color .12s,opacity .12s,transform .12s;
}
.card:hover{border-color:var(--border-strong);box-shadow:var(--shadow-sm)}
.card.dragging{opacity:.45;transform:rotate(1.5deg)}
.card-top{display:flex;gap:6px;flex-wrap:wrap}
.card-title{font-weight:550;color:var(--text);text-decoration:none;line-height:1.35;overflow-wrap:anywhere}
.card-title:hover{color:var(--primary-text)}
.card-sub{font-size:12.5px;color:var(--muted)}
.card-progress{display:flex;align-items:center;gap:8px}
.card-progress .bar{flex:1;height:5px}
.card-progress small{font-size:11.5px;color:var(--muted);font-variant-numeric:tabular-nums}
.card-foot{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--muted);min-height:22px}
.card-foot > span:first-child{display:inline-flex;align-items:center;gap:4px}
.card-foot .ico{width:13px;height:13px}
.avatar.xs{width:22px;height:22px;font-size:9.5px}
.card-move select{height:30px;font-size:12px;padding:0 28px 0 8px;color:var(--muted);background-position:right 6px center}
@media (hover:hover) and (pointer:fine){
  .card-move{display:none}
  .card:focus-within .card-move{display:block}
}

.toast{
  position:fixed;left:50%;bottom:24px;z-index:100;
  transform:translate(-50%,20px);
  padding:10px 16px;
  border-radius:var(--radius);
  background:var(--text);color:var(--surface);
  font-weight:500;font-size:13.5px;
  box-shadow:var(--shadow-lg);
  opacity:0;pointer-events:none;
  transition:opacity .18s,transform .18s;
}
.toast.show{opacity:1;transform:translate(-50%,0)}
.toast.erro{background:var(--danger);color:#fff}

/* ---------- Calendário ---------- */

.btn-group{display:inline-flex}
.btn-group .btn{border-radius:0;margin-left:-1px}
.btn-group .btn:first-child{border-radius:var(--radius-sm) 0 0 var(--radius-sm);margin-left:0}
.btn-group .btn:last-child{border-radius:0 var(--radius-sm) var(--radius-sm) 0}
.btn.icon-only{width:36px;padding:0}
.btn.small.icon-only{width:30px}

.legend{display:flex;gap:14px;font-size:12.5px;color:var(--muted)}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend i{width:10px;height:10px;border-radius:3px;display:inline-block}
.legend .lg-pend{background:var(--primary)}
.legend .lg-task{border:1.5px solid var(--muted);border-radius:50%}

.cal-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}
.cal-head div{
  padding:8px 10px;
  font-size:12px;font-weight:500;color:var(--muted);
  background:var(--surface-2);
  border-bottom:1px solid var(--border);
}
.cal-day{
  min-height:112px;
  padding:6px;
  display:flex;flex-direction:column;gap:3px;
  border-right:1px solid var(--border);
  border-bottom:1px solid var(--border);
  min-width:0;
}
.cal-day:nth-child(7n){border-right:none}
.cal-grid:last-child .cal-day:nth-last-child(-n+7){border-bottom:none}
.cal-day.weekend{background:color-mix(in srgb,var(--surface-2) 60%,transparent)}
.cal-day.out{background:var(--surface-2)}
.cal-day.out .cal-num{color:var(--faint)}
.cal-num{
  width:24px;height:24px;
  display:grid;place-items:center;
  border-radius:50%;
  font-size:12.5px;font-weight:500;color:var(--text-2);
  font-variant-numeric:tabular-nums;
}
.cal-day.today .cal-num{background:var(--primary);color:#fff;font-weight:600}

.cal-ev{
  display:block;
  padding:2px 6px;
  border-radius:4px;
  font-size:12px;line-height:1.5;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  text-decoration:none;
}
.cal-ev.pend{background:var(--primary-soft);color:var(--primary-text);border-left:3px solid var(--primary)}
.cal-ev.pend.alta{border-left-color:var(--danger)}
.cal-ev.pend.late{background:var(--danger-soft);color:var(--danger-text);border-left-color:var(--danger)}
.cal-ev.task{color:var(--text-2);padding-left:4px}
.cal-ev.task::before{content:"○ ";color:var(--muted)}
.cal-ev.closed{opacity:.55;text-decoration:line-through}
.cal-ev:hover{filter:brightness(.96);text-decoration:underline}

.cal-more{position:relative;font-size:12px}
.cal-more summary{cursor:pointer;color:var(--muted);padding:0 6px;list-style:none}
.cal-more summary::-webkit-details-marker{display:none}
.cal-more summary:hover{color:var(--text)}
.cal-pop{
  position:absolute;z-index:10;top:100%;left:0;
  min-width:200px;max-width:260px;
  display:flex;flex-direction:column;
  padding:6px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-lg);
}
.cal-pop a{padding:5px 8px;border-radius:4px;color:var(--text);text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cal-pop a:hover{background:var(--surface-hover)}

/* ---------- Relatórios ---------- */

.segmented{display:inline-flex;padding:3px;gap:2px;background:var(--surface-hover);border-radius:var(--radius)}
.segmented a{padding:6px 12px;border-radius:7px;color:var(--muted);text-decoration:none;font-weight:500;font-size:13px}
.segmented a:hover{color:var(--text)}
.segmented a.active{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}

.chart{display:grid;grid-template-columns:auto 1fr;grid-template-rows:180px auto;column-gap:10px}
.chart-grid{
  grid-row:1;grid-column:1;
  display:flex;flex-direction:column;justify-content:space-between;
  font-size:11px;color:var(--faint);text-align:right;
  font-variant-numeric:tabular-nums;
  transform:translateY(-6px);
}
.chart-grid span:last-child{transform:translateY(12px)}
.chart-bars{
  grid-row:1;grid-column:2;
  display:grid;grid-template-columns:repeat(var(--n),1fr);gap:4px;align-items:end;
  border-bottom:1px solid var(--border-strong);
  background:linear-gradient(var(--border) 1px,transparent 1px) 0 0/100% 50%;
}
.chart-col{position:relative;height:100%;display:flex;align-items:flex-end;justify-content:center;outline:none}
.chart-bar{width:min(100%,28px);background:var(--primary);border-radius:4px 4px 0 0;transition:filter .12s}
.chart-col:hover .chart-bar,.chart-col:focus .chart-bar{filter:brightness(1.15)}
.chart-col:hover::before,.chart-col:focus::before{content:"";position:absolute;inset:0;background:var(--surface-hover);opacity:.5;border-radius:4px;z-index:-1}
.chart-tip{
  position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);
  padding:6px 9px;
  background:var(--text);color:var(--surface);
  border-radius:6px;
  font-size:12px;line-height:1.35;white-space:nowrap;text-align:center;
  opacity:0;pointer-events:none;transition:opacity .1s;z-index:5;
}
.chart-col{align-self:stretch}
.chart-col .chart-tip{bottom:auto;top:-8px;transform:translate(-50%,-100%)}
.chart-col:hover .chart-tip,.chart-col:focus .chart-tip{opacity:1}
.chart-labels{
  grid-row:2;grid-column:2;
  display:grid;grid-template-columns:repeat(var(--n),1fr);gap:4px;
  padding-top:6px;
  font-size:11px;color:var(--muted);text-align:center;white-space:nowrap;
}
.chart-table{margin-top:14px;font-size:13px}
.chart-table summary{cursor:pointer;color:var(--muted)}
.chart-table summary:hover{color:var(--text)}
.chart-table table{margin-top:8px}
.chart-table th,.chart-table td{padding:7px 10px}

.workload{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.workload-col{padding:18px 20px;display:flex;flex-direction:column;gap:14px;min-width:0}
.workload-col + .workload-col{border-left:1px solid var(--border)}
.workload-col h4{font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.workload .top strong{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.workload em{font-style:normal}

@media (max-width:1100px){
  .todo-layout{grid-template-columns:1fr}
  .workload{grid-template-columns:1fr}
  .workload-col + .workload-col{border-left:none;border-top:1px solid var(--border)}
}
@media (max-width:900px){
  .cal-day{min-height:76px;padding:4px}
  .cal-ev{font-size:10.5px;padding:1px 4px}
  .cal-head div{padding:6px 4px;text-align:center}
  .legend{display:none}
  .board{grid-template-columns:repeat(4,minmax(250px,82vw));scroll-snap-type:x mandatory}
  .board-col{scroll-snap-align:start}
  .checklist-add{flex-wrap:wrap;padding:12px 16px}
  .tabs{padding:0 8px}
  .todo-actions{opacity:1}
  .quick-add-opts .btn.primary{margin-left:0;flex:1}
}
@media (max-width:560px){
  .cal-ev{font-size:0;height:6px;padding:0;border-left-width:0 !important;border-radius:3px}
  .cal-ev.task{background:var(--border-strong)}
  .cal-ev.task::before{content:none}
}
