:root {
  color-scheme: light;
}

html.dark {
  color-scheme: dark;
}

[x-cloak] {
  display: none !important;
}

body {
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
  background-image: radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--color-secondary) 20%, transparent), transparent 35%),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--color-primary) 18%, transparent), transparent 30%);
}

.card-surface {
  border: 1px solid rgb(226 232 240 / 0.8);
  background: var(--color-card);
  border-radius: 1rem;
  box-shadow: 0 10px 30px -20px rgb(15 23 42 / 0.35);
}

.dark .card-surface {
  border-color: rgb(30 41 59 / 0.7);
}

.nav-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.72rem;
  border-radius: 0.7rem;
  color: rgb(203 213 225);
  transition: all 0.18s ease;
}

.nav-item:hover {
  background: rgb(255 255 255 / 0.09);
  color: white;
}

.nav-item.is-active {
  background: linear-gradient(90deg, rgb(255 255 255 / 0.19), rgb(255 255 255 / 0.08));
  color: white;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14);
}

.nav-item i {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.nav-item svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.nav-item span {
  display: inline-block;
  line-height: 1.2;
}

.icon-chip {
  display: inline-flex;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  background: color-mix(in srgb, var(--color-primary) 14%, white);
  color: var(--color-primary);
}

.dark .icon-chip {
  background: rgb(30 41 59 / 0.95);
}

.btn-primary,
button.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(130deg, var(--color-primary), color-mix(in srgb, var(--color-secondary) 60%, var(--color-primary)));
  box-shadow: 0 10px 24px -16px color-mix(in srgb, var(--color-primary) 75%, #0f172a);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn-primary:hover,
button.btn-primary:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -16px color-mix(in srgb, var(--color-primary) 85%, #0f172a);
}

.btn-soft,
button.btn-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid rgb(203 213 225);
  border-radius: 0.75rem;
  padding: 0.55rem 0.9rem;
  background: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.btn-soft:hover,
button.btn-soft:hover {
  border-color: rgb(148 163 184);
  transform: translateY(-1px);
}

.dark .btn-soft,
.dark button.btn-soft {
  border-color: rgb(51 65 85);
  background: rgb(15 23 42);
}

.btn-table {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 0.62rem;
  padding: 0.34rem 0.58rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
  transition: all 0.16s ease;
  cursor: pointer;
}

.btn-table i,
.btn-table svg {
  width: 0.78rem;
  height: 0.78rem;
}

.btn-table-detail {
  color: white;
  background: linear-gradient(130deg, var(--color-primary), color-mix(in srgb, var(--color-secondary) 60%, var(--color-primary)));
  box-shadow: 0 8px 18px -14px color-mix(in srgb, var(--color-primary) 85%, #0f172a);
}

.btn-table-detail:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn-table-edit {
  color: rgb(15 23 42);
  background: rgb(241 245 249);
  border-color: rgb(203 213 225);
}

.btn-table-edit:hover {
  background: rgb(226 232 240);
  border-color: rgb(148 163 184);
  transform: translateY(-1px);
}

.dark .btn-table-edit {
  color: rgb(226 232 240);
  background: rgb(15 23 42);
  border-color: rgb(51 65 85);
}

.dark .btn-table-edit:hover {
  background: rgb(30 41 59);
}

.btn-table-danger {
  color: rgb(190 18 60);
  background: rgb(255 241 242);
  border-color: rgb(254 205 211);
}

.btn-table-danger:hover {
  background: rgb(255 228 230);
  border-color: rgb(253 164 175);
}

.icon-btn {
  border: 1px solid rgb(203 213 225);
  border-radius: 0.65rem;
  height: 2rem;
  width: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dark .icon-btn {
  border-color: rgb(51 65 85);
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(2 6 23 / 0.6);
}

.modal-panel {
  position: relative;
  width: min(40rem, 100%);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid rgb(226 232 240 / 0.8);
  border-radius: 1rem;
  background: var(--color-card);
  box-shadow: 0 28px 70px -32px rgb(2 6 23 / 0.75);
}

.badge {
  border-radius: 9999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgb(226 232 240);
  color: rgb(51 65 85);
}

.badge-success {
  background: rgb(220 252 231);
  color: rgb(21 128 61);
}

.badge-warning {
  background: rgb(254 243 199);
  color: rgb(180 83 9);
}

.badge-danger {
  background: rgb(ffe4e6);
  color: rgb(190 18 60);
}

.table-modern thead th {
  padding: 0.8rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: rgb(100 116 139);
  background: rgb(248 250 252);
  border-bottom: 1px solid rgb(226 232 240);
}

.table-modern tbody td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgb(241 245 249);
}

.table-modern tbody tr:hover {
  background: rgb(248 250 252);
}

.dark .table-modern thead th {
  background: rgb(2 6 23);
  color: rgb(148 163 184);
  border-bottom-color: rgb(30 41 59);
}

.dark .table-modern tbody td {
  border-bottom-color: rgb(30 41 59);
}

.dark .table-modern tbody tr:hover {
  background: rgb(15 23 42);
}

#network-map,
#map-picker-canvas {
  background: rgb(226 232 240);
}

.alert {
  border: 1px solid rgb(226 232 240);
  border-radius: 0.8rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  background: rgb(255 255 255 / 0.95);
}

@media (max-width: 767px) {
  .table-modern {
    display: block !important;
    width: 100% !important;
    border-collapse: separate !important;
  }

  .table-modern thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
  }

  .table-modern tbody,
  .table-modern tr,
  .table-modern td {
    display: block !important;
    width: 100% !important;
  }

  .table-modern tbody tr {
    margin: 0.55rem;
    border: 1px solid rgb(226 232 240 / 0.9);
    border-radius: 0.9rem;
    background: var(--color-card);
    box-shadow: 0 10px 24px -20px rgb(15 23 42 / 0.35);
    overflow: hidden;
  }

  .dark .table-modern tbody tr {
    border-color: rgb(30 41 59 / 0.9);
  }

  .table-modern tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid rgb(241 245 249);
    text-align: right !important;
    word-break: break-word;
  }

  .dark .table-modern tbody td {
    border-bottom-color: rgb(30 41 59);
  }

  .table-modern tbody td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: rgb(100 116 139);
    text-align: left;
    margin-right: auto;
  }

  .dark .table-modern tbody td::before {
    color: rgb(148 163 184);
  }

  .table-modern tbody tr td:last-child {
    border-bottom: 0;
  }

  .table-modern tbody td .btn-table {
    min-height: 2rem;
  }
}
