:root {
  --bg: #0f1115;
  --panel: #181b22;
  --border: #272b35;
  --text: #e6e8ee;
  --muted: #8b909c;
  --accent: #d97757;     /* Claude-ish terracotta */
  --green: #3fb950;
  --red: #f85149;
  --bar-bg: #242833;
}

* { box-sizing: border-box; }

/* The HTML `hidden` attribute must win over class-based display rules below
   (e.g. .modal { display: flex }), otherwise "hidden" elements stay visible. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* --- Login ----------------------------------------------------------------- */
.login-body {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card h1 { margin: 0; font-size: 22px; }
.login-card .muted { margin: 0 0 8px; }

/* --- Layout ---------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 18px; margin: 0; }
.actions { display: flex; align-items: center; gap: 10px; }
main { padding: 24px; max-width: 980px; margin: 0 auto; }
.muted { color: var(--muted); }
.link { color: var(--muted); text-decoration: none; font-size: 14px; }
.link:hover { color: var(--text); }

/* --- Buttons + inputs ------------------------------------------------------ */
button {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #1a1207; font-weight: 600; }
input[type="text"], input[type="password"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  width: 100%;
}

/* --- Table ----------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 500; }
.row-actions { display: flex; gap: 8px; }

.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.red { background: var(--red); box-shadow: 0 0 6px var(--red); }

.bar {
  background: var(--bar-bg);
  border-radius: 6px;
  height: 8px;
  width: 140px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
.bar-fill { height: 100%; background: var(--green); transition: width .4s ease; }
.bar-fill.weekly { background: var(--accent); }
.bar-fill.danger { background: var(--red); }
.bar-label { font-size: 12px; color: var(--muted); margin-left: 8px; }

/* --- Modal + toast --------------------------------------------------------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
}
.modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 540px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-card h2 { margin: 0; font-size: 18px; }
.steps { margin: 4px 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.url-row { display: flex; gap: 8px; align-items: center; }
.url-row a { align-self: center; color: var(--accent); text-decoration: none; font-size: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.alert {
  background: rgba(248,81,73,.12);
  border: 1px solid var(--red);
  color: #ffb4ae;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--accent);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
}
