/* Shared styles for Toolbox and Equitrac tools */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg:          #0d0f12;
  --surface:     #13161b;
  --surface2:    #1a1e25;
  --border:      #252a34;
  --border-bright: #2e3545;
  --accent:      #00c2ff;
  --accent-dim:  rgba(0,194,255,0.12);
  --accent-glow: rgba(0,194,255,0.25);
  --green:       #00e5a0;
  --green-dim:   rgba(0,229,160,0.12);
  --amber:       #ffb830;
  --amber-dim:   rgba(255,184,48,0.12);
  --danger:      #ff4d6a;
  --danger-dim:  rgba(255,77,106,0.12);
  --text:        #e2e8f0;
  --text-muted:  #64748b;
  --text-dim:    #94a3b8;
  --mono:        'IBM Plex Mono', monospace;
  --sans:        'IBM Plex Sans', sans-serif;
  --radius:      6px;
  --transition:  0.15s ease;

  /* Admin UI tokens — derived from the palette above, not new colours. */
  --panel:       var(--surface);
  --muted:       var(--text-muted);
  --ok-bg:       var(--green-dim);
  --ok-fg:       var(--green);
  --warn-bg:     var(--amber-dim);
  --warn-fg:     var(--amber);
  --bad-bg:      var(--danger-dim);
  --bad-fg:      var(--danger);
}

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

html { font-size: 14px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  min-height: 100vh;
  line-height: 1.6;
}

/* ── HEADER ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}
header a.logo-badge {
  text-decoration: none;
  color: inherit;
}
header a.logo-badge:hover {
  text-decoration: none;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon svg { width: 16px; height: 16px; fill: #000; }

.logo-text {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.logo-sep {
  color: var(--border-bright);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
  margin: 0 2px;
}

.logo-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Header nav links (base layout) */
.header-right a {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.header-right a:hover { color: var(--accent); background: var(--accent-dim); }
.header-right .user-email {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 8px;
  letter-spacing: 0.02em;
}

/* Responsive header — keep the logo + nav usable down to small phones.
   Tighten padding/gap and shrink the nav links so they don't overflow or clip. */
@media (max-width: 640px) {
  header { padding: 0 14px; gap: 8px; }
  .logo-text { font-size: 12px; }
  .logo-sub { display: none; }
  .header-right { gap: 2px; }
  .header-right a { padding: 6px 8px; font-size: 11px; }
}
@media (max-width: 380px) {
  .logo-icon { display: none; }
}

.status-pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.status-pill.ready { border-color: var(--green); color: var(--green); background: var(--green-dim); }

/* ── LAYOUT ── */
.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 56px);
}
.shell.tool-single {
  grid-template-columns: 1fr;
}

/* ── SIDEBAR ── */
nav {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.nav-section-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 20px 8px;
  margin-top: 20px;
}
.nav-section-label:first-child { margin-top: 0; }

nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 400;
  border-left: 2px solid transparent;
  transition: all var(--transition);
}
nav a:hover { color: var(--text); background: var(--surface2); }
nav a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-dim); }
nav a.complete { color: var(--text-dim); }

nav a .nav-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border-bright);
  flex-shrink: 0;
  transition: background var(--transition);
}
nav a.active .nav-dot  { background: var(--accent); }
nav a.complete .nav-dot { background: var(--green); }

/* ── MAIN CONTENT ── */
main {
  padding: 32px 40px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
main.tool-layout {
  padding: 24px 32px 32px;
  max-width: none;
  width: 100%;
}
/* Tool pages use a single header (tool-bar), so one 56px bar */
main.tool-layout .shell { min-height: calc(100vh - 56px); }
main.tool-layout nav {
  top: 56px;
  height: calc(100vh - 56px);
}
/* When tool-bar is the page header it sticks at top */
header.tool-bar { top: 0; }

/* Tool page bar (when extending base – back link + tool name + status) */
.tool-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  position: sticky;
  top: 56px;
  z-index: 99;
}
.tool-bar-back {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all var(--transition);
  flex-shrink: 0;
}
.tool-bar-back:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.tool-bar .logo-badge { flex-shrink: 0; }
.tool-bar .status-pill { flex-shrink: 0; margin-right: 8px; }
.tool-bar .header-right { margin-left: auto; }

/* ── SECTIONS ── */
.section {
  display: none;
  animation: fadeIn 0.2s ease;
}
.section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-header {
  margin-bottom: 28px;
}

.section-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.section-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  max-width: 72ch;
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.card-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── FIELDS ── */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-grid.single { grid-template-columns: 1fr; }
.field-grid.thirds { grid-template-columns: 1fr 1fr 1fr; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

label .required {
  color: var(--danger);
  font-size: 10px;
}

label .hint {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 10px;
  margin-left: auto;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="email"],
select,
textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); font-size: 12px; }

textarea { resize: vertical; min-height: 80px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

select option { background: var(--surface); }

/* ── TOGGLES ── */
.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all var(--transition);
  gap: 12px;
}
.toggle-row:hover { border-color: var(--border-bright); background: var(--surface2); }
.toggle-row.enabled { border-color: var(--accent); background: var(--accent-dim); }

.toggle-info { flex: 1; min-width: 0; }

.toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.toggle-switch {
  width: 36px;
  height: 20px;
  background: var(--border-bright);
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition);
}
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: all var(--transition);
}
.toggle-row.enabled .toggle-switch { background: var(--accent); }
.toggle-row.enabled .toggle-switch::after { left: 19px; background: #000; }

.toggle-row input[type="checkbox"] { display: none; }
.toggle-row.locked { opacity: 0.55; pointer-events: none; }

/* ── Santa action options ── */
.santa-action-options { display: flex; flex-direction: column; gap: 6px; }
.santa-action-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.santa-action-row input[type="radio"] { margin: 0; }
.santa-action-row:has(input:disabled) { opacity: 0.6; cursor: not-allowed; }

/* ── BITMASK DISPLAY (Equitrac) ── */
.bitmask-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 16px;
}

.bitmask-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bitmask-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.bitmask-breakdown {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ── PRINTER / DRIVER LISTS (Equitrac) ── */
.printer-list,
.driver-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.printer-item {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color var(--transition);
}
.printer-item:hover { border-color: var(--border-bright); }

.driver-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color var(--transition);
}
.driver-item:hover { border-color: var(--border-bright); }

/* ── TABLE/LIST ITEMS (Toolbox) ── */
input[type="checkbox"] { accent-color: var(--accent); }
.item-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.item-row {
  display: grid;
  gap: 10px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color var(--transition);
}
.item-row:hover { border-color: var(--border-bright); }
.item-row.app-row { grid-template-columns: 28px 1fr 1.2fr 120px 1fr 80px auto; }
.item-row.url-row { grid-template-columns: 1fr auto; }
.item-row.bookmark-row { grid-template-columns: 32px 80px 1fr 1fr auto auto; }
.item-row.bookmark-row .bm-drag { cursor: grab; color: var(--text-muted); font-size: 14px; }
.item-row.bookmark-row .bm-drag:active { cursor: grabbing; }
.item-row.bookmark-row .item-edit { padding: 4px 10px; font-size: 11px; min-width: 0; }
.item-row.bookmark-row.drop-target { border-color: var(--accent); background: var(--accent-dim); }
.item-row.bookmark-row.drop-target-child { border-color: var(--green); background: var(--green-dim); }
.item-row.driver-row { grid-template-columns: 1fr auto; }
.item-row.custom-label-row { grid-template-columns: 1fr 1fr 100px 1fr 80px auto; }
.item-row.santa-row { grid-template-columns: 1fr 1fr auto; }
.item-row.fusion-row { grid-template-columns: 1fr 1fr 1fr auto; }
.item-row.autoconfig-row { grid-template-columns: 1fr 1.2fr 1.5fr auto; }

.item-cell { font-family: var(--mono); font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-cell.name { color: var(--text); font-weight: 500; }

.item-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  user-select: none;
}
.item-drag-handle:active { cursor: grabbing; }
.item-list-draggable .item-row.dragging { opacity: 0.5; }

.col-header {
  display: grid;
  gap: 10px;
  padding: 0 14px 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.col-header.app-row { grid-template-columns: 28px 1fr 1.2fr 120px 1fr 80px auto; }
.col-header.bookmark-row { grid-template-columns: 32px 80px 1fr 1fr auto auto; }
.col-header.custom-label-row { grid-template-columns: 1fr 1fr 100px 1fr 80px auto; }
.col-header.santa-row { grid-template-columns: 1fr 1fr auto; }
.col-header.fusion-row { grid-template-columns: 1fr 1fr 1fr auto; }
.col-header.autoconfig-row { grid-template-columns: 1fr 1.2fr 1.5fr auto; }

.item-remove {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}
.item-remove:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-dim); }

.item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.item-edit {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  transition: all var(--transition);
}
.item-edit:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── ADD BUTTONS ── */
.btn-add {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px dashed var(--border-bright);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: all var(--transition);
  letter-spacing: 0.04em;
}
.btn-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── SECTION FOOTER ── */
.section-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  text-transform: uppercase;
  /* .btn is used on <a> as well as <button> — without this an anchor keeps its
     underline and the default link colour, which is how the admin "Manage"
     link rendered as barely-legible blue text. */
  text-decoration: none;
}

.btn-ghost {
  background: none;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--border-bright); color: var(--text); }

.btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 600;
  border-color: var(--accent);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 0 16px var(--accent-glow); }
.btn:disabled, .btn[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Busy state for any .btn kicking off a slow action. A busy button is also
   disabled, so these must out-specify .btn:disabled above — otherwise the
   spinner is dimmed to 0.4 and reads as broken rather than working. */
.btn.is-busy:disabled, .btn.is-busy[disabled] {
  opacity: 0.85;
  cursor: progress;
  pointer-events: auto;
}
.btn-spinner {
  display: none;
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}
.btn.is-busy .btn-spinner { display: inline-block; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn-spinner { animation-duration: 1.8s; }
}

.btn-success {
  background: var(--green);
  color: #000;
  font-weight: 600;
  border-color: var(--green);
}
.btn-success:hover { filter: brightness(1.1); box-shadow: 0 0 16px rgba(0,229,160,0.3); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  font-weight: 600;
  border-color: var(--danger);
}
.btn-danger:hover { filter: brightness(1.1); }

/* ── ALERTS (flashed messages) ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert-info, .alert-success { border-color: var(--green); background: var(--green-dim); color: var(--green); }
.alert-danger, .alert-error { border-color: var(--danger); background: var(--danger-dim); color: var(--danger); }
.alert-warning { border-color: var(--amber); background: var(--amber-dim); color: var(--amber); }

/* ── PAGE HERO (index, dashboard) ── */
.page-hero {
  text-align: center;
  padding: 48px 24px 56px;
}
.page-hero .page-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.page-hero .page-lead {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 28px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.page-hero .btn { text-decoration: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-hero .btn-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.page-hero .btn-row + .btn-ghost { margin-top: 28px; }

/* ── DASHBOARD ── */
.dashboard {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}
.dashboard-welcome {
  margin-bottom: 32px;
}
.dashboard-welcome .card-title {
  margin-bottom: 8px;
}
.dashboard-welcome .user-info {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}
.dashboard-welcome .user-info strong { color: var(--accent); }
.dashboard-search {
  margin-bottom: 24px;
}
.tool-search-input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition);
  box-sizing: border-box;
}
.tool-search-input::placeholder {
  color: var(--text-muted);
}
.tool-search-input:focus {
  border-color: var(--accent);
}
.no-results {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.dashboard-tools {
  margin-bottom: 32px;
}
.dashboard-tools:last-of-type { margin-bottom: 0; }
.tool-group-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
  letter-spacing: 0.02em;
}
.tool-group-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 16px 0;
}
.tool-group-desc a {
  color: var(--accent);
  text-decoration: none;
}
.tool-group-desc a:hover { text-decoration: underline; }
.tool-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.tool-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
}
.tool-card:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.tool-card-left {
  flex: 1;
  min-width: 0;
}
.tool-card-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.tool-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}
.tool-card .btn {
  flex-shrink: 0;
  text-decoration: none;
}
.dashboard-signout {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.dashboard-signout .btn-ghost { text-decoration: none; }

/* ── BADGE (Toolbox) ── */
.badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.badge-allow { background: var(--green-dim); color: var(--green); border: 1px solid var(--green); }
.badge-block { background: var(--danger-dim); color: var(--danger); border: 1px solid var(--danger); }
.badge-team { background: var(--amber-dim); color: var(--amber); border: 1px solid var(--amber); }
.badge-sign { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent); }

/* ── GENERATE CARD ── */
.generate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.generate-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.generate-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.generate-actions {
  display: flex;
  gap: 8px;
}

.xml-preview {
  font-family: var(--mono);
  font-size: 12px;
  color: #a8c4e0;
  padding: 24px;
  line-height: 1.7;
  white-space: pre;
  overflow-x: auto;
  background: var(--bg);
  max-height: 520px;
  overflow-y: auto;
}

.xml-preview .xml-tag    { color: #5b9bd5; }
.xml-preview .xml-key    { color: var(--accent); }
.xml-preview .xml-string { color: var(--green); }
.xml-preview .xml-bool   { color: var(--amber); }
.xml-preview .xml-comment{ color: #4a5568; font-style: italic; }

/* ── VALIDATION BANNER ── */
.validation-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--danger-dim);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--danger);
}
.validation-banner.visible { display: flex; }

/* ── PROGRESS BAR ── */
.progress-bar {
  height: 2px;
  background: var(--border);
  position: sticky;
  top: 56px;
  z-index: 99;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── FIELD VALIDATION ── */
input.invalid { border-color: var(--danger) !important; }
.field-error { font-size: 11px; color: var(--danger); font-family: var(--mono); display: none; }
.field-error.visible { display: block; }

/* ── EMPTY STATE & INFO BOXES (Toolbox) ── */
.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.info-box {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.warning-box {
  background: var(--amber-dim);
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--amber);
  margin-bottom: 16px;
}

.two-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.item-list { min-width: 0; }
.item-row .item-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  main { padding: 24px 24px; }
  main.tool-layout { padding: 20px 24px 28px; }
  .three-col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  header, .tool-bar { padding: 0 16px; }
  main { padding: 20px 16px; max-width: none; }
  main.tool-layout { padding: 16px 16px 24px; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .section-title { font-size: 20px; }
  .card { padding: 18px 16px; }
  .tool-card-grid { grid-template-columns: 1fr; }
  .field-grid, .field-grid.thirds { grid-template-columns: 1fr; }
  .section-footer { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 480px) {
  html { font-size: 13px; }
  header, .tool-bar { padding: 0 12px; gap: 12px; }
  main { padding: 16px 12px; }
  main.tool-layout { padding: 12px 12px 20px; }
  .card { padding: 14px 12px; }
  .item-row.app-row,
  .col-header.app-row { grid-template-columns: 1fr 1fr auto; }
  .item-row.bookmark-row,
  .col-header.bookmark-row { grid-template-columns: 28px 60px 1fr 1fr auto auto; }
  .item-row.custom-label-row,
  .col-header.custom-label-row { grid-template-columns: 1fr 1fr auto; }
}

code { font-family: var(--mono); color: var(--accent); font-size: 11px; overflow-wrap: anywhere; }

/* ── DROP ZONES (Toolbox) ── */
.drop-zone {
  border: 1px dashed var(--border-bright);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
  position: relative;
}
.drop-zone:hover { border-color: var(--accent); background: var(--accent-dim); }
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.drop-zone-icon {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text-muted);
  transition: color var(--transition);
}
.drop-zone:hover .drop-zone-icon,
.drop-zone.drag-over .drop-zone-icon { color: var(--accent); }
.drop-zone-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  transition: color var(--transition);
}
.drop-zone:hover .drop-zone-label,
.drop-zone.drag-over .drop-zone-label { color: var(--accent); }
.drop-zone-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.7;
}
.drop-zone.has-file { border-color: var(--green); background: var(--green-dim); }
.drop-zone.has-file .drop-zone-icon,
.drop-zone.has-file .drop-zone-label { color: var(--green); }

/* ═══════════════════════════════════════════════════════════════
   Bookmarklet drag-target button (shared across IBB, pkg_pusher,
   intune_toolkit, and the _toolkit_bookmarklet_link partial).
   Note: IBB and pkg_pusher templates also carry an inline copy of
   these rules for historical reasons; this shared copy is the one
   the toolkit pages rely on.
   ═══════════════════════════════════════════════════════════════ */
.pusher-bookmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: linear-gradient(180deg, #4a9eff 0%, #3b83d6 100%);
  color: #fff !important;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(74, 158, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
  cursor: grab;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, .15);
  transition: transform .12s ease, box-shadow .12s ease;
}
.pusher-bookmark:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(74, 158, 255, .4), inset 0 1px 0 rgba(255, 255, 255, .25); }
.pusher-bookmark:active { cursor: grabbing; transform: translateY(0); }

/* ── SEND-TO-CLIENT MODAL ── */
.stc-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.stc-modal {
  width: 100%; max-width: 440px;
  max-height: calc(100vh - 32px); overflow-y: auto;
}
.pusher-bookmark-icon { font-size: 18px; line-height: 1; }

/* Numbered steps — shared by pkg_pusher, intune_toolkit, jamf_connect, landings.
   Previously defined only inline in pkg_pusher.html, so they rendered unstyled
   everywhere else (big stacked numbers). Promoted here so all consumers match. */
.pusher-step {
  display: flex; gap: 16px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.pusher-step:last-child { border-bottom: none; }
.pusher-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-dim); border: 1px solid var(--accent); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 600; font-size: 13px;
  flex-shrink: 0;
}
.pusher-step-body { flex: 1; }
.pusher-step-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.pusher-step-desc { color: var(--text-muted); font-size: 13px; line-height: 1.5; }

/* Profile Converter */
.field-hint { font-size: 11px; color: var(--text-muted, #888); margin-top: 4px; min-height: 14px; }
.input { display: block; width: 100%; }
.pc-log { max-height: 160px; overflow-y: auto; font-family: var(--mono, monospace); font-size: 12px; }
.pc-log p { margin: 2px 0; color: var(--text-muted, #aaa); }
.pc-log p.err { color: var(--red, #e55); }
.pc-catalog-row { padding: 6px 0; border-bottom: 1px solid var(--border, #262b34); }

/* Dashboard empty state (no capabilities assigned yet) */
.empty-state {
  padding: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.empty-state h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.empty-state p { margin: 0; color: var(--text-muted); }

/* Login page (Task B5) */
.login-card {
  max-width: 26rem;
  margin: 3rem auto;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.login-card h1 { margin: 0 0 .35rem; font-size: 1.4rem; }
.login-help { margin: 0 0 1.25rem; color: var(--text-muted); }
.login-form label {
  display: block;
  margin-bottom: .35rem;
  font-size: .875rem;
}
.login-form input[type="email"] {
  width: 100%;
  padding: .6rem .7rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: inherit;
}
.login-form input[type="email"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
/* Full width, and centred because .btn is inline-flex with a gap — without
   this the spinner + label sit hard against the left edge. */
.login-submit {
  width: 100%;
  justify-content: center;
  min-height: 40px;
}
.login-status {
  margin: .75rem 0 0;
  min-height: 1.15em;          /* reserve the line so nothing shifts on submit */
  font-size: .8125rem;
  color: var(--text-muted);
  text-align: center;
}
