/* ══════════════════════════════════════════════════
   SHARED INNER-PAGE STYLES
   Used by: api-keys, logs, usage, settings
══════════════════════════════════════════════════ */

/* ── Dropdown divider (used in navbar and elsewhere) ── */
.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

/* ══════════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.page-header-text { flex: 1; }

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.btn-primary:disabled,
.btn-primary.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary:disabled:hover,
.btn-primary.is-disabled:hover {
  background: var(--accent);
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--bg-overlay);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-secondary:hover { background: var(--bg-muted); color: var(--text-primary); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(248, 81, 73, 0.3);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-danger:hover { background: var(--red-bg); border-color: var(--red-border); }

.btn-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-icon:hover { background: var(--bg-muted); color: var(--text-secondary); }

.btn-icon.danger:hover { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }

/* ══════════════════════════════════════════════════
   TOASTS
══════════════════════════════════════════════════ */
.toast-stack {
  position: fixed;
  top: 84px;
  right: 20px;
  z-index: 1200;
  width: min(360px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 34, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast-card.closing {
  opacity: 0;
  transform: translateY(-6px);
}

.toast-info { border-color: rgba(56, 189, 248, 0.28); }
.toast-success { border-color: rgba(63, 185, 80, 0.32); }
.toast-error { border-color: rgba(248, 81, 73, 0.34); }

.toast-copy {
  min-width: 0;
  flex: 1;
}

.toast-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.toast-message {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.toast-close {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.toast-close:hover { color: var(--text-primary); }

/* ══════════════════════════════════════════════════
   SECTION CARD
══════════════════════════════════════════════════ */
.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.section-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.section-card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.section-card-body { padding: 20px; }

/* ══════════════════════════════════════════════════
   CALLOUT / INFO BOX
══════════════════════════════════════════════════ */
.callout {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid;
  font-size: 13px;
  line-height: 1.55;
}

.callout.info {
  background: rgba(88, 166, 255, 0.07);
  border-color: var(--blue-border);
  color: var(--text-secondary);
}

.callout.warning {
  background: var(--amber-bg);
  border-color: var(--amber-border);
  color: var(--text-secondary);
}

.callout.danger {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--text-secondary);
}

.callout-icon { flex-shrink: 0; margin-top: 1px; }
.callout strong { color: var(--text-primary); }

/* ══════════════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.stat-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.stat-delta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-delta.up   { color: var(--green); }
.stat-delta.down { color: var(--red); }

/* ══════════════════════════════════════════════════
   DATA TABLE
══════════════════════════════════════════════════ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td { background: var(--bg-overlay); }

.data-table .col-name { color: var(--text-primary); font-weight: 500; }
.data-table .col-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.data-table .col-actions {
  text-align: right;
  white-space: nowrap;
}

.data-table .col-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* ══════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid;
  white-space: nowrap;
}

.badge-active  { background: var(--green-bg);  border-color: var(--green-border);  color: var(--green); }
.badge-revoked { background: var(--red-bg);    border-color: var(--red-border);    color: var(--red); }
.badge-draft   { background: var(--amber-bg);  border-color: var(--amber-border);  color: var(--amber); }
.badge-scope {
  background: var(--bg-overlay);
  border-color: var(--border);
  color: var(--text-muted);
  font-size: 10.5px;
  padding: 1px 6px;
}

.log-level {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.log-level.info  { background: rgba(88,166,255,0.08); border-color: var(--blue-border);  color: var(--blue); }
.log-level.warn  { background: var(--amber-bg);        border-color: var(--amber-border); color: var(--amber); }
.log-level.error { background: var(--red-bg);          border-color: var(--red-border);   color: var(--red); }
.log-level.debug { background: var(--bg-overlay);      border-color: var(--border);        color: var(--text-muted); }

/* ══════════════════════════════════════════════════
   PAGE TABS
══════════════════════════════════════════════════ */
.page-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.page-tab {
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 450;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 7px;
}

.page-tab:hover { color: var(--text-secondary); }
.page-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); font-weight: 550; }

.page-tab-count {
  font-size: 11px;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 6px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 18px;
  text-align: center;
}

.page-tab.active .page-tab-count {
  background: var(--accent-glow);
  border-color: rgba(13,148,136,0.2);
  color: var(--accent);
}

/* ══════════════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar-search {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}

.filter-bar-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.filter-bar-search input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}

.filter-bar-search input::placeholder { color: var(--text-muted); }
.filter-bar-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 450;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
  font-family: 'Inter', sans-serif;
}

.filter-chip:hover { background: var(--bg-muted); color: var(--text-secondary); }
.filter-chip.active { background: var(--accent-glow); border-color: rgba(13,148,136,0.3); color: var(--accent); }

/* ══════════════════════════════════════════════════
   LOG ENTRY
══════════════════════════════════════════════════ */
.log-list {
  display: flex;
  flex-direction: column;
}

.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
  font-size: 13px;
  cursor: pointer;
}

.log-entry:last-child { border-bottom: none; }
.log-entry:hover { background: var(--bg-overlay); }

.log-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 2px;
  min-width: 152px;
  flex-shrink: 0;
}

.log-msg {
  flex: 1;
  line-height: 1.5;
  color: var(--text-secondary);
  word-break: break-word;
}

.log-msg strong { color: var(--text-primary); font-weight: 500; }

.log-duration {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
  min-width: 54px;
  text-align: right;
}

.log-duration.slow { color: var(--amber); }
.log-duration.error { color: var(--red); }

/* ══════════════════════════════════════════════════
   SETTINGS LAYOUT
══════════════════════════════════════════════════ */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: flex-start;
}

.settings-nav {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.1s;
  cursor: pointer;
  border: none;
  background: none;
  font-family: 'Inter', sans-serif;
  width: 100%;
  text-align: left;
}

.settings-nav-item svg { flex-shrink: 0; opacity: 0.7; }
.settings-nav-item:hover { background: var(--bg-overlay); color: var(--text-secondary); }
.settings-nav-item.active { background: var(--bg-overlay); color: var(--text-primary); font-weight: 500; }
.settings-nav-item.danger { color: var(--red); opacity: 0.8; }
.settings-nav-item.danger:hover { background: var(--red-bg); opacity: 1; }

.settings-nav-divider { height: 1px; background: var(--border-subtle); margin: 6px 4px; }

/* ── Form elements (for settings forms) ── */
.field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-hint { font-size: 12px; color: var(--text-muted); line-height: 1.55; }
.field-input,
.field-select,
.field-textarea {
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  color: var(--text-primary);
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-input::placeholder, .field-textarea::placeholder { color: var(--text-muted); }
.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.field-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e7681' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
  cursor: pointer;
}
.field-textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Section divider ── */
.settings-section-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ── API key display ── */
.key-reveal {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.key-reveal .key-mask { flex: 1; letter-spacing: 2px; color: var(--text-muted); }
.key-reveal .key-copy { flex-shrink: 0; cursor: pointer; color: var(--text-muted); }
.key-reveal .key-copy:hover { color: var(--accent); }

/* ══════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-state-icon {
  width: 44px;
  height: 44px;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state-text {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════════════
   MODAL OVERLAY
══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  display: none;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  overflow: hidden;
}

.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.modal-close {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.1s;
}
.modal-close:hover { background: var(--bg-overlay); color: var(--text-primary); }

.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border-subtle); display: flex; justify-content: flex-end; gap: 8px; }

/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .page-header { flex-direction: column; gap: 12px; }
  .page-header-actions { width: 100%; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar-search { max-width: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Language switcher ── */
.lang-switcher {
  display: flex;
  gap: 8px;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--bg-canvas);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.lang-btn.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: #fff;
  font-weight: 600;
}

.lang-flag {
  font-size: 16px;
  line-height: 1;
}


/* ═══════════════════════════════════════════════════
   Workspace switcher
═══════════════════════════════════════════════════ */
.ws-switcher {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 4px;
}

.ws-switcher-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 4px 4px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
  max-width: 200px;
  white-space: nowrap;
}
.ws-switcher-trigger:hover { border-color: var(--border-muted, #444c56); background: rgba(255,255,255,0.03); }

.ws-dot {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: #0d9488;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ws-current-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.ws-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 230px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  z-index: 200;
  overflow: hidden;
}

.ws-dropdown-label {
  padding: 10px 14px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.ws-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.1s;
}
.ws-dropdown-item:hover   { background: rgba(255,255,255,0.04); }
.ws-dropdown-item.active  { background: rgba(56,139,253,0.08); }

.ws-item-dot {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.ws-item-info { flex: 1; min-width: 0; }
.ws-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-item-role { font-size: 11px; color: var(--text-muted); }

.ws-dropdown-footer { border-top: 1px solid var(--border-subtle); padding: 6px 8px; }
.ws-dropdown-create {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: background 0.1s, color 0.1s;
}
.ws-dropdown-create:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }


/* ═══════════════════════════════════════════════════
   Agents page — info callout
═══════════════════════════════════════════════════ */
.agents-info-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(56,139,253,0.07);
  border: 1px solid rgba(56,139,253,0.2);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}
.agents-info-callout strong { color: var(--text-primary); }


/* ═══════════════════════════════════════════════════
   Agent cards grid
═══════════════════════════════════════════════════ */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.agent-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s;
}
.agent-card:hover { border-color: var(--border-muted, #444c56); }

.agent-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.agent-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: rgba(56,139,253,0.1);
  border: 1px solid rgba(56,139,253,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.agent-card-title-wrap { flex: 1; min-width: 0; }
.agent-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-card-slug {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.agent-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.agent-status-published { background: rgba(63,185,80,0.15); color: #3fb950; border: 1px solid rgba(63,185,80,0.3); }
.agent-status-draft     { background: rgba(139,148,158,0.15); color: #8b949e; border: 1px solid rgba(139,148,158,0.3); }
.agent-status-archived  { background: rgba(210,153,34,0.15); color: #d29922; border: 1px solid rgba(210,153,34,0.3); }

.agent-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.agent-card-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.agent-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}
.agent-stat-value { font-weight: 600; color: var(--text-secondary); }

.agent-endpoint-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}
.agent-endpoint-url {
  flex: 1;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-endpoint-copy {
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.1s, background 0.1s;
  flex-shrink: 0;
}
.agent-endpoint-copy:hover { color: var(--accent); background: rgba(56,139,253,0.1); }

.agent-card-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.agent-card-date {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.agent-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}
.agent-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  min-width: 0;
  white-space: normal;
  text-align: center;
}
.agent-action-btn:hover { border-color: var(--border-muted, #444c56); color: var(--text-primary); background: rgba(255,255,255,0.03); }
.agent-action-btn.danger:hover { border-color: var(--error, #f87171); color: var(--error, #f87171); background: rgba(248,113,113,0.06); }


/* ═══════════════════════════════════════════════════
   Drawer (side panel)
═══════════════════════════════════════════════════ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 150;
  backdrop-filter: blur(2px);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 100vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  z-index: 151;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.drawer-title   { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.drawer-subtitle{ font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.drawer-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.drawer-close:hover { border-color: var(--error, #f87171); color: var(--error, #f87171); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.drawer-section {}
.drawer-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.drawer-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.drawer-section-header .drawer-section-title { margin-bottom: 0; }
.drawer-section-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(56,139,253,0.1);
  padding: 2px 8px;
  border-radius: 20px;
}
.drawer-section-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: var(--bg-surface);
}


/* ═══════════════════════════════════════════════════
   Agent status toggle (in drawer)
═══════════════════════════════════════════════════ */
.agent-status-toggle {
  display: flex;
  gap: 0;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.agent-status-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.agent-status-opt.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════
   Operations picker (in drawer)
═══════════════════════════════════════════════════ */
.ops-picker {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.ops-picker-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
}
.ops-picker-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
}
.ops-picker-search-input::placeholder { color: var(--text-muted); }
.ops-picker-clear {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  border-radius: 3px;
}
.ops-picker-clear:hover { color: var(--text-secondary); }

.ops-picker-list {
  max-height: 260px;
  overflow-y: auto;
}

.ops-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}
.ops-picker-item:last-child { border-bottom: none; }
.ops-picker-item:hover    { background: rgba(255,255,255,0.03); }
.ops-picker-item.selected { background: rgba(56,139,253,0.07); }

.ops-picker-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.1s, background 0.1s;
}
.ops-picker-item.selected .ops-picker-check {
  border-color: var(--accent);
  background: rgba(56,139,253,0.12);
}

.ops-picker-info { flex: 1; min-width: 0; }
.ops-picker-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ops-picker-slug {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.ops-picker-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ops-status-active   { background: #3fb950; }
.ops-status-draft    { background: #8b949e; }
.ops-status-error    { background: #f85149; }
.ops-status-inactive { background: #8b949e; }

.ops-picker-empty {
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.ops-picker-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}


/* ═══════════════════════════════════════════════════
   Agents — recommendation callout
═══════════════════════════════════════════════════ */
.agents-rec-callout {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(210,153,34,0.08);
  border: 1px solid rgba(210,153,34,0.25);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.agents-rec-callout svg { flex-shrink: 0; color: #d2991f; margin-top: 1px; }
.agents-rec-callout strong { color: var(--text-primary); }


/* ═══════════════════════════════════════════════════
   Settings — Members enhanced
═══════════════════════════════════════════════════ */
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.member-row:last-child { border-bottom: none; }

.member-last-active {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

.member-role-select {
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  min-width: 110px;
}
.member-role-select:hover  { border-color: var(--accent); }
.member-role-select:focus  { border-color: var(--accent); }

.member-remove-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.member-remove-btn:hover {
  border-color: var(--error, #f87171);
  color: var(--error, #f87171);
  background: rgba(248,113,113,0.07);
}

.member-role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.role-owner     { background: rgba(56,139,253,0.15);  color: #58a6ff; border: 1px solid rgba(56,139,253,0.3); }
.role-admin     { background: rgba(139,92,246,0.15);  color: #a78bfa; border: 1px solid rgba(139,92,246,0.3); }
.role-developer { background: rgba(63,185,80,0.12);   color: #3fb950; border: 1px solid rgba(63,185,80,0.25); }
.role-viewer    { background: rgba(139,148,158,0.15); color: #8b949e; border: 1px solid rgba(139,148,158,0.3); }

.role-def-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.role-def-row:last-child { border-bottom: none; }
.role-def-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Workspace dropdown management links ── */
.ws-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}
.ws-dropdown-mgmt-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
  cursor: pointer;
}
.ws-dropdown-mgmt-link:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}
.ws-dropdown-mgmt-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .toast-stack {
    top: 72px;
    right: 16px;
    left: 16px;
    width: auto;
  }
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.list-toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-select {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-overlay);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
}

.resource-list {
  display: grid;
  gap: 14px;
}

.resource-card {
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.resource-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.resource-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.resource-card-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.resource-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.resource-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.resource-meta-item {
  min-width: 0;
}

.resource-meta-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.resource-meta-value {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  word-break: break-word;
}

.resource-detail-block {
  margin-top: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.resource-detail-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.resource-detail-pre {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(12, 17, 24, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.resource-pill-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.resource-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.resource-status-pill.active,
.resource-status-pill.running,
.resource-status-pill.succeeded {
  border-color: rgba(63, 185, 80, 0.28);
  background: rgba(63, 185, 80, 0.12);
  color: #71dd8a;
}

.resource-status-pill.idle,
.resource-status-pill.pending {
  border-color: rgba(110, 118, 129, 0.28);
  background: rgba(110, 118, 129, 0.12);
  color: var(--text-secondary);
}

.resource-status-pill.failed,
.resource-status-pill.cancelled,
.resource-status-pill.stopped {
  border-color: rgba(248, 81, 73, 0.28);
  background: rgba(248, 81, 73, 0.12);
  color: #ff8a83;
}

.resource-status-pill.completed {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.12);
  color: #79d8ff;
}
