/* =========================================================
   Agenda MineTech — identidade visual de minetech.com.br
   ========================================================= */
:root {
  --bg: #08090d;
  --bg-2: #0d0f17;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.1);
  --panel: rgba(16, 18, 30, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.15);

  --text: #f5f7fa;
  --text-2: #aab2c0;
  --text-3: #737c8c;
  --lavender: #948bb8;

  --blue: #3366ff;
  --blue-2: #4d7dff;
  --cyan: #37d9ff;
  --violet: #7b5cff;
  --violet-2: #8f72ff;
  --pink: #ff6fa8;
  --green: #36e2b4;
  --amber: #f5b544;
  --red: #ff5468;

  --grad: linear-gradient(90deg, #3366ff 0%, #37d9ff 50%, #7b5cff 100%);
  --glow: 0 10px 40px -10px rgba(53, 107, 255, 0.8);

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Sora", "Geist", ui-sans-serif, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;

  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; letter-spacing: -0.02em; font-weight: 600; }
::selection { background: rgba(51, 102, 255, 0.45); }

/* fundo: grid + brilho */
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
}
.bg-glow {
  position: fixed; pointer-events: none; z-index: 0;
  width: 900px; height: 700px; right: -250px; top: -250px;
  background: radial-gradient(closest-side, rgba(53,107,255,.22), rgba(123,92,255,.08) 55%, transparent);
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.mono { font-family: var(--font-mono); }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  border: 0; cursor: pointer; font-weight: 500; font-size: 14px;
  transition: transform .15s, background .15s, box-shadow .15s, opacity .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--blue); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), var(--glow);
}
.btn-primary:hover { background: var(--blue-2); }
.btn-ghost {
  background: var(--surface-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-2);
}
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: rgba(255,84,104,.12); color: #ff8b98; box-shadow: inset 0 0 0 1px rgba(255,84,104,.3); }
.btn-danger:hover { background: rgba(255,84,104,.2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn kbd {
  font: 500 11px var(--font-mono); padding: 1px 6px; border-radius: 6px;
  background: rgba(255,255,255,.16); margin-left: auto;
}
.btn:disabled { opacity: .55; cursor: default; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 0; cursor: pointer;
  display: inline-grid; place-items: center; background: transparent; color: var(--text-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: rgba(255,84,104,.14); color: #ff8b98; }

svg.i { width: 18px; height: 18px; flex: none; }
[data-icon] { display: inline-flex; }

/* ---------- layout ---------- */
.layout { position: relative; z-index: 1; display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 248px; flex: none;
  display: flex; flex-direction: column; gap: 22px;
  padding: 24px 16px 16px;
  border-right: 1px solid var(--border);
  background: rgba(8, 9, 13, 0.6);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand img { height: 26px; width: auto; }
.brand-tag {
  font: 500 10.5px var(--font-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--cyan); padding: 3px 8px; border-radius: 999px;
  border: 1px solid rgba(55,217,255,.3); background: rgba(55,217,255,.06);
}
.btn-new { width: 100%; justify-content: flex-start; padding-left: 16px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--text-2); transition: background .15s, color .15s;
}
.nav a b { font-weight: 500; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.nav a.active svg { color: var(--cyan); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font: 600 13px var(--font-head);
  background: var(--grad); color: #fff;
}

.main { flex: 1; min-width: 0; padding: 32px 36px 80px; max-width: 1440px; }
.loading { display: flex; align-items: center; gap: 12px; color: var(--text-2); padding: 40px 0; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--surface-3); border-top-color: var(--cyan);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 32px; letter-spacing: -0.03em; line-height: 1.15; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 11px var(--font-mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--lavender); padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  margin-bottom: 14px;
}
.eyebrow .dot, .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(55,217,255,.18); display: inline-block;
}

/* ---------- cards ---------- */
.card {
  background: linear-gradient(rgba(255,255,255,.045), rgba(255,255,255,.015));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  position: relative;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-head .count { font: 500 12px var(--font-mono); color: var(--text-3); }
.link { color: var(--cyan); font-size: 13px; cursor: pointer; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 18px 20px; overflow: hidden; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.kpi-icon {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c, var(--blue)) 16%, transparent);
  color: var(--c, var(--blue));
}
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-value { font: 600 30px/1.1 var(--font-head); letter-spacing: -0.03em; margin-top: 14px; }
.kpi-value.money { font-size: clamp(19px, 2vw, 24px); margin-top: 18px; white-space: nowrap; }
.kpi-value small { font-size: 16px; color: var(--text-3); font-weight: 500; }
.kpi-sub { color: var(--text-3); font-size: 12.5px; margin-top: 4px; }
.kpi::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c, var(--blue)) 22%, transparent), transparent);
  pointer-events: none;
}
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 12px; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width .4s; }

/* grid dashboard */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* quick add */
.quick-add {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 16px; border-radius: 999px;
  border: 1px solid var(--border-2); background: rgba(0,0,0,.25);
  margin-bottom: 16px;
}
.quick-add svg { color: var(--text-3); }
.quick-add input { flex: 1; background: none; border: 0; outline: none; height: 36px; min-width: 0; }
.quick-add input::placeholder { color: var(--text-3); }
.quick-add:focus-within { border-color: rgba(51,102,255,.6); box-shadow: 0 0 0 4px rgba(51,102,255,.15); }

/* timeline do dia */
.timeline { display: flex; flex-direction: column; }
.tl-item {
  display: grid; grid-template-columns: 62px 22px minmax(0, 1fr); gap: 10px;
  align-items: start; padding: 4px 0; position: relative;
}
.tl-time { font: 500 13px var(--font-mono); color: var(--text-2); padding-top: 14px; text-align: right; }
.tl-time small { display: block; color: var(--text-3); font-size: 11px; }
.tl-rail { position: relative; height: 100%; display: flex; justify-content: center; }
.tl-rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-2); }
.tl-item:first-child .tl-rail::before { top: 18px; }
.tl-item:last-child .tl-rail::before { bottom: calc(100% - 18px); }
.tl-dot {
  position: relative; margin-top: 16px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--c, var(--blue));
}
.tl-item.is-done .tl-dot { background: var(--c, var(--blue)); }
.tl-item.is-next .tl-dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--blue)) 25%, transparent); }
.tl-now { display: grid; grid-template-columns: 62px 22px 1fr; gap: 10px; align-items: center; margin: 2px 0; }
.tl-now span:first-child { font: 600 11px var(--font-mono); color: var(--pink); text-align: right; letter-spacing: .08em; }
.tl-now i { width: 9px; height: 9px; border-radius: 50%; background: var(--pink); margin: 0 auto; box-shadow: 0 0 12px var(--pink); }
.tl-now b { height: 1px; background: linear-gradient(90deg, var(--pink), transparent); }

/* item de tarefa */
.task {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; transition: background .15s, border-color .15s; min-width: 0;
  position: relative;
}
.task:hover { background: var(--surface-2); border-color: var(--border-2); }
.task::before {
  content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px;
  background: var(--c, transparent);
}
.task.is-done { opacity: .55; }
.task.is-done .task-title { text-decoration: line-through; text-decoration-color: var(--text-3); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 500; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 5px; color: var(--text-3); font-size: 12.5px; }
.task-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.task-meta svg { width: 13px; height: 13px; }
.task-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.task-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.amount { font: 500 13px var(--font-mono); color: var(--text); white-space: nowrap; }
.amount.paid { color: var(--green); }
.pay-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 0; cursor: pointer;
  background: rgba(245,181,68,.12); color: var(--amber);
}
.pay-badge.paid { background: rgba(54,226,180,.12); color: var(--green); }
.prio-high { color: var(--red) !important; }

.check {
  width: 22px; height: 22px; flex: none; border-radius: 7px; cursor: pointer; margin-top: 1px;
  border: 1.5px solid var(--border-2); background: transparent; display: grid; place-items: center;
  color: transparent; transition: all .15s; padding: 0;
}
.check:hover { border-color: var(--cyan); }
.check svg { width: 14px; height: 14px; }
.check.on { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 14px rgba(51,102,255,.6); }

/* etiqueta */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 500; line-height: 1; padding: 5px 9px; border-radius: 99px;
  color: color-mix(in srgb, var(--c) 70%, white);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 32%, transparent);
  white-space: nowrap;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }

.empty {
  text-align: center; padding: 30px 16px; color: var(--text-3);
  border: 1px dashed var(--border-2); border-radius: var(--r);
}
.empty svg { width: 28px; height: 28px; color: var(--text-3); margin-bottom: 8px; }
.empty b { display: block; color: var(--text-2); font-weight: 500; margin-bottom: 4px; }

/* próximo compromisso */
.next-card {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(51,102,255,.28), transparent 55%),
    linear-gradient(rgba(255,255,255,.05), rgba(255,255,255,.015));
  border-color: rgba(77,125,255,.3);
}
.next-when { font: 500 12px var(--font-mono); color: var(--cyan); letter-spacing: .1em; text-transform: uppercase; }
.next-title { font: 600 20px/1.25 var(--font-head); margin: 8px 0 6px; overflow-wrap: anywhere; }
.next-count { font: 600 36px/1 var(--font-head); letter-spacing: -0.03em; margin-top: 14px; }
.next-count small { font-size: 14px; color: var(--text-2); font-weight: 500; letter-spacing: 0; margin-left: 4px; }

/* barras */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13px; }
.bar-row .name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-row .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .name i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.bar-row .val { font-family: var(--font-mono); color: var(--text-2); font-size: 12.5px; }
.bar-row .track { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: inherit; background: var(--c); }

/* semana */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; min-width: 0; }
.week-col { width: 100%; height: 120px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 10px; background: var(--surface); position: relative; overflow: hidden; }
.week-col i { display: block; width: 100%; border-radius: 10px 10px 0 0; background: linear-gradient(180deg, var(--blue-2), rgba(51,102,255,.35)); min-height: 0; transition: height .4s; }
.week-col i.done { background: linear-gradient(180deg, var(--green), rgba(54,226,180,.3)); border-radius: 0; }
.week-col b { position: absolute; top: 6px; left: 0; right: 0; text-align: center; font: 600 13px var(--font-mono); }
.week-day span { font-size: 12px; color: var(--text-3); text-transform: capitalize; }
.week-day.today span { color: var(--cyan); font-weight: 600; }
.week-day:hover .week-col { box-shadow: inset 0 0 0 1px var(--border-2); }
.week-day small { font: 500 11px var(--font-mono); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }

/* finanças */
.fin-total { font: 600 28px/1.1 var(--font-head); letter-spacing: -0.03em; }
.fin-split { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); margin: 14px 0 12px; }
.fin-split i { display: block; height: 100%; }
.fin-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fin-rows div { padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.fin-rows span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.fin-rows span i { width: 8px; height: 8px; border-radius: 50%; }
.fin-rows b { display: block; font: 600 16px var(--font-mono); margin-top: 4px; }

.stack { display: flex; flex-direction: column; gap: 8px; }
.row-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }

/* ---------- agenda (calendário) ---------- */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.cal-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-toolbar h2 { font-size: 20px; margin-right: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); padding: 0 8px 6px; }
.cal-cell {
  min-height: 112px; border-radius: 12px; padding: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  transition: background .15s, border-color .15s;
}
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.out { opacity: .38; }
.cal-cell.sel { border-color: rgba(77,125,255,.7); box-shadow: 0 0 0 3px rgba(51,102,255,.18); }
.cal-num { display: flex; align-items: center; justify-content: space-between; font: 500 13px var(--font-mono); color: var(--text-2); }
.cal-cell.today .cal-num b { background: var(--blue); color: #fff; border-radius: 8px; padding: 1px 7px; box-shadow: var(--glow); }
.cal-num b { font-weight: 600; }
.cal-num em { font-style: normal; font-size: 10.5px; color: var(--green); }
.cal-pill {
  font-size: 11.5px; line-height: 1.25; padding: 3px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--c, var(--blue)) 18%, transparent);
  border-left: 2px solid var(--c, var(--blue));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-pill.done { opacity: .45; text-decoration: line-through; }
.cal-more { font-size: 11px; color: var(--text-3); padding-left: 4px; }
.day-panel { position: sticky; top: 24px; }

/* ---------- tarefas (lista) ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.search {
  display: flex; align-items: center; gap: 8px; flex: 1 1 240px;
  height: 40px; padding: 0 14px; border-radius: 999px;
  background: rgba(0,0,0,.25); border: 1px solid var(--border-2);
}
.search svg { color: var(--text-3); }
.search input { flex: 1; border: 0; background: none; outline: none; min-width: 0; }
.select {
  height: 40px; padding: 0 34px 0 14px; border-radius: 999px; cursor: pointer;
  background: rgba(0,0,0,.25) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aab2c0' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--border-2); appearance: none; outline: none;
}
.select option { background: #12141f; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 32px; padding: 0 13px; border-radius: 99px; cursor: pointer; font-size: 13px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
}
.chip:hover { color: var(--text); }
.chip.on { background: rgba(51,102,255,.16); border-color: rgba(77,125,255,.55); color: var(--text); }
.group-title {
  display: flex; align-items: center; gap: 10px; margin: 22px 0 10px;
  font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--text-3);
}
.group-title b { color: var(--text-2); font-weight: 600; }
.group-title.late b { color: var(--red); }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.summary-bar {
  position: sticky; bottom: 16px; margin-top: 24px;
  display: flex; gap: 22px; flex-wrap: wrap; align-items: center;
  padding: 12px 18px; border-radius: 16px;
  background: rgba(13,15,26,.9); border: 1px solid var(--border-2); backdrop-filter: blur(12px);
  font-size: 13px; color: var(--text-2);
}
.summary-bar b { color: var(--text); font-family: var(--font-mono); font-weight: 500; }

/* ---------- etiquetas ---------- */
.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tag-card { display: flex; align-items: center; gap: 14px; padding: 16px; }
.tag-swatch {
  width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent);
  color: var(--c);
}
.tag-card .info { flex: 1; min-width: 0; }
.tag-card .info b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-card .info span { font-size: 12.5px; color: var(--text-3); }
.tag-card .actions { display: flex; gap: 2px; }

/* ---------- formulários ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field input, .field textarea, .field select, textarea.code {
  width: 100%; padding: 10px 13px; border-radius: 12px; outline: none;
  background: rgba(0,0,0,.3); border: 1px solid var(--border-2);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: rgba(77,125,255,.7); box-shadow: 0 0 0 4px rgba(51,102,255,.15);
}
.field textarea { resize: vertical; min-height: 80px; }
.field input[type=date]::-webkit-calendar-picker-indicator,
.field input[type=time]::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; }
.input-prefix { display: flex; align-items: center; border-radius: 12px; background: rgba(0,0,0,.3); border: 1px solid var(--border-2); }
.input-prefix:focus-within { border-color: rgba(77,125,255,.7); box-shadow: 0 0 0 4px rgba(51,102,255,.15); }
.input-prefix em { font-style: normal; padding-left: 13px; color: var(--text-3); font-family: var(--font-mono); }
.input-prefix input { border: 0 !important; background: none !important; box-shadow: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
.form-section { font-size: 14px; color: var(--text-2); margin-top: 6px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.3); border: 1px solid var(--border-2); }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; padding: 7px 10px; border-radius: 9px; cursor: pointer;
  font-size: 13px; color: var(--text-2); transition: background .15s, color .15s;
}
.seg input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2); }
.seg input:focus-visible + span { outline: 2px solid var(--blue); }
.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-picker button {
  border: 0; cursor: pointer; opacity: .5; filter: saturate(.6);
  transition: opacity .15s, filter .15s;
}
.tag-picker button.on { opacity: 1; filter: none; box-shadow: inset 0 0 0 1.5px var(--c); }
.tag-picker button:hover { opacity: 1; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; }
.toggle input { position: absolute; opacity: 0; }
.toggle i {
  width: 38px; height: 22px; border-radius: 99px; background: var(--surface-3); position: relative; transition: background .2s;
}
.toggle i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .2s;
}
.toggle input:checked + i { background: var(--green); }
.toggle input:checked + i::after { transform: translateX(16px); }
.toggle input:focus-visible + i { outline: 2px solid var(--blue); outline-offset: 2px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatches button {
  width: 30px; height: 30px; border-radius: 9px; border: 0; cursor: pointer; background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.swatches button.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }
.swatches input[type=color] { width: 30px; height: 30px; border: 0; padding: 0; border-radius: 9px; background: none; cursor: pointer; }
.alert { padding: 10px 14px; border-radius: 12px; background: rgba(255,84,104,.12); border: 1px solid rgba(255,84,104,.3); color: #ffb3bc; font-size: 13.5px; }
.alert-warn { background: rgba(245,181,68,.1); border-color: rgba(245,181,68,.3); color: #ffd99a; }
textarea.code { font: 12px/1.5 var(--font-mono); resize: vertical; margin: 12px 0; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(4, 5, 10, .7); backdrop-filter: blur(6px);
  animation: fade .15s ease-out;
}
.modal {
  width: 100%; max-width: 620px; max-height: calc(100vh - 40px); overflow: auto;
  background: linear-gradient(rgba(255,255,255,.05), rgba(255,255,255,.02)), #0e1019;
  border: 1px solid var(--border-2); border-radius: var(--r-lg);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(51,102,255,.08);
  animation: pop .18s ease-out;
}
.modal-sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 4px; }
.modal-head h2 { font-size: 19px; }
.modal-body { padding: 16px 22px; }
.modal-foot { display: flex; gap: 10px; align-items: center; padding: 6px 22px 22px; }
.modal-foot .spacer { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 60; bottom: 20px; left: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; max-width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 16px; border-radius: 999px; font-size: 13.5px;
  background: #151827; border: 1px solid var(--border-2); box-shadow: 0 14px 40px -10px rgba(0,0,0,.7);
  animation: pop .2s ease-out;
}
.toast.err { border-color: rgba(255,84,104,.5); }
.toast .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(54,226,180,.18); }
.toast.err .dot { background: var(--red); box-shadow: 0 0 0 3px rgba(255,84,104,.2); }
.toast button { background: none; border: 0; color: var(--cyan); cursor: pointer; font-weight: 500; }

.fab { display: none; }

/* ---------- login / instalação ---------- */
.auth-page { display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  padding: 34px 30px; border-radius: 26px;
  background: linear-gradient(rgba(255,255,255,.05), rgba(255,255,255,.015)), rgba(10,11,18,.85);
  border: 1px solid var(--border-2); backdrop-filter: blur(16px);
  box-shadow: 0 40px 100px -30px rgba(51,102,255,.35);
}
.auth-card-wide { max-width: 600px; }
.auth-logo { height: 30px; margin-bottom: 26px; display: block; }
.auth-card h1 { font-size: 30px; letter-spacing: -0.035em; line-height: 1.15; margin-bottom: 6px; }
.auth-card > .muted { margin: 0 0 22px; }
.auth-card .form { margin-top: 20px; }

/* ---------- responsivo ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-wrap { grid-template-columns: 1fr; }
  .day-panel { position: static; }
}
@media (max-width: 960px) {
  .dash-grid, .row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: sticky; top: 0; z-index: 20; height: auto; width: 100%;
    flex-direction: row; align-items: center; gap: 8px; padding: 10px 16px;
    border-right: 0; border-bottom: 1px solid var(--border);
    backdrop-filter: none; background: rgba(8,9,13,.94);
  }
  .brand img { height: 22px; }
  .brand-tag { display: none; }
  .btn-new { display: none; }
  .nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    flex-direction: row; justify-content: space-around; gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(8,9,13,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
  }
  .nav a { flex-direction: column; gap: 3px; padding: 6px 10px; font-size: 11px; }
  .nav a.active { background: none; box-shadow: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .user-name { display: none; }
  .main { padding: 22px 16px 110px; }
  .page-head h1 { font-size: 26px; }
  .fab {
    display: grid; place-items: center; position: fixed; z-index: 31; right: 18px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--blue); color: #fff; box-shadow: var(--glow), inset 0 0 0 1px rgba(255,255,255,.15);
  }
  .fab svg { width: 24px; height: 24px; }
  .cal-cell { min-height: 64px; padding: 5px; }
  .cal-pill { font-size: 0; padding: 0; height: 5px; border-left: 0; background: var(--c, var(--blue)); }
  .cal-more { font-size: 10px; }
  .cal-num em { display: none; }
  .cal-toolbar { flex-wrap: nowrap; gap: 4px; }
  .cal-toolbar h2 { font-size: 17px; }
  .cal-dow { padding: 0 2px 4px; font-size: 10px; letter-spacing: .05em; }
  .summary-bar { bottom: 80px; }
  #toasts { bottom: 90px; }
}
@media (max-width: 560px) {
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 24px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :first-child { grid-column: 1 / -1; }
  .week { gap: 5px; }
  .week-col { height: 90px; }
  .week-day small { display: none; }
  .kpi-value.money { font-size: 18px; }
  .quick-add .btn { display: none; }
  .quick-add { padding-right: 16px; }
  .card-head .count { display: none; }
  .tl-item, .tl-now { grid-template-columns: 46px 16px minmax(0, 1fr); gap: 6px; }
  .task { padding: 11px 12px; }
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal { max-height: 92vh; border-radius: 22px 22px 0 0; }
  .fin-rows { grid-template-columns: 1fr; }
}
