/* ============================================================
   PerfOS NT — classic NT4/98 chrome, modern CSS underneath
   ============================================================ */
:root {
  --face: #c0c0c0;
  --face-light: #dfdfdf;
  --white: #ffffff;
  --shadow: #808080;
  --dark: #0a0a0a;
  --desktop: #008080;
  --title-a: #000080;
  --title-b: #1084d0;
  --title-inactive-a: #808080;
  --title-inactive-b: #b5b5b5;
  --text: #000000;
  --disabled: #808080;
  --sel: #000080;
  --sel-text: #ffffff;
  --link: #000080;
  --ok: #008000;
  --warnc: #808000;
  --bad: #c00000;
  --info-bg: #ffffe1; /* tooltip yellow */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--desktop);
  color: var(--text);
  font-family: Tahoma, 'MS Sans Serif', 'Segoe UI', Verdana, sans-serif;
  font-size: 12px;
  -webkit-font-smoothing: none;
  cursor: default;
}
::selection { background: var(--sel); color: var(--sel-text); }

/* --------- bevels --------- */
.raised, .btn, .tb-btn, .listview th, .start-btn {
  background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--white),
              inset -2px -2px var(--shadow), inset 2px 2px var(--face-light);
}
.sunken {
  background: var(--white);
  box-shadow: inset -1px -1px var(--white), inset 1px 1px var(--shadow),
              inset -2px -2px var(--face-light), inset 2px 2px var(--dark);
}
.sunken-thin { box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--white); }
.divider-h { height: 2px; box-shadow: inset 0 1px var(--shadow), inset 0 -1px var(--white); margin: 6px 0; }

/* --------- window --------- */
.desktop-area { padding: 12px 12px 46px; min-height: calc(100vh - 34px); }
.window {
  background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--face-light),
              inset -2px -2px var(--shadow), inset 2px 2px var(--white);
  padding: 3px;
  max-width: 1280px;
  margin: 0 auto;
}
.window.modal { max-width: 460px; margin: 8vh auto 0; }
.title-bar {
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: #fff;
  display: flex; align-items: center; gap: 6px;
  padding: 2px 3px 2px 5px;
  height: 22px;
  user-select: none;
}
.title-bar .t-icon { width: 16px; height: 16px; image-rendering: pixelated; }
.title-bar .t-text { font-weight: bold; font-size: 12px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .2px; }
.title-bar-controls { display: flex; gap: 2px; }
.title-bar-controls button {
  width: 18px; height: 16px; font-size: 10px; line-height: 1;
  font-family: Tahoma, sans-serif; font-weight: bold; color: #000;
  padding: 0; border: 0;
  background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--white),
              inset -2px -2px var(--shadow), inset 2px 2px var(--face-light);
}
.title-bar-controls button:active { box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--white); }

/* --------- menu bar (main nav) --------- */
.menubar {
  display: flex; flex-wrap: wrap; align-items: center;
  padding: 1px 2px; gap: 1px;
  background: var(--face);
  border-bottom: 1px solid var(--shadow);
  box-shadow: 0 1px 0 var(--white);
}
.menubar a {
  color: var(--text); text-decoration: none;
  padding: 3px 9px; border: 1px solid transparent;
}
.menubar a:hover { border-color: var(--face-light) var(--shadow) var(--shadow) var(--face-light); }
.menubar a.active { background: var(--sel); color: var(--sel-text); }
.menubar .spacer { flex: 1; }
.menubar .badge {
  background: var(--bad); color: #fff; font-size: 10px; font-weight: bold;
  padding: 0 4px; margin-left: 4px; border: 1px solid #400000;
}

/* --------- content --------- */
.content { padding: 12px; background: var(--face); }
h1, h2, h3 { font-size: 12px; margin: 0 0 8px; }
h1 { font-size: 13px; }
p { margin: 0 0 8px; line-height: 1.5; }
a { color: var(--link); }
.muted { color: var(--shadow); }
.small { font-size: 11px; }
.mono { font-family: 'Courier New', monospace; font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 10px; } .mb { margin-bottom: 10px; }
.flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* --------- buttons --------- */
.btn {
  display: inline-block;
  min-width: 76px; padding: 4px 12px;
  font: inherit; color: var(--text); text-align: center; text-decoration: none;
  border: 0; cursor: pointer; user-select: none;
}
.btn:active, .btn.pressed {
  box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--white),
              inset 2px 2px var(--shadow), inset -2px -2px var(--face-light);
  padding: 5px 11px 3px 13px;
}
.btn:focus { outline: 1px dotted #000; outline-offset: -5px; }
.btn[disabled] { color: var(--disabled); text-shadow: 1px 1px 0 var(--white); cursor: default; }
.btn.default { box-shadow: 0 0 0 1px var(--dark), inset -1px -1px var(--dark), inset 1px 1px var(--white), inset -2px -2px var(--shadow), inset 2px 2px var(--face-light); font-weight: bold; }
.btn.small { min-width: 0; padding: 2px 8px; font-size: 11px; }
.btn.danger { color: #800000; font-weight: bold; }

/* --------- forms --------- */
label { display: block; margin: 8px 0 2px; }
label.inline { display: inline; margin: 0 4px 0 0; }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=month], input[type=time], input[type=url], select, textarea {
  font: inherit; color: var(--text);
  background: var(--white);
  border: 0; padding: 4px 5px;
  box-shadow: inset -1px -1px var(--white), inset 1px 1px var(--shadow),
              inset -2px -2px var(--face-light), inset 2px 2px var(--dark);
  width: 100%; max-width: 320px;
}
textarea { max-width: 100%; min-height: 64px; resize: vertical; }
select { padding: 3px 4px; }
input:focus, select:focus, textarea:focus { outline: 1px dotted #000; outline-offset: -4px; }
input[disabled], select[disabled] { background: var(--face); color: var(--disabled); }
input[type=checkbox], input[type=radio] { width: 13px; height: 13px; }
.field-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.field-row > div { min-width: 130px; }
.w-sm { max-width: 90px !important; } .w-md { max-width: 160px !important; } .w-lg { max-width: 480px !important; }

fieldset {
  border: 0; margin: 0 0 12px; padding: 10px;
  box-shadow: inset -1px -1px var(--white), inset 1px 1px var(--shadow),
              1px 1px 0 0 var(--white) inset;
  border: 1px solid; border-color: var(--shadow) var(--white) var(--white) var(--shadow);
}
legend { padding: 0 4px; background: var(--face); }

/* --------- listview tables --------- */
.listview-wrap { background: var(--white); box-shadow: inset -1px -1px var(--white), inset 1px 1px var(--shadow), inset -2px -2px var(--face-light), inset 2px 2px var(--dark); padding: 2px; overflow: auto; }
table.listview { border-collapse: collapse; width: 100%; background: var(--white); }
.listview th {
  font-weight: normal; text-align: left;
  padding: 3px 8px; cursor: pointer; user-select: none;
  border-right: 1px solid var(--shadow);
  white-space: nowrap;
  position: sticky; top: 0;
}
.listview th:active { box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--white); }
.listview td { padding: 3px 8px; border-bottom: 1px solid #efefef; vertical-align: top; }
.listview tr:hover td { background: #e8e8f8; }
.listview tr.sel td, .listview tr.sel:hover td { background: var(--sel); color: var(--sel-text); }
.listview tr.sel a { color: #fff; }
.listview td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --------- status bar / taskbar --------- */
.statusbar {
  display: flex; gap: 3px; padding: 3px 2px 2px; background: var(--face);
  border-top: 1px solid var(--white);
}
.statusbar .cell {
  padding: 2px 8px; flex: 0 0 auto;
  box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--white);
  color: var(--text); white-space: nowrap;
}
.statusbar .cell.grow { flex: 1; }

.taskbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  height: 34px; padding: 3px 4px;
  background: var(--face);
  box-shadow: inset 0 1px var(--face-light), inset 0 2px var(--white);
  display: flex; gap: 4px; align-items: center;
}
.start-btn {
  display: flex; align-items: center; gap: 5px;
  font-weight: bold; padding: 3px 10px 3px 6px; border: 0; font: inherit; font-weight: bold;
  cursor: pointer; height: 28px;
}
.start-btn img { width: 18px; height: 18px; image-rendering: pixelated; }
.start-btn:active, .start-btn.open { box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--white), inset 2px 2px var(--shadow); }
.tb-btn {
  display: flex; align-items: center; gap: 5px;
  height: 28px; padding: 3px 10px; max-width: 170px;
  color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden;
}
.tb-btn img { width: 16px; height: 16px; image-rendering: pixelated; }
.tb-btn.active { box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--white), inset 2px 2px var(--shadow); background: repeating-conic-gradient(var(--white) 0 25%, var(--face) 0 50%) 0 0/4px 4px; font-weight: bold; }
.tb-tray {
  margin-left: auto; height: 28px; display: flex; align-items: center; gap: 8px; padding: 0 10px;
  box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--white);
}
.tb-tray img { width: 16px; height: 16px; image-rendering: pixelated; }

/* --------- start menu --------- */
.start-menu {
  position: fixed; bottom: 36px; left: 4px; z-index: 100;
  display: none; min-width: 230px;
  background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--face-light),
              inset -2px -2px var(--shadow), inset 2px 2px var(--white);
  padding: 3px;
}
.start-menu.open { display: flex; }
.sm-banner {
  width: 26px; background: linear-gradient(180deg, var(--title-a), var(--title-b));
  color: #fff; font-weight: bold; font-size: 15px;
  writing-mode: vertical-rl; transform: rotate(180deg);
  display: flex; align-items: center; justify-content: flex-start; padding: 10px 0;
  letter-spacing: 1px;
}
.sm-items { flex: 1; display: flex; flex-direction: column; }
.sm-items a {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 14px 6px 8px; color: var(--text); text-decoration: none;
}
.sm-items a img { width: 20px; height: 20px; image-rendering: pixelated; }
.sm-items a:hover { background: var(--sel); color: var(--sel-text); }
.sm-sep { height: 2px; margin: 3px 2px; box-shadow: inset 0 1px var(--shadow), inset 0 -1px var(--white); }

/* --------- misc components --------- */
.msgbar {
  display: flex; gap: 8px; align-items: center;
  padding: 6px 10px; margin-bottom: 10px;
  background: var(--info-bg); border: 1px solid #808000;
}
.msgbar.error { background: #ffe0e0; border-color: #c00000; }
.msgbar.success { background: #e0ffe0; border-color: #008000; }
.msgbar .x { margin-left: auto; cursor: pointer; font-weight: bold; }

.led { display: inline-block; width: 10px; height: 10px; border: 1px solid var(--dark); vertical-align: -1px; }
.led.pass { background: #00c000; } .led.warn { background: #e0e000; } .led.fail { background: #e00000; } .led.off { background: var(--shadow); }

.chip { display: inline-block; padding: 0 6px; border: 1px solid var(--dark); font-weight: bold; background: var(--white); }
.chip.Ap, .chip.gA\+ { background: #7be27b; }
.grade-A\+, .grade-A { background: #7be27b; }
.grade-B { background: #b8e0ff; }
.grade-C { background: #ffe08a; }
.grade-D { background: #ff9a9a; }
.chip.status-draft { background: #eee; }
.chip.status-published { background: #b8e0ff; }
.chip.status-acknowledged { background: #7be27b; }
.chip.status-disputed { background: #ffb0b0; }
.chip.status-locked { background: #d0d0d0; color: #404040; }
.chip.status-pending { background: #ffe08a; }
.chip.status-approved { background: #7be27b; }
.chip.status-rejected { background: #ff9a9a; }
.chip.sev-minor { background: #ffffd0; }
.chip.sev-moderate { background: #ffe08a; }
.chip.sev-major { background: #ffb060; }
.chip.sev-critical { background: #ff9a9a; }

.scorebar { display: inline-flex; gap: 1px; padding: 2px; background: var(--white); box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--white); vertical-align: middle; }
.scorebar i { width: 6px; height: 12px; background: var(--face); }
.scorebar i.on { background: var(--title-a); }
.scorebar i.on.warn { background: #c0a000; }
.scorebar i.on.bad { background: #c00000; }

.progress { height: 18px; background: var(--white); box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--white); padding: 2px; }
.progress > div { height: 100%; background: repeating-linear-gradient(90deg, var(--title-a) 0 8px, transparent 8px 10px); }

/* tabs */
.tabs { display: flex; gap: 2px; margin-bottom: -2px; position: relative; z-index: 2; padding-left: 4px; }
.tabs a {
  padding: 4px 12px; color: var(--text); text-decoration: none;
  background: var(--face);
  box-shadow: inset -1px 0 var(--dark), inset 1px 1px var(--white), inset -2px 0 var(--shadow), inset 2px 2px var(--face-light);
}
.tabs a.active { font-weight: bold; padding-bottom: 7px; margin-top: -2px; }
.tab-panel { padding: 12px; box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--white), inset -2px -2px var(--shadow), inset 2px 2px var(--face-light); background: var(--face); }

/* tree (explorer style) */
.tree { list-style: none; padding-left: 0; margin: 0; }
.tree li { padding: 2px 0 2px 18px; background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><rect x="7" y="0" width="1" height="8" fill="%23808080"/><rect x="7" y="8" width="8" height="1" fill="%23808080"/></svg>') no-repeat 0 0; }

/* stat tiles */
.tile { padding: 10px 12px; background: var(--face); box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--white), inset -2px -2px var(--shadow), inset 2px 2px var(--face-light); }
.tile .big { font-size: 22px; font-weight: bold; font-family: Tahoma; }
.tile .cap { color: #303030; margin-top: 2px; }

/* login desktop */
.logon-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; }
.logon-note { color: #d8f0f0; text-align: center; font-size: 11px; }

/* print */
@media print {
  body { background: #fff; }
  .taskbar, .menubar, .statusbar, .title-bar-controls, .no-print { display: none !important; }
  .window { box-shadow: none; max-width: none; }
  .content { padding: 0; background: #fff; }
}

/* scrollbars (webkit) */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: repeating-conic-gradient(var(--white) 0 25%, var(--face-light) 0 50%) 0 0/4px 4px; }
::-webkit-scrollbar-thumb {
  background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--white), inset -2px -2px var(--shadow), inset 2px 2px var(--face-light);
}
::-webkit-scrollbar-button { background: var(--face); height: 16px; width: 16px; box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--white), inset -2px -2px var(--shadow), inset 2px 2px var(--face-light); }

/* bluescreen error page */
.bsod { background: #0000aa; color: #fff; min-height: 100vh; padding: 60px 40px; font-family: 'Courier New', monospace; font-size: 15px; }
.bsod .t { background: #c0c0c0; color: #0000aa; padding: 1px 10px; font-weight: bold; }
.bsod a { color: #fff; }

/* --------- "What's this?" field tooltips --------- */
.qtip {
  display: inline-block; width: 14px; height: 14px; line-height: 14px;
  text-align: center; font-size: 10px; font-weight: bold; color: #000;
  background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--white), inset -2px -2px var(--shadow), inset 2px 2px var(--face-light);
  cursor: help; position: relative; vertical-align: 1px; margin-left: 4px; user-select: none;
}
.qtip:focus { outline: 1px dotted #000; outline-offset: -3px; }
.qtip::after {
  content: attr(data-tip);
  display: none; position: absolute; left: -10px; top: 19px; z-index: 60;
  width: 270px; max-width: 60vw;
  background: var(--info-bg); border: 1px solid #000;
  padding: 6px 9px; font-weight: normal; font-size: 11px; line-height: 1.55;
  text-align: left; white-space: normal; box-shadow: 2px 2px 0 rgba(0,0,0,.3);
}
.qtip:hover::after, .qtip:focus::after { display: block; }
.qtip.tip-right::after { left: auto; right: -10px; }

/* --------- contextual help bar --------- */
.helpbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 4px 9px; margin: 0 0 10px; font-size: 11px;
  background: #e4ecf7; border: 1px solid #6a84b0;
}
.helpbar img { width: 14px; height: 14px; image-rendering: pixelated; }

/* --------- handbook article typography --------- */
.article { background: var(--white); padding: 16px 20px; box-shadow: inset -1px -1px var(--white), inset 1px 1px var(--shadow), inset -2px -2px var(--face-light), inset 2px 2px var(--dark); }
.article h1 { font-size: 15px; margin: 0 0 10px; border-bottom: 2px solid var(--title-a); padding-bottom: 5px; }
.article h2 { font-size: 13px; margin: 16px 0 6px; color: var(--title-a); }
.article h3 { font-size: 12px; margin: 12px 0 4px; }
.article p, .article li { line-height: 1.7; font-size: 12.5px; }
.article ul, .article ol { margin: 4px 0 10px; padding-left: 24px; }
.article code { background: #f0f0f0; border: 1px solid #bbb; padding: 0 3px; font-family: 'Courier New', monospace; }
@media print { .article { box-shadow: none; padding: 0; } }
