/* HostOK panel overrides on top of Dore theme */

/* —— Typography & base —— */
body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.hostok-user-email {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* —— Page layout (Dore dashboard pattern) —— */
.hostok-page-heading h1 {
  font-weight: 600;
  line-height: 1.25;
}
.hostok-page-title-row {
  gap: 0.75rem;
}
.hostok-page-actions {
  flex-shrink: 0;
}
.hostok-page-heading .breadcrumb-container {
  margin-top: 0.35rem;
}

/* —— Admin area separation —— */
body.hostok-admin-area .hostok-menu-panel {
  display: none;
}
body:not(.hostok-admin-area) .hostok-menu-admin {
  display: none;
}

body.hostok-admin-area .menu.hostok-menu-admin-mode {
  background: linear-gradient(180deg, rgba(35, 101, 145, 0.08) 0%, rgba(35, 101, 145, 0.02) 100%);
  border-right: 1px solid rgba(35, 101, 145, 0.15);
}
body.hostok-admin-area[data-theme-mode="dark"] .menu.hostok-menu-admin-mode {
  background: linear-gradient(180deg, rgba(120, 170, 210, 0.1) 0%, rgba(120, 170, 210, 0.03) 100%);
  border-right-color: rgba(120, 170, 210, 0.2);
}

body.hostok-admin-area main {
  border-left: 3px solid rgba(35, 101, 145, 0.22);
  background: linear-gradient(90deg, rgba(35, 101, 145, 0.04) 0%, transparent 120px);
}
body.hostok-admin-area[data-theme-mode="dark"] main {
  border-left-color: rgba(120, 170, 210, 0.35);
  background: linear-gradient(90deg, rgba(120, 170, 210, 0.06) 0%, transparent 140px);
}

.menu-back-to-panel {
  margin: 0.5rem 0.75rem 0.85rem;
}
.menu-back-to-panel > a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 0.35rem;
  font-weight: 700;
  background: rgba(35, 101, 145, 0.12);
  color: var(--theme-color-1, #236591);
  border: 1px solid rgba(35, 101, 145, 0.2);
}
.menu-back-to-panel > a:hover,
.menu-back-to-panel > a:focus {
  background: rgba(35, 101, 145, 0.18);
  color: var(--theme-color-1, #236591);
  text-decoration: none;
}
body[data-theme-mode="dark"] .menu-back-to-panel > a {
  background: rgba(120, 170, 210, 0.12);
  border-color: rgba(120, 170, 210, 0.25);
  color: #b8d4ea;
}
body[data-theme-mode="dark"] .menu-back-to-panel > a:hover,
body[data-theme-mode="dark"] .menu-back-to-panel > a:focus {
  background: rgba(120, 170, 210, 0.2);
  color: #d4e8f7;
}

.menu-admin-entry > a {
  border-left: 3px solid transparent;
  padding-left: calc(1.5rem - 3px);
  font-weight: 600;
}
.menu-admin-entry > a:hover {
  border-left-color: rgba(35, 101, 145, 0.35);
}

body.hostok-admin-area .menu .menu-section-admin {
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 0;
}
body.hostok-admin-area .menu-section-admin span {
  font-weight: 700;
  opacity: 0.85;
}
body.hostok-admin-area .menu-admin-item > a {
  border-left: 3px solid transparent;
  padding-left: calc(1.5rem - 3px);
}
body.hostok-admin-area .menu-admin-item.active > a {
  border-left-color: var(--theme-color-1, #236591);
}

.hostok-admin-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  margin-right: 0.5rem;
}
.hostok-admin-nav-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 0.25rem;
  background: rgba(35, 101, 145, 0.12);
  color: var(--theme-color-1, #236591);
}
body[data-theme-mode="dark"] .hostok-admin-nav-badge {
  background: rgba(255, 255, 255, 0.08);
}

.menu-section-label {
  padding: 0.75rem 1.5rem 0.25rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
}

/* —— Cards & content containers —— */
.hostok-card {
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 15px rgba(0, 0, 0, 0.04), 0 1px 6px rgba(0, 0, 0, 0.04);
}
body[data-theme-mode="dark"] .hostok-card {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 15px rgba(0, 0, 0, 0.2), 0 1px 6px rgba(0, 0, 0, 0.15);
}
.hostok-card .card-header {
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1rem 1.5rem;
}
body[data-theme-mode="dark"] .hostok-card .card-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.hostok-card .card-body {
  padding: 1.25rem 1.5rem;
}
.hostok-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0;
}
.hostok-card .table {
  margin-bottom: 0;
}
.hostok-card .table thead th {
  border-top: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
  font-weight: 600;
}
.hostok-card .empty {
  margin: 0;
  padding: 1.5rem 0;
  text-align: center;
}

.hostok-stat-cards .card {
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 15px rgba(0, 0, 0, 0.04), 0 1px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
body[data-theme-mode="dark"] .hostok-stat-cards .card {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 15px rgba(0, 0, 0, 0.2);
}
.hostok-stat-cards .card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.hostok-stat-cards .card-body {
  padding: 1.25rem;
}
.hostok-stat-cards .stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
}
.hostok-stat-cards .hostok-stat-icon {
  font-size: 1.5rem;
}
  font-size: 0.8rem;
  opacity: 0.7;
  margin-bottom: 0.25rem;
}

.hostok-empty-state .hostok-empty-icon {
  font-size: 2rem;
  opacity: 0.35;
}

/* —— Forms —— */
.hostok-form {
  max-width: 640px;
}
.hostok-form .has-float-label > span {
  opacity: 0.75;
}
.hostok-form .form-control:focus + span,
.hostok-form .has-float-label input:not(:placeholder-shown) + span {
  opacity: 1;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* —— Tables —— */
.hostok-card .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}
body[data-theme-mode="dark"] .hostok-card .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(255, 255, 255, 0.03);
}
.hostok-card .table td,
.hostok-card .table th {
  vertical-align: middle;
  padding: 0.75rem 1rem;
}
.hostok-card .table tbody tr:hover {
  background-color: rgba(35, 101, 145, 0.04);
}
body[data-theme-mode="dark"] .hostok-card .table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

/* —— Status rows —— */
.hostok-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  margin-bottom: 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  text-decoration: none;
  color: inherit;
  background: rgba(0, 0, 0, 0.015);
}
body[data-theme-mode="dark"] .hostok-row {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.hostok-row:hover {
  text-decoration: none;
  opacity: 0.95;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.dot.up {
  background: #3dd68c;
  box-shadow: 0 0 8px rgba(61, 214, 140, 0.45);
}
.dot.down {
  background: #ff6b6b;
}
.dot.unknown,
.dot.degraded {
  background: #f0c14a;
}

.meta {
  margin-left: auto;
  font-size: 0.85rem;
  opacity: 0.75;
  text-align: right;
}
.muted {
  opacity: 0.75;
}
.empty {
  opacity: 0.7;
}

.shimmer {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.04) 25%, rgba(0, 0, 0, 0.08) 50%, rgba(0, 0, 0, 0.04) 75%);
  background-size: 200% 100%;
  animation: hostok-shim 1.2s infinite;
  height: 52px;
  border-radius: 0.75rem;
  margin-bottom: 0.6rem;
}
body[data-theme-mode="dark"] .shimmer {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
}
.shimmer-wrap[hidden] {
  display: none !important;
}
@keyframes hostok-shim {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.hostok-sortable-table th.hostok-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.hostok-sortable-table th.hostok-sortable:hover {
  opacity: 0.85;
}
.hostok-sortable-table th.sort-asc::after {
  content: ' ▲';
  font-size: 0.65em;
  opacity: 0.6;
}
.hostok-sortable-table th.sort-desc::after {
  content: ' ▼';
  font-size: 0.65em;
  opacity: 0.6;
}

#status-chart {
  max-height: 180px;
}

[data-list][hidden] {
  display: none !important;
}

/* —— Auth / login —— */
.auth-card {
  margin-top: 3rem;
  border: none;
  box-shadow: 0 3px 30px rgba(0, 0, 0, 0.1), 0 3px 20px rgba(0, 0, 0, 0.1);
}
.auth-card .form-side {
  padding: 2.5rem 2rem;
}
.auth-card .image-side {
  min-height: 100%;
}

/* Login background: balloon images not shipped in subset */
.fixed-background {
  background: linear-gradient(135deg, #0f1c3f 0%, #1e3a6e 45%, #2a5298 100%) !important;
  background-size: cover !important;
}

/* —— Responsive —— */
@media (max-width: 767px) {
  .hostok-page-actions {
    width: 100%;
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding-top: 0.5rem;
  }
  .hostok-card .card-body {
    padding: 1rem;
  }
  .hostok-card .card-header {
    padding: 0.85rem 1rem;
  }
  .hostok-user-email {
    display: none !important;
  }
  body.hostok-admin-area main {
    border-left-width: 0;
    background: none;
  }
}

.hostok-wizard-tabs .nav-link {
  cursor: default;
  pointer-events: none;
}
.hostok-ip-field {
  position: relative;
}
.hostok-ip-shimmer {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 0.5rem 0;
}
.hostok-ip-shimmer .shimmer {
  height: 2.25rem;
  border-radius: 0.25rem;
}
@media (min-width: 992px) {
  #server-wizard-modal .modal-dialog {
    max-width: 900px;
  }
}
