:root{
  --bg-deep:#0A0E1A;
  --bg-panel:#11162A;
  --orange:#F4732A;
  --orange-light:#FF9A5C;
  --glass:rgba(255,255,255,0.055);
  --glass-strong:rgba(255,255,255,0.09);
  --border:rgba(255,255,255,0.09);
  --text:#F4F6FB;
  --text-muted:#9AA3BE;
  --teal:#28D9B8;
  --danger:#FF6161;
}
*{box-sizing:border-box;}
html,body{
  margin:0; background:var(--bg-deep);
  font-family:-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--text);
}
a{ text-decoration:none; color:inherit; }

.bg-glow{position:fixed; border-radius:50%; filter:blur(90px); z-index:0; pointer-events:none;}
.bg-glow-a{width:520px; height:520px; top:-160px; left:-120px; background:radial-gradient(circle, rgba(244,115,42,0.35), transparent 70%);}
.bg-glow-b{width:460px; height:460px; bottom:-140px; right:-100px; background:radial-gradient(circle, rgba(40,217,184,0.16), transparent 70%);}

.shell{ display:flex; min-height:100vh; position:relative; z-index:1;}

.sidebar{
  width:250px; flex-shrink:0;
  background:linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  backdrop-filter: blur(18px);
  border-right:1px solid var(--border);
  display:flex; flex-direction:column; padding:22px 16px; gap:22px;
  position:sticky; top:0; height:100vh;
}
.brand{display:flex; align-items:center; gap:10px; padding:0 4px;}
.brand-mark{
  width:36px; height:36px; border-radius:11px; display:flex; align-items:center; justify-content:center;
  font-weight:800; color:#fff; background:linear-gradient(135deg, var(--orange), var(--orange-light));
  box-shadow:0 6px 18px rgba(244,115,42,0.35); font-size:16px;
}
.brand-mark.big{ width:56px; height:56px; font-size:24px; margin:0 auto 14px; border-radius:16px;}
.brand-name{color:var(--text); font-weight:700; font-size:15px; letter-spacing:0.2px;}
.brand-sub{color:var(--text-muted); font-size:11px; margin-top:1px;}

.nav{display:flex; flex-direction:column; gap:4px; flex:1;}
.nav-item{
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px;
  background:transparent; border:1px solid transparent; color:var(--text-muted);
  font-size:13.5px; cursor:pointer; text-align:left; transition:all .15s ease;
}
.nav-item:hover{ background:var(--glass); color:var(--text); }
.nav-item.active{
  background:linear-gradient(135deg, rgba(244,115,42,0.22), rgba(244,115,42,0.06));
  border-color:rgba(244,115,42,0.35); color:#fff;
}
.sidebar-foot{ border-top:1px solid var(--border); padding-top:14px; display:flex; flex-direction:column; gap:10px;}
.user-chip{display:flex; align-items:center; gap:9px;}
.avatar{ width:32px; height:32px; border-radius:50%; background:var(--glass-strong); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; border:1px solid var(--border);}
.user-name{ color:var(--text); font-size:12.5px; font-weight:600;}
.user-role{ color:var(--text-muted); font-size:11px;}
.logout{ justify-content:center; text-align:center; }

.main{ flex:1; padding:32px 40px; min-height:100vh; overflow-y:auto;}
.page{ max-width:1200px; margin:0 auto; display:flex; flex-direction:column; gap:20px;}
.page-header{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap;}
.page-header h1{ color:var(--text); font-size:24px; margin:0 0 4px; letter-spacing:-0.3px;}
.page-header p{ color:var(--text-muted); font-size:13.5px; margin:0;}

.glass-card{
  background:var(--glass); border:1px solid var(--border); border-radius:16px; padding:20px;
  backdrop-filter: blur(16px); box-shadow:0 8px 30px rgba(0,0,0,0.25);
}
.card-title{ color:var(--text); font-weight:600; font-size:14px; margin-bottom:14px;}

.stat-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(190px,1fr)); gap:14px;}
.stat-card{ display:flex; align-items:center; gap:12px; padding:16px;}
.stat-icon{ width:38px; height:38px; border-radius:11px; background:linear-gradient(135deg, rgba(244,115,42,0.25), rgba(244,115,42,0.08)); color:var(--orange-light); display:flex; align-items:center; justify-content:center; flex-shrink:0; font-weight:700;}
.stat-value{ color:var(--text); font-size:19px; font-weight:700;}
.stat-label{ color:var(--text-muted); font-size:11.5px; margin-top:1px;}

.search-bar{
  display:flex; align-items:center; gap:8px; padding:10px 14px; border-radius:11px;
  background:var(--glass); border:1px solid var(--border); color:var(--text-muted); max-width:460px;
}
.search-bar input{ background:transparent; border:none; outline:none; color:var(--text); font-size:13.5px; width:100%;}
.search-bar input::placeholder{ color:var(--text-muted);}

.table{ width:100%; border-collapse:collapse; font-size:13px;}
.table th{ text-align:left; color:var(--text-muted); font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:0.05em; padding:10px 12px; border-bottom:1px solid var(--border);}
.table td{ padding:12px; color:var(--text); border-bottom:1px solid rgba(255,255,255,0.05); vertical-align:middle;}
.table tr:last-child td{ border-bottom:none;}
.table tr:hover td{ background:rgba(255,255,255,0.02);}
.cell-strong{ font-weight:600; }
.table-scroll{ overflow-x:auto; }

.badge{ display:inline-block; padding:4px 10px; border-radius:20px; background:rgba(244,115,42,0.14); color:var(--orange-light); font-size:11.5px; font-weight:600; border:1px solid rgba(244,115,42,0.25);}
.badge.subtle{ background:rgba(40,217,184,0.12); color:var(--teal); border-color:rgba(40,217,184,0.25);}

.row-actions{ display:flex; gap:6px; justify-content:flex-end;}
.icon-btn{
  width:auto; height:30px; padding:0 10px; border-radius:8px; border:1px solid var(--border); background:var(--glass);
  color:var(--text-muted); display:inline-flex; align-items:center; justify-content:center; cursor:pointer;
  transition:all .15s; font-size:12px;
}
.icon-btn:hover{ color:#fff; background:var(--glass-strong);}
.icon-btn.danger:hover{ color:var(--danger); border-color:rgba(255,97,97,0.4);}

.btn-primary{
  display:inline-flex; align-items:center; gap:7px; padding:10px 16px; border-radius:10px; border:none;
  background:linear-gradient(135deg, var(--orange), var(--orange-light)); color:#fff; font-weight:600; font-size:13.5px;
  cursor:pointer; box-shadow:0 6px 16px rgba(244,115,42,0.3); transition:transform .12s ease;
}
.btn-primary:hover{ transform:translateY(-1px); }
.btn-primary.full{ width:100%; justify-content:center; margin-top:6px;}
.btn-ghost{
  display:inline-flex; align-items:center; gap:6px; padding:9px 14px; border-radius:10px;
  background:var(--glass); border:1px solid var(--border); color:var(--text); font-size:13px; cursor:pointer;
}
.btn-ghost:hover{ background:var(--glass-strong); }

.notice{ padding:12px 16px; border-radius:10px; background:rgba(244,115,42,0.1); border:1px solid rgba(244,115,42,0.25); color:var(--orange-light); font-size:13px;}
.notice.error{ background:rgba(255,97,97,0.1); border-color:rgba(255,97,97,0.3); color:var(--danger);}

.hardware-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(200px,1fr)); gap:16px;}
.hardware-card{
  background:rgba(255,255,255,0.03); border:1px solid var(--border); border-radius:14px; overflow:hidden;
  display:flex; flex-direction:column; transition:transform .15s ease, border-color .15s ease;
}
.hardware-card:hover{ transform:translateY(-2px); border-color:rgba(244,115,42,0.3); }
.hardware-thumb{
  width:100%; aspect-ratio:4/3; background:rgba(255,255,255,0.04);
  display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.hardware-thumb img{ width:100%; height:100%; object-fit:contain; padding:10px; }
.hardware-thumb-fallback{ color:var(--text-muted); font-size:12px; }
.hardware-card-body{ padding:14px 14px 4px; display:flex; flex-direction:column; gap:6px;}
.hardware-card-actions{ padding:12px 14px 14px; justify-content:flex-start; }

.image-preview{
  border:1px solid var(--border); border-radius:12px; overflow:hidden; background:rgba(255,255,255,0.03);
  display:flex; align-items:center; justify-content:center; max-height:180px;
}
.image-preview img{ width:100%; max-height:180px; object-fit:contain; }
.notice.success{ background:rgba(40,217,184,0.1); border-color:rgba(40,217,184,0.3); color:var(--teal);}
.empty-state{ text-align:center; padding:36px 0; color:var(--text-muted); font-size:13.5px;}

.modal-backdrop{ position:fixed; inset:0; background:rgba(4,6,14,0.6); backdrop-filter:blur(4px); display:flex; align-items:center; justify-content:center; z-index:50; padding:20px;}
.modal-card{ width:100%; max-width:460px; background:var(--bg-panel); border:1px solid var(--border); border-radius:18px; padding:22px; box-shadow:0 20px 60px rgba(0,0,0,0.5); max-height:88vh; overflow-y:auto;}
.modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px;}
.modal-head h3{ color:var(--text); margin:0; font-size:16px;}

.form-grid{ display:flex; flex-direction:column; gap:14px;}
.field{ display:flex; flex-direction:column; gap:6px;}
.field span{ display:flex; align-items:center; gap:6px; color:var(--text-muted); font-size:12px; font-weight:600;}
.field input, .field select{
  background:rgba(255,255,255,0.04); border:1px solid var(--border); border-radius:9px; padding:10px 12px;
  color:var(--text); font-size:13.5px; outline:none; width:100%; font-family:inherit;
}
.field input:focus, .field select:focus{ border-color:rgba(244,115,42,0.5); }
.field input:disabled{ opacity:0.6; }
.field select option{ background:#161c33; color:#fff; }
.form-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:6px;}

.login-shell{ min-height:100vh; display:flex; align-items:center; justify-content:center; position:relative; z-index:1;}
.login-card{
  width:100%; max-width:380px; background:var(--glass); border:1px solid var(--border); border-radius:20px;
  padding:32px 30px; backdrop-filter: blur(20px); box-shadow:0 20px 60px rgba(0,0,0,0.4); text-align:center;
}
.login-title{ color:var(--text); font-size:20px; margin:0 0 2px;}
.login-sub{ color:var(--text-muted); font-size:12.5px; margin:0 0 20px;}
.tab-row{ display:flex; background:rgba(255,255,255,0.04); border-radius:10px; padding:4px; margin-bottom:18px;}
.tab{ flex:1; padding:8px; border:none; background:transparent; color:var(--text-muted); border-radius:8px; font-size:12.5px; font-weight:600; cursor:pointer; text-align:center;}
.tab.active{ background:linear-gradient(135deg, var(--orange), var(--orange-light)); color:#fff;}
.login-card .field{ text-align:left; margin-bottom:12px;}
.login-note{ color:var(--text-muted); font-size:11px; margin-top:14px; line-height:1.5;}

@media (max-width:800px){
  .shell{ flex-direction:column; }
  .sidebar{ width:100%; height:auto; position:relative; }
  .main{ padding:20px; }
}
