:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --text: #e8eef4;
  --muted: #8b9aab;
  --accent: #3d9a6a;
  --warn: #c45c26;
  --line: #2a3542;
  --empty: #243040;
  --full: #2f6b4f;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 10% -10%, #1c2a22, transparent),
              radial-gradient(900px 500px at 100% 0%, #1a2433, transparent),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
}
.brand { color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: 0.02em; }
nav a { color: var(--muted); margin-left: 1rem; text-decoration: none; }
nav a:hover { color: var(--text); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
h1 { margin-top: 0; font-size: 1.6rem; }
h2 { font-size: 1.1rem; margin-top: 2rem; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.error { color: #f07178; }
.login {
  max-width: 380px;
  margin: 12vh auto;
  padding: 2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.card-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem 0;
}
.card-form.row { flex-wrap: wrap; flex-direction: row; align-items: end; }
.card-form.row label { flex: 1 1 140px; }
label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
input, select, button {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #12181f;
  color: var(--text);
}
button {
  background: var(--accent);
  border: none;
  cursor: pointer;
  font-weight: 600;
  color: #04140c;
}
button.linkish {
  background: transparent;
  color: var(--warn);
  padding: 0;
  border: none;
  text-decoration: underline;
}
.carousel {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.5rem;
  margin: 1rem 0 2rem;
}
@media (max-width: 700px) {
  .carousel { grid-template-columns: repeat(5, 1fr); }
}
.vial {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line);
  background: var(--empty);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vial.full {
  background: var(--full);
  border-color: #4caf7a;
  box-shadow: 0 0 0 1px rgba(76, 175, 122, 0.3);
}
.vial .num { font-weight: 700; font-size: 0.95rem; }
.vial .st { font-size: 0.7rem; color: var(--muted); }
.vial.full .st { color: #c8f0d8; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 600; background: #141b22; }
.list { list-style: none; padding: 0; }
.list li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); display: flex; gap: 1rem; flex-wrap: wrap; }
code { font-size: 0.8rem; color: #9ad4b2; }
.inline { margin-bottom: 1rem; }
.status-row { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0.75rem 0 1.5rem; }
.status-card {
  flex: 1 1 180px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.status-card .label { color: var(--muted); font-size: 0.85rem; }
.status-card .seen { font-size: 0.8rem; color: var(--muted); }
.badge {
  display: inline-block;
  width: fit-content;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-online { background: #1e5c3a; color: #b6f0cd; }
.badge-sleeping { background: #3a3f55; color: #c5cae8; }
.badge-offline { background: #5c2a2a; color: #f0b6b6; }
.badge-sincronizando { background: #5c4a1e; color: #f0e0b6; }

/* Janela de conexão / agenda */
.flow-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.5rem;
}
.flow-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
  line-height: 1.55;
}
.flow-steps strong { color: var(--text); }
.row-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.row-fields label { flex: 1 1 240px; }
.hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.25rem;
}
.slot-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem;
  background: #12181f;
}
.slot-card header { margin-bottom: 0.65rem; }
.slot-card .check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
}
.time-inputs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.time-inputs input { width: 4.2rem; }
.wake-preview {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.wake-preview strong { color: #b6f0cd; }
.nav-back { margin-top: 2rem; }
.nav-back a { color: var(--muted); }
.flash-ok { color: #9ad4b2; }
.mem-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  margin: 0.75rem 0 1.5rem;
}
.mem-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0.35rem 0;
}
.mem-row > p { margin: 0; flex: 1 1 14rem; }
.mem-hint { font-size: 0.85rem; white-space: nowrap; }
.mem-json {
  overflow-x: auto;
  font-size: 0.8rem;
  color: #9ad4b2;
  background: #12181f;
  padding: 0.75rem;
  border-radius: 8px;
}
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 2rem;
}
.inline-action { display: inline-block; margin: 0; }
.btn-warn {
  background: var(--warn);
  color: #1a0c04;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Janela de conexão / agenda */
.flow-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.5rem;
}
.flow-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
  line-height: 1.55;
}
.flow-steps strong { color: var(--text); }
.row-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.row-fields label { flex: 1 1 240px; }
.hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.25rem;
}
.slot-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem;
  background: #12181f;
}
.slot-card header { margin-bottom: 0.65rem; }
.slot-card .check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
}
.time-inputs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.time-inputs input { width: 4.2rem; }
.wake-preview {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.wake-preview strong { color: #b6f0cd; }
.nav-back { margin-top: 2rem; }
.nav-back a { color: var(--muted); }

