:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #0c1828;
  --panel2: #111f31;
  --line: #203248;
  --text: #f7f9fc;
  --muted: #91a3b8;
  --accent: #55d6be;
  --accent2: #7ba7ff;
  --gold: #e5bd66;
  --danger: #ff7d88;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}
* {
  box-sizing: border-box;
}
html,
body {
  overflow-x: hidden;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: radial-gradient(circle at 80% 0, #132949 0, transparent 32%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  min-height: 100vh;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
.app-shell {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 252px;
  padding: 26px 18px;
  background: rgba(7, 17, 31, 0.96);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 20;
  backdrop-filter: blur(18px);
}
.brand,
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 21px;
  background: linear-gradient(145deg, var(--accent), var(--accent2));
  color: #06121c;
  box-shadow: 0 10px 30px rgba(85, 214, 190, 0.22);
}
.brand-mark.large {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  font-size: 26px;
}
.brand strong,
.login-brand strong {
  display: block;
  letter-spacing: 0.13em;
}
.brand span,
.login-brand span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.nav {
  display: grid;
  gap: 7px;
  margin-top: 42px;
}
.nav-item,
.logout {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  gap: 11px;
  align-items: center;
}
.nav-item:hover,
.nav-item.active {
  background: #122236;
  color: var(--text);
}
.nav-item.active {
  box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
}
.security-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 13px;
  background: #0c1d2e;
  border: 1px solid #1d334a;
}
.security-card strong,
.security-card small {
  display: block;
}
.security-card small {
  color: var(--muted);
  margin-top: 2px;
}
.security-dot {
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(85, 214, 190, 0.1);
}
.logout {
  justify-content: center;
  border: 1px solid var(--line);
}
.main {
  margin-left: 252px;
  padding: 34px 38px 60px;
  max-width: 1700px;
}
.topbar {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  justify-content: space-between;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}
.topbar h1,
.section-head h2,
.login-card h1 {
  margin: 0;
}
.subtitle,
.section-head p,
.card-copy p {
  color: var(--muted);
  line-height: 1.55;
}
.master-chip {
  display: flex;
  gap: 11px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(13, 25, 40, 0.75);
  padding: 9px 13px;
  border-radius: 16px;
  min-width: 220px;
}
.master-chip .avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #18334b;
  color: var(--accent);
  font-weight: 800;
}
.master-chip strong,
.master-chip span {
  display: block;
}
.master-chip span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.metric {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 31, 49, 0.95), rgba(11, 24, 39, 0.95));
  border-radius: 18px;
  box-shadow: 0 8px 34px rgba(0, 0, 0, 0.11);
}
.metric-icon {
  width: 45px;
  height: 45px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #17293d;
  color: var(--accent2);
  font-weight: 900;
}
.metric-icon.online {
  color: var(--accent);
}
.metric-icon.migration {
  color: var(--gold);
}
.metric-icon.attention {
  color: var(--danger);
}
.metric small,
.metric strong {
  display: block;
}
.metric small {
  color: var(--muted);
}
.metric strong {
  font-size: 28px;
  margin-top: 3px;
}
.projects-section {
  margin-top: 34px;
}
.section-head {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-end;
}
.section-head > div:first-child {
  max-width: 680px;
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
}
.search {
  min-width: 230px;
  height: 42px;
  border: 1px solid var(--line);
  background: #0b1929;
  border-radius: 12px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}
select {
  height: 42px;
  border: 1px solid var(--line);
  background: #0b1929;
  color: var(--text);
  border-radius: 12px;
  padding: 0 12px;
}
.primary,
.secondary,
.icon-action,
.icon-btn {
  border-radius: 12px;
  border: 1px solid transparent;
  transition: 0.18s ease;
}
.primary {
  background: linear-gradient(135deg, var(--accent), #70b5f5);
  color: #06121c;
  font-weight: 800;
  padding: 12px 16px;
}
.primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}
.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.secondary {
  background: #132338;
  color: var(--text);
  border-color: #29405a;
  padding: 12px 16px;
}
.small {
  padding: 9px 12px;
}
.refresh-line {
  margin: 14px 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}
.project-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 31, 49, 0.97), rgba(9, 22, 36, 0.98));
  border-radius: 20px;
  padding: 19px;
  box-shadow: var(--shadow);
  min-height: 390px;
  display: flex;
  flex-direction: column;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.project-icon {
  width: 47px;
  height: 47px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #173551, #17263a);
  border: 1px solid #2c4560;
  color: var(--accent);
  font-size: 20px;
  font-weight: 900;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 6px 9px;
  border: 1px solid;
}
.status.online {
  color: var(--accent);
  border-color: rgba(85, 214, 190, 0.35);
  background: rgba(85, 214, 190, 0.08);
}
.status.migration {
  color: var(--gold);
  border-color: rgba(229, 189, 102, 0.35);
  background: rgba(229, 189, 102, 0.08);
}
.status.attention,
.status.offline {
  color: var(--danger);
  border-color: rgba(255, 125, 136, 0.34);
  background: rgba(255, 125, 136, 0.07);
}
.status.unknown {
  color: var(--accent2);
  border-color: rgba(123, 167, 255, 0.35);
  background: rgba(123, 167, 255, 0.08);
}
.card-copy {
  margin-top: 17px;
}
.category {
  font-size: 10px !important;
  font-weight: 800;
  color: var(--accent) !important;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 7px;
}
.card-copy h3 {
  font-size: 21px;
  margin: 0;
}
.card-copy p {
  font-size: 13px;
  margin: 8px 0 0;
}
.feature-row,
.feature-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.feature-row {
  margin: 14px 0;
}
.feature-row span,
.feature-chip {
  font-size: 10px;
  padding: 5px 7px;
  border-radius: 8px;
  background: #12263b;
  color: #bcd0e4;
  border: 1px solid #203a54;
}
.project-facts {
  display: grid;
  gap: 9px;
  border-top: 1px solid #1b3045;
  padding-top: 13px;
  margin-top: auto;
}
.project-facts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.project-facts small {
  color: var(--muted);
}
.project-facts strong {
  font-size: 11px;
  max-width: 65%;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}
.icon-action,
.icon-btn {
  background: #122236;
  color: var(--text);
  border-color: var(--line);
  padding: 9px 11px;
}
.empty {
  padding: 45px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
}
.login-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: auto;
}
.login-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 15%, rgba(85, 214, 190, 0.14), transparent 24%),
    radial-gradient(circle at 85% 80%, rgba(123, 167, 255, 0.16), transparent 26%),
    linear-gradient(135deg, #06101c, #0b1726);
}
.login-card {
  position: relative;
  width: min(470px, 100%);
  border: 1px solid #24405d;
  border-radius: 26px;
  background: rgba(9, 22, 36, 0.92);
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.45);
  padding: 30px;
  backdrop-filter: blur(22px);
}
.login-copy {
  margin: 28px 0 22px;
}
.login-copy h1 {
  font-size: 34px;
  margin-top: 10px;
}
.login-copy p {
  color: var(--muted);
  line-height: 1.55;
}
.secure-pill {
  display: inline-flex;
  color: var(--accent);
  background: rgba(85, 214, 190, 0.08);
  border: 1px solid rgba(85, 214, 190, 0.25);
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.login-card form {
  display: grid;
  gap: 13px;
}
.login-card label {
  font-size: 12px;
  font-weight: 700;
  color: #c7d4e2;
}
.login-card input {
  display: block;
  width: 100%;
  margin-top: 7px;
  height: 48px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #091827;
  color: var(--text);
  padding: 0 13px;
  outline: none;
}
.login-card input:focus {
  border-color: #4d8f9e;
  box-shadow: 0 0 0 3px rgba(85, 214, 190, 0.08);
}
.form-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
  margin: 0;
}
.login-note {
  margin-top: 18px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #0c1c2d;
  color: var(--muted);
  font-size: 11px;
}
.detail-dialog {
  width: min(760px, calc(100% - 28px));
  border: 1px solid #29435e;
  border-radius: 22px;
  background: #0b1929;
  color: var(--text);
  padding: 24px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
}
.detail-dialog::backdrop {
  background: rgba(1, 7, 13, 0.72);
  backdrop-filter: blur(6px);
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.dialog-head h2 {
  margin: 0;
}
.detail-status {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  margin: 18px 0;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.detail-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d1d2f;
}
.detail-grid small,
.detail-grid strong {
  display: block;
}
.detail-grid small {
  color: var(--muted);
  margin-bottom: 4px;
}
.detail-grid strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.detail-block {
  margin-top: 20px;
}
.detail-block h3 {
  font-size: 14px;
}
.structure-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.structure-list li {
  font-size: 12px;
  background: #0e2033;
  border: 1px solid #1d354d;
  padding: 8px;
  border-radius: 9px;
}
.dialog-actions {
  display: flex;
  gap: 9px;
  margin-top: 22px;
}
.muted {
  color: var(--muted);
}
@media (max-width: 1180px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .actions {
    width: 100%;
    flex-wrap: wrap;
  }
}
@media (max-width: 780px) {
  .sidebar {
    transform: translateX(-102%);
    transition: 0.2s ease;
  }
  .menu-open .sidebar {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
    padding: 22px 16px 42px;
  }
  .menu-btn {
    display: block;
  }
  .topbar {
    align-items: flex-start;
  }
  .master-chip {
    display: none;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .search {
    grid-column: 1/-1;
    min-width: 0;
  }
  .actions .primary {
    grid-column: 1/-1;
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  .metrics {
    grid-template-columns: 1fr;
  }
  .topbar > div:nth-child(2) {
    max-width: calc(100% - 50px);
  }
  .topbar h1 {
    font-size: 28px;
  }
  .actions {
    grid-template-columns: 1fr;
  }
  .search,
  .actions .primary {
    grid-column: auto;
  }
  .project-card {
    min-height: auto;
  }
  .card-actions {
    flex-wrap: wrap;
  }
  .detail-grid,
  .structure-list {
    grid-template-columns: 1fr;
  }
  .login-card {
    padding: 24px 20px;
  }
  .login-copy h1 {
    font-size: 30px;
  }
}

[hidden] {
  display: none !important;
}

.main,
.metric,
.project-card {
  min-width: 0;
}

/* MOBILE DRAWER FIX 20260822 */
.sidebar-close,
.sidebar-backdrop {
  display: none;
}
@media (max-width: 780px) {
  body.menu-open {
    overflow: hidden;
    touch-action: none;
  }
  .sidebar {
    width: min(86vw, 360px);
    max-width: 100%;
    box-shadow: 22px 0 70px rgba(0, 0, 0, 0.48);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .sidebar-close {
    display: grid;
    position: absolute;
    top: 22px;
    right: 16px;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #102136;
    color: var(--text);
    font-size: 26px;
    line-height: 1;
    z-index: 2;
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(0, 6, 14, 0.62);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 19;
  }
  .menu-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .nav-item {
    min-height: 48px;
  }
}
