/* Partex GPU Command Center — dark ops theme
   Palette grounded in the Partex mark: deep navy surfaces, the brand's
   node-orange as the single active accent, teal reserved for "healthy/idle". */
@property --p{syntax:'<number>';inherits:false;initial-value:0}

:root{
  --bg:#0a0e18;
  --surface:#111827;
  --surface-2:#161f33;
  --border:#22304a;
  --border-soft:#1a2438;
  --text:#e9edf6;
  --muted:#8993ab;
  --muted-2:#5f6a85;
  --orange:#ff7a45;
  --orange-dim:#ff7a4522;
  --teal:#2dd4a7;
  --red:#f2555f;
  --track:#1c2740;
  --radius:14px;
}

*{box-sizing:border-box}
body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text);font-variant-numeric:tabular-nums;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}

/* ---- nav ---- */
.nav{height:64px;background:#0d1420;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 28px;border-bottom:1px solid var(--border-soft)}
.brand{display:flex;align-items:center;gap:14px}
.logo-badge{display:inline-flex;align-items:center;background:#fff;border-radius:8px;padding:6px 10px;box-shadow:0 1px 3px rgba(0,0,0,.35);transition:transform .25s ease,box-shadow .25s ease}
.logo-badge:hover{transform:translateY(-1px) scale(1.02);box-shadow:0 4px 10px rgba(0,0,0,.4)}
.logo-badge img{display:block;height:20px;width:auto}
.brand-divider{width:1px;height:22px;background:var(--border)}
.brand-text{font-weight:700;font-size:17px;letter-spacing:-.2px;color:#dfe5f2}
.links{display:flex;gap:22px;font-size:13.5px}
.links a{color:var(--muted);transition:color .15s ease}
.links a:hover{color:#fff}
.container{max-width:1400px;margin:0 auto;padding:30px 28px 60px}

/* ---- headings ---- */
h1{font-size:28px;margin:0 0 6px;letter-spacing:-.5px;font-weight:700;color:#f2f5fb}
h2{font-size:18px;margin:36px 0 14px;font-weight:700;color:#dbe1ee}
h3{margin:0;font-size:16px;font-weight:700;color:#f2f5fb}
.muted,.hint{color:var(--muted)}
.page-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px}

/* ---- status strip ---- */
.status-strip{display:flex;align-items:center;gap:10px;background:var(--surface);border:1px solid var(--border-soft);border-radius:10px;padding:11px 16px;margin-bottom:22px;font-size:13.5px;color:var(--muted)}
.status-strip strong{color:var(--text);font-weight:700}
.status-strip .sep{color:var(--muted-2)}

/* ---- buttons ---- */
.btn{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border);border-radius:8px;padding:10px 15px;background:var(--surface-2);color:#e6ebf5;font-weight:600;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease,background .15s ease,border-color .15s ease}
.btn:hover{background:#1b2740;border-color:#2c3c5c}
.btn:active{transform:scale(.97)}
.btn.primary{background:var(--orange);border-color:var(--orange);color:#1a0e08}
.btn.primary:hover{background:#ff8a5c;box-shadow:0 4px 18px rgba(255,122,69,.35)}
.small-btn{padding:6px 10px;font-size:12px}

/* ---- node icon (brand motif: three linked nodes) ---- */
.node-icon{width:20px;height:20px;flex:none}
.node-icon circle{fill:currentColor}
.node-icon line{stroke:currentColor;stroke-width:1.4;opacity:.55}

/* ---- stat cards ---- */
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.stat,.card,.panel{background:var(--surface);border:1px solid var(--border-soft);border-radius:var(--radius);box-shadow:0 8px 24px rgba(0,0,0,.25)}
.stat{padding:18px 20px;display:flex;align-items:center;gap:16px}
.stat-ring{width:56px;height:56px;border-radius:50%;flex:none;--p:0;background:conic-gradient(var(--ring-c,var(--teal)) calc(var(--p)*1%),var(--track) 0);display:grid;place-items:center;transition:--p 1.1s cubic-bezier(.22,.9,.3,1);position:relative}
.stat-ring::before{content:'';position:absolute;inset:6px;border-radius:50%;background:var(--surface)}
.stat-ring-inner{position:relative;z-index:1;color:var(--text)}
.stat-ring-inner b{font-size:14px;font-weight:700}
.stat-icon{width:56px;height:56px;border-radius:50%;background:var(--surface-2);border:1px solid var(--border);display:grid;place-items:center;color:var(--orange);flex:none}
.stat-icon.live{border-color:var(--orange);animation:ringPulse 2.4s infinite}
@keyframes ringPulse{0%{box-shadow:0 0 0 0 rgba(255,122,69,.35)}70%{box-shadow:0 0 0 9px rgba(255,122,69,0)}100%{box-shadow:0 0 0 0 rgba(255,122,69,0)}}
.stat-body{display:flex;flex-direction:column;gap:2px;min-width:0}
.stat-body span{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:12.5px}
.stat-body strong{font-size:26px;font-weight:700;color:#f5f7fc;transition:color .25s ease}
.stat-body small{color:var(--muted-2);font-size:11.5px}
.live-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--teal);animation:pulseDot 2s infinite}
.stat-icon .live-dot{width:14px;height:14px;background:var(--orange);animation:pulseDotWarn 2s infinite}
.live-dot.warn{background:var(--orange)}
.live-dot.crit{background:var(--red)}

/* ---- GPU capacity cards ---- */
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.card{padding:20px;display:flex;gap:18px;align-items:center;transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}
.card:hover{transform:translateY(-2px);box-shadow:0 14px 30px rgba(0,0,0,.32);border-color:#2a3a5a}
.gauge{--p:0;width:88px;height:88px;border-radius:50%;flex:none;position:relative;background:conic-gradient(var(--ring-c,var(--orange)) calc(var(--p)*1%),var(--track) 0);transition:--p 1.2s cubic-bezier(.22,.9,.3,1)}
.gauge::before{content:'';position:absolute;inset:9px;border-radius:50%;background:var(--surface)}
.gauge-label{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:1}
.gauge-label b{font-size:18px;color:#f5f7fc;line-height:1}
.gauge-label small{color:var(--muted-2);font-size:10px;margin-top:2px}
.card-body{min-width:0;flex:1}
.card-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.rate{font-weight:700;color:var(--orange);font-size:13.5px}
.capacity-number{color:#c7ceda;font-size:13.5px}
.capacity-number b{font-size:18px;color:#f5f7fc}
.capacity-number span,.small{color:var(--muted);font-size:12.5px}
.small{display:block;margin-top:8px}
.node-divider{display:flex;gap:5px;margin:12px 0 2px;opacity:.5}
.node-divider span{width:3px;height:3px;border-radius:50%;background:var(--orange)}

/* ---- tables ---- */
.table-wrap{overflow:auto;background:var(--surface);border:1px solid var(--border-soft);border-radius:var(--radius);box-shadow:0 8px 24px rgba(0,0,0,.25)}
table{width:100%;border-collapse:collapse;min-width:1050px}
th,td{text-align:left;padding:13px 14px;border-bottom:1px solid var(--border-soft);font-size:13px;white-space:nowrap}
th{background:#0d1424;color:var(--muted);font-weight:700;font-size:11.5px;text-transform:uppercase;letter-spacing:.04em}
td{color:#d7dce8}
tbody tr{transition:background .15s ease}
tbody tr:hover{background:#141d31}
tbody tr:last-child td{border-bottom:0}
.empty{text-align:center;color:var(--muted-2);padding:28px}
.row-cost,#live-cost{transition:color .25s ease}
.value-flash{animation:flash .6s ease}
@keyframes flash{0%{color:var(--orange)}100%{color:inherit}}

/* ---- forms ---- */
.form-panel{max-width:900px;padding:26px}
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}
label{display:flex;flex-direction:column;gap:7px;font-size:13px;font-weight:600;color:#b7c0d4}
label.wide{grid-column:1/-1}
input,select{font:inherit;font-weight:400;padding:11px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface-2);color:var(--text)}
input:focus,select:focus{outline:2px solid #ff7a4555;border-color:var(--orange)}
.hint{font-size:13px;margin:18px 0}
.alert{padding:12px 14px;border-radius:8px;margin-bottom:18px;font-size:13.5px}
.error{background:#3a1418;color:#ff9aa3;border:1px solid #5a1f26}

/* ---- login ---- */
.login-wrap{min-height:calc(100vh - 64px);display:flex;align-items:center;justify-content:center}
.login{width:410px;padding:32px}
.login h1{font-size:24px}
.login form{display:grid;gap:17px;margin-top:22px}
.login-logo{display:block;height:28px;width:auto;margin-bottom:20px;filter:brightness(0) invert(1);animation:fadeSlideDown .5s ease both}

/* ---- users ---- */
.two-col{display:grid;grid-template-columns:1fr 1.3fr;gap:18px}
.panel{padding:24px}
.panel form{display:grid;gap:16px}
.panel h2{margin:0 0 20px}
.user-list{border:1px solid var(--border-soft);border-radius:8px}
.user-row{display:flex;justify-content:space-between;padding:13px 14px;border-bottom:1px solid var(--border-soft);color:#d7dce8}
.user-row:last-child{border-bottom:0}
.badge{background:var(--orange-dim);color:var(--orange);padding:4px 8px;border-radius:999px;font-size:11px;font-weight:700;text-transform:uppercase}

/* ---- allocation detail ---- */
.detail-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin-bottom:24px}
.detail-grid div{background:var(--surface-2);border-radius:8px;padding:13px}
.detail-grid span{display:block;color:var(--muted);font-size:11px;text-transform:uppercase;margin-bottom:5px}
.detail-grid b{font-size:14px;color:#f2f5fb}

/* ---- motion ---- */
@keyframes fadeSlideDown{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}
@keyframes pulseDot{0%{box-shadow:0 0 0 0 rgba(45,212,167,.55)}70%{box-shadow:0 0 0 7px rgba(45,212,167,0)}100%{box-shadow:0 0 0 0 rgba(45,212,167,0)}}
.live-dot.warn{animation-name:pulseDotWarn}
@keyframes pulseDotWarn{0%{box-shadow:0 0 0 0 rgba(255,122,69,.55)}70%{box-shadow:0 0 0 7px rgba(255,122,69,0)}100%{box-shadow:0 0 0 0 rgba(255,122,69,0)}}

@media (prefers-reduced-motion: reduce){
  .stat-ring,.gauge{transition:none}
  .live-dot{animation:none}
}

@media(max-width:900px){
  .nav{padding:0 15px}
  .links{gap:10px;font-size:12px}
  .container{padding:25px 15px}
  .stats{grid-template-columns:repeat(2,1fr)}
  .grid,.two-col{grid-template-columns:1fr}
  .form-grid,.detail-grid{grid-template-columns:1fr}
  label.wide{grid-column:auto}
  .page-head{gap:15px;align-items:flex-start}
  .page-head .btn{white-space:nowrap}
  .card{flex-direction:column;align-items:flex-start}
}
