:root { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
       background: #0b0e14; color: #e6e9ef; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
h1 { font-size: 20px; margin: 0 0 2px; }
.sub { color: #8b93a7; font-size: 12px; }
.controls { display: flex; align-items: center; gap: 10px; }
.seg { display: inline-flex; border: 1px solid #2c3550; border-radius: 8px; overflow: hidden; }
.seg button { background: #141925; color: #b9c0d0; border: 0; border-right: 1px solid #2c3550;
              padding: 6px 12px; cursor: pointer; font-size: 12px; }
.seg button:last-child { border-right: 0; }
.seg button.active { background: #2b53b0; color: #fff; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 22px 0; }
.tcard { background: #141925; border: 1px solid #232a3b; border-radius: 12px; padding: 18px 20px; }
.tcard .k { color: #8b93a7; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.tcard .v { font-size: 28px; font-weight: 650; margin-top: 6px; }
.tcard.proj .v { color: #f0b429; }
.tcard.last .v { color: #8ea2ff; }
.lm { color: #8ea2ff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card { background: #141925; border: 1px solid #232a3b; border-radius: 12px; padding: 14px 16px;
        cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.card:hover { border-color: #344062; }
.card.sel { border-color: #4285f4; box-shadow: 0 0 0 1px #4285f4; }
.card.dim { opacity: .5; }
.card .name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.pname { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ico { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid; flex: none;
       object-fit: contain; background: #fff; padding: 1px; }
.ext, .cardbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; padding: 0; margin-right: -6px;
  color: #8b93a7; font-size: 19px; line-height: 1; text-decoration: none;
  background: none; border: 0; cursor: pointer; flex: none;
}
.ext { margin-left: auto; }
.ext:hover, .cardbtn:hover { color: #e6e9ef; background: #232a3b; }
.cardbtn:disabled { opacity: .5; cursor: default; background: none; }
.foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.foot-info { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.row { display: flex; justify-content: space-between; margin-top: 8px; }
.row .lab { color: #8b93a7; }
.muted { color: #8b93a7; font-size: 12px; margin-top: 8px; }
.card .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 10px; padding: 1px 6px; border-radius: 6px; background: #2a2140; color: #c9a3ff;
         white-space: nowrap; flex: none; }
.badge.err { background: #3a1d1d; color: #ff9b9b; }
.badge.ok { background: #15301f; color: #74e0a3; }
canvas { margin-top: 8px; }
section { margin-top: 26px; }
.head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; }
button.btn { background: #1d2433; color: #e6e9ef; border: 1px solid #2c3550; border-radius: 8px;
             padding: 5px 11px; cursor: pointer; font-size: 12px; }
button.btn:hover { background: #252e42; }
.err-line { color: #ff9b9b; }
#login { position: fixed; inset: 0; background: rgba(11,14,20,.94); display: none;
         align-items: center; justify-content: center; z-index: 100; }
#login form { background: #141925; border: 1px solid #232a3b; border-radius: 14px; padding: 26px; width: 320px; }
#login h2 { margin: 0 0 6px; font-size: 18px; }
#login p { color: #8b93a7; margin: 0 0 16px; font-size: 13px; }
#login input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #2c3550;
               background: #0f131c; color: #e6e9ef; font-size: 14px; margin-bottom: 12px; }
#login button { width: 100%; padding: 9px; }
#login-err { display: none; margin-top: 10px; font-size: 12px; }
