.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 20px;
}
.admin-toolbar p {
  margin: 0;
  font-size: 13px;
}
.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  background: #f8fafc;
}
th,
td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
tbody tr:last-child td {
  border-bottom: 0;
}
td button {
  font-size: 12px;
  min-height: 32px;
  padding: 6px 10px;
}
.flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}
.flow-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 22px;
}
.flow-symbol {
  background: #f0eafd;
  color: var(--primary);
  border-radius: 9px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 19px;
  margin-bottom: 20px;
  font-weight: 600;
}
.flow-card h2 {
  line-height: 1.5;
}
.flow-card .muted {
  font-size: 12px;
}
.flow-preview {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 10px;
  font-size: 12px;
  min-height: 105px;
  color: var(--muted);
}
.flow-preview p {
  margin: 5px 0;
  overflow-wrap: anywhere;
}
.card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.card-actions button {
  font-size: 12px;
  padding: 7px 10px;
}
.step-order {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}
.step-order button {
  font-size: 11px;
  min-height: 28px;
  padding: 5px 8px;
}
.editor-image {
  max-width: 100%;
  max-height: 150px;
  margin: 12px 0;
  display: block;
  border-radius: 6px;
}
.step-editor input[type="file"] {
  font-size: 12px;
}
@media (max-width: 600px) {
  .admin-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  th,
  td {
    padding: 12px;
  }
  .flow-grid {
    grid-template-columns: 1fr;
  }
  .flow-card {
    padding: 18px;
  }
}

html[data-surface="staff"] .flow-grid { display:flex; flex-direction:column; gap:10px; }
html[data-surface="staff"] .flow-card.flow-row { display:flex; align-items:center; gap:10px; padding:12px; border-radius:14px; }
.flow-row-icon { display:grid; place-items:center; flex:0 0 36px; width:36px; height:36px; border-radius:10px; color:#285d45; background:#e6f0e7; }
.flow-row-main { flex:1; min-width:0; }
.flow-row .flow-row-main h2 { margin:0 0 4px; font-size:15px; overflow-wrap:anywhere; }
.flow-row .flow-row-main p { margin:0; font-size:11px; }
.flow-inactive { color:#a76b3c; }
.flow-row .flow-row-edit,.flow-row-more summary { display:grid; place-items:center; width:44px; height:44px; padding:10px; border:0; background:transparent; color:#285d45; border-radius:10px; flex-shrink:0; cursor:pointer; }
.flow-row-more { position:relative; flex-shrink:0; }
.flow-row-more summary { list-style:none; }
.flow-row-more summary::-webkit-details-marker { display:none; }
.flow-row-more[open] > div { position:absolute; z-index:5; top:44px; right:0; min-width:110px; padding:4px; border:1px solid #dfe7dc; border-radius:12px; background:white; box-shadow:0 8px 24px #17382e20; }
.flow-row-more button { display:block; min-height:44px; width:100%; border:0; background:white; text-align:left; padding:10px 14px; }

.flow-row-more.opens-up[open] > div { top:auto; bottom:44px; }

html[data-surface="staff"] #admin-section .admin-toolbar:has(#new-flow) > #new-flow { display:none; }
.flow-row .flow-row-edit { display:flex; width:auto; gap:4px; padding:8px 4px; font-size:12px; white-space:nowrap; }
.flow-row .flow-row-edit .ui-icon { width:17px; height:17px; min-width:17px; }
html[data-surface="staff"] #staff-new-flow { margin-left:auto; white-space:nowrap; min-height:44px; font-size:12px; padding:8px 10px; }
