:root {
  --bg: #0b1120;
  --bg-soft: #111c34;
  --surface: rgba(15, 23, 42, 0.74);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-muted: rgba(255, 255, 255, 0.78);
  --border: rgba(148, 163, 184, 0.24);
  --text: #e2e8f0;
  --text-strong: #0f172a;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.18), transparent 24%),
    linear-gradient(145deg, #020617 0%, #0f172a 58%, #111827 100%);
}

a {
  color: inherit;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: visible;
}

.shell-backdrop {
  position: fixed;
  z-index: 0;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(14px);
  opacity: 0.55;
  pointer-events: none;
}

.shell-backdrop--left {
  top: 7rem;
  left: -10rem;
  background: rgba(14, 165, 233, 0.18);
}

.shell-backdrop--right {
  top: 14rem;
  right: -8rem;
  background: rgba(96, 165, 250, 0.16);
}

.shell-header,
.app-main {
  position: relative;
  z-index: 1;
  overflow: visible;
}

.shell-header {
  z-index: 50;
}

.app-container {
  max-width: 1440px;
  padding: 2rem 1rem 3rem;
}

.app-navbar {
  padding: 1rem 0;
  overflow: visible;
}

.app-navbar__inner {
  max-width: 1440px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow);
  overflow: visible;
}

.navbar-collapse,
.navbar-nav,
.nav-item.dropdown {
  overflow: visible;
}

.app-navbar__toggler {
  border: 0;
  box-shadow: none !important;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--text) !important;
  text-decoration: none;
}

.app-brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.app-brand strong {
  font-size: 0.98rem;
  letter-spacing: 0.1em;
}

.app-brand small {
  color: rgba(226, 232, 240, 0.7);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-brand__logo {
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.35rem;
}

.app-nav .nav-link,
.app-dropdown .dropdown-item,
.profile-chip,
.inline-link {
  text-decoration: none;
}

.app-nav .nav-link {
  color: rgba(226, 232, 240, 0.78) !important;
  border-radius: 999px;
  padding: 0.65rem 0.9rem !important;
  transition: 0.2s ease;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus,
.profile-chip:hover,
.profile-chip:focus {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08);
}

.app-dropdown {
  --bs-dropdown-bg: #0f172a;
  --bs-dropdown-color: #f8fafc;
  --bs-dropdown-link-color: #f8fafc;
  --bs-dropdown-link-hover-color: #ffffff;
  --bs-dropdown-link-hover-bg: rgba(148, 163, 184, 0.18);
  --bs-dropdown-border-color: rgba(71, 85, 105, 0.85);
  background: #0f172a;
  border: 1px solid rgba(71, 85, 105, 0.85);
  border-radius: var(--radius-sm);
  padding: 0.45rem;
  box-shadow: 0 22px 40px rgba(2, 6, 23, 0.42);
  opacity: 1;
  z-index: 2000;
}

.app-dropdown .dropdown-item {
  color: #f8fafc;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
}

.app-dropdown .dropdown-item:hover,
.app-dropdown .dropdown-item:focus {
  background: rgba(148, 163, 184, 0.18);
  color: #ffffff;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.profile-chip i {
  font-size: 1rem;
}

.page-shell,
.auth-shell,
.report-shell {
  display: grid;
  gap: 1.5rem;
}

.hero-card,
.panel-card,
.floating-card,
.report-card,
.auth-card {
  background: var(--surface-strong);
  color: var(--text-strong);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 2rem;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(59, 130, 246, 0.04)),
    var(--surface-strong);
}

.hero-card--dark {
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.22), transparent 28%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96));
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.18);
}

.hero-card h1,
.auth-card h1,
.panel-card h2,
.floating-card h2 {
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-card__eyebrow,
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-card--dark .hero-card__eyebrow,
.hero-card--dark .text-muted {
  color: rgba(226, 232, 240, 0.72) !important;
}

.panel-card,
.floating-card,
.report-card,
.auth-card {
  padding: 1.5rem;
}

.panel-card--soft {
  background: rgba(255, 255, 255, 0.86);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.toolbar__actions,
.icon-actions,
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.search-shell {
  position: relative;
}

.search-shell i {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-shell .form-control {
  padding-left: 2.75rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.5rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(203, 213, 225, 0.92);
  color: var(--text-muted);
  font-weight: 700;
  text-decoration: none;
  transition: 0.2s ease;
}

.status-pill:hover,
.status-pill:focus {
  color: var(--text-strong);
  border-color: rgba(56, 189, 248, 0.45);
}

.status-pill.active {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  border-color: transparent;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-badge--open {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.status-badge--troubleshooting {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.status-badge--closed {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.95rem;
  height: 2.95rem;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.icon-button:hover,
.icon-button:focus {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 20px 34px rgba(37, 99, 235, 0.3);
}

.icon-button--ghost {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.icon-button--muted {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-strong);
  box-shadow: none;
}

.icon-button--danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.metric-grid,
.info-grid,
.form-grid,
.ticket-grid {
  display: grid;
  gap: 1rem;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-card {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(203, 213, 225, 0.78);
}

.metric-card span {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card strong {
  display: block;
  margin-top: 0.55rem;
  font-size: 1.06rem;
}

.info-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.info-card {
  padding: 1.1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(203, 213, 225, 0.82);
}

.info-card label {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-card div {
  margin-top: 0.45rem;
  font-weight: 600;
}

.ticket-grid {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.ticket-card {
  display: grid;
  gap: 1rem;
  padding: 1.4rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.ticket-card__meta,
.ticket-card__footer {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.ticket-card__summary {
  color: var(--text-muted);
}

.data-panel table.dataTable,
.data-panel .table {
  margin: 0 !important;
}

.data-panel .table thead th,
.data-panel table.dataTable thead th {
  border-bottom: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-panel .table tbody td,
.data-panel table.dataTable tbody td {
  padding-top: 1rem;
  padding-bottom: 1rem;
  vertical-align: middle;
  border-color: rgba(226, 232, 240, 0.92);
}

.table-actions {
  display: inline-flex;
  gap: 0.6rem;
}

.conversation {
  display: grid;
  gap: 1rem;
}

.message-row {
  display: flex;
}

.message-row--engineer {
  justify-content: flex-end;
}

.message-bubble {
  max-width: min(100%, 680px);
  padding: 1rem 1.1rem;
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.09);
}

.message-row--customer .message-bubble {
  background: rgba(254, 249, 195, 0.72);
}

.message-row--engineer .message-bubble {
  background: rgba(220, 252, 231, 0.82);
}

.message-bubble__meta {
  margin-top: 0.65rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  text-align: right;
}

.note-editor textarea,
.form-control,
.form-select {
  border-radius: 18px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  background: rgba(255, 255, 255, 0.92);
  padding: 0.95rem 1rem;
  box-shadow: none !important;
}

.note-editor textarea:focus,
.form-control:focus,
.form-select:focus {
  border-color: rgba(14, 165, 233, 0.45);
}

.form-floating > .form-control,
.form-floating > .form-select {
  height: calc(3.9rem + 2px);
}

.form-floating > label {
  padding: 1rem 1rem;
}

.form-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.auth-shell {
  min-height: calc(100vh - 10rem);
  align-items: center;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 1.5rem;
}

.auth-card {
  height: 100%;
}

.auth-card--dark {
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.2), transparent 26%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96));
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.18);
}

.auth-points {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.auth-point {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.auth-point i {
  color: var(--accent);
  font-size: 1.15rem;
}

.login-actions,
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.inline-link {
  color: #2563eb;
  font-weight: 700;
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.report-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 20px;
  background: rgba(14, 165, 233, 0.08);
  padding: 0.75rem;
}

.legend-list {
  display: grid;
  gap: 0.6rem;
}

.legend-list span {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
}

.legend-dot--open {
  background: var(--success);
}

.legend-dot--progress {
  background: var(--warning);
}

.legend-dot--closed {
  background: var(--danger);
}

.modal-content {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.modal {
  z-index: 3000;
}

.modal-backdrop {
  z-index: 2990;
}

.modal-dialog {
  z-index: 3010;
  pointer-events: auto;
}

.report-inline-panel {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(59, 130, 246, 0.03)),
    rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.14);
  color: var(--text-strong);
}

.modal-header,
.modal-footer {
  border: 0;
}

.visually-hidden-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 991.98px) {
  .app-navbar__inner {
    border-radius: 30px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .app-container {
    padding-inline: 0.75rem;
  }

  .hero-card,
  .panel-card,
  .floating-card,
  .report-card,
  .auth-card {
    padding: 1.25rem;
    border-radius: 22px;
  }

  .toolbar,
  .report-header,
  .ticket-card__meta,
  .ticket-card__footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
