:root {
  --bg: #f4f7fb;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-subtle-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-soft: #eef2f6;
  --border-focus: #3b82f6;

  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;

  --indigo: #4f46e5;
  --indigo-soft: #eef2ff;
  --indigo-border: #c7d2fe;

  --emerald: #059669;
  --emerald-soft: #ecfdf5;
  --emerald-border: #a7f3d0;

  --amber: #d97706;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;

  --rose: #e11d48;
  --rose-soft: #fff1f2;
  --rose-border: #fecdd3;

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 10px 28px -6px rgba(15, 23, 42, 0.05);
  --shadow-modal: 0 24px 60px -12px rgba(15, 23, 42, 0.22);

  --font-sans: "Vazirmatn", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--primary-border);
  direction: ltr;
  display: inline-block;
}

/* Soft Modern Light Backdrop */
.bg-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 420px at 88% -5%, rgba(37, 99, 235, 0.08), transparent 60%),
    radial-gradient(760px 380px at 10% 105%, rgba(16, 185, 129, 0.07), transparent 60%),
    linear-gradient(180deg, #f8fafd 0%, #f1f5f9 100%);
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 8px 18px -4px rgba(37, 99, 235, 0.42);
}

.brand-logo svg {
  width: 22px;
  height: 22px;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-title-row h1 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.3px;
}

.brand-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

.page-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
}

.page-handle {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
}

.page-meta {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.divider-v {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-emerald { background: var(--emerald); box-shadow: 0 0 0 3px var(--emerald-soft); }
.dot-rose { background: var(--rose); box-shadow: 0 0 0 3px var(--rose-soft); }
.dot-amber { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.dot-muted { background: var(--text-dim); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Kill Switch */
.kill-switch-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.kill-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.kill-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px;
}

.kill-track {
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  position: relative;
  transition: all 0.2s ease;
  direction: ltr;
}

.kill-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease, background 0.2s ease;
}

.kill-switch.is-on .kill-track {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.kill-switch.is-on .kill-thumb {
  transform: translateX(20px);
  background: var(--emerald);
}

.kill-switch.is-on .kill-state { color: var(--emerald); }
.kill-switch.is-off .kill-state { color: var(--rose); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-indigo { background: var(--indigo-soft); color: var(--indigo); border-color: var(--indigo-border); }
.badge-cyan { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
.badge-emerald { background: var(--emerald-soft); color: var(--emerald); border-color: var(--emerald-border); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-border); }
.badge-rose { background: var(--rose-soft); color: var(--rose); border-color: var(--rose-border); }
.badge-neutral { background: var(--bg-subtle-hover); color: var(--text-secondary); border-color: var(--border); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  color: var(--text);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.38);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.48);
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--bg-subtle-hover);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding: 5px 9px;
  font-size: 12px;
}

.btn-danger-ghost:hover {
  color: var(--rose);
  background: var(--rose-soft);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-icon svg {
  width: 17px;
  height: 17px;
}

.btn-icon-text {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-soft-green {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-soft-green.active {
  border-color: var(--emerald-border);
  background: var(--emerald-soft);
  color: var(--emerald);
}

.pulse-ring {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.btn-soft-green.active .pulse-ring {
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(5, 150, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Unsaved Bar */
.unsaved-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-md);
}

.unsaved-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #92400e;
}

.unsaved-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-card);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -6px rgba(15, 23, 42, 0.08);
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-title {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
}

.stat-value-mono {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 0;
}

.stat-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-foot {
  font-size: 11.5px;
  color: var(--text-dim);
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1.18fr 0.95fr;
  gap: 18px;
  align-items: start;
}

.side-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.panel-header.compact {
  align-items: center;
}

.panel-header h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

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

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Rules List */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rule-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.rule-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px -4px rgba(15, 23, 42, 0.05);
}

.rule-card.is-disabled {
  opacity: 0.6;
}

.rule-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rule-title-input {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  padding: 6px 11px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.rule-title-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.rule-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Small toggle switch */
.mini-switch {
  position: relative;
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  direction: ltr;
}

.mini-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.mini-switch.on {
  background: var(--emerald);
  border-color: var(--emerald);
}

.mini-switch.on::after {
  transform: translateX(18px);
}

/* Keyword chips */
.keywords-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.keywords-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.kw-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.kw-remove {
  background: none;
  border: none;
  color: #60a5fa;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.kw-remove:hover {
  color: var(--rose);
}

.kw-input {
  flex: 1;
  min-width: 130px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  padding: 3px 4px;
}

.kw-input:focus {
  outline: none;
}

.rule-reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* Inputs & Textareas */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.field label {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.label-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 400;
  margin-right: 6px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

textarea {
  resize: vertical;
  line-height: 1.75;
  unicode-bidi: plaintext;
}

textarea::-webkit-scrollbar {
  width: 6px;
}

textarea::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn input {
  flex: 1;
}

.global-config-box {
  border-top: 1px solid var(--border-soft);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Sandbox */
.tabs-mini {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  gap: 3px;
}

.tab-mini {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-mini.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.sandbox-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sandbox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.hint-text {
  font-size: 11.5px;
  color: var(--text-muted);
}

.dry-result,
.live-result {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 13px;
}

.dry-result.match { border-color: var(--emerald-border); background: var(--emerald-soft); }
.dry-result.miss { border-color: var(--amber-border); background: var(--amber-soft); }

.dry-reply-preview {
  margin-top: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: pre-wrap;
  unicode-bidi: plaintext;
  font-size: 12.5px;
  color: var(--text);
}

/* Feed */
.feed-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  background: var(--bg-subtle-hover);
}

.filter-pill.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-border);
}

.feed-search {
  max-width: 210px;
  padding: 6px 11px !important;
  font-size: 12px !important;
}

.events-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-left: 4px;
}

.events-feed::-webkit-scrollbar {
  width: 6px;
}

.events-feed::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.event-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease;
}

.event-item:hover {
  border-color: #cbd5e1;
}

.event-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.event-meta-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.event-actor {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  background: #ffffff;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
}

.event-time {
  font-size: 11px;
  color: var(--text-muted);
}

.event-body {
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  unicode-bidi: plaintext;
}

.event-json-toggle {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.event-json-toggle:hover {
  color: var(--primary);
}

.event-json-pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 9px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
  max-height: 180px;
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
}

.modal-card {
  width: 100%;
  max-width: 470px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 800;
}

.modal-header p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.form-error {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--rose-soft);
  border: 1px solid var(--rose-border);
  color: var(--rose);
  font-size: 12.5px;
  font-weight: 500;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
}

.toast {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.2s ease;
}

.toast.ok { border-color: var(--emerald-border); color: #065f46; background: #ecfdf5; }
.toast.err { border-color: var(--rose-border); color: #9f1239; background: #fff1f2; }

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

/* Responsive */
@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 12px 12px 36px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .feed-search {
    max-width: 100%;
  }
}
