:root {
  --navy: #0B1D35; --navy-light: #132845; --blue: #1C69DF;
  --teal: #047F94; --orange: #F97316; --red: #D73D3D;
  --surface: #F1F5F9; --white: #FFFFFF; --ink: #0B1D35;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--surface); color: var(--ink); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.topbar { background: var(--navy); color: #fff; padding: 16px 0; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.brand small { font-weight: 400; opacity: 0.6; font-size: 13px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px rgba(28,105,223,0.25); }
.logout { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 14px; }
.logout:hover { color: #fff; }

.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 28px 0; }
.stat { background: #fff; border: 1px solid rgba(11,29,53,0.08); border-radius: 14px; padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.stat .n { font-size: 32px; font-weight: 700; line-height: 1; }
.stat .l { font-size: 13px; color: rgba(11,29,53,0.55); }
.stat.ok .n { color: var(--teal); }
.stat.warn .n { color: var(--orange); }
.stat.error .n { color: var(--red); }
.stat.total .n { color: var(--navy); }

.tablewrap { background: #fff; border: 1px solid rgba(11,29,53,0.08); border-radius: 14px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(11,29,53,0.45); padding: 14px 18px; border-bottom: 2px solid var(--surface); }
td { padding: 14px 18px; border-bottom: 1px solid var(--surface); font-size: 14px; }
tr:last-child td { border-bottom: none; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.muted { color: rgba(11,29,53,0.5); }
.row-error { background: rgba(215,61,61,0.04); }

.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.ok { background: rgba(4,127,148,0.12); color: var(--teal); }
.pill.warn { background: rgba(249,115,22,0.14); color: #b45309; }
.pill.error { background: rgba(215,61,61,0.12); color: var(--red); }

.empty { background: #fff; border: 1px dashed rgba(11,29,53,0.15); border-radius: 14px; padding: 40px; text-align: center; color: rgba(11,29,53,0.5); }

.loginpage { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.loginbox { background: #fff; border: 1px solid rgba(11,29,53,0.08); border-radius: 16px; padding: 40px; width: 340px; box-shadow: 0 10px 40px rgba(11,29,53,0.08); text-align: center; }
.loginbox .brand { justify-content: center; color: var(--navy); font-size: 24px; }
.loginbox .sub { color: rgba(11,29,53,0.5); font-size: 13px; margin: 4px 0 24px; }
.loginbox input { width: 100%; padding: 12px 14px; border: 1px solid rgba(11,29,53,0.15); border-radius: 10px; font-size: 15px; margin-bottom: 14px; }
.loginbox input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(28,105,223,0.15); }
.loginbox button { width: 100%; padding: 12px; background: var(--blue); color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; }
.loginbox button:hover { background: #1557bf; }
.loginbox .err { color: var(--red); font-size: 13px; margin-bottom: 14px; }

/* --- Add Server + detail pages --- */
.topactions { display:flex; align-items:center; gap:16px; }
.btn { background:var(--blue); color:#fff; text-decoration:none; font-size:14px; font-weight:600; padding:8px 16px; border-radius:8px; }
.btn:hover { background:#1557bf; }
.wrap.narrow { max-width:820px; }
.pagetitle { margin:28px 0 6px; font-size:26px; color:var(--navy); }
.lead { color:rgba(11,29,53,0.6); margin-bottom:22px; }
.card { background:#fff; border:1px solid rgba(11,29,53,0.08); border-radius:14px; padding:24px 26px; margin-bottom:20px; }
.form label { display:block; font-weight:600; color:var(--navy); font-size:14px; margin-bottom:16px; }
.form input, .form select { width:100%; margin-top:6px; padding:11px 13px; border:1px solid rgba(11,29,53,0.15); border-radius:9px; font-size:15px; font-weight:400; }
.form input:focus, .form select:focus { outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(28,105,223,0.15); }
.form .hint { display:block; font-weight:400; color:rgba(11,29,53,0.45); font-size:12px; margin-top:4px; }
.form button { background:var(--blue); color:#fff; border:none; border-radius:9px; padding:12px 22px; font-size:15px; font-weight:600; cursor:pointer; }
.form button:hover { background:#1557bf; }
.err-banner { background:rgba(215,61,61,0.1); border:1px solid rgba(215,61,61,0.35); color:var(--red); padding:12px 16px; border-radius:10px; margin-bottom:18px; font-size:14px; }
.step h2 { font-size:17px; color:var(--navy); display:flex; align-items:center; gap:10px; margin-bottom:6px; }
.step .num { background:var(--blue); color:#fff; width:24px; height:24px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:13px; }
.kv { width:100%; border-collapse:collapse; margin-top:12px; }
.kv th { text-align:left; width:80px; color:rgba(11,29,53,0.45); font-size:12px; text-transform:uppercase; padding:8px 0; vertical-align:top; }
.kv td { padding:8px 0; word-break:break-all; }
.scriptbox { position:relative; margin-top:12px; }
.copybtn { position:absolute; top:10px; right:10px; background:var(--navy); color:#fff; border:none; border-radius:7px; padding:6px 12px; font-size:12px; cursor:pointer; }
.scriptbox pre { background:var(--navy); color:#e6edf5; padding:18px; border-radius:12px; overflow-x:auto; font-family:ui-monospace,"SF Mono",Menlo,monospace; font-size:12px; line-height:1.5; max-height:360px; overflow-y:auto; white-space:pre; }
td a { color:var(--blue); text-decoration:none; }
td a:hover { text-decoration:underline; }

/* --- server settings/edit --- */
.settings { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; flex-wrap:wrap; }
.inlineform { display:flex; align-items:flex-end; gap:14px; flex-wrap:wrap; margin:0; }
.inlineform label { display:flex; flex-direction:column; font-size:12px; font-weight:600; color:rgba(11,29,53,0.5); text-transform:uppercase; letter-spacing:0.04em; gap:6px; margin:0; }
.inlineform input, .inlineform select { padding:9px 11px; border:1px solid rgba(11,29,53,0.15); border-radius:8px; font-size:14px; font-weight:400; text-transform:none; letter-spacing:normal; color:var(--ink); }
.inlineform button { background:var(--blue); color:#fff; border:none; border-radius:8px; padding:10px 18px; font-size:14px; font-weight:600; cursor:pointer; }
.inlineform button:hover { background:#1557bf; }
.btn-danger { background:transparent; color:var(--red); border:1px solid rgba(215,61,61,0.4); border-radius:8px; padding:10px 16px; font-size:14px; font-weight:600; cursor:pointer; }
.btn-danger:hover { background:rgba(215,61,61,0.08); }

/* --- dashboard status filters --- */
.summary { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat { cursor: pointer; transition: box-shadow .15s ease, border-color .15s ease; user-select: none; }
.stat:hover { border-color: rgba(11,29,53,0.2); }
.stat.active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(28,105,223,0.14); }
.stat.awaiting .n { color: var(--blue); }
.pill.awaiting { background: rgba(28,105,223,0.1); color: var(--blue); }
.filterhint { color: rgba(11,29,53,0.45); font-size: 13px; padding: 12px 18px 4px; margin: 0; }
.search { margin-bottom: 16px; }
.search input { width: 100%; max-width: 360px; padding: 11px 14px; border: 1px solid rgba(11,29,53,0.15); border-radius: 9px; font-size: 15px; background: #fff; }
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(28,105,223,0.15); }

/* --- Notify: incident/maintenance status + severity pills --- */
.pill.critical, .pill.investigating { background: rgba(215,61,61,0.12); color: var(--red); }
.pill.major, .pill.identified, .pill.in_progress { background: rgba(249,115,22,0.14); color: #b45309; }
.pill.minor, .pill.scheduled { background: rgba(28,105,223,0.1); color: var(--blue); }
.pill.monitoring { background: rgba(28,105,223,0.1); color: var(--blue); }
.pill.resolved, .pill.completed { background: rgba(4,127,148,0.12); color: var(--teal); }
.pill.cancelled { background: rgba(11,29,53,0.08); color: rgba(11,29,53,0.55); }

.sectionhead { display:flex; align-items:center; justify-content:space-between; margin:28px 0 14px; }
.sectionhead h2 { font-size:18px; color:var(--navy); }

/* checkbox group for choosing target contact groups when sending */
.checkgroup { display:flex; flex-direction:column; gap:10px; margin-top:6px; }
.checkgroup label { display:flex; align-items:center; gap:10px; font-weight:400; font-size:14px; color:var(--ink); margin-bottom:0; cursor:pointer; }
.checkgroup input[type="checkbox"] { width:auto; margin:0; accent-color: var(--blue); }
.checkgroup .cnt { color: rgba(11,29,53,0.45); font-size:12px; }

textarea.form-textarea { width:100%; margin-top:6px; padding:11px 13px; border:1px solid rgba(11,29,53,0.15); border-radius:9px; font-size:15px; font-family:inherit; resize:vertical; min-height:120px; }
textarea.form-textarea:focus { outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(28,105,223,0.15); }

/* timeline of updates on an incident/maintenance detail page */
.timeline { list-style:none; margin:0; padding:0; }
.timeline li { position:relative; padding:0 0 24px 28px; border-left:2px solid var(--surface); }
.timeline li:last-child { border-left-color:transparent; padding-bottom:0; }
.timeline li::before { content:''; position:absolute; left:-7px; top:2px; width:12px; height:12px; border-radius:50%; background:var(--blue); border:2px solid #fff; box-shadow:0 0 0 1px rgba(11,29,53,0.1); }
.timeline .tmeta { font-size:12px; color:rgba(11,29,53,0.45); margin-bottom:4px; }
.timeline .tmsg { font-size:14px; color:var(--ink); white-space:pre-line; }

.badgebar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:6px; }
.metaline { color:rgba(11,29,53,0.55); font-size:13px; margin-bottom:18px; }
.sendresult { font-size:13px; color: rgba(11,29,53,0.55); margin-top:10px; }
.sendresult.hasfail { color: var(--red); }

.tabs { display:flex; gap:6px; margin:24px 0 0; border-bottom:1px solid rgba(11,29,53,0.08); }
.tabs a { padding:10px 4px; margin-right:20px; text-decoration:none; color:rgba(11,29,53,0.5); font-size:14px; font-weight:600; border-bottom:2px solid transparent; }
.tabs a.active { color:var(--navy); border-bottom-color:var(--blue); }

.chiplist { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.chip { background:var(--surface); border-radius:8px; padding:6px 12px; font-size:13px; display:flex; align-items:center; gap:8px; }
.chip form { margin:0; }
.chip button { background:none; border:none; color: rgba(11,29,53,0.4); cursor:pointer; font-size:14px; line-height:1; padding:0; }
.chip button:hover { color: var(--red); }
