/* ==========================================================================
   olt.css — NETASSET OLT list page
   Follows the finalized Server-page visual standard.
   ========================================================================== */

.olt-page {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 30px 36px 56px;
  box-sizing: border-box;
}

.olt-topbar {
  min-height: 118px;
}

.olt-title-block {
  min-width: 0;
}

.olt-title-block h1 {
  margin: 5px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.olt-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.olt-inventory-panel {
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.olt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 88px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.olt-search-wrap {
  width: min(100%, 390px);
}

.olt-search-wrap input {
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
}

.olt-search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.olt-filter-wrap {
  flex-shrink: 0;
}

.olt-filter-wrap .filter-select {
  width: 190px;
  height: 44px;
  box-sizing: border-box;
}

.olt-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
}

.olt-stats .stat-card {
  min-width: 0;
  padding: 20px 22px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.olt-stats .stat-card:last-child {
  border-right: none;
}

.olt-stats .stat-label {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.olt-stats .stat-value {
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  line-height: 1;
  font-weight: 600;
}

.olt-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.olt-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  table-layout: fixed;
}

.olt-table th {
  height: 52px;
  padding: 0 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.olt-table td {
  height: 74px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  vertical-align: middle;
}

.olt-table tbody tr:last-child td {
  border-bottom: none;
}

.olt-table th:nth-child(1),
.olt-table td:nth-child(1) {
  width: 24%;
}

.olt-table th:nth-child(2),
.olt-table td:nth-child(2) {
  width: 15%;
}

.olt-table th:nth-child(3),
.olt-table td:nth-child(3) {
  width: 11%;
}

.olt-table th:nth-child(4),
.olt-table td:nth-child(4) {
  width: 14%;
}

.olt-table th:nth-child(5),
.olt-table td:nth-child(5) {
  width: 11%;
}

.olt-table th:nth-child(6),
.olt-table td:nth-child(6) {
  width: 8%;
}

.olt-table th:nth-child(7),
.olt-table td:nth-child(7) {
  width: 9%;
}

.olt-table th:nth-child(8),
.olt-table td:nth-child(8) {
  width: 9%;
}

.olt-table th:nth-child(9),
.olt-table td:nth-child(9) {
  width: 92px;
}

.olt-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.olt-icon {
  display: inline-flex;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.olt-name-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.olt-name-text strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.olt-name-text small,
.olt-muted {
  color: var(--text-muted);
  font-size: 11px;
}

.olt-hostname,
.olt-type {
  display: block;
}

.olt-hostname,
.olt-mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.olt-type {
  margin-top: 4px;
  color: var(--text);
  font-size: 12px;
}

.olt-badge,
.olt-operational {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
}

.olt-badge {
  padding: 8px 11px;
  border-radius: 999px;
}

.olt-badge i,
.olt-operational i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
}

.olt-badge-active {
  color: #067647;
  background: #e8f7f0;
}

.olt-badge-maintenance {
  color: #344054;
  background: #f0f2f5;
}

.olt-badge-retired {
  color: #b42318;
  background: #fdecec;
}

.olt-operational-up {
  color: #067647;
}

.olt-operational-degraded {
  color: #b54708;
}

.olt-operational-down {
  color: #b42318;
}

.olt-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.olt-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 54px;
  padding: 8px 18px;
  border-top: 1px solid var(--border);
  box-sizing: border-box;
}

.olt-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.btn-reset-demo {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.btn-reset-demo:hover {
  border-color: var(--border-strong);
}

/* Modal */
.olt-modal {
  width: min(1040px, calc(100vw - 32px));
  max-width: 1040px;
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.olt-modal::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.olt-modal form {
  display: flex;
  max-height: calc(100vh - 24px);
  flex-direction: column;
}

.olt-modal .modal-head {
  position: relative;
  flex: 0 0 auto;
  min-height: 108px;
  padding: 28px 72px 24px 30px;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}

.olt-modal .modal-head h3 {
  margin: 6px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  line-height: 1.1;
}

.olt-modal .modal-eyebrow {
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.olt-modal .modal-close {
  position: absolute !important;
  top: 28px !important;
  right: 28px !important;
  left: auto !important;
  width: 38px !important;
  height: 38px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid var(--border) !important;
  border-radius: 9px !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  cursor: pointer !important;
  font-size: 20px !important;
  line-height: 1 !important;
  transform: none !important;
  z-index: 5 !important;
}

.olt-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.olt-modal .form-section {
  padding: 24px 30px;
  border-bottom: 1px solid var(--border);
}

.olt-modal .form-section:last-child {
  border-bottom: none;
}

.olt-modal .form-section-head {
  margin-bottom: 18px;
}

.olt-modal .form-section-head h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
}

.olt-modal .form-section-head p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.olt-modal .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.olt-modal .form-field {
  min-width: 0;
}

.olt-modal .form-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.olt-modal .form-field .hint {
  color: var(--text-muted);
  font-weight: 400;
}

.olt-modal .form-field input,
.olt-modal .form-field select {
  width: 100%;
  height: 46px;
  box-sizing: border-box;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  font: inherit;
  font-size: 13px;
}

.olt-modal .form-field input:focus,
.olt-modal .form-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.olt-modal .form-field input:disabled {
  background: var(--bg);
  color: var(--text-muted);
}

.olt-modal .modal-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 16px 30px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.olt-empty {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--text-muted);
  text-align: center;
}

.olt-empty strong {
  color: var(--text);
  font-size: 14px;
}

@media (max-width: 1000px) {
  .olt-page {
    padding-left: 20px;
    padding-right: 20px;
  }

  .olt-table {
    min-width: 1000px;
  }

  .olt-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .olt-stats .stat-card:nth-child(2) {
    border-right: none;
  }
}

@media (max-width: 700px) {
  .olt-page {
    padding: 18px 12px 36px;
  }

  .olt-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .olt-search-wrap {
    width: 100%;
  }

  .olt-filter-wrap .filter-select {
    width: 100%;
  }

  .olt-stats {
    grid-template-columns: 1fr;
  }

  .olt-stats .stat-card {
    border-right: none;
  }

  .olt-modal {
    width: calc(100vw - 16px);
  }

  .olt-modal .modal-head,
  .olt-modal .form-section,
  .olt-modal .modal-foot {
    padding-left: 18px;
    padding-right: 18px;
  }

  .olt-modal .modal-head {
    padding-right: 64px;
  }

  .olt-modal .modal-close {
    right: 18px !important;
  }

  .olt-modal .form-grid {
    grid-template-columns: 1fr;
  }
}
