/* WATTMIND 360 — portal · tema escuro partilhado */
:root {
  color-scheme: dark;
  --bg: #0f1419;
  --bg-2: #161c24;
  --bg-3: #1f2731;
  --line: #2b3543;
  --txt: #e6e9ee;
  --txt-dim: #9aa7b8;
  --txt-faint: #5b6776;
  --accent: #f59e0b;
  --accent-dark: #b9770a;
  --danger: #ef4444;
  --ok: #22c55e;
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--txt);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* topbar */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 1.4rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar .brand {
  font-weight: 700; letter-spacing: 0.18em; font-size: 0.95rem;
}
.topbar .brand .accent { color: var(--accent); }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 0.85rem; color: var(--txt-dim); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 1.6rem 1.4rem 4rem; }

h1 { font-size: 1.5rem; margin-bottom: 0.3rem; }
h2 { font-size: 1.1rem; margin: 1.8rem 0 0.8rem; color: var(--txt); }
.sub { color: var(--txt-dim); font-size: 0.9rem; margin-bottom: 1.2rem; }

/* cards */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.grid { display: grid; gap: 0.8rem; }
.grid.cols { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* botoes */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font: inherit; font-size: 0.9rem; font-weight: 600;
  padding: 0.5rem 0.9rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-3); color: var(--txt);
  cursor: pointer; transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: #283341; }
.btn.primary { background: var(--accent); color: #1a1205; border-color: var(--accent); }
.btn.primary:hover { background: #ffb224; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #2a1a1c; }
.btn.sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* inputs */
label.field { display: block; margin-bottom: 0.8rem; font-size: 0.85rem; color: var(--txt-dim); }
input[type=text], input[type=email], select {
  width: 100%; margin-top: 0.25rem;
  font: inherit; font-size: 0.92rem;
  padding: 0.5rem 0.65rem;
  background: var(--bg); color: var(--txt);
  border: 1px solid var(--line); border-radius: 8px;
}
input:focus, select:focus { outline: 2px solid var(--accent-dark); }

/* tabelas / listas */
.row {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-2); margin-bottom: 0.5rem;
}
.row .main { flex: 1; min-width: 0; }
.row .main b { font-weight: 600; }
.row .meta { font-size: 0.8rem; color: var(--txt-dim); }
.row .actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

.tag {
  font-size: 0.72rem; font-weight: 600; padding: 0.12rem 0.45rem;
  border-radius: 5px; background: var(--bg-3); color: var(--txt-dim);
}
.tag.ok { background: #14321f; color: var(--ok); }
.tag.draft { background: #3a2f12; color: var(--accent); }

.muted { color: var(--txt-faint); font-size: 0.85rem; }
.empty { color: var(--txt-faint); padding: 1.4rem; text-align: center; }

/* modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem; width: min(440px, 92vw);
}
.modal h3 { margin-bottom: 1rem; }
.modal .btns { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1rem; }

.hidden { display: none !important; }

/* toast */
#toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--line);
  padding: 0.7rem 1.1rem; border-radius: 8px; font-size: 0.88rem;
  z-index: 100; opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
#toast.show { opacity: 1; }
#toast.err { border-color: var(--danger); color: #fca5a5; }

.progress-bar {
  height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden;
  margin-top: 0.5rem;
}
.progress-bar > div { height: 100%; background: var(--accent); width: 0; transition: width 0.2s; }
