/* ================================================================
   UniFi Converter — "Ink" theme
   Flat, solid surfaces. GitHub-dark inspired. Green accent.
   No backdrop blur, no glows, no gradient orbs.
   ================================================================ */
:root {
  /* Surfaces */
  --bg:              #0d1117;
  --bg-2:            #010409;
  --bg-card:         #161b22;
  --bg-card-hover:   #1c2128;
  --bg-panel:        #161b22;
  --bg-input:        #0d1117;
  --bg-hover:        #21262d;
  --bg-th:           #1c2128;

  /* Borders */
  --border:          #30363d;
  --border-light:    #21262d;
  --border-active:   #2f81f7;

  /* Accent — solid green */
  --accent:          #238636;
  --accent-h:        #2ea043;
  --accent-fg:       #ffffff;
  --accent-dim:      rgba(46,160,67,0.12);
  --grad-primary:    #238636;
  --primary:         #2ea043;
  --primary-glow:    transparent;

  --link:            #58a6ff;
  --violet:          #a371f7;

  /* Status */
  --success:         #3fb950;
  --success-bg:      rgba(46,160,67,0.10);
  --warning:         #d29922;
  --warning-bg:      rgba(187,128,9,0.10);
  --error:           #f85149;
  --error-bg:        rgba(248,81,73,0.10);

  /* Text */
  --text:            #e6edf3;
  --text-muted:      #8b949e;
  --text-dim:        #6e7681;

  /* Geometry */
  --radius:          8px;
  --radius-sm:       6px;

  --shadow-card:     none;
  --shadow-pop:      0 8px 24px rgba(1,4,9,0.55), 0 0 0 1px rgba(48,54,61,0.6);

  --maxw:            1080px;
  --font:            -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', system-ui, sans-serif;
  --mono:            'SF Mono', 'JetBrains Mono', 'Cascadia Code', ui-monospace, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; }
::selection { background: rgba(56,139,253,0.30); }

/* ================================================================
   App shell
   ================================================================ */
.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 1.5rem; height: 60px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 600; font-size: 15px; white-space: nowrap; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 64px; height: 64px; border-radius: 7px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 40px; height: 40px; color: #fff; }
.brand small { display: block; font-size: 11px; font-weight: 400; color: var(--text-dim); letter-spacing: 0; text-transform: none; margin-top: 1px; }

.topbar-spacer { flex: 1; }

.conn-chip {
  display: flex; align-items: center; gap: .55rem;
  padding: .35rem .75rem .35rem .65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  text-decoration: none;
  color: var(--text);
}
.conn-chip:hover { background: var(--bg-hover); border-color: #444c56; text-decoration: none; }
.conn-chip.off { border-color: rgba(248,81,73,0.4); }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.conn-chip.off .conn-dot { background: var(--error); }
.conn-text { display: flex; flex-direction: column; line-height: 1.25; }
.conn-text b { font-size: 12px; font-weight: 600; }
.conn-text span { font-size: 11px; color: var(--text-muted); }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); border-color: #444c56; text-decoration: none; }
.icon-btn.active { color: var(--accent-h); border-color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }

/* ================================================================
   Horizontal stepper
   ================================================================ */
.stepper-wrap { display: flex; justify-content: center; padding: 1.75rem 1.5rem .25rem; }
.stepper { display: flex; align-items: flex-start; width: 100%; max-width: 720px; }
.step {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  flex: 0 0 auto; background: none; border: none; cursor: pointer; padding: 0;
  text-decoration: none;
}
.step:disabled { cursor: not-allowed; }
.step-node {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  transition: all .2s ease;
}
.step-node svg { width: 15px; height: 15px; }
.step.done .step-node { color: #fff; background: var(--accent); border-color: var(--accent); }
.step.current .step-node { color: var(--accent-h); border-color: var(--accent-h); background: var(--accent-dim); }
.step-label { font-size: 11.5px; font-weight: 500; color: var(--text-dim); white-space: nowrap; transition: color .2s; }
.step.current .step-label { color: var(--text); font-weight: 600; }
.step.done .step-label { color: var(--text-muted); }
.step-line { flex: 1 1 auto; height: 2px; margin: 16px .3rem 0; background: var(--border); border-radius: 2px; }
.step-line.filled { background: var(--accent); }

/* ================================================================
   Main content
   ================================================================ */
.main {
  flex: 1; width: 100%; max-width: var(--maxw);
  margin: 0 auto; padding: 1.25rem 1.5rem 4rem;
  animation: slide-in .25s ease both;
}
@keyframes slide-in { from { transform: translateY(6px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .main { animation: none; } }

.page-head { margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.55rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: .3rem; }
.page-head .sub { color: var(--text-muted); font-size: 14px; max-width: 64ch; }
.page-head .sub code, .field-hint code, .sub code {
  font-family: var(--mono); font-size: 12px;
  background: rgba(110,118,129,0.18);
  padding: .12rem .4rem; border-radius: 5px; color: var(--text);
}

/* Legacy page-header alias */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.55rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: .3rem; }
.page-header .subtitle { color: var(--text-muted); font-size: 14px; }

/* ================================================================
   Cards
   ================================================================ */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card + .card { margin-top: 1rem; }
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-th);
}
.card-header h3 { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.card-body { padding: 1.15rem; }

.success-card { border-color: rgba(46,160,67,0.4); }
.success-card .card-header { background: var(--success-bg); }
.warning-card { border-color: rgba(187,128,9,0.4); }

/* ================================================================
   Two-column
   ================================================================ */
.two-col { display: grid; grid-template-columns: 5fr 7fr; gap: 1rem; align-items: start; }
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; } }

/* ================================================================
   Tables
   ================================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: .55rem 1.1rem;
  background: var(--bg-th); color: var(--text-muted);
  font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}
td { padding: .55rem 1.1rem; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: rgba(177,186,196,0.04); }
tr.row-warning td { background: rgba(248,81,73,0.07); }
tr.row-uplink td { box-shadow: inset 2px 0 0 var(--warning); }
tr.row-off { opacity: .45; }
tr.row-deselected { opacity: .45; }

.mono { font-family: var(--mono); font-size: 12.5px; }
.dim  { color: var(--text-muted); }
.small{ font-size: 12px; }
.vlan-cell { font-family: var(--mono); font-size: 12.5px; }

/* ================================================================
   Badges / labels
   ================================================================ */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .1rem .55rem;
  border-radius: 999px;
  font-size: 11px; font-weight: 500; line-height: 1.55;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge svg { width: 11px; height: 11px; }
.badge-cyan   { background: rgba(56,139,253,0.15);  color: #6cb6ff; border-color: rgba(56,139,253,0.32); }
.badge-blue   { background: rgba(56,139,253,0.15);  color: #6cb6ff; border-color: rgba(56,139,253,0.32); }
.badge-violet { background: rgba(163,113,247,0.15); color: #d2a8ff; border-color: rgba(163,113,247,0.32); }
.badge-purple { background: rgba(163,113,247,0.15); color: #d2a8ff; border-color: rgba(163,113,247,0.32); }
.badge-green  { background: rgba(46,160,67,0.15);   color: #3fb950; border-color: rgba(46,160,67,0.32); }
.badge-red    { background: rgba(248,81,73,0.15);   color: #ff7b72; border-color: rgba(248,81,73,0.32); }
.badge-amber  { background: rgba(187,128,9,0.15);   color: #e3b341; border-color: rgba(187,128,9,0.34); }
.badge-yellow { background: rgba(187,128,9,0.15);   color: #e3b341; border-color: rgba(187,128,9,0.34); }
.badge-gray   { background: rgba(110,118,129,0.15); color: #8b949e; border-color: rgba(110,118,129,0.3); }

/* ================================================================
   Buttons
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s, opacity .12s;
  white-space: nowrap; line-height: 1;
  text-decoration: none;
}
.btn svg { width: 15px; height: 15px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(0.5px); }
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: rgba(255,255,255,0.08); }
.btn-primary:hover:not(:disabled) { background: var(--accent-h); }

.btn-secondary { background: var(--bg-hover); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: #2d333b; border-color: #444c56; }

.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }

.btn-danger { background: var(--error); color: #fff; border-color: rgba(255,255,255,0.08); }
.btn-danger:hover:not(:disabled) { background: #da3633; }

.btn-sm { padding: .32rem .65rem; font-size: 12px; }
.btn-group { display: flex; gap: .3rem; }

/* Ghost small — legacy compat */
.btn-ghost-sm {
  background: none; border: none; color: var(--text-dim);
  font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .35rem .6rem; border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
  font-family: inherit;
}
.btn-ghost-sm:hover { background: var(--bg-hover); color: var(--text-muted); }

/* ================================================================
   Forms
   ================================================================ */
.field { margin-bottom: 1.1rem; }
.field:last-child { margin-bottom: 0; }
.field label, .field-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text);
  margin-bottom: .4rem; text-transform: none; letter-spacing: 0;
}

/* Legacy form-group alias */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text);
  margin-bottom: .4rem;
}

input[type=text], input[type=url], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px; font-family: inherit;
  padding: .55rem .75rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:focus, select:focus, textarea:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(47,129,247,0.3);
}
textarea {
  resize: vertical; min-height: 180px;
  background: var(--bg-2);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
}
.field-hint { color: var(--text-muted); font-size: 12px; margin-top: .4rem; line-height: 1.5; }
.input-row { display: flex; gap: .5rem; }
.input-row input { flex: 1; }

/* input-with-action alias */
.input-with-action { display: flex; gap: .5rem; }
.input-with-action input { flex: 1; }

.checkbox-label {
  display: inline-flex !important; align-items: center; gap: .5rem; cursor: pointer;
  font-size: 13px; color: var(--text) !important;
  text-transform: none !important; letter-spacing: 0 !important; font-weight: 400 !important; margin: 0 !important;
}
.checkbox-label input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* form-row alias */
.form-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.form-row label { white-space: nowrap; font-size: 13px; color: var(--text-muted); }
.form-row select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: .45rem .75rem;
  outline: none;
  width: auto;
}

/* ================================================================
   Dropzone
   ================================================================ */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem;
  padding: 2.5rem 2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--bg-2);
  margin: 0;
}
.dropzone:hover, .dropzone.drag, .dropzone.drag-over { border-color: var(--accent-h); background: rgba(46,160,67,0.05); }
.dropzone .dz-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--bg-hover); border: 1px solid var(--border);
}
.dropzone .dz-icon svg { width: 22px; height: 22px; color: var(--text-muted); }
.dropzone:hover .dz-icon svg { color: var(--accent-h); }
.dropzone svg { width: 40px; height: 40px; color: var(--text-dim); }
.dropzone:hover svg { color: var(--accent-h); }
.dropzone h3 { font-size: 15px; font-weight: 600; }
.dropzone p { color: var(--text-muted); font-size: 13px; }
.dropzone .hint { font-size: 11.5px; color: var(--text-dim); }

/* ================================================================
   Section label
   ================================================================ */
.section-label { display: flex; align-items: center; gap: .55rem; margin: 0 0 .65rem; font-size: 14px; }
.section-label.mt { margin-top: 2rem; }
/* upload-section-label alias */
.upload-section-label { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; font-size: 14px; }

/* ================================================================
   Stats
   ================================================================ */
.stats-row { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: .25rem; }
.stat { display: flex; flex-direction: column; gap: .1rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; color: var(--success); }
.stat-label { font-size: 11.5px; color: var(--text-muted); }

/* ================================================================
   Pick cards (switch / controller)
   ================================================================ */
.pick-grid { display: flex; flex-direction: column; gap: .5rem; padding: .8rem; }
.pick-card {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.pick-card:hover { border-color: #444c56; background: var(--bg-hover); }
.pick-card.selected { border-color: var(--accent); background: rgba(46,160,67,0.08); }
.pick-card.off { opacity: .5; }
.pick-card.offline { opacity: .5; }
.pick-icon {
  width: 42px; height: 42px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: grid; place-items: center; background: var(--bg-hover); border: 1px solid var(--border);
}
.pick-icon svg { width: 24px; height: 24px; color: var(--text-muted); }
.pick-card.selected .pick-icon svg { color: var(--accent-h); }
.pick-info { flex: 1; min-width: 0; }
.pick-name { font-weight: 600; font-size: 14px; }
.pick-meta { font-size: 12px; color: var(--text-muted); }
.pick-meta .mono { font-size: 11.5px; }

.radio-dot {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--border); display: grid; place-items: center;
  transition: border-color .12s;
}
.pick-card.selected .radio-dot { border-color: var(--accent); }
.pick-card.selected .radio-dot::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

/* Switch-grid legacy alias */
.switch-grid { display: flex; flex-direction: column; gap: .5rem; padding: .8rem; }

/* Controller grid (settings) */
.controller-grid { display: flex; flex-direction: column; gap: .4rem; }

/* ================================================================
   Alerts
   ================================================================ */
.alert {
  display: flex; gap: .65rem;
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 13px; margin-bottom: 1rem; line-height: 1.5;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-warning { background: var(--warning-bg); border-color: rgba(187,128,9,0.4); color: #e3b341; }
.alert-success { background: var(--success-bg); border-color: rgba(46,160,67,0.4); color: #56d364; }
.alert-error   { background: var(--error-bg);   border-color: rgba(248,81,73,0.4); color: #ff7b72; }
.alert-info    { background: rgba(56,139,253,0.1); border-color: rgba(56,139,253,0.4); color: #6cb6ff; }
.alert a { color: inherit; text-decoration: underline; }

/* ================================================================
   Actions bar
   ================================================================ */
.actions-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
.warning-list { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--warning); font-size: 12.5px; line-height: 1.8; }

/* ================================================================
   Empty / loading
   ================================================================ */
.placeholder { padding: 2.25rem; text-align: center; color: var(--text-muted); font-size: 13px; }
.empty-state { padding: 2.25rem; text-align: center; color: var(--text-dim); font-size: 13px; }
.spinner-row { display: flex; align-items: center; justify-content: center; gap: .65rem; padding: 2.25rem; color: var(--text-muted); font-size: 13px; }
/* Legacy loading-placeholder */
.loading-placeholder { display: flex; align-items: center; justify-content: center; gap: .65rem; padding: 2.25rem; color: var(--text-muted); font-size: 13px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent-h); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner.lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   Overlay
   ================================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(1,4,9,0.72);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem;
}
.overlay p { color: var(--text-muted); font-size: 14px; }

/* ================================================================
   Toast
   ================================================================ */
.toast-container { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 200; display: flex; flex-direction: column; gap: .55rem; }
.toast {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  font-size: 13px; min-width: 230px; max-width: 380px;
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast.success svg { color: var(--success); }
.toast.warning svg { color: var(--warning); }
.toast.error svg   { color: var(--error); }
.toast.info svg    { color: var(--link); }

/* Legacy toast type classes */
.toast-success { border-color: rgba(46,160,67,0.4); }
.toast-success svg { color: var(--success); }
.toast-error   { border-color: rgba(248,81,73,0.4); }
.toast-error svg { color: var(--error); }
.toast-warning { border-color: rgba(187,128,9,0.4); }
.toast-warning svg { color: var(--warning); }
.toast-info    { border-color: rgba(56,139,253,0.4); }
.toast-info svg { color: var(--link); }

/* ================================================================
   Sheet (settings / help)
   ================================================================ */
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(1,4,9,0.6); display: flex; justify-content: flex-end; }
.sheet {
  width: 480px; max-width: 92vw; height: 100%;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
  animation: sheet-in .22s ease;
}
@keyframes sheet-in { from { transform: translateX(32px); } to { transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sheet-head h2 { font-size: 16px; font-weight: 600; }
.sheet-body { padding: 1.25rem; overflow-y: auto; flex: 1; }

/* ================================================================
   Mode tabs (settings page)
   ================================================================ */
.tabs { display: flex; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; margin-bottom: 1.1rem; }
.tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .45rem .85rem; border-radius: calc(var(--radius-sm) - 2px);
  border: none; background: transparent; color: var(--text-muted); cursor: pointer;
  font-size: 12.5px; font-weight: 600; transition: background .12s, color .12s;
  font-family: inherit;
}
.tab svg { width: 14px; height: 14px; }
.tab.active { background: var(--bg-hover); color: var(--text); }
.tab:hover:not(.active) { color: var(--text); }

/* disc-tabs alias → tabs */
.disc-tabs { display: flex; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; margin-bottom: 1.1rem; width: fit-content; }
.disc-tab {
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem .85rem; border-radius: calc(var(--radius-sm) - 2px);
  border: none; background: transparent; color: var(--text-muted); cursor: pointer;
  font-size: 12.5px; font-weight: 600; transition: background .12s, color .12s;
  font-family: inherit;
}
.disc-tab.active { background: var(--bg-hover); color: var(--text); }
.disc-tab:hover:not(.active) { color: var(--text); }

/* ================================================================
   Pills
   ================================================================ */
.pill-group { display: flex; flex-wrap: wrap; gap: .45rem; }
.pill { padding: .35rem .9rem; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 13px; transition: all .12s; }
.pill:hover { border-color: #444c56; }
.pill.selected { border-color: var(--accent); background: rgba(46,160,67,0.1); color: #56d364; font-weight: 600; }

/* site-pill alias */
.site-pill { padding: .35rem .9rem; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 13px; transition: all .12s; }
.site-pill:hover { border-color: #444c56; }
.site-pill.selected { border-color: var(--accent); background: rgba(46,160,67,0.1); color: #56d364; font-weight: 600; }

/* ================================================================
   Settings page specifics
   ================================================================ */
.settings-msg {
  margin-top: .75rem;
  padding: .6rem .9rem;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.settings-msg.ok   { background: var(--success-bg); color: #56d364; border-color: rgba(46,160,67,0.4); }
.settings-msg.err  { background: var(--error-bg);   color: #ff7b72; border-color: rgba(248,81,73,0.4); }
.settings-msg.warn { background: var(--warning-bg); color: #e3b341; border-color: rgba(187,128,9,0.4); }

.ctrl-icon svg { width: 32px; height: 32px; color: var(--text-dim); }
.ctrl-name { font-weight: 600; font-size: 14px; }
.ctrl-meta { font-size: 12px; color: var(--text-muted); margin-top: .1rem; }

/* controller-row → now uses pick-card style but keep class for JS compat */
.controller-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.controller-row:hover { border-color: #444c56; background: var(--bg-hover); }
.controller-row.selected { border-color: var(--accent); background: rgba(46,160,67,0.08); }

/* VLAN create form */
.create-vlan-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--border-light);
}
.create-vlan-row:last-child { border-bottom: none; }
.create-vlan-row input[type="text"] {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: .4rem .75rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: auto;
}
.create-vlan-row input[type="text"]:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(47,129,247,0.3);
}

/* ================================================================
   Ports page specifics
   ================================================================ */
.row-uplink td { box-shadow: inset 2px 0 0 var(--warning); }
.uplink-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: 11px; font-weight: 600;
  padding: .1rem .55rem; border-radius: 999px;
  background: rgba(187,128,9,0.15); color: #e3b341;
  border: 1px solid rgba(187,128,9,0.34);
}
.port-check { cursor: pointer; }
td.check-cell { width: 36px; text-align: center; }
th.check-cell { width: 36px; }

/* ================================================================
   Help panel content (inside sheet)
   ================================================================ */
.help-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); margin-bottom: .65rem;
}
.help-api-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.help-api-head {
  font-size: 12px; font-weight: 600; margin-bottom: .4rem;
  display: flex; align-items: center; gap: .35rem; flex-wrap: wrap;
}
.help-api-list { list-style: none; padding: 0; margin: 0; }
.help-api-list li { font-size: 11px; color: var(--text-muted); line-height: 2; }
.help-hint { font-size: 11px; color: var(--text-muted); margin-top: .4rem; line-height: 1.5; }
.help-faq { border-top: 1px solid var(--border-light); padding: .55rem 0; }
.help-faq:first-of-type { border-top: none; }
.help-faq summary {
  cursor: pointer; font-size: 12px; font-weight: 500; color: var(--text);
  list-style: none; display: flex; align-items: center; gap: .4rem;
}
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary::before {
  content: '›'; color: var(--text-muted); transition: transform .15s;
  display: inline-block; width: 12px;
}
.help-faq[open] summary::before { transform: rotate(90deg); }
.help-faq summary:hover { color: var(--accent-h); }
.help-faq-body {
  padding: .5rem 0 .25rem 1rem;
  font-size: 12px; color: var(--text-muted); line-height: 1.6;
}

/* ================================================================
   Utilities
   ================================================================ */
.hidden { display: none !important; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-muted); }

code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(110,118,129,0.18);
  border-radius: 4px;
  padding: .05rem .35rem;
  color: var(--text);
}

/* Field-label standalone (used in ports.php) */
.field-label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: .4rem;
}
