/* ============================================================
   jy-console.css - servicedetail console skin
   Bento card grid, SaaS console language.
   Scoped to .jy-sd2 so nothing outside the server detail page is touched.
   All comments are ASCII on purpose: the bt panel mangles UTF-8 on upload.
   ============================================================ */
.jy-sd2{
  --brand:#635BFF;
  --brand-hover:#7A73FF;
  --brand-soft:#EFEEFF;
  --orange:#FF7A00;
  --orange-soft:#FFF2E5;
  --green:#22C55E;
  --green-soft:#E7F8EE;
  --red:#E5484D;
  --red-soft:#FDECEC;
  --page:#F5F7FB;
  --card:#FFFFFF;
  --sunken:#F4F7FB;
  --line:#E4E8EF;
  --line-soft:#EEF1F6;
  --line-strong:#D5DAE3;
  --t0:#0F172A;
  --t1:#334155;
  --t2:#64748B;
  --t3:#94A3B8;
  --r:12px;
  --r-sm:6px;
  --mono:"SF Mono","JetBrains Mono",Consolas,"Courier New",monospace;
  --shadow:0 1px 2px rgba(15,23,42,.04);
  font-family:"PingFang SC","HarmonyOS Sans SC","Microsoft YaHei",-apple-system,"Segoe UI",Roboto,sans-serif;
  color:var(--t1);
}

/* page ground only on this page ( :has keeps it off every other view ) */
.ewy-container-fluid:has(.jy-sd2){background:#F5F7FB}
.jy-sd2{padding-bottom:8px}

/* ============================================================ HERO
   headpc.tpl .machineInformation + tabpanes .jy-specs are two separate
   elements; they are welded into one card here. */
.jy-sd2 .machineInformation{
  display:flex !important;
  align-items:center;justify-content:space-between;
  gap:14px;flex-wrap:wrap;
  background:var(--card);
  border:1px solid var(--line);
  border-bottom:none;
  border-radius:var(--r) var(--r) 0 0;
  box-shadow:var(--shadow);
  padding:16px 20px;
  margin:0 !important;
  list-style:none;
}
.jy-sd2 .machineInformation .Information-content{
  display:flex !important;align-items:center;gap:10px;min-width:0;
}
.jy-sd2 .machineInformation .return{color:var(--t3);text-decoration:none;font-size:15px}
.jy-sd2 .machineInformation .return:hover{color:var(--brand)}
.jy-sd2 .machineInformation .name{
  font-size:17px;font-weight:600;color:var(--t0);letter-spacing:.2px;
  word-break:break-all;
}
.jy-sd2 .machineInformation .ip{font-family:var(--mono);font-size:12px;color:var(--t2)}

/* status pill injected by headpc.tpl */
.jy-sd2 .jy-status{
  display:inline-flex;align-items:center;gap:5px;
  height:22px;padding:0 10px;border-radius:11px;
  font-size:11px;font-weight:500;white-space:nowrap;
  background:var(--green-soft);color:var(--green);
}
.jy-sd2 .jy-status::before{
  content:"";width:6px;height:6px;border-radius:50%;background:currentColor;flex:0 0 6px;
}
.jy-sd2 .jy-status.suspended{background:var(--orange-soft);color:var(--orange)}
.jy-sd2 .jy-status.expired,
.jy-sd2 .jy-status.terminated,
.jy-sd2 .jy-status.cancelled{background:var(--red-soft);color:var(--red)}
.jy-sd2 .jy-status.pending{background:var(--brand-soft);color:var(--brand)}

/* action buttons */
.jy-sd2 .machineInformation .instanceInformation-itme{
  display:flex !important;flex-wrap:wrap;align-items:center;gap:8px;
  margin:0 !important;padding:0 !important;border:none !important;list-style:none;
}
.jy-sd2 .machineInformation .itme_button{
  height:30px;padding:0 14px;border-radius:var(--r-sm);
  font-size:12px;font-weight:500;line-height:28px;
  display:inline-flex;align-items:center;
  border:1px solid var(--line-strong);
  background:var(--card);color:var(--t1);
  box-shadow:none !important;text-decoration:none;cursor:pointer;
  transition:border-color .16s ease,color .16s ease,background .16s ease;
}
.jy-sd2 .machineInformation .itme_button:hover{
  border-color:var(--brand);color:var(--brand);background:var(--card);
}
.jy-sd2 .machineInformation .itme_button:first-child{
  background:var(--brand);border-color:var(--brand);color:#fff;
}
.jy-sd2 .machineInformation .itme_button:first-child:hover{
  background:var(--brand-hover);border-color:var(--brand-hover);color:#fff;
}
.jy-sd2 .machineInformation .itme_button.btn-primary{
  background:var(--orange);border-color:var(--orange);color:#fff;
}
.jy-sd2 .machineInformation .itme_button.btn-primary:hover{
  background:#FF8F26;border-color:#FF8F26;color:#fff;
}

/* hero bottom: the spec strip becomes the metric band of the same card */
.jy-sd2 .jy-specs{
  display:flex !important;flex-wrap:wrap;
  background:var(--card);
  border:1px solid var(--line);
  border-top:1px solid var(--line-soft);
  border-radius:0 0 var(--r) var(--r);
  box-shadow:var(--shadow);
  margin:0 0 14px !important;padding:0 !important;
}
.jy-sd2 .jy-spec{
  flex:1 1 0;min-width:118px;
  padding:12px 18px;
  border-left:1px solid var(--line-soft);
  background:none !important;border-radius:0 !important;box-shadow:none !important;
  border-top:none;border-right:none;border-bottom:none;
}
.jy-sd2 .jy-spec:first-child{border-left:none}
.jy-sd2 .jy-spec .k{font-size:11px;color:var(--t2);margin-bottom:4px}
.jy-sd2 .jy-spec .v{
  font-size:15px;font-weight:600;color:var(--t0);line-height:1.35;
  font-variant-numeric:tabular-nums;word-break:break-word;
}
.jy-sd2 .jy-spec .bar{display:none}

/* kill any gap in the chain between the two hero blocks */
.jy-sd2 .tab-content{padding-top:0 !important}
.jy-sd2 > .ewy-flex-container{margin-top:0 !important}
.jy-sd2 .ewy-column{margin-bottom:0 !important;padding-bottom:0 !important}
.jy-sd2 #example > .machineInformation{margin-bottom:0 !important}
.jy-sd2 #example > .jy-specs{margin-top:0 !important}

/* ============================================================ CARD GRID
   display:contents dissolves the two rails and the monitoring card so that
   info cards and chart cells become siblings of one 3 column grid. */
/* NOTE: do NOT use :has(.chartbox) / :has(.example-left) to widen this.
   :has() matches ANY descendant, so it also hits the OUTER .ewy-flex-container
   that wraps .ewy-column, turning that wrapper into a 3 column grid too. The
   real .jy-grid then ends up inside a 1/3-wide grid item (~350px) and every
   card shrinks to ~110px. Only the .jy-grid class marks the real card grid. */
.ewy-container .jy-sd2 .jy-grid{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  align-items:start;
}
/* The whole chain from the page wrapper down to the grid has to be forced to
   100%. Inside a flex parent a plain block child sizes to its CONTENT, and
   because our columns are minmax(0,1fr) the min-content of the cards is tiny -
   the grid collapsed to ~345px (3 x ~110px) and left the right ~60% of the
   page empty. Without this the cards are "correctly" laid out but microscopic. */
.ewy-container .ewy-servicedetail,
.ewy-container .jy-sd2,
.ewy-container .jy-sd2 .ewy-column,
.ewy-container .jy-sd2 .ewy-flex-100,
.ewy-container .jy-sd2 .tab-content,
.ewy-container .jy-sd2 .tab-content > .tab-pane,
.ewy-container .jy-sd2 .jy-grid{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  flex:1 1 100% !important;
  box-sizing:border-box;
}
/* cards must never be stretched to the tallest row - that is what
   produced the big empty gap under short cards like 系统信息 */
.ewy-container .jy-sd2 .ewy-flex-container > .ewy-card,
.ewy-container .jy-sd2 .ewy-flex-container > .example-rigth > .ewy-card,
.jy-sd2 .jy-c,
.jy-sd2 .chartInformation > .row > .chartbox,
.jy-sd2 .usageInformation{align-self:start}
.jy-sd2 .jy-grid .ewy-card{margin-bottom:0 !important}
.ewy-container .jy-sd2 .example-left,
.ewy-container .jy-sd2 .example-rigth{display:contents}
/* the monitoring card shell: dissolve it, keep only the chart cells */
.jy-sd2 .example-rigth > .ewy-card:has(> .chartInformation){display:contents}
.jy-sd2 .example-rigth > .ewy-card:not(.usageInformation) > .ewy-title{display:none}
.jy-sd2 .chartInformation,
.jy-sd2 .chartInformation > .row{display:contents}
/* anything unexpected that lands in the grid goes full width */
.jy-sd2 .jy-grid > div:not(.jy-c):not(.chartbox):not(.usageInformation){grid-column:1 / -1}

/* ---------- card shell ---------- */
.jy-sd2 .ewy-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  padding:0;margin:0 !important;overflow:hidden;
}
.jy-sd2 .ewy-title{
  font-size:13px;font-weight:600;color:var(--t0);
  width:100%;margin:0;padding:13px 18px;
  border-bottom:1px solid var(--line-soft);
  display:flex;justify-content:space-between;align-items:center;gap:8px;
}
/* status badge carried by the instance info card title */
.jy-sd2 .ewy-title .productstate{
  display:inline-flex;align-items:center;gap:5px;
  height:22px;padding:0 10px;border-radius:11px;
  font-size:11px;font-weight:500;
  background:var(--green-soft);color:var(--green) !important;
}
.jy-sd2 .ewy-title .productstate::before{
  content:"";width:6px;height:6px;border-radius:50%;background:currentColor;
}
.jy-sd2 .ewy-title .productstate.bg-suspended{background:var(--orange-soft);color:var(--orange) !important}
.jy-sd2 .ewy-title .productstate.bg-expired,
.jy-sd2 .ewy-title .productstate.bg-terminated,
.jy-sd2 .ewy-title .productstate.bg-cancelled{background:var(--red-soft);color:var(--red) !important}
.jy-sd2 .ewy-title .productstate.bg-pending{background:var(--brand-soft);color:var(--brand) !important}

/* ---------- key / value rows ---------- */
.jy-sd2 .instanceInformation-row{
  display:block !important;padding:6px 18px 12px;margin:0;list-style:none;
}
.jy-sd2 .instanceInformation-itme{
  display:flex !important;justify-content:space-between;align-items:center;
  gap:14px;padding:9px 0;margin:0;
  border:none !important;font-size:12px;
}
.jy-sd2 .instance-itme-name{
  flex:0 0 auto;max-width:45%;
  color:var(--t2);font-size:12px;font-weight:400;
}
.jy-sd2 .instance-itme-desc{
  display:flex;justify-content:flex-end;align-items:center;gap:6px;
  flex:1 1 auto;min-width:0;
  color:var(--t0);font-size:12px;font-weight:500;text-align:right;word-break:break-all;
}
.jy-sd2 .instance-itme-desc a,
.jy-sd2 .instance-itme-desc .text-primary{color:var(--brand);font-size:12px}
.jy-sd2 .instance-itme-desc a:hover,
.jy-sd2 .instance-itme-desc .text-primary:hover{text-decoration:underline}
.jy-sd2 .instance-itme-desc .badge,
.jy-sd2 .instance-itme-desc .label{border-radius:var(--r-sm);font-weight:500}

/* ---------- explicit placement ---------- */
.jy-sd2 .jy-c1{grid-column:1;grid-row:1}
.jy-sd2 .jy-c2{grid-column:1;grid-row:2}
.jy-sd2 .jy-c3{grid-column:1;grid-row:3}
.jy-sd2 .jy-c5{grid-column:2 / span 2;grid-row:4}
.jy-sd2 .jy-c4{grid-column:2 / span 2;grid-row:3}
.jy-sd2 .usageInformation{grid-column:1;grid-row:4}
.jy-sd2 .chartInformation > .row > .chartbox:nth-child(1){grid-column:2;grid-row:1}
.jy-sd2 .chartInformation > .row > .chartbox:nth-child(2){grid-column:3;grid-row:1}
.jy-sd2 .chartInformation > .row > .chartbox:nth-child(3){grid-column:2;grid-row:2}
.jy-sd2 .chartInformation > .row > .chartbox:nth-child(4){grid-column:3;grid-row:2}
.jy-sd2 .chartInformation > .row > .chartbox:nth-child(n+5){grid-column:1 / -1}

/* no charts at all: fall back to a plain two column flow */
.jy-sd2 .jy-grid:not(:has(.chartbox)){grid-template-columns:repeat(2,minmax(0,1fr))}
.jy-sd2 .jy-grid:not(:has(.chartbox)) .jy-c,
.jy-sd2 .jy-grid:not(:has(.chartbox)) .usageInformation{grid-column:auto;grid-row:auto}

/* ---------- spec card: sunken sub blocks, like the reference ---------- */
.jy-sd2 .jy-c4 .instanceInformation-row{
  display:grid !important;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;padding:14px 18px;
}
.jy-sd2 .jy-c4 .instanceInformation-itme{
  flex-direction:column;align-items:flex-start;justify-content:flex-start;
  gap:4px;padding:10px 12px;background:var(--sunken);border-radius:8px;
}
.jy-sd2 .jy-c4 .instance-itme-name{max-width:100%;font-size:11px}
.jy-sd2 .jy-c4 .instance-itme-desc{text-align:left;justify-content:flex-start;font-size:13px}

/* ============================================================ CHART CARDS */
.jy-sd2 .chartbox{
  width:auto !important;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  padding:0;margin:0 !important;min-width:0;overflow:hidden;
  display:flex;flex-direction:column;
}
.jy-sd2 .module_chart{padding:0}
.jy-sd2 .module_chart > div[style*="height: 60px"]{
  height:auto !important;
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  padding:12px 16px 0;margin:0;
  border:none;
}
.jy-sd2 .module_chart h4{
  float:none !important;margin:0 !important;
  font-size:13px;font-weight:600;color:var(--t0);
}
.jy-sd2 .module_chart > div[style*="float: right"],
.jy-sd2 .module_chart > div[style*="float:right"]{
  width:auto !important;float:none !important;margin:0 0 0 auto !important;
}
.jy-sd2 .module_chart .bootstrap-select{width:auto !important;min-width:104px;margin-bottom:0 !important}
.jy-sd2 .module_chart .bootstrap-select .dropdown-toggle{
  height:26px;padding:0 22px 0 10px;font-size:11px;line-height:24px;
  border-radius:13px;border:1px solid var(--line);
  background:var(--sunken);color:var(--t2);box-shadow:none;
}
.jy-sd2 .module_chart .bootstrap-select .dropdown-toggle:hover,
.jy-sd2 .module_chart .bootstrap-select.show .dropdown-toggle{
  border-color:var(--brand);color:var(--brand);background:var(--card);
}
/* the raw datetime inputs are noisy - the range pill replaces them */
.jy-sd2 .module_chart_date{display:none}
.jy-sd2 .jy-range{
  display:inline-flex;align-items:center;height:24px;padding:0 10px;
  border-radius:12px;background:var(--sunken);color:var(--t2);
  font-size:11px;font-variant-numeric:tabular-nums;white-space:nowrap;
}
.jy-sd2 .jy-range:empty{display:none}

/* KPI trio */
.jy-sd2 .jy-kpis{
  display:flex;gap:22px;flex-wrap:wrap;
  padding:10px 16px 2px;margin:0;
}
.jy-sd2 .jy-kpi .k{font-size:11px;color:var(--t2);margin-bottom:2px}
.jy-sd2 .jy-kpi .v{
  font-size:15px;font-weight:600;color:var(--t0);line-height:1.3;
  font-variant-numeric:tabular-nums;
}
.jy-sd2 .jy-kpi .v em{font-style:normal;font-size:11px;color:var(--t3);font-weight:400;margin-left:2px}
.jy-sd2 .jy-kpi.now .v{color:var(--brand)}
.jy-sd2 .module_chart_disk ~ .jy-kpis .jy-kpi.now .v,
.jy-sd2 .module_chart_io ~ .jy-kpis .jy-kpi.now .v,
.jy-sd2 .module_chart_net ~ .jy-kpis .jy-kpi.now .v,
.jy-sd2 .module_chart_flow ~ .jy-kpis .jy-kpi.now .v,
.jy-sd2 .module_chart_bw ~ .jy-kpis .jy-kpi.now .v{color:var(--orange)}

.jy-sd2 .chartbox > .w-100,
.jy-sd2 .chartbox > .h-100{flex:1 1 auto;min-width:0;padding:0 8px 8px}
.jy-sd2 .chart_content_box{height:150px !important;min-height:150px;width:100% !important}

/* ============================================================ USAGE CARD */
.jy-sd2 .usageInformation{padding-bottom:2px}
.jy-sd2 .usageInformation .mt-4{margin-top:14px !important}
.jy-sd2 .usageInformation .mb-4{margin-bottom:0 !important}
.jy-sd2 .usageInformation .ll-flex{display:flex;align-items:center;gap:12px}
.jy-sd2 .usageInformation .progress{
  flex:1 1 auto;height:8px;border-radius:4px;background:var(--line-soft);
  margin:0 !important;box-shadow:none;
}
.jy-sd2 .usageInformation .progress-bar{
  background:var(--brand);border-radius:4px;
  font-size:10px;line-height:8px;box-shadow:none;
}
.jy-sd2 .usageInformation .btn-outline-secondary{
  border:1px solid var(--line-strong);color:var(--t1);background:var(--card);
  border-radius:var(--r-sm);font-size:12px;height:30px;padding:0 14px;
  line-height:28px;box-shadow:none;
}
.jy-sd2 .usageInformation .btn-outline-secondary:hover{
  border-color:var(--brand);color:var(--brand);background:var(--card);
}

/* ============================================================ MISC */
.jy-sd2 .configuration_list{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
  gap:6px 16px;list-style:none;margin:0;padding:0;
}
.jy-sd2 .bx{font-size:14px}
.jy-sd2 .layui-elem-quote{
  border-radius:var(--r);margin:0 0 14px;font-size:12px;
  background:var(--orange-soft);border-left:3px solid var(--orange);color:var(--t1);
}

/* ============================================================ RESPONSIVE */
@media (max-width:1099px){
  .ewy-container .jy-sd2 .jy-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .jy-sd2 .jy-c1,.jy-sd2 .jy-c2,.jy-sd2 .jy-c3,
  .jy-sd2 .jy-c4,.jy-sd2 .jy-c5,
  .jy-sd2 .usageInformation,
  .jy-sd2 .chartInformation > .row > .chartbox{grid-column:auto;grid-row:auto}
}
@media (max-width:767px){
  .ewy-container .jy-sd2 .jy-grid{grid-template-columns:minmax(0,1fr)}
  .jy-sd2 .jy-spec{flex:1 1 50%;min-width:0}
  .jy-sd2 .jy-c4 .instanceInformation-row{grid-template-columns:repeat(2,minmax(0,1fr))}
  .jy-sd2 .machineInformation{flex-direction:column;align-items:flex-start}
}

/* ============================================================ WAP / NARROW
   Everything below is intentionally placed LAST and leans on !important:
   (a) the :has() selectors above are more specific than the plain .jy-grid
       ones, so they used to win even inside the narrow media query and kept
       the page two-column on phones;
   (b) mobileEnd.css is loaded after this file for $client requests, so it
       would otherwise re-apply its own two-column card widths.
   Rule for phones: one single column, every card full width. */
@media (max-width:991px){
  .ewy-container .jy-sd2 .jy-grid{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:12px !important;
  }
  /* the content column is a flex child that otherwise shrinks to its
     min-content (~190px on a 390px screen) instead of filling the row */
  .ewy-container > .ewy-container-fluid{
    width:100% !important;
    min-width:0 !important;
    flex:1 1 100% !important;
  }
  .jy-sd2 .jy-c,
  .jy-sd2 .usageInformation,
  .jy-sd2 .chartInformation > .row > .chartbox,
  .jy-sd2 .ewy-flex-container > .ewy-card{
    grid-column:1 / -1 !important;
    grid-row:auto !important;
    width:100% !important;
    max-width:100% !important;
    flex:1 1 100% !important;
    margin:0 !important;
  }
  /* charts need a bit more height once they span the full width */
  .jy-sd2 .chart_content_box{height:170px !important;min-height:170px}
  .jy-sd2 .chartbox > .w-100,
  .jy-sd2 .chartbox > .h-100{padding:0 10px 10px}
  /* spec grid: two sub blocks per row reads better than three on a phone */
  .jy-sd2 .jy-c4 .instanceInformation-row{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  /* hero stacks, buttons wrap instead of overflowing */
  .jy-sd2 .machineInformation{
    flex-direction:column !important;
    align-items:flex-start !important;
    gap:10px;
  }
  .jy-sd2 .machineInformation .instanceInformation-itme{width:100%}
  .jy-sd2 .machineInformation .Information-content{min-width:0;flex-wrap:wrap}
  /* key/value rows must not shatter into single characters */
  .jy-sd2 .instanceInformation-itme{flex-wrap:wrap !important}
  .jy-sd2 .instance-itme-name{white-space:nowrap}
  .jy-sd2 .instance-itme-desc{white-space:normal !important;word-break:break-word}
}
@media (max-width:575px){
  .jy-sd2 .jy-spec{flex:1 1 100% !important}
  .jy-sd2 .tab-content{padding-left:0 !important;padding-right:0 !important}
  .jy-sd2 .ewy-card{padding-left:14px;padding-right:14px}
}
