/*
 * J-Log pela USB (wifi.js, usbfiles.js) and Modelos de redes. Same tokens
 * and primitives as app.css; only what those pages add.
 */

/* In-page tabs (buttons: changing the hash would close the USB port). */
.tabs button.tab {
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.tabs button.tab.active {
  font-weight: 600;
}

.pad {
  padding: 12px;
}

/* Wi-Fi signal: 4 bars */
.sig {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  width: 18px;
  height: 14px;
  flex-shrink: 0;
}
.sig i {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: var(--border-strong);
}
.sig i:nth-child(1) { height: 25%; }
.sig i:nth-child(2) { height: 50%; }
.sig i:nth-child(3) { height: 75%; }
.sig i:nth-child(4) { height: 100%; }
.sig.lvl-1 i:nth-child(-n + 1),
.sig.lvl-2 i:nth-child(-n + 2),
.sig.lvl-3 i:nth-child(-n + 3),
.sig.lvl-4 i:nth-child(-n + 4) {
  background: var(--success-text);
}
.sig.lvl-1 i:nth-child(-n + 1) {
  background: var(--warning-text);
}

/* Network lists */
.net-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.net-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 6px 12px;
  border: 0;
  border-top: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  text-align: left;
}
.net-row:first-child {
  border-top: 0;
}
button.net-row {
  cursor: pointer;
}
button.net-row:hover {
  background: var(--accent);
}
button.net-row:disabled {
  cursor: progress;
  opacity: 0.6;
}
.net-name {
  font-weight: 500;
  min-width: 0;
  flex-shrink: 1;
}
.net-row .icon-sm.ok {
  color: var(--success-text);
}
.add-net summary {
  cursor: pointer;
  color: var(--brand-text);
  font-size: 14px;
  margin-bottom: 10px;
}

/* Password with show/hide */
.pass-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.pass-field .input {
  width: 100%;
  padding-right: 40px;
}
.pass-field .btn {
  position: absolute;
  right: 2px;
}

/* Templates */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  align-items: start;
}
.table-wrap.flat {
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.tpl-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tpl-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.tpl-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tpl-preview li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tpl-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--muted-foreground);
}
.dialog.wide {
  width: min(640px, calc(100vw - 32px));
}

/* Files over USB */
.day-list button.day {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.day-list button.day:hover {
  background: var(--accent);
}
.day-list button.day.active {
  background: var(--brand-subtle);
  color: var(--brand-text);
  font-weight: 600;
}
.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}
.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.2s linear;
}
.transfer .row strong {
  min-width: 0;
}

@media (max-width: 767px) {
  .tpl-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .tpl-row .pass-field {
    grid-column: 1;
    grid-row: 2;
  }
  .day-list button.day {
    width: auto;
    flex-shrink: 0;
  }
}
