/* Disparos Hub — tema dark/neon */
:root {
  --bg: #06080f;
  --bg2: #0a0e1a;
  --panel: #0d1322;
  --panel2: #111a30;
  --line: rgba(99, 140, 255, .14);
  --line2: rgba(99, 140, 255, .28);
  --txt: #e8eeff;
  --muted: #8b97b8;
  --neon: #4f8bff;
  --neon2: #9b5cff;
  --cyan: #2dd4bf;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --grad: linear-gradient(135deg, #4f8bff, #9b5cff);
  --glow: 0 0 24px rgba(79, 139, 255, .25);
  --radius: 14px;
  font-size: 15px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(155, 92, 255, .12), transparent 60%),
    radial-gradient(1000px 500px at -10% 20%, rgba(79, 139, 255, .10), transparent 60%),
    var(--bg);
  color: var(--txt);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}
a { color: var(--neon); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--txt);
  background: #0a0f1e; border: 1px solid var(--line2);
  border-radius: 10px; padding: 9px 12px; width: 100%;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--neon); box-shadow: 0 0 0 3px rgba(79,139,255,.15); }
textarea { resize: vertical; min-height: 110px; }
label { display: block; font-size: .82rem; color: var(--muted); margin: 12px 0 5px; letter-spacing: .3px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--grad); color: #fff; border: 0;
  padding: 10px 18px; border-radius: 10px; font-weight: 600;
  box-shadow: var(--glow); transition: transform .1s, filter .15s;
}
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line2); box-shadow: none; color: var(--txt); }
.btn.ghost:hover { border-color: var(--neon); }
.btn.danger { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.btn.sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; }
.login-card {
  width: min(400px, 92vw); padding: 42px 36px;
  background: linear-gradient(180deg, rgba(17,26,48,.9), rgba(10,14,26,.9));
  border: 1px solid var(--line2); border-radius: 20px;
  box-shadow: 0 0 60px rgba(79,139,255,.18), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
}
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.35rem; letter-spacing: .5px; }
.logo .bolt {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad); box-shadow: var(--glow); font-size: 1.2rem;
}
.logo small { display: block; font-weight: 400; font-size: .72rem; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 26px; background: rgba(6,8,15,.8); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .spacer { flex: 1; }
.container { max-width: 1240px; margin: 0 auto; padding: 28px 26px 80px; }
.crumb { color: var(--muted); font-size: .9rem; }
.crumb b { color: var(--txt); }

h1.page { font-size: 1.5rem; margin-bottom: 4px; }
.sub { color: var(--muted); margin-bottom: 26px; font-size: .92rem; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card {
  position: relative; background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card.clickable:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: var(--glow); cursor: pointer; }
.card h3 { font-size: 1.05rem; margin-bottom: 2px; }
.card .meta { color: var(--muted); font-size: .82rem; }
.card .stats { display: flex; gap: 16px; margin-top: 16px; }
.card .stat b { font-size: 1.25rem; display: block; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card .stat span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.card.add {
  display: grid; place-items: center; min-height: 150px; border-style: dashed; color: var(--muted);
  background: transparent;
}
.card.add:hover { color: var(--neon); border-color: var(--neon); cursor: pointer; }

.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot-on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot-off { background: var(--red); box-shadow: 0 0 8px var(--red); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 20px 0 24px; }
.tab {
  background: none; border: 0; color: var(--muted); padding: 10px 18px;
  border-bottom: 2px solid transparent; font-weight: 600; letter-spacing: .3px;
}
.tab.on { color: var(--txt); border-image: var(--grad) 1; border-bottom: 2px solid var(--neon); }
.tab:hover { color: var(--txt); }

/* ---------- chips/badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 600; border: 1px solid var(--line2); color: var(--muted);
}
.chip.sent { color: var(--green); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.08); }
.chip.failed { color: var(--red); border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.08); }
.chip.pending { color: var(--amber); border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.08); }
.chip.skipped, .chip.filtered { color: var(--muted); }
.chip.neon { color: var(--neon); border-color: rgba(79,139,255,.4); background: rgba(79,139,255,.08); }
.chip.slot { cursor: pointer; }
.chip.slot:hover { color: var(--red); border-color: var(--red); }

/* ---------- tabela ---------- */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; padding: 10px 12px; border-bottom: 1px solid var(--line2); }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:hover td { background: rgba(79,139,255,.04); }
.mono { font-family: ui-monospace, 'Cascadia Code', monospace; font-size: .8rem; }
.ellip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- calendário ---------- */
.cal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cal-head h3 { flex: 0 0 auto; min-width: 180px; text-transform: capitalize; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; padding: 6px 0; }
.cal-day {
  min-height: 86px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px;
  background: rgba(13,19,34,.6); position: relative; transition: border-color .12s, box-shadow .12s;
  display: flex; flex-direction: column; gap: 4px; overflow: hidden;
}
.cal-day:hover { border-color: var(--neon); box-shadow: 0 0 14px rgba(79,139,255,.18); cursor: pointer; }
.cal-day .num { font-size: .8rem; color: var(--muted); }
.cal-day.today .num { color: #fff; background: var(--grad); border-radius: 6px; padding: 0 6px; display: inline-block; width: fit-content; }
.cal-day.other { opacity: .35; }
.cal-day.past { opacity: .55; }
.cal-ev {
  font-size: .68rem; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(79,139,255,.16); border: 1px solid rgba(79,139,255,.35); color: #bcd2ff;
}
.cal-ev.once { background: rgba(45,212,191,.14); border-color: rgba(45,212,191,.4); color: #99f0e3; }
.cal-day .add-hint {
  position: absolute; right: 7px; top: 5px; opacity: 0; color: var(--neon); font-weight: 700;
}
.cal-day:hover .add-hint { opacity: 1; }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(3,5,10,.75); backdrop-filter: blur(4px);
  display: grid; place-items: center; z-index: 50; padding: 20px; overflow: auto;
}
.modal {
  width: min(960px, 96vw); max-height: 92vh; overflow: auto;
  background: linear-gradient(180deg, #111a30, #0b1120);
  border: 1px solid var(--line2); border-radius: 18px; padding: 28px;
  box-shadow: 0 0 80px rgba(79,139,255,.2);
}
.modal.narrow { width: min(560px, 96vw); }
.modal h2 { font-size: 1.2rem; margin-bottom: 4px; }
.modal .sub { margin-bottom: 14px; }
.modal-cols { display: grid; grid-template-columns: 1fr 330px; gap: 28px; }
@media (max-width: 860px) { .modal-cols { grid-template-columns: 1fr; } }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }

/* ---------- phone preview ---------- */
.phone {
  width: 300px; margin: 0 auto; border-radius: 34px; border: 3px solid #1d2742;
  background: #0b141a; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 30px rgba(79,139,255,.12);
}
.phone .ph-top {
  background: #1f2c34; padding: 12px 14px; display: flex; align-items: center; gap: 10px; font-size: .85rem;
}
.phone .ph-ava {
  width: 32px; height: 32px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-size: .8rem; font-weight: 700;
}
.phone .ph-body {
  min-height: 340px; max-height: 420px; overflow: auto; padding: 16px 12px;
  background: #0b141a url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" opacity="0.04"><circle cx="30" cy="30" r="1.5" fill="white"/></svg>');
}
.bubble {
  background: #005c4b; color: #e9edef; border-radius: 10px; border-top-right-radius: 2px;
  padding: 8px 10px; margin: 0 0 8px auto; max-width: 85%; width: fit-content;
  font-size: .85rem; line-height: 1.35; word-wrap: break-word; white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0,0,0,.3);
}
.bubble img { max-width: 100%; border-radius: 8px; margin-bottom: 6px; display: block; }
.bubble .b-time { display: block; text-align: right; font-size: .62rem; color: #9fd4c6; margin-top: 3px; }
.bubble a { color: #53bdeb; }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.empty .big { font-size: 2.4rem; margin-bottom: 10px; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.copy-box {
  display: flex; gap: 8px; align-items: center; background: #0a0f1e; border: 1px dashed var(--line2);
  border-radius: 10px; padding: 9px 12px; font-family: ui-monospace, monospace; font-size: .78rem;
  overflow: hidden;
}
.copy-box span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 8px 16px; font-weight: 600; }
.seg button.on { background: var(--grad); color: #fff; }
.list-item {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px;
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
}
.list-item .grow { flex: 1; min-width: 0; }
.list-item h4 { font-size: .98rem; }
.list-item .meta { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.switch { position: relative; width: 40px; height: 22px; flex: 0 0 auto; cursor: pointer; }
.switch input { display: none; }
.switch i { position: absolute; inset: 0; background: #1a2440; border-radius: 999px; transition: .15s; border: 1px solid var(--line2); }
.switch i::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #5b6a8f; top: 2px; left: 2px; transition: .15s; }
.switch input:checked + i { background: rgba(52,211,153,.25); border-color: var(--green); }
.switch input:checked + i::after { left: 19px; background: var(--green); box-shadow: 0 0 8px var(--green); }

#toast-root { position: fixed; bottom: 24px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #111a30; border: 1px solid var(--line2); border-left: 3px solid var(--neon);
  padding: 13px 18px; border-radius: 10px; min-width: 260px; box-shadow: 0 10px 40px rgba(0,0,0,.5);
  animation: slidein .2s ease;
}
.toast.err { border-left-color: var(--red); }
.toast.okk { border-left-color: var(--green); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20; max-height: 260px; overflow: auto;
  background: #0d1426; border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 16px 50px rgba(0,0,0,.6);
}
.dropdown-menu div { padding: 9px 13px; cursor: pointer; font-size: .86rem; }
.dropdown-menu div:hover { background: rgba(79,139,255,.12); }
.dropdown-menu small { color: var(--muted); display: block; }
.spin {
  width: 18px; height: 18px; border: 2px solid var(--line2); border-top-color: var(--neon);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 720px) {
  .container { padding: 18px 14px 60px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .cal-day { min-height: 58px; }
}
