* {
  box-sizing: border-box;
}

:root {
  font-family:
    Inter,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;

  color: #172033;
  background: #f3f6fa;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;

  background:
    radial-gradient(
      circle at top left,
      #eef3ff 0,
      transparent 35%
    ),
    #f3f6fa;
}


/* ==========================================================
   TOPBAR
   ========================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;

  height: 74px;
  padding: 0 32px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: rgba(255, 255, 255, 0.94);

  border-bottom: 1px solid #e5eaf1;

  box-shadow:
    0 2px 14px rgba(20, 35, 60, 0.05);

  backdrop-filter: blur(12px);
}

.brand {
  font-size: 23px;
  font-weight: 850;
  letter-spacing: -0.5px;

  color: #111827;
}

.subtitle {
  margin-top: 2px;

  font-size: 12px;
  font-weight: 600;

  letter-spacing: 0.08em;

  color: #7a8496;
}


/* API STATUS
   Tetap ada untuk JavaScript,
   tetapi tidak ditampilkan ke user.
   ========================================================== */

#apiStatus {
  display: none !important;
}


/* ==========================================================
   MAIN CONTAINER
   ========================================================== */

.container {
  width: min(
    1120px,
    calc(100% - 32px)
  );

  margin: 34px auto 60px;
}


/* ==========================================================
   SEARCH CARD
   ========================================================== */

.search-card {
  position: relative;

  padding: 28px;

  background: #ffffff;

  border: 1px solid #e5eaf1;

  border-radius: 18px;

  box-shadow:
    0 8px 30px rgba(25, 40, 70, 0.06);
}

.search-card::before {
  content: "";

  position: absolute;

  left: 0;
  top: 22px;
  bottom: 22px;

  width: 4px;

  border-radius: 0 5px 5px 0;

  background: #5268ff;
}

.search-card h1 {
  margin: 0 0 6px;

  font-size: 24px;
  font-weight: 800;

  letter-spacing: -0.5px;
}

.muted {
  margin: 0 0 20px;

  color: #7b8494;

  font-size: 13px;
  line-height: 1.6;
}


/* ==========================================================
   SEARCH ROW
   ========================================================== */

.search-row {
  display: flex;
  gap: 10px;
}

.search-row input {
  flex: 1;
}


/* ==========================================================
   INPUT
   ========================================================== */

input {
  width: 100%;

  min-height: 46px;

  padding: 0 14px;

  background: #ffffff;

  border: 1px solid #d5dce7;

  border-radius: 10px;

  color: #172033;

  font-size: 14px;

  outline: none;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

input::placeholder {
  color: #a1a9b7;
}

input:hover {
  border-color: #b9c3d2;
}

input:focus {
  border-color: #5268ff;

  box-shadow:
    0 0 0 3px rgba(82, 104, 255, 0.10);
}


/* ==========================================================
   BUTTON
   ========================================================== */

button {
  min-height: 46px;

  padding: 0 20px;

  border: 0;
  border-radius: 10px;

  background: #172033;
  color: #ffffff;

  font-size: 13px;
  font-weight: 750;

  cursor: pointer;

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}

button:hover {
  opacity: 0.94;

  box-shadow:
    0 5px 14px rgba(23, 32, 51, 0.16);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.5;

  cursor: not-allowed;

  box-shadow: none;
}


/* ==========================================================
   HIDDEN
   ========================================================== */

.hidden {
  display: none !important;
}


/* ==========================================================
   MESSAGE
   ========================================================== */

.message {
  margin-top: 18px;

  padding: 14px 17px;

  border: 1px solid #f1d6a8;

  border-radius: 11px;

  background: #fff8eb;

  color: #875100;

  font-size: 13px;

  line-height: 1.5;
}


/* ==========================================================
   ONU CARD
   ========================================================== */

.onu-card {
  margin-top: 22px;

  padding: 25px;

  background: #ffffff;

  border: 1px solid #e4e9f0;

  border-radius: 18px;

  box-shadow:
    0 8px 30px rgba(25, 40, 70, 0.055);
}


/* ==========================================================
   ONU MAIN
   ========================================================== */

.onu-main {
  display: flex;

  align-items: flex-start;

  justify-content: space-between;

  gap: 20px;
}

.onu-main h2 {
  margin: 5px 0 7px;

  font-size: 21px;

  font-weight: 800;

  letter-spacing: -0.3px;

  color: #172033;
}


/* ==========================================================
   LABEL
   ========================================================== */

.label {
  display: block;

  margin-bottom: 5px;

  font-size: 10px;

  font-weight: 800;

  letter-spacing: 0.09em;

  color: #929bab;

  text-transform: uppercase;
}


/* ==========================================================
   MONOSPACE
   ========================================================== */

.mono {
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;

  font-size: 12px;

  color: #687286;
}


//* ==========================================================
   ONU STATUS
   ========================================================== */

.status-badge {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  gap: 7px;

  padding: 7px 12px;

  border-radius: 999px;

  font-size: 12px;

  font-weight: 850;

  letter-spacing: 0.04em;

  white-space: nowrap;
}
.status-online {
  background: #e8f8ef;

  color: #137a3e;

  border: 1px solid #ccefdc;
}

.status-offline {
  background: #fbeaea;

  color: #a52c2c;

  border: 1px solid #f2cece;
}

.status-unknown {
  background: #eef1f5;

  color: #657084;
}


/* ==========================================================
   ONU INFORMATION GRID
   ========================================================== */

.onu-grid {
  display: grid;

  grid-template-columns:
    repeat(4, 1fr);

  gap: 18px;

  margin-top: 22px;

  padding-top: 20px;

  border-top: 1px solid #edf0f5;
}

.onu-grid > div {
  min-width: 0;
}

.onu-grid strong {
  display: block;

  font-size: 13px;

  font-weight: 700;

  color: #303a4d;

  overflow: hidden;

  text-overflow: ellipsis;
}


/* ==========================================================
   HIDE OLT & PON
   Tetap berada di DOM supaya app.js aman.
   ========================================================== */

.onu-grid > div:has(#onuOlt),
.onu-grid > div:has(#onuPon) {
  display: none;
}


/* ==========================================================
   WIFI SECTION
   ========================================================== */

.section-title {
  margin: 32px 0 14px;

  font-size: 18px;

  font-weight: 800;

  letter-spacing: -0.3px;

  color: #172033;
}


/* ==========================================================
   WIFI GRID
   ========================================================== */

.wifi-grid {
  display: grid;

  grid-template-columns:
    repeat(2, 1fr);

  gap: 18px;
}


/* ==========================================================
   WIFI CARD
   ========================================================== */

.wifi-card {
  position: relative;

  padding: 21px;

  background: #ffffff;

  border: 1px solid #e3e8ef;

  border-radius: 16px;

  box-shadow:
    0 7px 24px rgba(25, 40, 70, 0.05);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.wifi-card:hover {
  transform: translateY(-2px);

  border-color: #d7deea;

  box-shadow:
    0 12px 30px rgba(25, 40, 70, 0.08);
}


/* ==========================================================
   WIFI HEADER
   ========================================================== */

.wifi-header {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 15px;

  margin-bottom: 20px;

  padding-bottom: 15px;

  border-bottom: 1px solid #edf0f5;
}

.wifi-band {
  font-size: 18px;

  font-weight: 850;

  letter-spacing: -0.3px;

  color: #172033;
}

.wifi-port {
  margin-top: 3px;

  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;

  font-size: 11px;

  color: #8b94a4;
}


/* ==========================================================
   FIELD
   ========================================================== */

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;

  margin-bottom: 7px;

  font-size: 12px;

  font-weight: 750;

  color: #4b5668;
}


/* ==========================================================
   PASSWORD
   ========================================================== */

.password-row {
  display: flex;

  gap: 8px;
}

.password-row input {
  flex: 1;
}

.small-button {
  min-width: 102px;

  padding: 0 12px;

  font-size: 12px;
}


/* ==========================================================
   WIFI META
   ========================================================== */

.wifi-meta {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 10px;

  margin-top: 18px;

  padding-top: 15px;

  border-top: 1px solid #edf0f5;
}

.meta-item {
  padding: 9px 10px;

  border-radius: 8px;

  background: #f7f9fc;

  color: #7b8494;

  font-size: 11px;
}

.meta-item strong {
  display: block;

  margin-top: 3px;

  color: #303a4d;

  font-size: 12px;
}


/* ==========================================================
   SAVE BUTTON
   ========================================================== */

.save-button {
  width: 100%;

  margin-top: 18px;

  background: #172033;

  letter-spacing: 0.01em;
}

.save-button:hover {
  background: #222e46;
}


/* ==========================================================
   MODAL
   ========================================================== */

.modal {
  position: fixed;

  inset: 0;

  z-index: 1000;

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 20px;

  background:
    rgba(10, 18, 32, 0.58);

  backdrop-filter: blur(5px);
}


/* ==========================================================
   MODAL BOX
   ========================================================== */

.modal-box {
  width: min(
    480px,
    100%
  );

  padding: 25px;

  background: #ffffff;

  border: 1px solid #e1e6ee;

  border-radius: 17px;

  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.18);

  animation:
    modalIn 0.18s ease-out;
}

@keyframes modalIn {

  from {
    opacity: 0;

    transform:
      translateY(8px)
      scale(0.98);
  }

  to {
    opacity: 1;

    transform:
      translateY(0)
      scale(1);
  }

}

.modal-box h2 {
  margin: 0 0 10px;

  font-size: 19px;

  font-weight: 800;

  letter-spacing: -0.3px;
}

.modal-box p {
  font-size: 13px;

  line-height: 1.6;

  color: #687286;
}


/* ==========================================================
   CONFIRM DETAILS
   ========================================================== */

.confirm-details {
  margin: 18px 0;

  padding: 15px;

  background: #f6f8fb;

  border: 1px solid #e7ebf1;

  border-radius: 11px;

  font-size: 13px;

  line-height: 1.8;

  color: #3b4658;
}

.confirm-details strong {
  display: inline-block;

  margin-bottom: 2px;

  color: #172033;

  font-size: 14px;
}


/* ==========================================================
   MODAL ACTIONS
   ========================================================== */

.modal-actions {
  display: flex;

  justify-content: flex-end;

  gap: 10px;

  margin-top: 20px;
}

.button-secondary {
  background: #edf0f4;

  color: #172033;
}

.button-secondary:hover {
  background: #e2e6ec;
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 800px) {

  .container {
    width:
      min(
        100% - 24px,
        1120px
      );

    margin-top: 22px;
  }

  .wifi-grid {
    grid-template-columns: 1fr;
  }

  .onu-grid {
    grid-template-columns:
      repeat(2, 1fr);
  }

}


/* ==========================================================
   SMALL MOBILE
   ========================================================== */

@media (max-width: 520px) {

  .topbar {
    height: 68px;

    padding: 0 16px;
  }

  .brand {
    font-size: 20px;
  }

  .subtitle {
    font-size: 10px;
  }

  .container {
    width:
      calc(100% - 20px);

    margin-top: 15px;

    margin-bottom: 35px;
  }

  .search-card {
    padding: 22px;
  }

  .search-card h1 {
    font-size: 21px;
  }

  .search-row {
    flex-direction: column;
  }

  .search-row button {
    width: 100%;
  }

  .onu-card {
    padding: 20px;
  }

  .onu-main {
    flex-direction: column;

    gap: 12px;
  }

  .onu-grid {
    grid-template-columns: 1fr;

    gap: 14px;
  }

  .wifi-card {
    padding: 18px;
  }

  .password-row {
    flex-direction: column;
  }

  .small-button {
    width: 100%;
  }

  .wifi-meta {
    grid-template-columns: 1fr;
  }

  .modal-box {
    padding: 21px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }

}
/* Sembunyikan informasi DHCP dan Authentication */
.wifi-meta {
  display: none !important;
}
/* ==========================================================
   ROUTER HOSTS
   ========================================================== */

.router-hosts-wrapper {
  width: 100%;
  margin-bottom: 30px;
}


/* ==========================================================
   ROUTER HOSTS TABLE CONTAINER
   ========================================================== */

.router-hosts-table-wrapper {
  width: 100%;

  overflow-x: auto;

  background: #ffffff;

  border: 1px solid #e3e8ef;

  border-radius: 16px;

  box-shadow:
    0 7px 24px rgba(25, 40, 70, 0.05);

  -webkit-overflow-scrolling: touch;
}


/* ==========================================================
   TABLE
   ========================================================== */

.router-hosts-table {
  width: 100%;

  min-width: 720px;

  border-collapse: collapse;

  table-layout: auto;

  font-size: 13px;
}


/* ==========================================================
   TABLE HEADER
   ========================================================== */

.router-hosts-table thead {
  background: #f7f9fc;
}

.router-hosts-table th {
  padding: 14px 16px;

  text-align: left;

  white-space: nowrap;

  border-bottom: 1px solid #e5eaf1;

  color: #697386;

  font-size: 11px;

  font-weight: 800;

  letter-spacing: 0.05em;

  text-transform: uppercase;
}


/* ==========================================================
   TABLE BODY
   ========================================================== */

.router-hosts-table td {
  padding: 15px 16px;

  white-space: nowrap;

  border-bottom: 1px solid #edf0f5;

  color: #303a4d;

  font-size: 13px;
}

.router-hosts-table tbody tr:last-child td {
  border-bottom: none;
}


/* ==========================================================
   HOVER
   ========================================================== */

.router-hosts-table tbody tr {
  transition:
    background 0.15s ease;
}

.router-hosts-table tbody tr:hover {
  background: #f8fafc;
}


/* ==========================================================
   IP ADDRESS
   ========================================================== */

.router-hosts-table td:first-child {
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;

  font-weight: 700;

  color: #172033;
}


/* ==========================================================
   MAC ADDRESS
   ========================================================== */

.router-hosts-table td:nth-child(2) {
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;

  font-size: 12px;

  color: #596579;
}


/* ==========================================================
   INTERFACE
   ========================================================== */

.router-hosts-table td:nth-child(3) {
  font-weight: 600;
}


/* ==========================================================
   SOURCE
   ========================================================== */

.router-hosts-table td:nth-child(4) {
  color: #687286;
}


/* ==========================================================
   STATUS
   ========================================================== */

.router-hosts-status {
  display: inline-flex;

  align-items: center;

  gap: 7px;

  font-size: 10px;

  font-weight: 850;

  letter-spacing: 0.04em;
}

.router-hosts-status-dot {
  width: 8px;

  height: 8px;

  flex: 0 0 8px;

  border-radius: 50%;
}


/* ACTIVE */

.router-hosts-status.active {
  color: #137a3e;
}

.router-hosts-status.active
.router-hosts-status-dot {
  background: #22c55e;

  box-shadow:
    0 0 0 3px rgba(34, 197, 94, 0.12);
}


/* INACTIVE */

.router-hosts-status.inactive {
  color: #687286;
}

.router-hosts-status.inactive
.router-hosts-status-dot {
  background: #aab2bf;
}


/* ==========================================================
   EMPTY / LOADING MESSAGE
   ========================================================== */

.router-hosts-message {
  margin-bottom: 12px;

  padding: 14px 16px;

  background: #ffffff;

  border: 1px solid #e3e8ef;

  border-radius: 12px;

  color: #687286;

  font-size: 13px;

  text-align: center;
}

.router-hosts-message.hidden {
  display: none !important;
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 800px) {

  .router-hosts-table {
    min-width: 700px;
  }

  .router-hosts-table th,
  .router-hosts-table td {
    padding: 13px 14px;
  }

}


/* ==========================================================
   SMALL MOBILE
   ========================================================== */

@media (max-width: 520px) {

  .router-hosts-table-wrapper {
    border-radius: 14px;
  }

  .router-hosts-table {
    min-width: 680px;

    font-size: 12px;
  }

  .router-hosts-table th {
    padding: 12px 13px;

    font-size: 10px;
  }

  .router-hosts-table td {
    padding: 13px;

    font-size: 12px;
  }

  .router-hosts-table td:nth-child(2) {
    font-size: 11px;
  }

}
.onu-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  display: inline-block;
}


/* ONLINE - HIJAU */

.status-online .onu-status-dot {
  background: #22c55e;

  box-shadow:
    0 0 0 3px
    rgba(34, 197, 94, 0.15);
}


/* OFFLINE - MERAH */

.status-offline .onu-status-dot {
  background: #f59e0b;

  box-shadow:
    0 0 0 3px
    rgba(239, 68, 68, 0.15);
}


/* UNKNOWN / STATUS LAIN - KUNING */

.status-unknown .onu-status-dot {
  background: #ef4444;

  box-shadow:
    0 0 0 3px
    rgba(245, 158, 11, 0.15);
}
.status-text {
  font-weight: 900;
}