/* ==========================================================================
   NETASSET — router.css
   Router list page only
   Works with the new global style.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   ROUTER TABLE CELLS
   -------------------------------------------------------------------------- */

.router-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
}

.router-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 38px;
  height: 38px;
  flex: 0 0 38px;

  margin: 0;

  border-radius: 10px;

  background: var(--accent-soft);
  color: var(--accent-dark);

  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 500;
}

.router-name-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;

  line-height: 1.3;
}

.router-name-text strong {
  display: block;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.router-code-inline {
  color: var(--text-muted);

  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  line-height: 1.3;
}

.router-hostname {
  color: var(--text);

  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   ROUTER OPERATIONAL STATUS
   -------------------------------------------------------------------------- */

.router-operational {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.router-operational::before {
  content: "";

  width: 6px;
  height: 6px;
  flex: 0 0 6px;

  border-radius: 50%;
}

.router-operational-up {
  color: #078f68;
}

.router-operational-up::before {
  background: var(--success);
}

.router-operational-down {
  color: #dc2626;
}

.router-operational-down::before {
  background: var(--danger);
}

.router-operational-degraded {
  color: #d97706;
}

.router-operational-degraded::before {
  background: var(--warning);
}

/* --------------------------------------------------------------------------
   ROUTER SUMMARY
   -------------------------------------------------------------------------- */

.router-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  border-bottom: 1px solid var(--border);
}

.router-summary-item {
  min-width: 0;

  padding: 17px 22px;

  border-right: 1px solid var(--border);
}

.router-summary-item:last-child {
  border-right: none;
}

.router-summary-label {
  display: block;

  margin-bottom: 6px;

  color: var(--text-muted);

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.router-summary-value {
  display: block;

  color: var(--text);

  font-family: "Space Grotesk", sans-serif;
  font-size: 23px;
  font-weight: 600;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   ROUTER TOOLBAR
   --------------------------------------------------------------------------

   HTML router.html memakai:

   .table-toolbar
     ├── .search-box
     └── .topbar-actions
          ├── select
          └── select

   Jadi toolbar:
   kiri  = search
   kanan = filter
   -------------------------------------------------------------------------- */

.router-page .table-toolbar,
.panel .table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  min-height: 70px;
  padding: 16px 22px;

  border-bottom: 1px solid var(--border);
}

.router-page .table-toolbar .search-box,
.panel .table-toolbar .search-box {
  width: min(385px, 42%);
  flex: 0 1 385px;
}

.router-page .table-toolbar > .topbar-actions,
.panel .table-toolbar > .topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;

  flex: 0 0 auto;
}

.router-page .table-toolbar .filter-select,
.panel .table-toolbar .filter-select {
  min-width: 145px;
}

/* --------------------------------------------------------------------------
   ROUTER TABLE
   -------------------------------------------------------------------------- */

.router-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.router-table-wrap table {
  width: 100%;
  min-width: 1080px;
}

.router-table-wrap th {
  height: 46px;
  padding: 0 18px;

  background: var(--bg);
  border-bottom: 1px solid var(--border);

  color: var(--text-muted);

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.router-table-wrap td {
  height: 76px;
  padding: 11px 18px;

  border-bottom: 1px solid var(--border);

  vertical-align: middle;
}

.router-table-wrap tbody tr {
  transition: background 120ms ease;
}

.router-table-wrap tbody tr:hover {
  background: #fbfcfd;
}

.router-table-wrap tbody tr:last-child td {
  border-bottom: none;
}

/* --------------------------------------------------------------------------
   COLUMN BALANCE
   -------------------------------------------------------------------------- */

.router-table-wrap th:nth-child(1),
.router-table-wrap td:nth-child(1) {
  width: 28%;
}

.router-table-wrap th:nth-child(2),
.router-table-wrap td:nth-child(2) {
  width: 18%;
}

.router-table-wrap th:nth-child(3),
.router-table-wrap td:nth-child(3) {
  width: 13%;
}

.router-table-wrap th:nth-child(4),
.router-table-wrap td:nth-child(4) {
  width: 17%;
}

.router-table-wrap th:nth-child(5),
.router-table-wrap td:nth-child(5) {
  width: 10%;
}

.router-table-wrap th:nth-child(6),
.router-table-wrap td:nth-child(6) {
  width: 9%;
}

.router-table-wrap th:nth-child(7),
.router-table-wrap td:nth-child(7) {
  width: 10%;
}

.router-table-wrap th:nth-child(8),
.router-table-wrap td:nth-child(8) {
  width: 92px;
}

/* --------------------------------------------------------------------------
   ROUTER FORM NOTE
   -------------------------------------------------------------------------- */

.router-form-note {
  margin: 14px 24px 0;
  padding: 10px 12px;

  border: 1px solid var(--border);
  border-radius: 7px;

  background: var(--bg);
  color: var(--text-muted);

  font-size: 11px;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   ROUTER RESPONSIVE
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .router-page .table-toolbar,
  .panel .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .router-page .table-toolbar .search-box,
  .panel .table-toolbar .search-box {
    width: 100%;
    flex: 1 1 auto;
  }

  .router-page .table-toolbar > .topbar-actions,
  .panel .table-toolbar > .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .router-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .router-summary-item:nth-child(2) {
    border-right: none;
  }

  .router-summary-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 760px) {
  .router-summary {
    grid-template-columns: 1fr;
  }

  .router-summary-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .router-summary-item:last-child {
    border-bottom: none;
  }

  .router-page .table-toolbar > .topbar-actions,
  .panel .table-toolbar > .topbar-actions {
    justify-content: stretch;
  }

  .router-page .table-toolbar .filter-select,
  .panel .table-toolbar .filter-select {
    min-width: 0;
    width: 100%;
    flex: 1;
  }

  .router-page .table-toolbar > .topbar-actions {
    flex-wrap: wrap;
  }

  .router-name-cell {
    min-width: 220px;
  }

  .router-form-note {
    margin-left: 18px;
    margin-right: 18px;
  }
}

/* ==========================================================================
   NETASSET — ROUTER MODAL
   Modal-specific styling
   ========================================================================== */

#routerModal {
  width: min(760px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);

  padding: 0;
  border: none;
  border-radius: 14px;

  background: #ffffff;
  color: #071b35;

  box-shadow: 0 24px 70px rgba(7, 27, 53, 0.22);
}

#routerModal::backdrop {
  background: rgba(7, 27, 53, 0.42);
  backdrop-filter: blur(2px);
}

/* --------------------------------------------------------------------------
   MODAL HEADER
   -------------------------------------------------------------------------- */

#routerModal .modal-head {
  min-height: 66px;

  padding: 0 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  box-sizing: border-box;

  border-bottom: 1px solid #d9e1eb;
}

#routerModal .modal-head h3 {
  margin: 0;

  color: #071b35;

  font-family: "Space Grotesk", sans-serif;
  font-size: 21px;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   CLOSE BUTTON
   -------------------------------------------------------------------------- */

#routerModal .modal-close {
  width: 34px;
  height: 34px;

  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #cbd7e5;
  border-radius: 8px;

  background: #ffffff;
  color: #526b88;

  cursor: pointer;
}

#routerModal .modal-close:hover {
  background: #f4f7fb;
  color: #071b35;
}

/* --------------------------------------------------------------------------
   MODAL BODY
   -------------------------------------------------------------------------- */

#routerModal .modal-body {
  max-height: calc(100vh - 180px);

  padding: 20px 24px;

  box-sizing: border-box;

  overflow-y: auto;
}

/* --------------------------------------------------------------------------
   SECTION LABEL
   -------------------------------------------------------------------------- */

#routerModal .form-section-label {
  display: block;

  margin: 0 0 12px;

  color: #385572;

  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  font-weight: 700;

  line-height: 1.4;
  letter-spacing: 0.07em;

  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   FORM GRID
   -------------------------------------------------------------------------- */

#routerModal .form-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 18px;

  margin: 0 0 22px;
}

/* --------------------------------------------------------------------------
   FORM FIELD
   -------------------------------------------------------------------------- */

#routerModal .form-field {
  min-width: 0;

  display: flex;
  flex-direction: column;

  gap: 7px;
}

#routerModal .form-field.full {
  grid-column: 1 / -1;
}

/* --------------------------------------------------------------------------
   LABEL
   -------------------------------------------------------------------------- */

#routerModal .form-field label {
  display: block;

  margin: 0;

  color: #385572;

  font-size: 11px;
  font-weight: 600;

  line-height: 1.4;
}

#routerModal .form-field .hint {
  color: #60748e;

  font-size: 10px;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   INPUT / SELECT
   -------------------------------------------------------------------------- */

#routerModal .form-field input,
#routerModal .form-field select,
#routerModal .form-field textarea {
  width: 100%;
  min-height: 44px;

  padding: 10px 12px;

  box-sizing: border-box;

  border: 1px solid #cbd7e5;
  border-radius: 8px;

  outline: none;

  background: #ffffff;
  color: #071b35;

  font-family: "Inter", sans-serif;
  font-size: 13px;
}

#routerModal .form-field input:focus,
#routerModal .form-field select:focus,
#routerModal .form-field textarea:focus {
  border-color: var(--accent);

  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* --------------------------------------------------------------------------
   DISABLED ASSET CODE
   -------------------------------------------------------------------------- */

#routerModal .form-field input:disabled {
  background: #f4f7fb;
  color: #60748e;

  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   MONOSPACE FIELDS
   -------------------------------------------------------------------------- */

#routerModal .mono-input {
  font-family: "IBM Plex Mono", monospace !important;
  font-size: 12px !important;
}

/* --------------------------------------------------------------------------
   ROUTER FORM NOTE
   -------------------------------------------------------------------------- */

#routerModal .router-form-note {
  margin: 2px 0 0;

  padding: 11px 13px;

  border: 1px solid #d9e1eb;
  border-radius: 8px;

  background: #f7f9fc;
  color: #60748e;

  font-size: 11px;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   MODAL FOOTER
   -------------------------------------------------------------------------- */

#routerModal .modal-foot {
  min-height: 74px;

  padding: 14px 24px;

  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 10px;

  box-sizing: border-box;

  border-top: 1px solid #d9e1eb;

  background: #ffffff;
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  #routerModal {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  #routerModal .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  #routerModal .form-field.full {
    grid-column: auto;
  }

  #routerModal .modal-head {
    padding: 0 18px;
  }

  #routerModal .modal-body {
    padding: 18px;
  }

  #routerModal .modal-foot {
    padding: 14px 18px;
  }
}
