/* Meu Painel — tema escuro, moderno e minimalista */
:root {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #111113;
  --surface-2: #18181b;
  --surface-3: #1f1f23;
  --line: #232327;
  --line-strong: #2e2e33;
  --text: #ededef;
  --muted: #8b8b94;
  --faint: #5c5c64;

  --accent: #c8f169;          /* lima suave: a única cor forte do app */
  --accent-ink: #0b0d05;
  --accent-soft: rgba(200, 241, 105, .10);

  --green: #4ade80;  --green-soft: rgba(74, 222, 128, .10);
  --red: #f87171;    --red-soft: rgba(248, 113, 113, .10);
  --amber: #fbbf24;  --amber-soft: rgba(251, 191, 36, .10);
  --blue: #93a8ff;   --blue-soft: rgba(147, 168, 255, .10);

  /* nomes antigos usados no código */
  --card: var(--surface);
  --primary: var(--accent);
  --primary-soft: var(--accent-soft);

  --radius: 16px;
  --radius-sm: 10px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body {
  font-family: var(--font);
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.45; letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
/* brilho sutil no topo */
body::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 340px; pointer-events: none; z-index: -1;
  background: radial-gradient(60% 100% at 70% 0%, rgba(200, 241, 105, .045), transparent 70%);
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--text); }
strong { font-weight: 600; }
p { margin: 0 0 10px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ===== Layout: menu lateral no PC, barra inferior no celular ===== */
.layout { display: flex; min-height: 100vh; }
.nav {
  width: 232px; flex-shrink: 0; padding: 22px 14px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh;
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; padding: 4px 10px 26px; letter-spacing: -.01em; }
.logo { width: 18px; height: 18px; border-radius: 6px; background: var(--accent); box-shadow: 0 0 18px rgba(200, 241, 105, .35); }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--text); background: var(--surface-2); }
.nav a.active .ico { color: var(--accent); }
.nav-settings { margin-top: auto; }
.ico { width: 20px; height: 20px; flex-shrink: 0; }

.main { flex: 1; min-width: 0; padding: 30px 40px 48px; max-width: 1240px; }
.topbar { display: flex; align-items: center; margin-bottom: 24px; gap: 12px; min-height: 40px; }
.topbar h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.view { animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .nav {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto; width: 100%; height: auto; z-index: 10;
    flex-direction: row; justify-content: space-around; gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line);
    background: rgba(9, 9, 11, .82); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  }
  .brand { display: none; }
  .nav a { flex: 1; flex-direction: column; gap: 3px; padding: 7px 2px 5px; font-size: 10.5px; text-align: center; border-radius: 12px; }
  .nav a:hover { background: transparent; }
  .nav a.active { background: transparent; color: var(--text); }
  .nav a.active::after { content: ""; position: absolute; top: 0; left: 50%; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px; background: var(--accent); }
  .nav-settings { margin-top: 0; }
  .ico { width: 22px; height: 22px; }
  .main { padding: calc(18px + env(safe-area-inset-top)) 16px 104px; }
  .topbar { margin-bottom: 18px; }
  .topbar h1 { font-size: 26px; }
}

/* ===== Cartões e grades ===== */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.card h3 {
  margin: 0 0 14px; font-size: 11.5px; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: .09em;
}
.card h3.mt { margin-top: 22px; }
.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; } /* textos longos (ex.: links) não alargam a tela */
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }

.stat { padding: 18px 20px; display: flex; flex-direction: column; min-height: 118px; }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat .value { font-size: 30px; font-weight: 600; letter-spacing: -.035em; margin-top: 14px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .sub { color: var(--faint); font-size: 12px; margin-top: 4px; }
.stat.clickable { cursor: pointer; transition: border-color .2s, background .2s, transform .2s var(--ease); }
.stat.clickable:hover { border-color: var(--line-strong); background: var(--surface-2); }
.stat.clickable:active { transform: scale(.985); }

/* ===== Botões ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  padding: 9px 15px; border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s;
}
.btn:hover { background: var(--surface-3); border-color: #3a3a40; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.primary:hover { background: #d6f78a; }
.btn.danger { background: transparent; color: var(--red); border-color: rgba(248, 113, 113, .25); }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
#addBtn { border-radius: 999px; padding: 8px 16px; }

/* ===== Abas (segmentadas) ===== */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  padding: 7px 13px; border-radius: 999px; border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer; font-weight: 500; font-size: 13.5px; transition: color .15s, background .15s;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.active { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.tab .count { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 11.5px; line-height: 18px; text-align: center;
  background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.tab.active .count { background: var(--surface-3); color: var(--text); }

/* ===== Listas ===== */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 10px; margin: 0 -10px;
  border-radius: 12px; cursor: pointer; transition: background .15s;
  position: relative;
}
.item + .item::before { content: ""; position: absolute; top: 0; left: 10px; right: 10px; height: 1px; background: var(--line); }
.item:hover { background: var(--surface-2); }
.item:hover::before, .item:hover + .item::before { opacity: 0; }
.item .main-txt { flex: 1; min-width: 0; }
.item .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .s { color: var(--muted); font-size: 13px; margin-top: 1px; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gbill .s { -webkit-line-clamp: 3; }
.item .amt { font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item.done .t { text-decoration: line-through; text-decoration-color: var(--faint); color: var(--faint); }
.item.done .amt { color: var(--faint); }
.check {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex-shrink: 0;
  display: grid; place-items: center; cursor: pointer; background: none; padding: 0;
  font-size: 12px; font-weight: 700; color: var(--accent-ink); transition: background .15s, border-color .15s;
}
.check:hover { border-color: var(--accent); }
.check.on { background: var(--accent); border-color: var(--accent); }
.empty { color: var(--faint); text-align: center; padding: 30px 12px; font-size: 14px; }

/* ===== Selos ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.badge.blue  { background: var(--blue-soft);  color: var(--blue); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red   { background: var(--red-soft);   color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.gray  { background: var(--surface-2);  color: var(--muted); border-color: var(--line); }
/* horário dos compromissos */
.item > .badge:first-child { width: 68px; flex-shrink: 0; justify-content: center; font-family: var(--mono); font-size: 11.5px; }

.month-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.month-nav strong { min-width: 170px; text-align: center; font-weight: 500; }
#prev, #next { width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 16px; }

/* ===== Calendário ===== */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: 11px; color: var(--faint); font-weight: 500; padding: 4px 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.cal .day {
  aspect-ratio: 1 / 1; border-radius: 12px; border: 1px solid transparent; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; padding: 2px;
  font-variant-numeric: tabular-nums; font-size: 14px; transition: background .15s, border-color .15s;
}
.cal .day:hover { background: var(--surface-2); }
.cal .day.other { color: var(--faint); opacity: .5; }
.cal .day.today { border-color: var(--line-strong); color: var(--accent); font-weight: 600; }
.cal .day.sel { background: var(--accent); color: var(--accent-ink); font-weight: 600; border-color: transparent; }
.cal .dots { display: flex; gap: 3px; height: 5px; margin-top: 3px; }
.cal .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.cal .day.sel .dot { background: var(--accent-ink); }
@media (min-width: 761px) { .cal .day { aspect-ratio: auto; height: 62px; } }

/* ===== Documentos ===== */
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.doc { padding: 14px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.doc:hover { border-color: var(--line-strong); background: var(--surface-2); }
.doc .big { height: 92px; display: grid; place-items: center; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.file-tag { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--muted); padding: 5px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-strong); }
.doc:hover .file-tag { color: var(--accent); }
.doc .n { font-weight: 500; font-size: 13.5px; word-break: break-word; margin-top: 8px; }
.doc .s { color: var(--muted); font-size: 12px; }
.doc img { width: 100%; height: 92px; object-fit: cover; border-radius: 10px; }
.dropzone {
  display: block; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 24px;
  text-align: center; color: var(--muted); margin-bottom: 14px; cursor: pointer; font-size: 14px; transition: .2s;
}
.dropzone { display: flex; align-items: center; justify-content: center; gap: 10px; }
.dropzone .ico { color: var(--faint); transition: color .2s, transform .2s var(--ease); }
.dropzone:hover .ico, .dropzone.over .ico { color: var(--accent); transform: translateY(-2px); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }

.search {
  width: 100%; padding: 11px 14px 11px 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c5c64' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center; margin-bottom: 14px; outline: none; transition: border-color .15s;
}
.search:focus { border-color: var(--line-strong); }
.bar { height: 4px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar > div { height: 100%; background: var(--accent); border-radius: 99px; }
.cat-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin-top: 14px; }
.cat-row:first-of-type { margin-top: 0; }
.cat-row strong { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ===== Modal ===== */
dialog {
  border: 1px solid var(--line-strong); border-radius: 20px; padding: 0; width: min(480px, 94vw);
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
dialog[open] { animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog form { padding: 24px; }
dialog h2 { margin: 0 0 18px; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea, #cloudCard input, .colab-people select, .card form input:not([type=file]), .card form select {
  padding: 11px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--bg); width: 100%; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(200, 241, 105, .6); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field select, .colab-people select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: 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='%238b8b94' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.field textarea { min-height: 84px; resize: vertical; }
input[type=date], input[type=time], input[type=month] { color-scheme: dark; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.spacer { flex: 1; }
@media (max-width: 760px) {
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92vh; border-bottom: 0; }
  dialog[open] { animation: sheet .28s var(--ease); }
  dialog form { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  dialog form::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: -10px auto 16px; }
}
@keyframes sheet { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== Aviso rápido ===== */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(16px); opacity: 0;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line-strong);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: min(92vw, 440px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5); transition: .25s var(--ease); pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 760px) { .toast { bottom: calc(92px + env(safe-area-inset-bottom)); } }

.muted { color: var(--muted); }
.mt { margin-top: 18px; }
ol, ul { color: var(--muted); }

.sync-chip { text-decoration: none; }
.sync-chip { background: transparent !important; border-color: var(--line) !important; color: var(--muted) !important; }
.sync-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.sync-chip.green::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.sync-chip.blue::before { background: var(--blue); animation: pulse 1s infinite alternate; }
.sync-chip.amber::before { background: var(--amber); }
.sync-chip.red::before { background: var(--red); }
@keyframes pulse { to { opacity: .3; } }
@media (max-width: 760px) { .sync-chip span { display: none; } .sync-chip { padding: 7px; } }

@media (max-width: 760px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; }
  .grid.stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { min-height: 104px; padding: 14px 15px; }
  .stat .value { font-size: 22px; overflow-wrap: anywhere; }
  .grid.stats.lead > :first-child { grid-column: 1 / -1; min-height: 0; }
  .grid.stats.lead > :first-child .value { font-size: 30px; margin-top: 8px; }
  .card { padding: 16px; }
  .grid.two { grid-template-columns: minmax(0, 1fr); }
}

/* ===== Google ===== */
.g-mark {
  display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 4px; font-size: 9.5px; font-weight: 700;
  border-radius: 5px; background: var(--surface-3); color: var(--muted); vertical-align: 1px; border: 1px solid var(--line-strong);
}
.gbill { align-items: flex-start; }
.gbill-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Tarefas por colaborador */
.colab-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: var(--surface-3); color: var(--text); }
.colab-people { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.colab-people select { flex: 1; min-width: 0; }
.colab-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.colab-head h3 { margin: 0; }
.colab-head .muted { font-size: 13px; }
.colab-group { margin-bottom: 12px; }
.grid.colab-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .colab-stats .stat { padding: 14px 12px; }
  .colab-stats .value { font-size: 24px; }
  .colab-stats .label, .colab-stats .sub { font-size: 12px; }
}

/* E-mail aberto dentro do app */
.mail-meta { margin-bottom: 14px; }
.mail-meta .t { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.mail-meta .s { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.mail-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mail-block { border-top: 1px solid var(--line); padding: 12px 0; }
.mail-block .lbl { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.mail-code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; margin-bottom: 8px; }
.mail-att { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.mail-att .main-txt { flex: 1; min-width: 0; }
.mail-att .t { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-att .s { font-size: 12px; color: var(--muted); }
.mail-links { display: flex; flex-wrap: wrap; gap: 6px; }
.mail-links .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-text { border-top: 1px solid var(--line); padding-top: 12px; white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 14px; line-height: 1.55; color: var(--muted); max-height: 45vh; overflow-y: auto; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
