* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

:root {
  --primary: #1266f1;
  --primary-dark: #0b4fc3;
  --primary-soft: #eaf3ff;
  --navy: #0f2747;
  --text: #172033;
  --muted: #64748b;
  --border: #dbe7f5;
}

body {
  background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
  color: var(--text);
}

/* Auth */
.auth-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.auth-site-header {
  flex-shrink: 0;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  text-align: center;
}

.auth-site-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.auth-site-logo img {
  max-width: 186px;
  object-fit: contain;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.auth-page {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-site-footer {
  flex-shrink: 0;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  text-align: center;
}

.auth-copyright {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.auth-copyright a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 500;
}

.auth-copyright a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.auth-box {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  padding: 36px 30px;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.auth-head {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 12px;
}

.auth-head h2 {
  font-size: 24px;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-head p {
  font-size: 14px;
  color: var(--muted);
}

.form-item {
  margin-bottom: 16px;
}

.form-item label {
  display: block;
  font-size: 13px;
  color: #333;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-item input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
}

.form-item input:focus {
  border-color: var(--primary);
}

.btn-submit {
  width: 100%;
  padding: 12px;
  background-color: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 6px;
}

.btn-submit:hover {
  background-color: var(--primary-dark);
}

.msg {
  margin-top: 12px;
  font-size: 13px;
  text-align: center;
  min-height: 16px;
}

.msg-info { color: var(--primary); }
.msg-success { color: #0d9488; }
.msg-error { color: #e11d48; }

.auth-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: #555;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Dashboard */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: #f7fafc;
}

.sidebar {
  width: 248px;
  padding: 28px 0;
  color: #fff;
  background: linear-gradient(180deg, #0f2747 0%, #102f5f 100%);
  box-shadow: 10px 0 30px rgba(15, 39, 71, 0.12);
}

.sidebar-logo {
  text-align: center;
  margin-bottom: 34px;
}

.sidebar-logo img {
  width: 66px;
  height: 66px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu li {
  margin-bottom: 4px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 14px;
  padding: 13px 18px;
  color: #d8e7fb;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.sidebar-menu a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.10);
}

.sidebar-menu a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.main-content {
  flex: 1;
  padding: 30px 38px 42px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(219, 231, 245, 0.9);
}

.top-bar h1 {
  color: var(--navy);
  font-size: 28px;
  font-weight: 700;
}

.user-dropdown {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #28b7ff);
  box-shadow: 0 8px 18px rgba(18, 102, 241, 0.24);
  color: #fff;
  font-weight: 500;
}

.alert-bar {
  display: none;
  position: relative;
  z-index: 100;
  margin: 0 0 24px;
  padding: 14px 16px;
  border: 1px solid #b91c1c;
  border-radius: 8px;
  background: #dc2626;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.welcome-text {
  margin-bottom: 20px;
  color: var(--navy);
  font-size: 26px;
  font-weight: 700;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(340px, 0.95fr);
  gap: 24px;
}

.column-main,
.column-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  padding: 24px;
  border: 1px solid rgba(219, 231, 245, 0.95);
  background: rgba(255, 255, 255, 0.96);
}

.card.warning {
  border-color: #bfdcff;
  background: linear-gradient(135deg, #fff 0%, #eff7ff 100%);
}

.card-title {
  position: relative;
  margin-bottom: 10px;
  padding-left: 14px;
  color: var(--navy);
  font-size: 20px;
  font-weight: 700;
}

.card-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), #28b7ff);
}

.card > p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.status-text {
  margin-top: 10px;
  color: #4b5563;
  font-size: 14px;
}

.login-notes {
  margin-top: 16px;
  padding: 14px 16px 14px 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fbff;
  color: #475569;
  font-size: 18px;
  line-height: 1.65;
  list-style: disc;
}

.login-notes li + li {
  margin-top: 6px;
}

.login-notes .code-empty {
  color: #dc2626;
}

.setup-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: setup-step;
}

.step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  line-height: 1.8;
}

.step::after {
  counter-increment: setup-step;
  content: counter(setup-step);
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.step span {
  padding-right: 38px;
  color: #40516a;
  font-size: 18px;
}

.step span strong {
  color: var(--navy);
}

.step-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--primary-soft);
  object-fit: contain;
}

.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 10px 16px;
  border: 1px solid #bcd4f3;
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(18, 102, 241, 0.08);
}

.btn-download img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}


.btn-download:disabled {
  border-color: #e2e8f0;
  background: #f4f7fb;
  color: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-download.console-btn {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), #28a6ff);
  color: #fff;
}

.btn-download.console-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
}

.btn-assign {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  margin: 14px 0 0;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #28a6ff);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.btn-assign-plus {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.btn-assign:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.btn-assign:active:not(:disabled) {
  transform: translateY(0);
}

.btn-assign:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-web-console {
  width: auto;
  margin-top: 12px;
  padding: 8px 14px;
  border: 1px solid #bcd4f3;
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(18, 102, 241, 0.08);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.btn-web-console:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.agent-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.agent-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-item.disabled {
  padding: 12px 14px;
  border: 1px dashed #cbd8e8;
  border-radius: 12px;
  background: #f8fbff;
  opacity: 0.85;
  cursor: not-allowed;
}

.disabled-text {
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
}

.agent-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.server-item {
  margin-bottom: 12px;
  padding: 18px;
  border: 1px solid #dbe7f5;
  border-radius: 10px;
  background: #fbfdff;
  box-shadow: inset 0 1px 0 #fff;
}

.server-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 600;
}

.server-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.server-info {
  color: #4b5563;
  font-size: 18px;
  line-height: 1.5;
}

.status-badge {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.status-online {
  background: #d1fae5;
  color: #065f46;
}

.status-releasing {
  background: #fef3c7;
  color: #92400e;
}

.status-offline {
  background: #fee2e2;
  color: #991b1b;
}

.console-login-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 16px;
}

.console-login {
  width: min(100%, 430px);
  overflow: hidden;
  border: 1px solid #c4d8f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 39, 71, 0.10);
  font-family: "Segoe UI", sans-serif;
}

.console-login .title-bar {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 8px;
  border-bottom: 1px solid #dbe7f5;
  background: linear-gradient(180deg, #fff, #f4f8fd);
}

.console-login .logo-small {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  object-fit: contain;
}

.console-login .title-text {
  color: var(--navy);
  font-size: 16px;
  font-weight: 700;
}

.console-login .banner {
  height: 86px;
  background: url("/assets/img/anysecura-vps/BITMAP202_1.bmp") center / cover no-repeat;
}

.console-login .form-area {
  padding: 16px 18px 18px;
}

.console-login .form-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.console-login .form-row label {
  width: 80px;
  color: #334155;
  font-size: 14px;
  font-weight: 650;
}

.console-login .form-row input,
.console-login .form-row select {
  flex: 1;
  height: 30px;
  padding: 0 6px;
  border: 1px solid #bfd1e6;
  border-radius: 6px;
  font-size: 14px;
}

.console-login .checkbox-row {
  display: flex;
  gap: 16px;
  margin: 6px 0 14px 80px;
}

.console-login .checkbox-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}

.console-login .checkbox-item input {
  width: 16px;
  height: 16px;
}

.console-login .button-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.console-login .button-row button {
  width: 80px;
  height: 30px;
  border: 1px solid #bcd4f3;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
}

.console-login .button-ok {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
}

.guide-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
}

.guide-hole {
  position: absolute;
  z-index: 9991;
  border-radius: 12px;
  background: transparent;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.guide-tooltip {
  position: absolute;
  z-index: 9999;
  max-width: 340px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 39, 71, 0.18);
  pointer-events: auto;
}

.guide-tooltip h4 {
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 15px;
}

.guide-button {
  margin-top: 12px;
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary), #28a6ff);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 1180px) {
  .content-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .column-main,
  .column-side {
    display: contents;
  }

  .column-main > .card:first-child {
    order: 1;
  }

  #guideStep1 {
    order: 2;
  }

  #guideStep2 {
    order: 3;
  }

  #guideStep3 {
    order: 4;
  }

  #guideStep4 {
    order: 5;
  }

  .column-main > .card.warning {
    order: 6;
  }
}

@media (max-width: 780px) {
  .dashboard-layout {
    display: block;
  }

  .sidebar {
    width: 100%;
    padding: 18px 0;
  }

  .main-content {
    padding: 22px 16px 32px;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
