.btn {
  appearance: none; border: 1px solid transparent;
  border-radius: 12px; padding: 0.7rem 1.1rem;
  cursor: pointer; font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--primary {
  background: linear-gradient(135deg, var(--sy-green), var(--sy-green-dark));
  color: #fff; box-shadow: 0 8px 20px rgba(0,122,61,0.25);
}
.btn--secondary {
  background: rgba(197,164,109,0.16);
  border-color: rgba(197,164,109,0.35);
  color: var(--text);
}
.btn--ghost {
  background: transparent; border-color: var(--line); color: var(--text);
}
.btn--danger {
  background: rgba(206,17,38,0.1); color: var(--sy-red); border-color: rgba(206,17,38,0.25);
}
.btn--sm { padding: 0.45rem 0.75rem; font-size: 0.88rem; border-radius: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1rem; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-solid);
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }

.panel {
  background: var(--bg-elev);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.panel h3 { margin: 0 0 0.85rem; font-size: 1.05rem; }
.panel__head h3 { margin: 0; }
.panel h3 small { color: var(--muted); font-weight: 500; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute; inset-inline-end: -20px; top: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,122,61,0.15), transparent 70%);
}
.stat-card span { display: block; color: var(--muted); font-size: 0.88rem; }
.stat-card strong { display: block; margin-top: 0.35rem; font-size: 1.55rem; }

.progress {
  height: 10px; background: rgba(0,122,61,0.1); border-radius: 99px; overflow: hidden;
}
.progress--lg { height: 14px; }
.progress__bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--sy-green), var(--sy-gold));
  border-radius: inherit;
  transition: width 0.35s ease;
}

.dropzone {
  position: relative;
  border: 1.5px dashed rgba(0,122,61,0.35);
  border-radius: 24px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: linear-gradient(160deg, rgba(255,255,255,0.75), rgba(0,122,61,0.05));
  overflow: hidden;
  transition: 0.25s ease;
  outline: none;
}
.dropzone.is-drag {
  border-color: var(--sy-green);
  box-shadow: 0 0 0 4px rgba(0,122,61,0.12);
  transform: scale(1.01);
}
.dropzone__glow {
  position: absolute; inset: auto auto -40% 20%;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(197,164,109,0.22), transparent 70%);
  pointer-events: none;
}
.dropzone__icon {
  width: 72px; height: 72px; margin: 0 auto 1rem;
  display: grid; place-items: center;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--sy-green), var(--sy-green-dark));
  color: #fff; box-shadow: 0 12px 30px rgba(0,122,61,0.3);
}
.dropzone__icon svg { width: 36px; height: 36px; }
.dropzone h3 { margin: 0 0 0.4rem; }
.dropzone p { margin: 0; color: var(--muted); }
.dropzone__actions {
  display: flex; flex-wrap: wrap; gap: 0.65rem; justify-content: center; margin-top: 1.25rem;
}

.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.85rem; }
.field span { font-size: 0.9rem; color: var(--muted); }
.field--inline { flex-direction: row; align-items: center; gap: 0.5rem; margin: 0; }
.field input, .field select, .field textarea, .search, .toolbar input {
  border: 1px solid var(--line);
  background: var(--bg-solid);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus, .search:focus {
  border-color: rgba(0,122,61,0.45);
  box-shadow: 0 0 0 3px rgba(0,122,61,0.12);
}

.check {
  display: flex; align-items: center; gap: 0.55rem;
  margin-bottom: 0.55rem; cursor: pointer;
}
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--sy-green); }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 0.85rem; align-items: center;
}
.search { flex: 1; min-width: 180px; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
  margin-bottom: 1rem;
}
.table { width: 100%; border-collapse: collapse; min-width: 900px; }
.table th, .table td {
  padding: 0.75rem 0.85rem; text-align: right; border-bottom: 1px solid var(--line);
  font-size: 0.92rem; white-space: nowrap;
}
.table th { color: var(--muted); font-weight: 600; background: rgba(0,122,61,0.04); position: sticky; top: 0; }
.table tr:hover td { background: rgba(0,122,61,0.04); }
.cards-mobile { display: none; }

.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
}
.badge--pending { background: rgba(91,107,99,0.12); color: var(--muted); }
.badge--queued, .badge--processing { background: rgba(197,164,109,0.2); color: #8a6a2f; }
.badge--done { background: rgba(15,138,75,0.15); color: var(--ok); }
.badge--failed, .badge--cancelled { background: rgba(198,40,40,0.12); color: var(--danger); }

.mini-progress {
  width: 90px; height: 6px; background: rgba(0,122,61,0.1); border-radius: 99px; overflow: hidden; display: inline-block; vertical-align: middle;
}
.mini-progress > i { display: block; height: 100%; background: var(--sy-green); }

.process-list { display: grid; gap: 0.65rem; }
.process-card {
  display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1rem;
  padding: 0.85rem 1rem; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.45);
}
html.dark .process-card { background: rgba(255,255,255,0.03); }
.process-card__meta { color: var(--muted); font-size: 0.85rem; }
.process-card .ring {
  --p: 0;
  width: 48px; height: 48px; border-radius: 50%;
  background: conic-gradient(var(--sy-green) calc(var(--p) * 1%), rgba(0,122,61,0.12) 0);
  display: grid; place-items: center;
}
.process-card .ring span {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-solid); display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 700;
}

.player-panel .waveform {
  height: 96px; border-radius: 14px; background: rgba(0,122,61,0.05);
  margin-bottom: 0.85rem; overflow: hidden;
}
.player-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem;
}
.player-controls input[type="range"] { flex: 1; min-width: 120px; accent-color: var(--sy-green); }
.seg {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
}
.seg button {
  border: 0; background: transparent; padding: 0.35rem 0.8rem; cursor: pointer; color: var(--muted);
}
.seg button.is-active {
  background: rgba(0,122,61,0.14); color: var(--sy-green-dark); font-weight: 700;
}

.status-pill {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.75rem; border-radius: 999px;
  background: rgba(0,122,61,0.08); font-size: 0.85rem;
}
.status-pill .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--warn);
}
.status-pill.is-ok .dot { background: var(--ok); }
.status-pill.is-bad .dot { background: var(--danger); }

.activity-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.activity-list li {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.65rem; align-items: start;
  padding: 0.75rem 0.85rem; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.4);
}
.activity-list .tag {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 0.35rem;
}
.tag.success { background: var(--ok); }
.tag.error { background: var(--danger); }
.tag.warning { background: var(--warn); }
.tag.info { background: var(--sy-green); }
.activity-list time { color: var(--muted); font-size: 0.78rem; }

.tg-log {
  margin-top: 1rem; display: grid; gap: 0.4rem; max-height: 220px; overflow: auto;
}
.tg-log div {
  padding: 0.55rem 0.7rem; border-radius: 10px; font-size: 0.88rem;
  border: 1px solid var(--line);
}
.tg-log .ok { background: rgba(15,138,75,0.1); }
.tg-log .bad { background: rgba(198,40,40,0.1); }

.toasts {
  position: fixed; inset-inline-end: 1rem; bottom: 1rem; z-index: 1200;
  display: grid; gap: 0.55rem; width: min(360px, calc(100vw - 2rem));
}
.toast {
  background: var(--bg-solid); border: 1px solid var(--line);
  border-radius: 14px; padding: 0.85rem 1rem; box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
}
.toast--error { border-color: rgba(198,40,40,0.35); }
.toast--success { border-color: rgba(15,138,75,0.35); }

.wave-decor {
  margin-top: 1rem; height: 48px;
  background: repeating-linear-gradient(
    90deg,
    rgba(0,122,61,0.15) 0 3px,
    transparent 3px 10px
  );
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  animation: wavePulse 2.2s ease-in-out infinite;
  border-radius: 8px;
}

.file-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem;
  background: var(--bg-elev); margin-bottom: 0.65rem;
}
.file-card__row { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.35rem; color: var(--muted); font-size: 0.85rem; }
