body {
  font-family: "Poppins", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at 10% 20%, rgba(88, 101, 242, 0.35), transparent 55%),
    linear-gradient(180deg, #050712 0%, #060918 35%, #050712 100%);
  color: #ffffff;
  min-height: 100vh;
}

:root {
  --text-default: #f5f7ff;
  --text-muted: #cacaca;
  --text-secondary: #f5f7ff;
  --card-bg: rgba(13,16,32,0.95);
  --panel-border: rgba(255,255,255,0.08);
  --muted-overlay: rgba(0,0,0,0.32);
}

.text-muted {
  color: var(--text-muted) !important;
}

.hero-panel {
  background: rgba(13, 17, 32, 0.95);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.45);
}

.hero-metrics {
  background: rgba(9, 11, 24, 0.9);
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.hero-metrics .metric h2 {
  font-size: 2.25rem;
  margin-bottom: 0.2rem;
}

.hero-metrics .metric p {
  margin: 0;
  color: var(--text-muted);
}

.status-card,
.update-card,
.kb-card,
.cta-card {
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 1.1rem;
  padding: 1.25rem;
  box-shadow: 0 25px 60px rgba(2, 3, 8, 0.45);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.status-operational {
  background: #2ecc71;
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.65);
}

.status-degraded {
  background: #f1c40f;
  box-shadow: 0 0 12px rgba(241, 196, 15, 0.65);
}

.status-down {
  background: #e74c3c;
  box-shadow: 0 0 12px rgba(231, 76, 60, 0.65);
}

.kb-card {
  min-height: 180px;
}

.cta-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .cta-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.ticket-nav {
  background: rgba(8, 10, 20, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ticket-nav .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ticket-nav .nav-link {
  color: var(--text-secondary);
  font-weight: 500;
}

.ticket-nav .nav-link.active,
.ticket-nav .nav-link:hover {
  color: #ffffff;
}

.footer-glass {
  background: rgba(8, 10, 20, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.ticket-flash {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 1.15rem;
  margin: 1rem auto;
  max-width: 960px;
}

.ticket-flash.error {
  background: rgba(231, 76, 60, 0.12);
  border-color: rgba(231, 76, 60, 0.6);
  color: #c0392b; /* darker red for contrast */
}

.ticket-flash.success {
  background: rgba(46, 204, 113, 0.12);
  border-color: rgba(46, 204, 113, 0.45);
  color: #19773d; /* darker green for contrast */
}

.server-card {
  background: rgba(22, 27, 46, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.server-card:hover {
  border-color: rgba(114, 137, 218, 0.8);
  transform: translateY(-2px);
}

.placeholder-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #252a41;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.server-scroll {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
}

.server-scroll::-webkit-scrollbar {
  width: 6px;
}

.server-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 4px;
}

.ticket-table {
  width: 100%;
}

.ticket-table th,
.ticket-table td {
  padding: 0.85rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ticket-table th {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.ticket-table tbody tr:last-child td {
  border-bottom: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.15rem 0.8rem;
  font-size: 0.8rem;
  text-transform: capitalize;
}

.status-open {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.status-closed {
  background: rgba(231, 76, 60, 0.15);
  color: #ff6b6b;
}

.status-claimed {
  background: rgba(52, 152, 219, 0.18);
  color: #34a9ff;
}

.status-on-hold {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

.status-awaiting-user {
  background: rgba(241, 196, 15, 0.18);
  color: #f1c40f;
}

.status-escalated {
  background: rgba(155, 89, 182, 0.18);
  color: #bb6bd9;
}

.queue-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.queue-stat {
  background: rgba(10, 12, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
}

.queue-stat .label {
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.queue-stat h2 {
  margin: 0;
  font-size: 2.2rem;
}

.queue-stat.live {
  align-items: flex-start;
}

.ticket-layout aside {
  min-height: 100%;
}

.server-summary-scroll {
  max-height: 580px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.server-summary-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1.1rem;
  background: rgba(19, 20, 36, 0.95);
}

.server-icon-rounded {
  border-radius: 16px;
}

.summary-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.35rem;
}

.dot-open {
  background: #2ecc71;
}

.dot-claimed {
  background: #34a9ff;
}

.dot-awaiting {
  background: #f1c40f;
}

.dot-hold {
  background: #f39c12;
}

.dot-escalated {
  background: #bb6bd9;
}

.dot-closed {
  background: #e74c3c;
}

.dept-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  border-radius: 999px;
  padding: 0.1rem 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.92);
}

.ticket-shell .ticket-header {
  background: rgba(13, 16, 32, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.ticket-card,
.ticket-sidebar-card {
  background: rgba(12, 13, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.1rem;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(3, 4, 10, 0.45);
}

.ticket-body {
  background: rgba(9, 11, 24, 0.9);
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.25rem;
  white-space: pre-wrap;
}

.ticket-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.ticket-meta-grid > div {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 1rem;
}

.ticket-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ticket-timeline li {
  border-left: 2px solid rgba(255, 255, 255, 0.10);
  padding-left: 1rem;
}

.timeline-metadata {
  margin: 0.35rem 0 0;
  background: rgba(0, 0, 0, 0.32);
  border-radius: 0.5rem;
  padding: 0.65rem;
  font-size: 0.8rem;
}

.ticket-sidebar-card .ticket-sidebar-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ticket-inline-form label {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ticket-inline-form input,
.ticket-inline-form textarea {
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-default);
}

.watcher-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.watcher-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.watcher-list img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.assigned-agent {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.65rem;
  padding: 0.5rem 0.75rem;
}
