/* ============================================
   ETHMUS CONTROL CENTER v2 — Design System
   ============================================ */

:root {
  --bg: #080e0a;
  --surface: #0d1610;
  --surface2: #131d15;
  --border: #1e2e21;
  --text: #e8edf0;
  --text-muted: #6b8070;
  --green: #4ade80;
  --red: #ef4444;
  --yellow: #f59e0b;
  --purple: #a855f7;
  --indigo: #6366f1;
  --radius: 10px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --sidebar-width: 220px;
  --transition: 0.18s ease;
}

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

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

a { color: inherit; text-decoration: none; }

/* ============================================
   LAYOUT
   ============================================ */

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  position: relative;
  user-select: none;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-item:hover svg {
  opacity: 1;
}

.nav-item.active {
  color: var(--text);
  background: var(--surface2);
  border-left: 2px solid var(--green);
  padding-left: 10px;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--red);
  color: #fff;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-badge:empty {
  display: none;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-footer span {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  flex-shrink: 0;
}

.sidebar-footer button:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  scroll-behavior: smooth;
}

/* ============================================
   VIEWS
   ============================================ */

.view {
  display: none;
  animation: fadeIn 0.2s ease;
}

.view.active {
  display: block;
}

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

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.view-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.view-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.header-actions select,
.header-actions input[type="month"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 7px 12px;
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}

.header-actions select:hover,
.header-actions input[type="month"]:hover {
  border-color: var(--text-muted);
}

.header-actions select:focus,
.header-actions input[type="month"]:focus {
  border-color: var(--green);
}

.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 28px 0 14px;
}

/* ============================================
   STAT GRID
   ============================================ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition);
}

.stat-card:hover {
  border-color: var(--text-muted);
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.green  { background: rgba(74, 222, 128, 0.12); color: var(--green); }
.stat-icon.yellow { background: rgba(245, 158, 11, 0.12); color: var(--yellow); }
.stat-icon.indigo { background: rgba(99, 102, 241, 0.12); color: var(--indigo); }
.stat-icon.purple { background: rgba(168, 85, 247, 0.12); color: var(--purple); }
.stat-icon.red    { background: rgba(239, 68, 68, 0.12);  color: var(--red); }

.stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   LIVE INDICATOR
   ============================================ */

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}

/* ============================================
   MINI SYSTEMS (dashboard)
   ============================================ */

.mini-systems {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.mini-system-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.mini-system-card:hover {
  background: var(--surface2);
  border-color: var(--text-muted);
}

.mini-sys-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mini-sys-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   SYSTEMS GRID
   ============================================ */

.systems-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .systems-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .systems-grid { grid-template-columns: 1fr; }
}

.system-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  --accent: var(--green);
}

.system-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset, 0 4px 24px rgba(0,0,0,0.3);
}

.sys-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sys-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: -0.02em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.online   { background: rgba(74, 222, 128, 0.12); color: var(--green); }
.status-badge.offline  { background: rgba(239, 68, 68, 0.12);  color: var(--red); }
.status-badge.error    { background: rgba(245, 158, 11, 0.12); color: var(--yellow); }
.status-badge.unknown  { background: rgba(107, 128, 112, 0.12); color: var(--text-muted); }

.sys-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.sys-card-url {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sys-card-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.sys-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sys-meta-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sys-meta-value {
  font-size: 0.8rem;
  color: var(--text);
  font-family: var(--mono);
}

.sys-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ============================================
   TICKETS
   ============================================ */

.ticket-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  transition: border-color var(--transition);
  cursor: pointer;
}

.ticket-item:hover {
  border-color: var(--text-muted);
}

.ticket-system {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 80px;
  flex-shrink: 0;
}

.ticket-subject {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-client {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--mono);
  white-space: nowrap;
}

/* Ticket status badges */
.ticket-status {
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.ticket-status.open        { background: rgba(245, 158, 11, 0.12); color: var(--yellow); }
.ticket-status.in_progress { background: rgba(99, 102, 241, 0.12); color: var(--indigo); }
.ticket-status.resolved    { background: rgba(74, 222, 128, 0.12); color: var(--green); }
.ticket-status.closed      { background: rgba(107, 128, 112, 0.1); color: var(--text-muted); }

/* Priority badges */
.priority-badge {
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.priority-badge.low      { background: rgba(107, 128, 112, 0.1); color: var(--text-muted); }
.priority-badge.normal   { background: rgba(99, 102, 241, 0.12); color: var(--indigo); }
.priority-badge.high     { background: rgba(245, 158, 11, 0.12); color: var(--yellow); }
.priority-badge.critical { background: rgba(239, 68, 68, 0.12);  color: var(--red); }

/* ============================================
   TICKET DETAIL MODAL
   ============================================ */

.ticket-detail-header {
  margin-bottom: 16px;
}

.ticket-detail-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.ticket-detail-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ticket-status-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.message-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.84rem;
  line-height: 1.5;
}

.message-bubble.admin {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.15);
  align-self: flex-end;
  max-width: 90%;
}

.message-bubble.client {
  background: var(--surface2);
  border: 1px solid var(--border);
  align-self: flex-start;
  max-width: 90%;
}

.message-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   COSTS
   ============================================ */

.cost-totals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.cost-total-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.cost-total-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.cost-total-usd {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green);
  font-family: var(--mono);
}

.cost-total-brl {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

/* ============================================
   CHART
   ============================================ */

.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  max-height: 300px;
  position: relative;
}

/* ============================================
   DATA TABLE
   ============================================ */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table thead tr {
  background: var(--surface2);
}

.data-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.data-table tbody tr {
  border-top: 1px solid var(--border);
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--surface2);
}

.data-table tbody td {
  padding: 11px 14px;
  color: var(--text);
  vertical-align: middle;
}

.data-table tbody td.mono {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
}

/* ============================================
   BOT HEALTH
   ============================================ */

.bot-history-table .data-table td:first-child {
  font-family: var(--mono);
  font-size: 0.78rem;
}

/* ============================================
   DOCS
   ============================================ */

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition);
}

.doc-card:hover {
  border-color: var(--text-muted);
}

.doc-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.doc-card-system {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.doc-card-date {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.doc-card-actions {
  display: flex;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.doc-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* ============================================
   REPORTS
   ============================================ */

.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 700px) {
  .reports-grid { grid-template-columns: 1fr; }
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition);
}

.report-card:hover {
  border-color: var(--text-muted);
}

.report-icon {
  width: 40px;
  height: 40px;
  background: var(--surface2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.report-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.report-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  width: 100%;
}

.btn-primary {
  background: var(--green);
  color: #030a04;
  font-weight: 600;
}

.btn-primary:hover {
  background: #6ee79a;
}

.btn-ghost {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--text-muted);
  background: var(--surface);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.78rem;
  border-radius: 8px;
  width: auto;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.72rem;
  border-radius: 6px;
  width: auto;
}

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

/* ============================================
   FORMS
   ============================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 0.84rem;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--green);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  z-index: 400;
  transition: opacity 0.2s, visibility 0.2s;
  padding: 20px;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { transform: scale(0.96) translateY(8px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-header h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}

.modal-close:hover {
  color: var(--text);
  background: var(--surface2);
}

.modal-body {
  padding: 20px 24px 24px;
}

/* ============================================
   SYSTEM PANEL (slide from right)
   ============================================ */

.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  z-index: 300;
  transition: opacity 0.25s, visibility 0.25s;
}

.panel-overlay.open {
  opacity: 1;
  visibility: visible;
}

.sys-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 600px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  z-index: 301;
}

.panel-overlay.open .sys-panel {
  transform: translateX(0);
}

.sys-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sys-panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.sys-panel-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--mono);
}

.panel-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}

.panel-close:hover {
  color: var(--text);
  background: var(--surface2);
}

.sys-panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
}

.sys-tab {
  background: none;
  border: none;
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}

.sys-tab:hover {
  color: var(--text);
}

.sys-tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.sys-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.sys-tab-content {
  display: none;
}

.sys-tab-content.active {
  display: block;
}

/* Acessos tab */
.access-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.access-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 100px;
}

.access-value {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  flex: 1;
  word-break: break-all;
}

.access-copy {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  padding: 4px 8px;
  font-size: 0.7rem;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  flex-shrink: 0;
}

.access-copy:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ============================================
   TERMINAL
   ============================================ */

.terminal {
  background: #020804;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #86efac;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
}

.terminal .t-error { color: #f87171; }
.terminal .t-warn  { color: #fbbf24; }
.terminal .t-info  { color: #60a5fa; }
.terminal .t-dim   { color: #6b8070; }

/* Notes */
.note-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.note-content {
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.note-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

/* Vault */
.vault-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.vault-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--green);
  min-width: 120px;
  font-weight: 500;
}

.vault-value {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vault-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Deploy history */
.deploy-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}

.deploy-row:last-child {
  border-bottom: none;
}

.deploy-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.deploy-msg {
  flex: 1;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deploy-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================
   SKELETON LOADING
   ============================================ */

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-anim 1.5s infinite;
  border-radius: 6px;
}

@keyframes skeleton-anim {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.full { width: 100%; }

/* ============================================
   TOAST
   ============================================ */

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.84rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastIn 0.2s ease;
}

@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.toast.success { border-color: rgba(74, 222, 128, 0.3); }
.toast.error   { border-color: rgba(239, 68, 68, 0.3); }
.toast.warning { border-color: rgba(245, 158, 11, 0.3); }

.toast-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast.success .toast-icon { background: var(--green); }
.toast.error   .toast-icon { background: var(--red); }
.toast.warning .toast-icon { background: var(--yellow); }

/* ============================================
   SPINNER
   ============================================ */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  opacity: 0.3;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 0.84rem;
}

/* ============================================
   SCROLLBAR
   ============================================ */

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   AUTH PAGE (login / 2fa)
   ============================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-logo span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.auth-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.auth-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--red);
  margin-bottom: 16px;
}

/* ============================================
   UTILITY
   ============================================ */

.text-muted  { color: var(--text-muted); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-mono   { font-family: var(--mono); }
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.mb-12       { margin-bottom: 12px; }
.mb-16       { margin-bottom: 16px; }

code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--green);
}
