/* IT Helpdesk styles — PRS green/gold theme, clean + readable */
:root {
  --bg: #061208; --panel: #112215; --panel2: #16291a; --border: #2b4f2b;
  --text: #e0f0d0; --dim: #8fb87f; --accent: #f0d040; --accent2: #3dca3d;
  --red: #ff7a6b; --amber: #e8b84a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Trebuchet MS', 'Segoe UI', Tahoma, sans-serif; line-height: 1.5; min-height: 100vh; }
body::before {
  content:''; position:fixed; inset:0; pointer-events:none; z-index:-1;
  background-image: linear-gradient(rgba(61,202,61,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(61,202,61,.03) 1px, transparent 1px);
  background-size: 26px 26px;
}
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 26px; margin: 6vh auto; }
.narrow { max-width: 620px; }
h1 { color: var(--accent); font-size: 26px; margin-bottom: 6px; }
h2 { color: var(--accent); font-size: 20px; margin-bottom: 14px; }
h3 { color: var(--text); font-size: 15px; margin: 12px 0 6px; }
.muted { color: var(--dim); font-size: 13px; }
label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--dim); font-weight: 600; }
input, textarea, select {
  width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--panel2); border: 1px solid var(--border); border-radius: 9px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
.row { display: flex; gap: 12px; }
.row label { flex: 1; }
textarea { resize: vertical; }
button { padding: 10px 16px; font: inherit; border-radius: 9px; cursor: pointer; border: 1px solid var(--border); background: var(--panel2); color: var(--text); }
button.primary { background: linear-gradient(180deg, var(--accent), #c0a030); color: #1a1400; font-weight: 700; border-color: var(--accent); margin-top: 14px; }
button.ghost { margin-left: 8px; }
.inline { display: inline-flex !important; align-items: center; gap: 6px; color: var(--text) !important; }
.inline input { width: auto; margin-top: 0; }
#status { margin-top: 14px; font-size: 14px; }
#status.ok { color: var(--accent2); }
#status.err { color: var(--red); }
a { color: var(--accent2); }
header { padding: 18px 26px; border-bottom: 1px solid var(--border); display: flex; gap: 14px; align-items: center; }
header h1 { margin: 0; font-size: 20px; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th { text-align: left; font-size: 10px; letter-spacing: 1px; color: var(--amber); text-transform: uppercase; padding: 7px 8px; border-bottom: 1px solid var(--border); }
td { padding: 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
tr:hover td { background: var(--panel2); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge.new { background: rgba(232,184,74,.2); color: var(--amber); }
.badge.open, .badge.in_progress { background: rgba(127,176,255,.18); color: #9cc0ff; }
.badge.awaiting_client { background: rgba(61,202,61,.2); color: var(--accent2); }
.badge.resolved, .badge.closed { background: rgba(143,184,127,.16); color: var(--dim); }
.msg { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.msg.client { border-left: 3px solid var(--dim); }
.msg.partner { border-left: 3px solid var(--accent); }
.msg.system { border-left: 3px solid var(--amber); }
.msg.internal { opacity: .7; border-left: 3px solid var(--red); }
.msg .who { font-size: 11px; color: var(--dim); margin-bottom: 2px; }

/* ── portal nav ─────────────────────────────────────────── */
.portal-nav { display: inline-flex; gap: 12px; margin-left: 16px; }
.portal-nav a { text-decoration: none; padding: 2px 10px; border-radius: 6px; color: #556; }
.portal-nav a.on { background: #eef; font-weight: 600; color: #223; }
.portal-nav a:hover { background: #f0f2ff; }

/* ── work items / clients tables ────────────────────────── */
.inline-form { display: inline; }
select { padding: 3px 6px; }
ul.plain { list-style: none; padding-left: 0; }
ul.plain li { padding: 4px 0; border-bottom: 1px solid #f0f0f4; }

/* ── docs ───────────────────────────────────────────────── */
details.doc { border: 1px solid #e4e6ee; border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
details.doc summary { cursor: pointer; }
details.doc .fields { margin: 8px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.kv { font-size: 0.92em; }
pre.docbody { white-space: pre-wrap; background: #f7f8fb; border-radius: 6px; padding: 10px; font-size: 0.9em; }
.badge.kind-config { background: #e8f0fe; color: #1a56db; }

/* ── credential vault ───────────────────────────────────── */
tr.subrow td { padding-top: 0; }
.secret-reveal { background: #fffbe6; border: 1px solid #f0e0a0; border-radius: 8px; padding: 14px; margin: 12px 0; user-select: all; }
.secret-reveal code { font-size: 1.05em; word-break: break-all; }
.small { font-size: 0.85em; }

/* ── RMM ─────────────────────────────────────────────────── */
.meter { display: inline-block; width: 60px; height: 8px; background: #eef0f5; border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.meter .fill { display: block; height: 100%; background: #3fae5a; }
.meter .fill.warn { background: #e6b23c; }
.meter .fill.crit { background: #d84b40; }
.badge.online { background: #e2f5e7; color: #1d7a37; }
.badge.offline { background: #fdecea; color: #b3261e; }
.badge.warning, .alertrow.warning .badge { background: #fdf3dc; color: #946200; }
.badge.critical, .alertrow.critical .badge { background: #fdecea; color: #b3261e; }
.alertrow { padding: 8px 10px; border-left: 4px solid #ccc; margin: 6px 0; background: #fafafc; border-radius: 0 6px 6px 0; }
.alertrow.critical { border-left-color: #d84b40; }
.alertrow.warning { border-left-color: #e6b23c; }
.enroll-banner { background: #eef4ff; border: 1px solid #ccd9f0; border-radius: 8px; padding: 10px 14px; margin: 8px 0; }
.enroll-banner code { font-size: 1.1em; user-select: all; }

/* ── licenses ───────────────────────────────────────────── */
.expiring { color: #b3261e; font-weight: 600; }
