:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-soft: #0b1120;
  --panel: rgba(16, 24, 43, 0.88);
  --panel-solid: #10182b;
  --panel-2: #111b31;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text: #eef2ff;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #4ade80;
  --accent-2: #38bdf8;
  --accent-3: #a78bfa;
  --warning: #fbbf24;
  --danger: #f87171;
  --success-soft: rgba(74, 222, 128, 0.12);
  --danger-soft: rgba(248, 113, 113, 0.12);
  --warning-soft: rgba(251, 191, 36, 0.12);
  --info-soft: rgba(56, 189, 248, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.panel-body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(56, 189, 248, 0.12), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(167, 139, 250, 0.12), transparent 55%),
    linear-gradient(180deg, #070b14 0%, #0a1120 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 264px;
  flex: 0 0 264px;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(9, 14, 27, 0.96), rgba(8, 12, 23, 0.94));
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 5;
}

.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  font-weight: 800; letter-spacing: 0.04em;
  color: #052e16;
  background: linear-gradient(135deg, #86efac, #22d3ee 55%, #818cf8);
  box-shadow: 0 10px 30px rgba(34, 211, 238, 0.22);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 16px; letter-spacing: 0.01em; }
.brand-copy span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 10px 12px; border: 0; border-radius: 11px;
  background: transparent; color: var(--muted);
  text-align: left; font-size: 13px; font-weight: 600;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item svg { width: 17px; height: 17px; opacity: .9; }
.nav-item:hover { background: rgba(148, 163, 184, 0.08); color: var(--text); }
.nav-item.active {
  color: #d1fae5;
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.13), rgba(56, 189, 248, 0.07));
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.12);
}

.sidebar-status {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.45);
}
.sidebar-status strong { display: block; font-size: 12px; }
.sidebar-status small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.12);
  flex: 0 0 auto;
}
.status-dot.online { background: var(--accent); box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.15), 0 0 18px rgba(74, 222, 128, 0.5); }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.13); }
.status-dot.waiting { background: var(--warning); box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.13); }

.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-user { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; flex: 1; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  padding: 26px 32px 18px;
  position: sticky; top: 0;
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.96), rgba(7, 11, 20, 0.78) 70%, transparent);
  backdrop-filter: blur(14px);
  z-index: 4;
}
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.clock { color: var(--muted-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.bot-select { width: 180px; padding: 8px 10px; font-size: 11px; }

.content { padding: 10px 32px 46px; max-width: 1600px; margin: 0 auto; }
.section { display: none; animation: rise .24s ease both; }
.section.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.card {
  background: linear-gradient(180deg, rgba(16, 24, 43, 0.92), rgba(13, 20, 36, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card h2 { margin: 0; font-size: 14px; letter-spacing: 0.01em; }
.card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; margin-top: 16px; }
.section-gap { margin-top: 16px; }
.password-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-2 > .card { min-width: 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { padding: 17px 18px; position: relative; overflow: hidden; }
.kpi::after {
  content: ""; position: absolute; inset: auto -30px -55px auto;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12), transparent 65%);
  pointer-events: none;
}
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.kpi strong { display: block; font-size: 27px; letter-spacing: -0.03em; margin-top: 10px; }
.kpi small { display: block; color: var(--muted-2); font-size: 11px; margin-top: 6px; }
.kpi-tag { color: var(--muted); background: rgba(148, 163, 184, 0.08); border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; font-size: 10px; white-space: nowrap; }
.kpi-tag.up { color: var(--accent); background: var(--success-soft); border-color: rgba(74, 222, 128, 0.22); }
.kpi-tag.down { color: var(--danger); background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.22); }

.bar-chart { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.bar-row { display: grid; grid-template-columns: 38px 1fr 84px; gap: 10px; align-items: center; font-size: 12px; }
.bar-label { color: var(--muted); text-transform: capitalize; }
.bar-track { height: 9px; background: rgba(148, 163, 184, 0.09); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #34d399, #38bdf8); min-width: 2px; }
.bar-value { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.bot-body { display: flex; flex-direction: column; gap: 14px; }
.bot-identity { display: flex; align-items: center; gap: 12px; }
.bot-avatar { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; background: linear-gradient(135deg, rgba(74,222,128,.24), rgba(56,189,248,.22)); border: 1px solid rgba(74,222,128,.2); color: #d1fae5; }
.bot-identity strong { display: block; font-size: 14px; }
.bot-identity small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.bot-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bot-stats > div { background: rgba(2, 6, 23, 0.36); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
.bot-stats span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.bot-stats strong { display: block; margin-top: 4px; font-size: 14px; }
.bot-error { display: none; color: #fecaca; background: var(--danger-soft); border: 1px solid rgba(248, 113, 113, .22); border-radius: 10px; padding: 8px 10px; font-size: 11px; }
.bot-error.visible { display: block; }
.status-badge { border-radius: 999px; border: 1px solid var(--line); padding: 4px 9px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.status-badge.online { color: var(--accent); border-color: rgba(74,222,128,.24); background: var(--success-soft); }
.status-badge.offline { color: var(--danger); border-color: rgba(248,113,113,.24); background: var(--danger-soft); }
.status-badge.waiting { color: var(--warning); border-color: rgba(251,191,36,.24); background: var(--warning-soft); }

.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 10px 11px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; background: rgba(2, 6, 23, 0.3); }
tbody tr:hover { background: rgba(148, 163, 184, 0.045); }
tbody tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted-2); text-align: center; padding: 22px 10px; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 11px; }
.phone { color: #dbeafe; }
.amount-pos { color: var(--accent); }
.amount-neg { color: var(--danger); }

.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; border: 1px solid var(--line); padding: 4px 8px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.badge.success { color: var(--accent); border-color: rgba(74,222,128,.22); background: var(--success-soft); }
.badge.danger { color: var(--danger); border-color: rgba(248,113,113,.22); background: var(--danger-soft); }
.badge.warning { color: var(--warning); border-color: rgba(251,191,36,.22); background: var(--warning-soft); }
.badge.info { color: var(--accent-2); border-color: rgba(56,189,248,.22); background: var(--info-soft); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 12px; font-weight: 700; font-size: 12px;
  transition: transform .14s ease, background .14s ease, border-color .14s ease, opacity .14s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.primary { background: linear-gradient(135deg, #34d399, #22d3ee); color: #04210f; }
.button.secondary { background: rgba(148, 163, 184, .09); border-color: var(--line); color: var(--text); }
.button.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.button.danger { background: var(--danger-soft); color: #fecaca; border-color: rgba(248,113,113,.24); }
.button.small { padding: 7px 9px; font-size: 11px; border-radius: 8px; }
.button.full { width: 100%; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-count { color: var(--muted); font-size: 11px; margin-left: auto; }
input, select, textarea {
  background: rgba(2, 6, 23, .5); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 10px; outline: none; min-width: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: rgba(56, 189, 248, .55); box-shadow: 0 0 0 3px rgba(56, 189, 248, .1); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
.toolbar input { width: 250px; }
.toolbar select { min-width: 150px; }

.activity { display: flex; flex-direction: column; gap: 3px; max-height: 330px; overflow: auto; padding-right: 3px; }
.activity-item { display: grid; grid-template-columns: 8px 1fr auto; gap: 9px; align-items: start; padding: 8px 4px; border-bottom: 1px solid rgba(148, 163, 184, .07); font-size: 12px; }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); margin-top: 5px; }
.activity-text { color: var(--muted); overflow-wrap: anywhere; }
.activity-text strong { color: var(--text); font-weight: 600; }
.activity-time { color: var(--muted-2); font-size: 10px; white-space: nowrap; }

.command-mix { display: flex; flex-wrap: wrap; gap: 8px; }
.mix-item { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(2, 6, 23, .26); font-size: 11px; color: var(--muted); }
.mix-item strong { color: var(--text); }
.mix-bar { width: 58px; height: 6px; border-radius: 99px; background: rgba(148, 163, 184, .1); overflow: hidden; }
.mix-bar span { display: block; height: 100%; background: linear-gradient(90deg, #a78bfa, #38bdf8); }

.command-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.command-card { display: flex; flex-direction: column; gap: 14px; }
.command-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.command-head h2 { font-size: 15px; }
.command-key { color: var(--muted-2); font-size: 10px; margin-top: 3px; }
.command-controls { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.command-controls label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; }
.command-controls input { width: 100%; }

.switch-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(148, 163, 184, .18); border: 1px solid var(--line); transition: background .16s ease; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; top: 2px; left: 2px; background: #cbd5e1; transition: transform .16s ease, background .16s ease; }
.switch input:checked + span { background: rgba(74, 222, 128, .22); border-color: rgba(74, 222, 128, .3); }
.switch input:checked + span::after { transform: translateX(18px); background: #86efac; }

.form-grid { display: flex; flex-direction: column; gap: 13px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; }
.form-grid input, .form-grid textarea { width: 100%; }
.form-grid textarea { resize: vertical; min-height: 78px; }
.password-grid label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; }
.password-grid input { width: 100%; }

.event-log { display: flex; flex-direction: column; gap: 0; max-height: 430px; overflow: auto; }
.event-line { display: grid; grid-template-columns: 76px 1fr; gap: 8px; padding: 8px 2px; border-bottom: 1px solid rgba(148, 163, 184, .07); font-size: 11px; }
.event-line:last-child { border-bottom: 0; }
.event-type { color: var(--accent-2); font-weight: 600; overflow-wrap: anywhere; }
.event-payload { color: var(--muted); overflow-wrap: anywhere; }

.toast-root { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: 360px; }
.toast { background: rgba(15, 23, 42, .97); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); border-radius: 12px; padding: 11px 13px; box-shadow: var(--shadow); font-size: 12px; color: var(--text); animation: toast-in .22s ease both; }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, .7); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 18px; z-index: 70; }
.modal { width: min(640px, 100%); max-height: 88vh; overflow: auto; background: linear-gradient(180deg, #101b31, #0d1628); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow); padding: 20px; }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.modal-close { border: 1px solid var(--line); background: rgba(148, 163, 184, .08); color: var(--muted); border-radius: 9px; width: 32px; height: 32px; display: grid; place-items: center; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-stat { background: rgba(2, 6, 23, .34); border: 1px solid var(--line); border-radius: 11px; padding: 10px; }
.modal-stat span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.modal-stat strong { display: block; margin-top: 4px; font-size: 15px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.modal-section { margin-top: 16px; }
.modal-section h3 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; }
.modal-form { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; align-items: end; }
.modal-form label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 11px; }
.modal-form input { width: 100%; }
.qr-box { display: grid; place-items: center; gap: 12px; padding: 14px; }
.qr-box img { width: min(320px, 80vw); height: auto; border-radius: 14px; background: #fff; padding: 10px; }

.login-body {
  min-height: 100vh; margin: 0; display: grid; place-items: center;
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(56, 189, 248, .16), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(167, 139, 250, .14), transparent 55%),
    #070b14;
  color: var(--text); overflow: hidden; position: relative;
}
.login-orb { position: fixed; border-radius: 50%; filter: blur(60px); pointer-events: none; }
.login-orb-a { width: 320px; height: 320px; background: rgba(74, 222, 128, .13); top: -100px; left: -80px; }
.login-orb-b { width: 360px; height: 360px; background: rgba(56, 189, 248, .12); bottom: -150px; right: -100px; }
.login-shell { width: min(420px, calc(100vw - 32px)); position: relative; z-index: 1; }
.login-card { background: linear-gradient(180deg, rgba(16, 24, 43, .95), rgba(10, 16, 30, .96)); border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: var(--shadow); padding: 28px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand strong { display: block; font-size: 15px; }
.login-brand span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.login-card h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.login-subtitle { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 7px 0 20px; }
.login-form { display: flex; flex-direction: column; gap: 13px; }
.login-form label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; }
.login-form input { width: 100%; padding: 11px 12px; }
.login-error { display: none; margin-bottom: 12px; background: var(--danger-soft); border: 1px solid rgba(248,113,113,.24); color: #fecaca; border-radius: 10px; padding: 9px 11px; font-size: 12px; }
.login-error.visible { display: block; }
.login-foot { color: var(--muted-2); font-size: 10px; text-align: center; margin-top: 18px; line-height: 1.5; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: auto; flex: none; height: auto; position: static; padding: 14px; gap: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 4px; }
  .nav { flex-direction: row; overflow-x: auto; padding-bottom: 2px; }
  .nav-item { width: auto; white-space: nowrap; padding: 8px 10px; }
  .nav-item span { display: none; }
  .sidebar-status { display: none; }
  .sidebar-foot { display: none; }
  .topbar { padding: 18px 16px 12px; align-items: flex-start; flex-direction: column; }
  .content { padding: 6px 16px 34px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .command-grid { grid-template-columns: 1fr; }
  .toolbar input { width: 100%; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .modal-grid, .modal-form { grid-template-columns: 1fr; }
}

.hidden { display: none !important; }
.account-summary { margin-bottom: 4px; }
.card h3 { margin: 0; font-size: 13px; }
.permission-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0; }
legend { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 0 5px; }
.check-line { display: flex; align-items: center; gap: 7px; min-height: 25px; color: var(--muted); font-size: 11px; }
.check-line input { width: 14px; height: 14px; accent-color: #34d399; }
.command-permissions { margin-top: 10px; }
.command-perm { display: grid; grid-template-columns: 1fr repeat(3, auto); gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(148,163,184,.07); font-size: 11px; }
.command-perm:last-child { border-bottom: 0; }
.command-perm strong { font-size: 12px; }
.command-perm .check-line { white-space: nowrap; }
@media (max-width: 860px) { .permission-grid { grid-template-columns: 1fr; } .command-perm { grid-template-columns: 1fr 1fr 1fr; } .command-perm strong { grid-column: 1/-1; } }

.reply-preview { color: var(--muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-status-line { display: inline-flex; align-items: center; gap: 6px; }
.bot-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* GRINGO BICOS panel */
body.panel-body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(148,163,184,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.035) 1px, transparent 1px);
  background-size: 42px 42px; z-index: -1;
}
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.quick-action { text-align: left; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(135deg, rgba(74,222,128,.08), rgba(56,189,248,.04)); color: var(--text); padding: 12px; cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
.quick-action:hover { transform: translateY(-2px); border-color: rgba(74,222,128,.32); }
.quick-action strong { display: block; font-size: 12px; }
.quick-action span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.tools-grid .card { min-height: 280px; }
.tool-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.tool-stats > div, .tool-summary .modal-stat { background: rgba(2,6,23,.34); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.tool-stats span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.tool-stats strong { display: block; margin-top: 4px; font-size: 16px; }
.tool-summary { display: flex; flex-direction: column; gap: 8px; }
.tool-summary .empty { padding: 10px; }
.tool-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(148,163,184,.08); font-size: 12px; }
.tool-row:last-child { border-bottom: 0; }
.tool-row span { color: var(--muted); }
.tool-row strong { text-align: right; overflow-wrap: anywhere; }
#cpfTable { max-height: 460px; overflow: auto; }
#cpfTable table { min-width: 420px; }
.report-kpis { margin-bottom: 16px; }
.button.active { border-color: rgba(74,222,128,.36); background: var(--success-soft); color: var(--accent); }
.report-total { color: var(--accent); }
.bot-avatar { font-size: 12px; }
@media (max-width: 1180px) { .quick-actions { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .quick-actions { grid-template-columns: 1fr; } .tool-stats { grid-template-columns: 1fr; } }

.dashboard-hero {
  position: relative; overflow: hidden; display: flex; justify-content: space-between; gap: 20px;
  padding: 24px 26px; margin-bottom: 16px; border-radius: 20px;
  border: 1px solid rgba(74,222,128,.16);
  background: linear-gradient(115deg, rgba(14,32,28,.92), rgba(13,25,45,.94) 55%, rgba(26,22,8,.9));
  box-shadow: 0 20px 70px rgba(0,0,0,.28);
}
.dashboard-hero::before { content: ""; position: absolute; inset: -60% 35% auto -20%; height: 260px; background: radial-gradient(circle, rgba(74,222,128,.18), transparent 62%); pointer-events: none; }
.dashboard-hero::after { content: ""; position: absolute; inset: auto -40px -100px auto; width: 280px; height: 280px; background: radial-gradient(circle, rgba(250,204,21,.12), transparent 65%); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; max-width: 720px; }
.eyebrow { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.hero-copy h2 { margin: 9px 0 6px; font-size: clamp(20px, 2.3vw, 30px); letter-spacing: -.035em; }
.hero-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 15px; color: var(--muted); font-size: 11px; }
.hero-mark { position: relative; z-index: 1; align-self: center; width: 92px; height: 92px; border-radius: 26px; display: grid; place-items: center; font-size: 26px; font-weight: 900; letter-spacing: -.06em; color: #07120b; background: linear-gradient(135deg, #fde68a, #4ade80 55%, #38bdf8); box-shadow: 0 18px 50px rgba(74,222,128,.22); transform: rotate(-4deg); }
@media (max-width: 860px) { .dashboard-hero { padding: 19px; } .hero-mark { width: 64px; height: 64px; font-size: 18px; border-radius: 18px; } }

.card { transition: border-color .16s ease, transform .16s ease; }
.card:hover { border-color: rgba(148,163,184,.25); }
.kpi::before { content: ""; position: absolute; top: 0; left: 18px; width: 44px; height: 3px; border-radius: 0 0 4px 4px; background: linear-gradient(90deg,#4ade80,#38bdf8); }
.kpi:nth-child(2)::before { background: linear-gradient(90deg,#facc15,#f97316); }
.kpi:nth-child(3)::before { background: linear-gradient(90deg,#38bdf8,#818cf8); }
.kpi:nth-child(4)::before { background: linear-gradient(90deg,#a78bfa,#f472b6); }
.table-wrap th { position: sticky; top: 0; z-index: 2; backdrop-filter: blur(10px); }
.topbar { border-bottom: 1px solid rgba(148,163,184,.08); }
.nav-item { position: relative; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 99px; background: linear-gradient(180deg,#4ade80,#38bdf8); }
.button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid rgba(56,189,248,.45); outline-offset: 2px; }

.report-groups { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.report-groups:empty { display: none; }

.tools-main { display: flex; flex-direction: column; gap: 14px; }
.tool-form { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.4fr) auto; gap: 10px; align-items: end; }
.tool-form label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; }
.tool-form input, .tool-form select { width: 100%; }
.tool-help { margin: 0; color: var(--muted-2); font-size: 11px; }
.tool-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tool-summary .tool-row { display: block; background: rgba(2,6,23,.3); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
.tool-summary .tool-row span { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.tool-summary .tool-row strong { display: block; text-align: left; margin-top: 3px; font-size: 11px; }
@media (max-width: 900px) { .tool-form { grid-template-columns: 1fr; } .tool-summary { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .tool-summary { grid-template-columns: 1fr; } }
