/**
 * AZTOOLS — gemeinsames UI für Tools Hub und Satelliten-Tools.
 * Einbinden: <link rel="stylesheet" href="/ui-toolkit.css" />
 */
:root {
  --page-bg: #f3f4f6;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius: 12px;
  --shadow: 0 1px 3px rgb(0 0 0 / 0.06), 0 1px 2px rgb(0 0 0 / 0.04);
  --shadow-lg: 0 4px 14px rgb(0 0 0 / 0.07);
  --font: "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Menlo, Monaco, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}

[data-lucide] {
  width: 1.125rem;
  height: 1.125rem;
  stroke-width: 2;
  flex-shrink: 0;
}

.tool-ico [data-lucide] {
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.btn-ico [data-lucide] {
  width: 18px;
  height: 18px;
}

@keyframes ui-spin {
  to {
    transform: rotate(360deg);
  }
}

.ui-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ui-spin 0.65s linear infinite;
  display: inline-block;
  vertical-align: -0.125em;
  margin-right: 0.35rem;
  flex-shrink: 0;
}

.ui-spinner[hidden] {
  display: none !important;
}

.ui-spinner-lg {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid var(--accent);
  border-right-color: transparent;
  border-radius: 50%;
  animation: ui-spin 0.7s linear infinite;
}

.is-loading {
  pointer-events: none;
  opacity: 0.88;
}

.ui-global-busy {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgb(255 255 255 / 0.65);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
}

.ui-global-busy.show {
  display: flex;
}

/* Buttons (alle Tools) */
.btn,
button.tile-btn {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.08s,
    opacity 0.15s;
}

.btn:hover,
button.tile-btn:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn:active:not(:disabled),
button.tile-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled,
button.tile-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.primary,
button.tile-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 2px rgb(79 70 229 / 0.2);
}

.btn.primary:hover:not(:disabled),
button.tile-btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn.success,
.btn.good {
  background: var(--ok);
  color: #fff;
  border-color: transparent;
}

.btn.success:hover:not(:disabled),
.btn.good:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn.danger {
  background: var(--danger-soft);
  color: #991b1b;
  border-color: #fecaca;
}

.btn.danger:hover:not(:disabled) {
  background: #fee2e2;
}

.btn.sm,
button.small {
  font-size: 0.75rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
}

.btn-ico {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-ico:hover {
  background: #f9fafb;
  color: var(--text);
}

input,
select,
textarea {
  font: inherit;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  background: #fafafa;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(79 70 229 / 0.15);
  background: #fff;
}

.ui-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--accent-soft);
  color: #4338ca;
  padding: 0.12em 0.35em;
  border-radius: 4px;
}
