:root{
  --bg:#eef1f5;
  --panel:#ffffff;
  --ink:#172033;
  --muted:#657086;
  --line:#d9dee8;
  --blue:#1d5fff;
  --orange:#ff7a1a;
  --red:#c8142f;
  --dark:#151b24;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:Segoe UI,Arial,sans-serif;
  background:var(--bg);
  color:var(--ink);
}
.shell{
  display:grid;
  grid-template-columns:260px 1fr;
  min-height:calc(100vh - 42px);
}
.sidebar{
  background:#f8f9fb;
  border-right:1px solid var(--line);
  padding:18px;
}
.brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding-bottom:20px;
  border-bottom:1px solid var(--line);
}
.brand span{display:block;color:var(--muted);font-size:12px;margin-top:2px}
.mark{
  width:36px;height:36px;border-radius:8px;
  background:linear-gradient(135deg,var(--red),var(--orange),var(--blue));
}
nav{margin-top:18px;display:grid;gap:4px}
nav a{
  padding:11px 12px;
  border-radius:6px;
  color:#263246;
  text-decoration:none;
  font-size:14px;
}
nav a.active,nav a:hover{
  background:#e9eef8;
  color:#0b4cd6;
}
main{padding:24px 28px 70px}
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  margin-bottom:22px;
}
h1,h2,h3,p{margin:0}
h1{font-size:26px}
.topbar p,.hero p,.module p{color:var(--muted)}
.status-pill{
  background:#e9fff1;
  color:#147a3b;
  border:1px solid #b8ebca;
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}
.hero{
  display:grid;
  grid-template-columns:1fr 340px;
  gap:22px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:10px;
  padding:26px;
  box-shadow:0 8px 24px rgba(10,20,40,.06);
}
.hero h2{font-size:32px;margin-bottom:12px}
.actions{display:flex;gap:10px;margin-top:22px}
.btn{
  display:inline-block;
  border:1px solid var(--line);
  background:#fff;
  padding:10px 14px;
  border-radius:6px;
  text-decoration:none;
  color:var(--ink);
  font-weight:600;
}
.btn.primary{background:var(--blue);color:#fff;border-color:var(--blue)}
.server-card{
  background:#f7f8fb;
  border:1px solid var(--line);
  border-radius:10px;
  padding:18px;
}
.server-card strong{display:block;margin-top:14px}
.server-card span{display:block;color:var(--muted);font-size:13px;margin-top:5px}
.server-render{
  height:150px;
  background:linear-gradient(180deg,#2c3442,#10151e);
  border-radius:12px;
  padding:22px;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  position:relative;
}
.bay{
  background:linear-gradient(180deg,#505b6d,#222a36);
  border:1px solid #6d7788;
  border-radius:6px;
}
.led{
  position:absolute;
  width:9px;height:9px;border-radius:50%;
  right:18px;bottom:18px;
  background:#42ff86;
  box-shadow:0 0 12px #42ff86;
}
.grid{
  margin-top:22px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:16px;
}
.module{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:9px;
  padding:16px;
  display:grid;
  grid-template-columns:46px 1fr auto;
  align-items:center;
  gap:13px;
}
.module-icon{
  width:42px;height:42px;border-radius:8px;
  display:grid;place-items:center;
  background:#eaf0ff;
  color:#0b4cd6;
  font-weight:800;
}
.badge{
  font-size:11px;
  border:1px solid var(--line);
  padding:5px 8px;
  border-radius:999px;
  color:#344056;
}
.taskbar{
  position:fixed;
  left:0;right:0;bottom:0;
  height:42px;
  background:#101722;
  color:#dfe7f5;
  display:flex;
  align-items:center;
  gap:18px;
  padding:0 14px;
  font-size:13px;
}
.taskbar .clock{margin-left:auto;color:#9eabc0}
@media(max-width:850px){
  .shell{grid-template-columns:1fr}
  .sidebar{display:none}
  .hero{grid-template-columns:1fr}
}

/* ==============================
   SiloArray Theme System
   ============================== */

.theme-toggle{
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--ink);
  border-radius:6px;
  padding:9px 12px;
  font-weight:700;
  cursor:pointer;
}

body.dark{
  --bg:#0f141c;
  --panel:#171e29;
  --ink:#eef3ff;
  --muted:#9aa7bd;
  --line:#293445;
  --dark:#080b10;
}

body.dark .sidebar{
  background:#111720;
}

body.dark nav a{
  color:#c7d1e3;
}

body.dark nav a.active,
body.dark nav a:hover{
  background:#1f2b3d;
  color:#78a6ff;
}

body.dark .hero,
body.dark .module,
body.dark .server-card{
  background:#171e29;
  border-color:#293445;
  box-shadow:0 10px 30px rgba(0,0,0,.35);
}

body.dark .server-card{
  background:#121923;
}

body.dark .btn{
  background:#121923;
  color:#eef3ff;
  border-color:#334156;
}

body.dark .btn.primary{
  background:#1d5fff;
  color:white;
}

body.dark .module-icon{
  background:#1f2b3d;
  color:#8fb4ff;
}

body.dark .badge{
  border-color:#334156;
  color:#c7d1e3;
}

body.dark .status-pill{
  background:#12351f;
  color:#87ffae;
  border-color:#2b7a45;
}

/* First-class shell refinements */
.shell-theme-switch{
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--line);
  background:var(--panel);
  padding:5px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}

.shell-theme-switch input{display:none}

.shell-theme-switch label{
  padding:6px 10px;
  border-radius:999px;
  cursor:pointer;
  color:var(--muted);
}

body:not(.dark) .shell-theme-switch label[for="themeLight"],
body.dark .shell-theme-switch label[for="themeDark"]{
  background:var(--blue);
  color:#fff;
}

.module-icon img,
.nav-icon{
  width:24px;
  height:24px;
  display:block;
}

.module-icon{
  color:#1d5fff;
}

body.dark .module-icon{
  color:#8fb4ff;
}

.server-product-image{
  width:100%;
  max-width:360px;
  display:block;
  margin:0 auto 12px;
}

.module{
  grid-template-columns:50px 1fr auto;
}

.module h3{
  font-size:15px;
}

.module p{
  font-size:13px;
}

.theme-toggle{
  display:none !important;
}

.brand-logo{
  width:38px;
  height:38px;
  object-fit:contain;
  border-radius:8px;
}

.wide-card{
  min-height:88px;
}

.sidebar nav a[href]{
  cursor:pointer;
}

.brand-logo{
  background:transparent;
}

.notice{
  background:#e9fff1;
  color:#147a3b;
  border:1px solid #b8ebca;
  padding:12px 14px;
  border-radius:8px;
  margin-bottom:16px;
  font-weight:700;
}

.upload-form{
  margin-top:18px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.upload-form input[type=file]{
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--ink);
  border-radius:6px;
  padding:10px;
}

.image-admin-card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:10px;
  padding:14px;
  display:grid;
  gap:10px;
}

.image-admin-card img{
  width:100%;
  height:180px;
  object-fit:contain;
  background:#f4f6fa;
  border:1px solid var(--line);
  border-radius:8px;
}

body.dark .image-admin-card img{
  background:#101722;
}

.public-product-shell .image-admin-card form,
.public-product-shell a[href*="product-images"]{
  display:none !important;
}

.product-card-clean span{
  word-break:normal;
}

.product-hero{
  align-items:center;
}

.product-catalog-grid{
  grid-template-columns:repeat(auto-fit,minmax(310px,1fr));
}

.catalog-card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 8px 24px rgba(10,20,40,.06);
}

.catalog-image{
  height:210px;
  background:#f5f7fb;
  display:grid;
  place-items:center;
  border-bottom:1px solid var(--line);
}

.catalog-image img{
  width:88%;
  height:180px;
  object-fit:contain;
}

.catalog-body{
  padding:18px;
  display:grid;
  gap:10px;
}

.catalog-body h2{
  font-size:22px;
}

.catalog-body p{
  color:var(--muted);
}

.catalog-topline{
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.04em;
}

.catalog-topline b{
  color:#147a3b;
}

.module-tags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:6px 0;
}

.module-tags span{
  border:1px solid var(--line);
  background:#f7f9fc;
  padding:5px 8px;
  border-radius:999px;
  font-size:12px;
  color:var(--muted);
}

.product-spec-row{
  margin-top:18px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#f7f9fc;
  display:grid;
  gap:4px;
}

.admin-form{
  display:grid;
  gap:10px;
  max-width:760px;
}

.admin-form label{
  display:grid;
  gap:5px;
  font-size:13px;
  font-weight:700;
  color:var(--muted);
}

.admin-form input,
.admin-form textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:6px;
  padding:10px;
  background:var(--panel);
  color:var(--ink);
  font:inherit;
}

.product-admin-row .module-icon img{
  width:34px;
  height:34px;
  object-fit:contain;
}

body.dark .catalog-image,
body.dark .module-tags span,
body.dark .product-spec-row{
  background:#101722;
}

.spec-table{
  margin-top:18px;
  border:1px solid var(--line);
  border-radius:10px;
  overflow:hidden;
  background:var(--panel);
}

.spec-table div{
  display:grid;
  grid-template-columns:190px 1fr;
  gap:12px;
  padding:11px 13px;
  border-bottom:1px solid var(--line);
}

.spec-table div:last-child{
  border-bottom:none;
}

.spec-table strong{
  color:var(--ink);
  font-size:13px;
}

.spec-table span{
  color:var(--muted);
  font-size:13px;
}

body.dark .spec-table{
  background:#121923;
}

.product-detail-layout{
  display:grid;
  grid-template-columns:minmax(340px, 1.1fr) minmax(320px, .9fr);
  gap:22px;
  align-items:stretch;
}

.product-visual-panel,
.product-info-panel,
.detail-section{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  padding:20px;
  box-shadow:0 8px 24px rgba(10,20,40,.06);
}

.product-main-image{
  height:430px;
  display:grid;
  place-items:center;
  background:#f7f9fc;
  border:1px solid var(--line);
  border-radius:10px;
}

.product-main-image img{
  max-width:94%;
  max-height:390px;
  object-fit:contain;
}

.product-gallery-strip{
  display:flex;
  gap:10px;
  margin-top:12px;
  overflow:auto;
}

.product-gallery-strip button{
  width:92px;
  height:72px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  cursor:pointer;
  padding:5px;
}

.product-gallery-strip img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.product-info-panel{
  display:grid;
  align-content:start;
  gap:14px;
}

.product-info-panel h2{
  font-size:30px;
}

.product-info-panel p{
  color:var(--muted);
  font-size:15px;
  line-height:1.55;
}

.detail-section{
  margin-top:22px;
}

.detail-section h2{
  margin-bottom:14px;
}

.related-grid .catalog-card{
  min-height:430px;
}

.related-grid .catalog-image{
  height:180px;
}

.related-card .catalog-body h2{
  font-size:18px;
}

body.dark .product-visual-panel,
body.dark .product-info-panel,
body.dark .detail-section{
  background:#171e29;
}

body.dark .product-main-image,
body.dark .product-gallery-strip button{
  background:#101722;
}

@media(max-width:950px){
  .product-detail-layout{
    grid-template-columns:1fr;
  }
}

/* Product detail image restraint */
.product-detail-layout{
  grid-template-columns:420px 1fr !important;
}

.product-main-image{
  height:300px !important;
}

.product-main-image img{
  max-width:92% !important;
  max-height:250px !important;
}

.product-visual-panel{
  padding:14px !important;
}

.product-info-panel h2{
  font-size:24px !important;
}

.related-grid .catalog-card{
  min-height:360px !important;
}

@media(max-width:950px){
  .product-detail-layout{
    grid-template-columns:1fr !important;
  }
}

.platform-engine-card{
  grid-template-columns:50px 1fr auto;
  align-items:start;
  min-height:150px;
}

.platform-engine-card p{
  line-height:1.45;
  margin-top:4px;
}

.deployment-card{
  min-height:420px !important;
}

.compact-spec{
  margin-top:10px;
}

.compact-spec div{
  grid-template-columns:92px 1fr;
  padding:9px 10px;
}

.module-actions{
  display:grid;
  gap:8px;
  justify-items:end;
}

.module-action-form{
  display:flex;
  gap:6px;
}

.module-action-form .btn{
  padding:7px 9px;
  font-size:12px;
}

.node-card{
  min-height:230px;
}

.node-card .spec-table{
  margin-top:10px;
}

.node-card .spec-table div{
  grid-template-columns:90px 1fr;
}

.admin-form select{
  width:100%;
  border:1px solid var(--line);
  border-radius:6px;
  padding:10px;
  background:var(--panel);
  color:var(--ink);
  font:inherit;
}

.provision-action-form{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  justify-content:flex-end;
}

.provision-action-form .btn{
  padding:7px 9px;
  font-size:12px;
}

.command-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
  gap:14px;
}

.command-tile{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  padding:18px;
  text-decoration:none;
  color:var(--ink);
  box-shadow:0 8px 24px rgba(10,20,40,.06);
}

.command-tile span{
  display:block;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}

.command-tile strong{
  display:block;
  font-size:34px;
  margin-top:8px;
}

body.dark .command-tile{
  background:#171e29;
}
