/* sign.online MCP Admin — styled after tracker.sign.online. */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #3a4d5c;       /* darker end of the gradient */
  --accent:  #6786a1;       /* lighter end */
  --ink:     #1f2d3a;
  --ink-soft:#4a5668;
  --muted:   #6c757d;
  --surface: #ffffff;
  --line:    #e3e7ec;
  --ok:      #2f7d5b;
  --bad:     #b4442f;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #6786a1 0%, #3a4d5c 100%);
  min-height: 100vh;
  padding: 20px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
}
#app { flex: 1; width: 100%; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ----- shared primitives ----- */
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1.2em; font-size: 14px; margin: 8px 0 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

h1 { font-size: 2rem; font-weight: 600; margin-bottom: 10px; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 24px 0 12px; color: var(--ink); }

/* ----- header (authed shell) ----- */
.header {
  text-align: center;
  color: #fff;
  margin-bottom: 36px;
  padding-top: 32px;
  position: relative;
}
.header .logo {
  width: 220px; max-width: 70%;
  height: auto; margin-bottom: 16px;
}
.logo-link { display: inline-block; line-height: 0; }
.logo-link:hover { opacity: 0.85; }
.header h1 { font-size: 2.1rem; color: #fff; }
.header p { font-size: 1rem; opacity: 0.9; margin-top: 4px; }
.header-actions {
  position: absolute; top: 16px; right: 0;
  display: flex; align-items: center; gap: 10px;
}
.logout-btn {
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; color: #fff;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px; padding: 8px 14px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.logout-btn:hover { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.55); }

/* ----- nav (pill tabs inside header) ----- */
.nav {
  display: flex; gap: 6px; justify-content: center; margin-top: 22px; flex-wrap: wrap;
}
.nav a {
  color: #fff; opacity: 0.85; padding: 8px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.nav a:hover { opacity: 1; background: rgba(255,255,255,0.18); text-decoration: none; }
.nav a.active { opacity: 1; background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.55); }

/* ----- cards ----- */
.card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  padding: 32px;
  margin-bottom: 24px;
}

/* ----- forms ----- */
label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--ink-soft); font-weight: 500; margin-bottom: 14px;
}
input, select, textarea {
  font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; background: #fff;
  transition: border-color 120ms, box-shadow 120ms;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(103,134,161,0.18);
}
select[multiple] { padding: 6px 8px; }

button {
  font: inherit; font-weight: 500;
  background: var(--primary); color: #fff;
  border: 0; border-radius: 8px;
  padding: 10px 20px; cursor: pointer;
  transition: background 120ms, transform 120ms;
}
button:hover { background: #2b3c48; }
button:active { transform: translateY(1px); }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
button.ghost:hover { background: #f6f8fa; border-color: var(--primary); color: var(--primary); }
button.danger { background: var(--bad); }
button:disabled { opacity: .5; cursor: default; }

/* ----- tables ----- */
table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden;
}
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { background: #f0f3f6; font-weight: 600; font-size: 13px; color: var(--ink-soft); }
tr:last-child td { border-bottom: 0; }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 500; background: #e8edf1; color: var(--ink-soft);
  margin-right: 4px;
}
.pill.on { background: #dcefe6; color: var(--ok); }
.pill.off { background: #f3e3df; color: var(--bad); }

/* ----- stat tiles ----- */
.stat {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.stat .cell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
.stat .n { font-size: 28px; font-weight: 600; color: var(--primary); }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 4px; }

.row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 140px; }

/* ----- code blocks ----- */
pre.code {
  position: relative;
  background: var(--ink);
  color: #e8edf1;
  padding: 14px 16px;
  border-radius: 10px;
  overflow: auto;
  font-size: 12.5px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  line-height: 1.5;
}
pre.code .mono { font-family: inherit; }
code { background: #eef1f4; padding: 1px 6px; border-radius: 4px; font-family: ui-monospace, Menlo, monospace; font-size: 0.92em; }

/* ----- toast ----- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 11px 20px; border-radius: 10px;
  max-width: 90vw; font-size: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  z-index: 100;
}
.toast.bad { background: var(--bad); }

/* ----- modal ----- */
dialog.dlg {
  border: 1px solid var(--line); border-radius: 14px; padding: 26px;
  width: min(540px, 92vw); color: var(--ink); background: #fff;
  box-shadow: 0 20px 60px rgba(27,45,61,0.25);
}
dialog.dlg::backdrop { background: rgba(31,45,58,0.5); }
dialog.dlg select, dialog.dlg input { width: 100%; }
dialog.dlg h2 { margin-top: 0; }

/* ----- login screen ----- */
#passwordScreen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  position: relative;
}
.password-card {
  text-align: center;
  max-width: 440px;
  width: 100%;
}
.password-card .logo-login {
  width: 220px; max-width: 70%;
  margin: 0 auto 20px;
  display: block;
}
.password-card h1 {
  font-size: 1.6rem; color: var(--ink); margin: 0 0 6px;
}
.password-card .lede { color: var(--muted); font-size: 14.5px; margin-bottom: 8px; }
.password-card .lede-link { font-size: 13.5px; margin: 0 0 20px; }
.password-card .lede-link a { color: var(--primary, #1a73e8); text-decoration: none; font-weight: 500; }
.password-card .lede-link a:hover { text-decoration: underline; }
.password-card label { text-align: left; }
.password-card button[type="submit"] { width: 100%; padding: 12px; }
.password-card .secret-hint {
  margin: 16px 0 8px; font-size: 13px; color: var(--muted); word-break: break-all;
}

/* ----- footer ----- */
.footer {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-align: center;
  padding: 18px 20px;
  margin: 40px auto 0;
  max-width: 1200px; width: 100%;
  border-radius: 10px;
  font-size: 0.9rem;
}
.footer a { color: #fff; margin: 0 10px; opacity: 0.9; transition: opacity 0.2s; text-decoration: none; }
.footer a:hover { opacity: 1; text-decoration: underline; }
.footer .copyright { display: inline-block; margin-right: 10px; }
.footer .brand { text-transform: lowercase; }

/* ----- responsive ----- */
@media (max-width: 768px) {
  .header { padding-top: 24px; margin-bottom: 24px; }
  .header h1 { font-size: 1.6rem; }
  .header-actions { position: static; justify-content: flex-end; margin-bottom: 12px; }
  .card { padding: 22px; }
  .footer { font-size: 0.8rem; padding: 14px 16px; }
  .footer a { display: block; margin: 5px 0; }
  .footer .copyright { display: block; margin: 0 0 6px; }
}
