/* Dashboard utama pada layar ponsel */
@media (max-width: 650px) {
  body { overflow-x: hidden; }

  body > header {
    position: sticky !important;
    top: 0;
    z-index: 10;
    height: auto !important;
    padding: 11px 12px !important;
    display: block !important;
  }

  body > header h1 {
    font-size: 19px;
    line-height: 1.15;
  }

  body > header .eyebrow { font-size: 8px; }

  .header-actions {
    width: 100%;
    margin-top: 10px !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px !important;
  }

  .header-actions .search {
    grid-column: 1 / -1;
    width: 100%;
    height: 38px;
    padding: 0 10px;
  }

  .header-actions .search input {
    width: 100%;
    min-width: 0;
    font-size: 12px;
  }

  .header-actions > button {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 7px 5px;
    font-size: 10px;
    line-height: 1.15;
    white-space: normal;
  }

  .summary {
    margin: 10px 12px !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden !important;
    border-radius: 12px;
  }

  .summary > div {
    min-width: 0 !important;
    padding: 10px 12px !important;
  }

  .summary strong { font-size: 19px; }
  .summary span { font-size: 9px; }
  .summary .legend { display: none !important; }

  .workspace {
    width: auto;
    min-width: 0;
    margin: 0 12px 18px !important;
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .topology-card,
  .panel {
    width: 100%;
    min-width: 0;
    border-radius: 13px !important;
  }

  .section-head {
    height: auto !important;
    min-height: 58px;
    padding: 11px 13px !important;
    align-items: center !important;
  }

  .section-head h2 {
    margin-top: 2px;
    font-size: 15px;
  }

  .section-head .eyebrow { font-size: 8px; }
  .section-head .hint { display: none; }

  #canvas {
    width: 100%;
    height: min(54vh, 520px) !important;
    min-height: 390px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .panel { min-height: 0 !important; }
  .empty-panel {
    min-height: 180px !important;
    padding: 28px 20px;
  }

  .empty-icon { font-size: 34px; }
  .empty-panel h3 { font-size: 15px; }
  .empty-panel p { font-size: 11px; }

  .panel-head { padding: 14px !important; }
  .panel-head h3 { font-size: 16px !important; }
  .chips { margin-top: 8px; gap: 5px !important; }
  .chip { padding: 4px 7px !important; font-size: 9px !important; }

  .cable-tabs {
    padding: 8px !important;
    gap: 5px !important;
    scrollbar-width: thin;
  }

  .cable-tabs button {
    min-height: 34px;
    padding: 6px 8px !important;
    font-size: 9px;
  }

  .core-table {
    width: 100%;
    table-layout: fixed;
  }

  .core-table th,
  .core-table td {
    padding: 6px 3px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
  }

  .core-table th { font-size: 8px; }
  .core-table th:nth-child(1), .core-table td:nth-child(1) { width: 42px; }
  .core-table th:nth-child(2), .core-table td:nth-child(2) { width: 17%; }
  .core-table th:nth-child(4), .core-table td:nth-child(4) { width: 67px; }
  .core-table th:nth-child(5), .core-table td:nth-child(5) { width: 42px; }

  .core-no {
    width: 30px;
    padding: 5px 2px !important;
  }

  .core-table .status {
    display: inline-block;
    max-width: 62px;
    padding: 4px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 7px;
  }

  .core-table .edit {
    width: 36px;
    min-height: 30px;
    padding: 4px 2px;
    font-size: 8px;
  }

  .cable-detail { padding: 14px; }
  .cable-detail dl {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
  }

  .cable-detail dt { font-size: 10px; }
  .cable-detail dd { font-size: 11px; overflow-wrap: anywhere; }

  #toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    text-align: center;
    font-size: 11px;
  }
}

@media (max-width: 760px) {
  body > header {
    padding: 14px 12px 12px !important;
    border-bottom: 1px solid #dce8ed;
    box-shadow: 0 5px 18px rgba(18,55,76,.07);
  }

  .summary {
    gap: 8px !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    overflow: visible !important;
  }

  .summary > div {
    min-height: 76px !important;
    padding: 13px 10px 11px 48px !important;
    border: 1px solid #d7e5eb !important;
    border-radius: 13px !important;
    overflow: hidden !important;
    box-shadow: 0 5px 14px rgba(18,55,76,.05) !important;
  }

  .summary > div:before {
    left: 11px !important;
    width: 28px !important;
    height: 28px !important;
  }

  .summary strong {
    position: relative;
    z-index: 1;
    display: block !important;
    margin: 0 !important;
    font-size: 20px !important;
    line-height: 1.05 !important;
  }

  .summary span {
    position: relative;
    z-index: 1;
    display: block !important;
    margin-top: 5px !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  .topology-card .section-head {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) auto !important;
    gap: 8px 10px !important;
    padding: 13px !important;
  }

  .topology-card .section-head > div:first-child { min-width: 0; }
  .topology-card .section-head h2 { font-size: 16px !important; }
  .topology-card .zoom-controls {
    grid-column: 1 / -1;
    justify-self: end;
    margin-top: 2px;
    padding: 4px;
    border: 1px solid #dce8ed;
    border-radius: 11px;
    background: #f5f9fa;
  }

  .topology-card .zoom-controls button {
    min-width: 35px;
    min-height: 32px;
    padding: 5px 8px;
  }

  #canvas {
    border-top: 1px solid #e0eaee;
    box-shadow: inset 0 8px 16px -16px rgba(18,55,76,.35);
    scrollbar-color: #8fb1c0 #edf4f6;
  }
}
