/* pmOps — HPE-inspired styling for the PMO demo server. */

:root {
  --hpe-green: #01a982;
  --hpe-green-dark: #00775b;
  --hpe-black: #000000;
  --hpe-slate: #1c1c1c;
  --hpe-teal: #0d5265;
  --hpe-orange: #ff8300;
  --hpe-red: #c54e4b;

  --bg: #f4f5f5;
  --surface: #ffffff;
  --border: #dddddd;
  --text: #333333;
  --text-muted: #666666;

  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .12);
  --header-h: 60px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Metric", "Segoe UI", -apple-system, BlinkMacSystemFont,
               Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */

.hpe-header {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
  padding: 0 24px;
  background: var(--hpe-black);
  color: #ffffff;
  flex: 0 0 auto;
}

.hpe-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
}

.hpe-logo {
  display: block;
  height: 26px;
  width: auto;
}

.hpe-brand-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, .3);
}

.hpe-brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}

.hpe-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 16px;
  flex: 1 1 auto;
}

.hpe-nav a {
  padding: 8px 14px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, .82);
  text-decoration: none;
  font-size: 15px;
  transition: background .15s, color .15s;
}

.hpe-nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.hpe-nav a.is-active {
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--hpe-green);
  border-radius: var(--radius) var(--radius) 0 0;
}

.hpe-user {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.hpe-user-name { font-size: 14px; color: rgba(255, 255, 255, .82); }

.hpe-user form { margin: 0; }

.hpe-signout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .45);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.hpe-signout:hover {
  background: var(--hpe-green);
  border-color: var(--hpe-green);
}

/* ---------- Layout ---------- */

.hpe-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.hpe-footer {
  flex: 0 0 auto;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-title { margin: 0; font-size: 28px; font-weight: 600; }

.page-sub { margin: 4px 0 0; color: var(--text-muted); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.btn-primary { background: var(--hpe-green); border-color: var(--hpe-green); color: #fff; }

.btn-primary:hover { background: var(--hpe-green-dark); border-color: var(--hpe-green-dark); }

.btn-block { display: block; width: 100%; }

.btn-secondary {
  background: var(--surface);
  border-color: #bbbbbb;
  color: var(--text);
  text-decoration: none;
}

.btn-secondary:hover { border-color: var(--text); }

.btn-danger { background: var(--hpe-red); border-color: var(--hpe-red); color: #fff; }

.btn-danger:hover { background: #a83f3c; border-color: #a83f3c; }

.btn-danger-link {
  background: transparent;
  border-color: transparent;
  color: var(--hpe-red);
  text-decoration: none;
  margin-left: auto;
}

.btn-danger-link:hover { text-decoration: underline; }

a.btn { display: inline-block; text-decoration: none; }

.head-actions { display: flex; gap: 10px; }

/* ---------- Messages ---------- */

.messages { margin-bottom: 20px; }

.alert-success {
  background: rgba(1, 169, 130, .1);
  border: 1px solid rgba(1, 169, 130, .45);
  color: var(--hpe-green-dark);
}

.alert-warn,
.alert-warning {
  background: rgba(255, 131, 0, .1);
  border: 1px solid rgba(255, 131, 0, .45);
  color: #8a4700;
}

.alert-info {
  background: rgba(13, 82, 101, .08);
  border: 1px solid rgba(13, 82, 101, .35);
  color: var(--hpe-teal);
}

/* ---------- Forms ---------- */

.form-panel { margin-bottom: 20px; }

.form-body { padding: 22px 24px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  padding: 22px 24px;
}

.form-field { display: flex; flex-direction: column; }

.form-field--wide { grid-column: span 2; }

@media (max-width: 700px) {
  .form-field--wide { grid-column: span 1; }
}

.form-field label {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.form-field input[type="text"],
.form-field input[type="date"],
.form-field select,
.form-body input[type="text"],
.formset-table input[type="text"],
.formset-table input[type="date"],
.formset-table select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #bbbbbb;
  border-radius: var(--radius);
  font: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--text);
}

.form-field input:focus,
.form-field select:focus,
.formset-table input:focus,
.formset-table select:focus {
  outline: none;
  border-color: var(--hpe-green);
  box-shadow: 0 0 0 3px rgba(1, 169, 130, .2);
}

.form-help { margin: 5px 0 0; font-size: 13px; color: var(--text-muted); }

.form-error { margin: 5px 0 0; font-size: 13px; color: var(--hpe-red); font-weight: 600; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.form-body .form-actions { margin-top: 24px; }

.panel-foot { padding: 14px 20px; border-top: 1px solid var(--border); }

.formset-table td { vertical-align: top; }

.formset-table .col-remove,
.data-table th.col-remove { width: 80px; text-align: center; }

.formset-table .col-remove input { width: auto; }

.col-actions { width: 130px; white-space: nowrap; }

.action {
  color: var(--hpe-green-dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-right: 12px;
}

.action:hover { text-decoration: underline; }

.action--danger { color: var(--hpe-red); }

.action--disabled { color: #bbbbbb; cursor: not-allowed; font-weight: 600; font-size: 14px; }

/* ---------- Confirm pages ---------- */

.confirm-shell { max-width: 640px; }

.confirm-body { padding: 22px 24px; }

.confirm-body > p { margin-top: 0; }

.confirm-note { color: var(--text-muted); font-size: 14px; }

.linked-list { margin: 0 0 16px; padding-left: 20px; }

.linked-list a { color: var(--hpe-green-dark); }

/* ---------- KPI tiles ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--hpe-green);
}

.kpi-label {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
}

.kpi-value { margin: 6px 0 2px; font-size: 34px; font-weight: 600; line-height: 1.1; }

.kpi-delta { margin: 0; font-size: 13px; }

.kpi-delta--ok { color: var(--hpe-green-dark); }

.kpi-delta--warn { color: var(--hpe-orange); }

.kpi-delta--bad { color: var(--hpe-red); }

.kpi-card--warn::before { background: var(--hpe-orange); }

.kpi-card--bad::before { background: var(--hpe-red); }

/* ---------- Panels ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 1000px) {
  .split { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-title { margin: 0; font-size: 17px; font-weight: 600; }

.panel-link { color: var(--hpe-green-dark); text-decoration: none; font-size: 14px; }

.panel-link:hover { text-decoration: underline; }

/* ---------- Table ---------- */

.table-wrap { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }

.data-table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid #eeeeee;
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: 0; }

.data-table tbody tr:hover { background: #fbfbfb; }

.cell-strong { font-weight: 600; }

.pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.pill--not_started { background: #ececec; color: #555555; }

.pill--in_progress { background: rgba(1, 169, 130, .14); color: var(--hpe-green-dark); }

.pill--on_hold { background: rgba(255, 131, 0, .16); color: #a35400; }

.pill--complete { background: rgba(13, 82, 101, .12); color: var(--hpe-teal); }

.pill--cancelled { background: #f2f2f2; color: #999999; text-decoration: line-through; }

/* Customer temperature */

.temp { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }

.temp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .05);
}

.temp--green .temp-dot { background: var(--hpe-green); }

.temp--yellow .temp-dot { background: #f5c518; }

.temp--red .temp-dot { background: var(--hpe-red); }

.flag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.flag--overdue { background: rgba(197, 78, 75, .14); color: var(--hpe-red); }

.cell-overdue { color: var(--hpe-red); font-weight: 600; }

.cell-mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
}

.cell-link { color: var(--hpe-green-dark); text-decoration: none; font-weight: 600; }

.cell-link:hover { text-decoration: underline; }

.empty-cell { padding: 28px 20px; text-align: center; color: var(--text-muted); }

.empty-cell a { color: var(--hpe-green-dark); }

.progress {
  display: inline-block;
  vertical-align: middle;
  width: 90px;
  height: 6px;
  background: #e6e6e6;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar { height: 100%; background: var(--hpe-green); }

.progress-num { margin-left: 8px; font-size: 13px; color: var(--text-muted); }

/* ---------- Activity ---------- */

.activity { list-style: none; margin: 0; padding: 0; }

.activity-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 20px;
  border-bottom: 1px solid #eeeeee;
}

.activity-item:last-child { border-bottom: 0; }

.activity-when {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}

.activity-text { font-size: 15px; }

.activity-when.is-overdue { color: var(--hpe-red); font-weight: 700; }

.activity-meta { font-size: 13px; color: var(--text-muted); }

.activity-meta a { color: var(--hpe-green-dark); text-decoration: none; font-weight: 600; }

.activity-meta a:hover { text-decoration: underline; }

.panel-note { font-size: 13px; color: var(--text-muted); }

/* ---------- Filter bar ---------- */

.filterbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.filter {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

.filter:hover { border-color: var(--hpe-green); }

.filter.is-active {
  background: var(--hpe-green);
  border-color: var(--hpe-green);
  color: #ffffff;
  font-weight: 600;
}

/* ---------- Detail page ---------- */

.crumbs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--text-muted);
}

.crumbs a { color: var(--hpe-green-dark); text-decoration: none; }

.crumbs a:hover { text-decoration: underline; }

.eyebrow {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: .5px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.meta-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.meta-item p { margin: 0; }

.meta-label {
  margin-bottom: 6px !important;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
}

.meta-value { font-size: 17px; font-weight: 600; }

/* ---------- Login ---------- */

body.login-page {
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(1, 169, 130, .22), transparent 60%),
    linear-gradient(160deg, #12181a 0%, #1c1c1c 55%, #0d2b2b 100%);
}

body.login-page .hpe-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: none;
}

body.login-page .hpe-footer {
  background: transparent;
  border-top-color: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .6);
}

.login-shell { width: 100%; max-width: 420px; }

.login-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  padding: 36px 34px 34px;
  overflow: hidden;
}

.login-accent {
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--hpe-green);
}

.login-title { margin: 0; font-size: 26px; font-weight: 600; }

.login-sub { margin: 6px 0 24px; color: var(--text-muted); font-size: 15px; }

.field { display: block; margin-bottom: 18px; }

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #bbbbbb;
  border-radius: var(--radius);
  font: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus {
  outline: none;
  border-color: var(--hpe-green);
  box-shadow: 0 0 0 3px rgba(1, 169, 130, .2);
}

.alert {
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 18px;
}

.alert-error {
  background: rgba(197, 78, 75, .1);
  border: 1px solid rgba(197, 78, 75, .4);
  color: #8d3230;
}

.login-legal {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, .55);
}
