
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* LogHouse Pro palette — warm cream + charcoal, monochrome chrome */
  --accent:     #3a3a3a;   /* charcoal: primary, active nav, links, focus */
  --danger:     #c0392b;

  /* legacy token names remapped to the Pro palette so existing rules resolve */
  --navy-900:  #efece4;    /* sidebar surface (warm) */
  --navy-800:  #e4e0d6;    /* sidebar hover fill */
  --navy-700:  #d9d5cb;
  --teal-400:  #3a3a3a;    /* accents -> charcoal */
  --green-600: #3a3a3a;    /* progress / default bars -> charcoal */
  --blue-600:  #3a3a3a;    /* links -> charcoal */
  --purple-500:#8B5CF6;
  --orange-500:#F59E0B;
  --red-500:   #c0392b;
  --gray-25:   #f1f0ea;    /* page canvas (cream) */
  --gray-100:  #e7e5db;    /* muted subtle fills */
  --gray-200:  #e0e0e0;    /* borders */
  --gray-400:  #b0b0b0;
  --gray-500:  #898989;
  --gray-700:  #5a5a58;
  --white:     #ffffff;    /* cards */

  --text:      #3a3a3a;
  --text-sub:  #898989;
  --text-muted:#b0b0b0;
  --radius:    12px;
  --sidebar-w: 236px;
}

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  background: var(--gray-25);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

/* ── Layout shell ─────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy-900);
  color: var(--text-sub);
  border-right: 1px solid var(--gray-200);
  position: fixed;
  top: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 14px;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 6px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.brand .logo svg { width: 18px; height: 18px; }
.brand .name { font-size: 15px; font-weight: 700; letter-spacing: 1px; color: var(--text); line-height: 1.1; }
.brand .sub  { font-size: 9px; font-weight: 600; letter-spacing: 1.5px; color: var(--text-muted); text-transform: uppercase; }

.nav { margin-top: 18px; flex: 1; overflow-y: auto; }
.nav-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-muted); text-transform: uppercase;
  padding: 16px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 1px 0;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-sub); cursor: pointer;
  position: relative;
  transition: background .12s, color .12s;
  user-select: none;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .9; }
.nav-item:hover { background: var(--navy-800); color: var(--text); }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-item.disabled { opacity: .45; cursor: not-allowed; }
.nav-item .tag {
  margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: .5px;
  color: var(--text-muted); text-transform: uppercase;
}

.employee {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-top: 1px solid var(--gray-200); margin-top: 8px;
}
.employee .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.employee .who { line-height: 1.2; }
.employee .who .n { font-size: 12.5px; font-weight: 600; color: var(--text); }
.employee .who .r { font-size: 11px; color: var(--text-muted); }

/* ── Main ─────────────────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }
.content { max-width: 1540px; padding: 30px 38px 64px; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 26px;
}
.page-header h1 { font-size: 29px; font-weight: 600; letter-spacing: -.5px; }
.page-header .desc { font-size: 13.5px; color: var(--text-muted); margin-top: 5px; }
.breadcrumb { font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--blue-600); cursor: pointer; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.header-actions { display: flex; gap: 10px; align-items: center; }

.env-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .4px;
  padding: 5px 11px; border-radius: 20px; text-transform: uppercase;
  background: #fef3c7; color: #92400e;
}
.env-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange-500); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--white); color: var(--text-sub);
  border: 1px solid var(--gray-200); border-radius: 9px;
  padding: 8px 13px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--gray-25); border-color: var(--gray-400); }
.btn svg { width: 15px; height: 15px; }
.btn.subtle { background: transparent; border-color: transparent; color: var(--blue-600); }
.btn.subtle:hover { background: var(--gray-100); }

/* ── KPI cards ────────────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.kpi {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 18px 18px 16px;
  transition: border-color .12s, box-shadow .12s;
}
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { border-color: var(--teal-400); box-shadow: 0 1px 8px rgba(18,34,56,.06); }
.kpi .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kpi .label { font-size: 12.5px; font-weight: 600; color: var(--text-sub); }
.kpi .icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--gray-25); color: var(--gray-500);
  display: flex; align-items: center; justify-content: center;
}
.kpi .icon svg { width: 16px; height: 16px; }
.kpi .value {
  font-size: 31px; font-weight: 600; letter-spacing: -1px;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.kpi .value.text { font-size: 22px; letter-spacing: -.4px; }
.kpi .trend { font-size: 12px; font-weight: 600; margin-top: 9px; display: flex; align-items: center; gap: 5px; }
.kpi .trend .cmp { color: var(--text-muted); font-weight: 400; }
.kpi .trend.up   { color: var(--green-600); }
.kpi .trend.down { color: var(--red-500); }
.kpi .trend.flat { color: var(--text-muted); }

/* ── Grid / panels ────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid.two   { grid-template-columns: 1.35fr 1fr; }
.grid.two-eq{ grid-template-columns: 1fr 1fr; }
.grid.four  { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
@media (max-width: 1100px) { .grid.two, .grid.two-eq { grid-template-columns: 1fr; } }

.panel {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 20px;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.panel-header h2 { font-size: 15px; font-weight: 600; letter-spacing: -.2px; }
.panel-header .count { color: var(--text-muted); font-weight: 400; font-size: 13px; margin-left: 4px; }
.panel-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.view-all { font-size: 12.5px; color: var(--blue-600); cursor: pointer; font-weight: 500; }
.view-all:hover { text-decoration: underline; }

/* ── Controls ─────────────────────────────────────────────────── */
.ctrl-select, .ctrl-search {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: 9px; padding: 7px 11px;
  font-size: 12.5px; color: var(--text); outline: none;
  transition: border-color .12s;
}
.ctrl-select { cursor: pointer; }
.ctrl-search { width: 230px; }
.ctrl-search:focus, .ctrl-select:focus { border-color: var(--teal-400); }
.ctrl-search::placeholder { color: var(--gray-400); }

/* ── Bar chart ────────────────────────────────────────────────── */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-label {
  font-size: 12.5px; color: var(--text-sub); width: 130px; flex-shrink: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track { flex: 1; background: var(--gray-100); border-radius: 6px; height: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: var(--green-600); transition: width .5s cubic-bezier(.4,0,.2,1); }
.bar-fill.teal { background: var(--teal-400); }
.bar-fill.blue { background: var(--blue-600); }
.bar-fill.purple { background: var(--purple-500); }
.bar-fill.amber { background: var(--orange-500); }
.bar-count { font-size: 12.5px; color: var(--text-muted); width: 52px; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Donut ────────────────────────────────────────────────────── */
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.donut .center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.donut .center .n { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.donut .center .l { font-size: 11px; color: var(--text-muted); }
.legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 180px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend-row .swatch { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.legend-row .lbl { color: var(--text-sub); flex: 1; }
.legend-row .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-row .pct { color: var(--text-muted); width: 48px; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Sparkline / area ─────────────────────────────────────────── */
.spark { width: 100%; height: 220px; }

/* ── Lists (activity, alerts) ─────────────────────────────────── */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--gray-100);
}
.list-row:last-child { border-bottom: none; }
.list-row .li-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: var(--gray-25); color: var(--gray-500);
  display: flex; align-items: center; justify-content: center;
}
.list-row .li-icon svg { width: 15px; height: 15px; }
.list-row .li-main { flex: 1; min-width: 0; }
.list-row .li-title { font-size: 13px; font-weight: 500; color: var(--text); }
.list-row .li-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .li-meta { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.list-row .li-val { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { background: var(--gray-25); }

/* ── Tables ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .4px;
  padding: 0 14px 11px 0; border-bottom: 1px solid var(--gray-200);
  white-space: nowrap; user-select: none;
}
thead th.sortable { cursor: pointer; }
thead th.sortable:hover { color: var(--text-sub); }
thead th .arrow { opacity: .4; margin-left: 3px; }
thead th.active { color: var(--text); }
thead th.active .arrow { opacity: 1; }
tbody tr { border-bottom: 1px solid var(--gray-100); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-25); }
tbody td { padding: 12px 14px 12px 0; color: var(--text-sub); vertical-align: middle; }
tbody td.primary { color: var(--text); font-weight: 500; }
tbody td.mono { font-family: "SF Mono", ui-monospace, monospace; font-size: 11.5px; color: var(--text-muted); }
tbody td.num { font-variant-numeric: tabular-nums; }
.group-row td {
  padding: 15px 0 5px; font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .4px; border-bottom: none !important;
}
.group-row:hover { background: transparent !important; }

.link-name { color: var(--text); font-weight: 500; cursor: pointer; }
.link-name:hover { color: var(--blue-600); text-decoration: underline; }

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px; white-space: nowrap;
  background: var(--gray-100); color: var(--text-sub);
}
.badge.green,  .badge.INSTALLED, .badge.In.Progress { background: #dcfce7; color: #166534; }
.badge.blue,   .badge.STORAGE   { background: #dbeafe; color: #1e40af; }
.badge.red,    .badge.DISPOSED  { background: #fee2e2; color: #991b1b; }
.badge.amber,  .badge.FOR_SALE  { background: #fef3c7; color: #92400e; }
.badge.purple, .badge.Completed { background: #ede9fe; color: #5b21b6; }
.badge.sev-HIGH   { background: #fee2e2; color: #991b1b; }
.badge.sev-MEDIUM { background: #fef3c7; color: #92400e; }
.badge.sev-LOW    { background: #e0e7ff; color: #3730a3; }

/* ── Progress bar (completion) ────────────────────────────────── */
.progress { display: flex; align-items: center; gap: 9px; }
.progress .track { width: 90px; height: 6px; border-radius: 4px; background: var(--gray-100); overflow: hidden; }
.progress .fill { height: 100%; border-radius: 4px; background: var(--green-600); }
.progress .pct { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-sub); width: 34px; }

/* ── Detail cards ─────────────────────────────────────────────── */
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.detail-header h1 { font-size: 25px; font-weight: 600; letter-spacing: -.5px; }
.detail-header .meta { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.detail-header .meta .sep { margin: 0 7px; opacity: .5; }

.mini-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin-bottom: 18px; }
.mini-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px; padding: 15px 16px; }
.mini-card .l { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.mini-card .v { font-size: 25px; font-weight: 600; letter-spacing: -.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 9px 14px; font-size: 13px; }
.kv dt { color: var(--text-muted); }
.kv dd { color: var(--text); font-weight: 500; }

.info-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 12px; }
.info-card { background: var(--gray-25); border: 1px solid var(--gray-100); border-radius: 12px; padding: 14px 16px; }
.info-card .name { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.info-card .sub { font-size: 12px; color: var(--text-muted); }

/* ── States ───────────────────────────────────────────────────── */
.loading, .empty, .err { text-align: center; padding: 44px 0; color: var(--text-muted); font-size: 13.5px; }
.err { color: var(--red-500); }
.skeleton { background: linear-gradient(90deg,var(--gray-100) 25%,#e9edf3 50%,var(--gray-100) 75%); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 8px; }
@keyframes sk { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.sk-kpi { height: 108px; }
.sk-panel { height: 260px; }

.stub {
  text-align: center; padding: 70px 20px; color: var(--text-muted);
  background: var(--white); border: 1px dashed var(--gray-200); border-radius: var(--radius);
}
.stub .big { font-size: 17px; font-weight: 600; color: var(--text-sub); margin-bottom: 8px; }
.stub .why { max-width: 460px; margin: 0 auto; font-size: 13px; line-height: 1.5; }

.note { font-size: 12px; color: var(--text-muted); margin-top: 12px; line-height: 1.5; }

/* ── Prototype banner ─────────────────────────────────────────── */
.proto-banner {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--gray-100); border: 1px solid var(--gray-200); color: var(--text-sub);
  border-radius: 12px; padding: 12px 15px; margin-bottom: 18px; font-size: 12.5px; line-height: 1.5;
}
.proto-banner strong { color: var(--text); }
.proto-banner svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; color: var(--text-muted); }
.proto-banner code { background: rgba(58,58,58,.10); padding: 1px 5px; border-radius: 5px; font-size: 11.5px; }

/* ── Settings ─────────────────────────────────────────────────── */
.setting-list { display: flex; flex-direction: column; }
.setting-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  padding: 14px 0; border-bottom: 1px solid var(--gray-100);
}
.setting-row:last-child { border-bottom: none; }
.setting-main { flex: 1; min-width: 0; }
.setting-label { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.setting-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.setting-value {
  font-size: 13px; color: var(--text); font-weight: 500; text-align: right;
  max-width: 46%; word-break: break-word; flex-shrink: 0;
}
@media (max-width: 720px) {
  .setting-row { flex-direction: column; gap: 6px; }
  .setting-value { text-align: left; max-width: 100%; }
}

@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .brand .name, .brand .sub, .nav-group-label, .nav-item span:not(.tag), .employee .who { display: none; }
  .nav-item { justify-content: center; }
  .main { margin-left: 64px; }
  .content { padding: 22px 18px 48px; }
}

/* ── Reshaped: avatars, rating, requirements, timeline ────────────── */
.avatar-sm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; margin-right: 6px;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 600;
  vertical-align: middle;
}
.rating { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.rating svg { width: 13px; height: 13px; color: var(--orange-500); }

.sub-head { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.req-list { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-sub); line-height: 1.9; }
.req-list li { padding-left: 2px; }

.timeline { display: flex; flex-direction: column; }
.tl-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--gray-100); }
.tl-row:last-child { border-bottom: none; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gray-200); flex-shrink: 0; }
.tl-row.done .tl-dot { background: var(--green-600); }
.tl-main { flex: 1; }
.tl-name { font-size: 13.5px; font-weight: 500; }
.tl-date { font-size: 12px; color: var(--text-muted); }

/* ── Login ────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 340px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 32px 28px; }
.login-logo { width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--accent); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.login-logo svg { width: 20px; height: 20px; }
.login-card h1 { font-size: 20px; font-weight: 600; letter-spacing: -.3px; }
.login-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; margin-bottom: 20px; }
.login-err { background: #fdecea; color: var(--red-500); font-size: 12.5px; padding: 9px 11px; border-radius: 8px; margin-bottom: 16px; }
.login-card label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-sub); margin-bottom: 14px; }
.login-card input { display: block; width: 100%; margin-top: 6px; padding: 9px 11px; font-size: 14px; border: 1px solid var(--gray-200); border-radius: 8px; background: var(--gray-25); color: var(--text); }
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card .btn.primary { width: 100%; justify-content: center; margin-top: 4px; background: var(--accent); color: #fff; border-color: var(--accent); }
.login-card .btn.primary:hover { opacity: .9; }
.login-card .btn.primary:disabled { opacity: .6; cursor: default; }
