/* ============================================================
   Mesa de Ayuda — El Vigía
   CSS Principal — Bootstrap 5 + Custom
   ============================================================ */

:root {
  --sidebar-bg:      #1e2a3a;
  --sidebar-text:    rgba(255,255,255,0.85);
  --sidebar-hover:   rgba(255,255,255,0.12);
  --sidebar-active:  #c0392b;
  --sidebar-w:       260px;
  --topbar-h:        56px;
  --accent:          #c0392b;
  --accent-dark:     #a93226;
  --surface:         #f8f9fa;
  --card-shadow:     0 1px 4px rgba(0,0,0,.08);
}

/* ── RESET / BASE ── */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f2f5;
  color: #1a202c;
}

/* ── LAYOUT ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  overflow-y: auto;
  transition: transform .25s ease;
}

.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s ease;
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 1040;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.main-content {
  flex: 1;
  padding: 1.5rem;
}

/* ── SIDEBAR ── */
.sidebar-header {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}

.sidebar-logo .bi { font-size: 1.25rem; color: var(--accent); }

.sidebar-subtitle {
  font-size: 0.7rem;
  color: rgba(255,255,255,.45);
  margin-top: .25rem;
  padding-left: 1.875rem;
}

.sidebar-nav {
  flex: 1;
  padding: .75rem .75rem;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: .5rem .5rem .25rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: .625rem;
  color: var(--sidebar-text);
  padding: .5rem .75rem;
  border-radius: 6px;
  font-size: .875rem;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.sidebar-nav .nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav .nav-link.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.sidebar-nav .nav-link .bi { font-size: 1rem; }

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-user { display: flex; align-items: center; gap: .625rem; }
.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .875rem;
  flex-shrink: 0;
}

.sidebar-user-name { font-size: .8rem; font-weight: 600; color: #fff; }
.sidebar-user-role { font-size: .7rem; color: rgba(255,255,255,.45); }

/* ── PAGE HEADER ── */
.page-header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a202c;
}
.page-subtitle { color: #718096; font-size: .875rem; }

/* ── CARDS ── */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  font-size: .9rem;
  padding: .875rem 1rem;
  border-radius: 10px 10px 0 0 !important;
}

/* ── KPI CARDS ── */
.kpi-card {
  border-radius: 10px;
  padding: 1.25rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.kpi-icon {
  font-size: 2rem;
  opacity: .35;
  position: absolute;
  right: 1rem; top: 50%;
  transform: translateY(-50%);
}
.kpi-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.kpi-label { font-size: .8rem; opacity: .85; margin-top: .25rem; }

.kpi-primary   { background: linear-gradient(135deg, #1a3a6e, #2c5fa8); }
.kpi-danger    { background: linear-gradient(135deg, #c0392b, #e74c3c); }
.kpi-warning   { background: linear-gradient(135deg, #d68910, #f39c12); }
.kpi-success   { background: linear-gradient(135deg, #1a7a4a, #27ae60); }
.kpi-info      { background: linear-gradient(135deg, #1470a3, #2980b9); }
.kpi-secondary { background: linear-gradient(135deg, #5d6d7e, #7f8c8d); }

/* ── STATUS DOTS ── */
.status-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-up      { background: #27ae60; box-shadow: 0 0 0 3px rgba(39,174,96,.2); }
.dot-down    { background: #c0392b; box-shadow: 0 0 0 3px rgba(192,57,43,.2); }
.dot-pending { background: #f39c12; }

/* ── NETWORK ── */
.net-status-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem 0;
  font-size: .875rem;
}
.net-name { font-weight: 500; }

/* Network nodes grid */
.node-card { border-radius: 10px; transition: box-shadow .2s; }
.node-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.node-inactive { opacity: .55; }

/* Ping log */
.ping-log {
  font-family: 'Courier New', monospace;
  font-size: .8rem;
  background: #0d1117;
  color: #c9d1d9;
  padding: 1rem;
  max-height: 250px;
  overflow-y: auto;
  border-radius: 0 0 10px 10px;
}
.ping-log-entry { padding: .1rem 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.ping-log .text-success { color: #56d364 !important; }
.ping-log .text-danger  { color: #f85149 !important; }
.ping-log .text-warning { color: #e3b341 !important; }

/* ── KANBAN ── */
.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  min-height: 60vh;
}

.kanban-column {
  flex: 0 0 280px;
  background: #edf2f7;
  border-radius: 10px;
  padding: .75rem;
  display: flex;
  flex-direction: column;
}

.kanban-col-header {
  padding: .75rem .75rem .5rem;
  background: #fff;
  border-radius: 8px;
  margin-bottom: .75rem;
  box-shadow: var(--card-shadow);
}

.kanban-cards-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

.kanban-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: box-shadow .2s, transform .1s;
  cursor: pointer;
}
.kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  transform: translateY(-1px);
}
.kanban-card-body { padding: .875rem; }
.kanban-card-title { font-size: .9rem; font-weight: 600; margin-bottom: .375rem; color: #1a202c; }
.kanban-card-desc { font-size: .8rem; color: #718096; margin-bottom: .5rem; }
.kanban-card-footer {
  display: flex;
  align-items: center;
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid #e2e8f0;
}

.kanban-assignee { display: flex; align-items: center; gap: .375rem; }
.assignee-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ── TICKET COMMENTS ── */
.comment-timeline { padding: 1rem; }
.comment-item {
  display: flex;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid #f0f2f5;
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .875rem;
  flex-shrink: 0;
}
.comment-meta { font-size: .8rem; margin-bottom: .375rem; }
.comment-text { font-size: .9rem; color: #2d3748; }

/* ── AUTH PAGES ── */
.auth-body {
  background: linear-gradient(135deg, #1e2a3a 0%, #2c3e50 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-container { width: 100%; max-width: 420px; }

.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.auth-header { text-align: center; margin-bottom: 1.75rem; }
.auth-logo {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.auth-title { font-size: 1.5rem; font-weight: 800; color: #1a202c; margin-bottom: .25rem; }
.auth-subtitle { color: #718096; font-size: .875rem; }
.auth-links {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .875rem;
}
.auth-domain-note {
  text-align: center;
  font-size: .75rem;
  color: #a0aec0;
  margin-top: 1rem;
  margin-bottom: 0;
}

/* ── UTILITIES ── */
.btn-xs {
  padding: .2rem .5rem;
  font-size: .75rem;
  border-radius: 4px;
}
.btn-ghost {
  border: none;
  background: transparent;
  padding: .2rem .35rem;
  color: #718096;
  border-radius: 4px;
}
.btn-ghost:hover { background: #e2e8f0; color: #2d3748; }

.badge-sm { font-size: .7rem; }

.mini-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #718096;
}

.bg-orange { background-color: #e67e22 !important; }

.font-monospace { font-family: 'Courier New', monospace; }

/* ── RESPONSIVE ── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
}

@media (max-width: 575.98px) {
  .main-content { padding: 1rem .75rem; }
  .kanban-column { flex: 0 0 240px; }
}
