:root {
  --bg: #0e1117; --panel: #171c26; --panel2: #1f2632; --line: #2a3340;
  --txt: #e6edf3; --muted: #8b97a7; --accent: #2f81f7; --accent2: #1f6feb;
  --ok: #3fb950; --off: #8b949e; --err: #f85149; --warn: #d29922;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #0b0f15; padding: 1px 6px; border-radius: 5px; font-size: .88em; color: #adbac7; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--txt); }
.brand span { color: var(--accent); }
.topbar nav a { margin-left: 20px; color: var(--muted); font-weight: 600; }
.topbar nav a:hover { color: var(--txt); text-decoration: none; }

.wrap { max-width: 980px; margin: 32px auto; padding: 0 20px; }
.foot { text-align: center; color: var(--muted); font-size: .82rem; padding: 30px; }

h1 { font-size: 1.5rem; margin: 0; }
h3 { margin: 0 0 14px; }
.muted { color: var(--muted); }
.head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 18px;
}
.login-card { max-width: 380px; margin: 8vh auto; }
.login-card h1 { font-size: 1.3rem; margin-bottom: 4px; }

label { display: block; margin: 14px 0; font-weight: 600; font-size: .92rem; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; }
input[type=text], input[type=password], input:not([type]), textarea, select {
  width: 100%; margin-top: 6px; padding: 10px 12px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 8px; color: var(--txt); font-size: .95rem;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
small.muted { font-weight: 400; }

button, .btn {
  display: inline-block; cursor: pointer; border: 0; border-radius: 8px;
  background: var(--accent2); color: #fff; padding: 10px 18px; font-size: .95rem; font-weight: 600;
}
button:hover, .btn:hover { background: var(--accent); text-decoration: none; }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn.danger, button.danger { background: #3a1d1d; color: #ff9c96; border: 1px solid #5a2a2a; }
.btn.danger:hover, button.danger:hover { background: var(--err); color: #fff; }
.form-actions { margin-top: 20px; }

table.grid { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.grid th, .grid td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: middle; }
.grid th { background: var(--panel2); color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.grid tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 8px; align-items: center; }
.actions form { margin: 0; }

.ok { color: var(--ok); font-weight: 600; }
.off { color: var(--off); }
.alert { background: #3a1d1d; border: 1px solid #5a2a2a; color: #ff9c96; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .76rem; font-weight: 600; border: 1px solid var(--line); color: var(--muted); }
.badge.provisioned { background: #122b18; color: var(--ok); border-color: #1c4326; }
.badge.error { background: #3a1d1d; color: #ff9c96; border-color: #5a2a2a; }
.badge.pending { background: #2d2710; color: var(--warn); border-color: #4a3f17; }
.badge.off { background: var(--panel2); }

fieldset.apps { border: 1px solid var(--line); border-radius: 8px; margin: 18px 0; padding: 14px 16px; }
fieldset.apps legend { padding: 0 8px; font-weight: 700; }
.app-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
