.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  font-size: inherit;
  line-height: 1;
  vertical-align: middle;
  user-select: none;
}

/* ── Reset & tokens ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0f0f17;
  --bg-card:     #1a1a28;
  --bg-input:    #12121e;
  --bg-sidebar:  #13131f;
  --border:      rgba(255,255,255,0.07);
  --text:        #e2e2f0;
  --text-muted:  rgba(255,255,255,0.38);
  --accent:      #7c9ef8;
  --accent-dim:  rgba(124,158,248,0.14);
  --green:       #6fcf97;
  --yellow:      #f2c94c;
  --red:         #eb5757;
  --radius:      10px;
  --radius-sm:   6px;
  --font-mono:   'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sidebar-w:   56px;
  --transition:  0.18s ease;

  /* ── Bot colors (used across bots, activity, pipeline pages) ── */
  --bot-po:           #f2c94c;
  --bot-scrum:        #c084fc;
  --bot-techlead:     #60a5fa;
  --bot-fullstack:    #f97316;
  --bot-frontend:     #fb7185;
  --bot-devops:       #34d399;
  --bot-em:           #94a3b8;
  --bot-qa:           #4ade80;
  --bot-security:     #f87171;
  --bot-docs:         #a3e635;
  --bot-triage:       #a78bfa;
  --bot-requirements: #38bdf8;
  --bot-issue:        #34d399;
  --bot-dev:          #f97316;
  --bot-review:       #7c9ef8;
  --bot-ui:           #fb7185;
  --bot-release:      #fbbf24;
  --bot-analyst:      #94a3b8;
  --bot-maintenance:  #e879f9;
  --bot-chat:         #2dd4bf;
  --bot-embedded:     #475569;
  --bot-reviewer:     #60a5fa;
  --bot-standup:      #c084fc;
  --bot-vpn:          #f59e0b;
  --bot-cross-repo:   #818cf8;
  --bot-clickup:      #7b68ee;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
body {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
}

.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 36px;
  overflow-y: auto;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}
.sidebar-header:hover { opacity: 0.75; }

.logo { font-size: 22px; }
.logo-text { display: none; }

nav { padding: 8px 0; flex: 1; display: flex; flex-direction: column; align-items: center; }

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
}

.nav-item:hover { background: var(--accent-dim); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-icon { font-size: 18px; line-height: 1; }

.sidebar-footer {
  padding: 10px 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-footer button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  transition: color var(--transition);
  line-height: 1;
}
.sidebar-footer button:hover { color: var(--accent); }
.sidebar-footer button:disabled { opacity: .4; cursor: default; }

.sidebar-footer-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#last-refresh { display: none; }
#btn-refresh-menu { display: none; }
#btn-save-restart { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; transition: color var(--transition); line-height: 1; }
#btn-save-restart:hover { color: var(--accent); }

.vpn-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  padding: 5px;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color 0.2s;
}
.vpn-label { display: none; }
.vpn-indicator:hover { border-color: var(--accent); }
.vpn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #555;
  flex-shrink: 0;
}
.vpn-ok   .vpn-dot { background: #4caf7d; box-shadow: 0 0 5px #4caf7d88; }
.vpn-fail .vpn-dot { background: #f47c7c; box-shadow: 0 0 5px #f47c7c88; }
.vpn-ok   { border-color: #4caf7d44; color: #4caf7d; }
.vpn-fail { border-color: #f47c7c44; color: #f47c7c; }

.refresh-menu {
  display: flex;
  gap: 4px;
  position: relative;
}

#btn-refresh-main {
  flex: 1;
  font-size: 14px;
}

#btn-refresh-menu {
  width: 24px;
  padding: 0;
  font-size: 12px;
}

.refresh-dropdown {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
  min-width: 140px;
  z-index: 100;
  margin-bottom: 8px;
}

.refresh-dropdown button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}

.refresh-dropdown button:last-child {
  border-bottom: none;
}

.refresh-dropdown button:hover {
  background: rgba(124,158,248,0.1);
  color: var(--accent);
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tab { display: none; }
.tab.active { display: block; }

h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}

h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.card.wide { grid-column: 1 / -1; }

/* ── Monitor grid ────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 160px;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1;   }
}

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

/* Modals que usam o próprio elemento como overlay */
#bot-info-modal,
#bot-config-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 0;
  border: none;
  border-radius: 0;
  min-width: unset;
  max-width: unset;
  gap: 0;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  min-width: 380px;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.modal-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.btn-cancel {
  padding: 7px 16px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}
.btn-cancel:hover { border-color: var(--text-muted); color: var(--text); }

.btn-save {
  padding: 7px 20px;
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-save:hover { opacity: 0.85; }

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}

.modal-col h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.modal h2 {
  margin-bottom: 4px;
}

.modal label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal label .text-muted {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.modal input {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
}

.modal input:focus { outline: none; border-color: var(--accent); }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn-modal-cancel {
  padding: 7px 16px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}
.btn-modal-cancel:hover { border-color: var(--text-muted); color: var(--text); }

.btn-modal-confirm {
  padding: 7px 20px;
  background: var(--accent);
  border: none;
  color: #0f0f17;
  font-weight: 700;
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-modal-confirm:hover { opacity: 0.85; }

/* ── State helpers ───────────────────────────────────────────────────────── */
.empty-state  { color: var(--text-muted); font-size: 13px; }
.error-state  { color: var(--red);        font-size: 13px; }
.loading-cell { color: var(--text-muted); font-size: 13px; padding: 12px; }

/* ── Scrollbars ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar             { width: 6px; height: 6px; }
::-webkit-scrollbar-track       { background: transparent; }
::-webkit-scrollbar-thumb       { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ── Shared stat blocks (used in processes, repos, home) ─────────────────── */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; }
.stat-value { font-size: 13px; font-weight: 600; color: var(--text); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  body { flex-direction: column; }

  .sidebar {
    width: 100%;
    min-height: auto;
    height: auto;
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--border);
  }

  .sidebar-header { display: none; }
  .sidebar-footer  { display: none; }

  nav {
    flex-direction: row;
    flex: 1;
    justify-content: space-around;
    align-items: center;
    padding: 4px 8px;
  }

  .nav-item { width: 44px; height: 44px; }

  .content {
    margin-left: 0;
    padding: 16px 12px 72px; /* bottom padding for bottom nav */
    min-height: 100vh;
  }

  .card.wide { grid-column: auto; }

  .card-grid {
    grid-template-columns: 1fr !important;
  }

  /* Modals */
  #bot-info-modal,
  #bot-config-modal {
    align-items: flex-end;
  }
  #bot-info-modal .modal-content,
  #bot-config-modal .modal-content {
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 85vh;
  }
  .bot-info-modal-content { max-width: 100% !important; width: 100% !important; }
}
