:root {
  --bg-image: url("Pictures/background.jpg");
  --glass-bg: rgba(15, 23, 42, 0.38);
  --glass-border: rgba(255, 255, 255, 0.24);
  --text-main: #f6f8ff;
  --text-muted: #d3dbf7;
  --shadow-soft: 0 16px 32px rgba(2, 8, 26, 0.42);
  --neon-high: linear-gradient(135deg, #54f6ff, #8b5cf6, #ff4fd8);
  --focus-glow: 0 0 0 1px rgba(183, 230, 255, 0.78), 0 0 18px rgba(94, 201, 255, 0.32);
  --layer-1: rgba(255, 255, 255, 0.1);
  --layer-2: rgba(255, 255, 255, 0.06);
}


body[data-theme="light"] {
  --glass-bg: rgba(255, 255, 255, 0.36);
  --glass-border: rgba(255, 255, 255, 0.42);
  --text-main: #10213f;
  --text-muted: #324b70;
  --shadow-soft: 0 16px 32px rgba(31, 71, 121, 0.16);
  --focus-glow: 0 0 0 1px rgba(20, 110, 255, 0.54), 0 0 16px rgba(93, 147, 255, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", Arial, sans-serif;
  color: var(--text-main);
  width: 100vw;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow-x: hidden;
  position: relative;
  width: 100vw;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.18), transparent 35%),
    radial-gradient(circle at 82% 14%, rgba(103, 208, 255, 0.16), transparent 33%),
    linear-gradient(120deg, rgba(11, 22, 45, 0.35), rgba(16, 28, 54, 0.62));
  pointer-events: none;
}

body.authenticated-shell {
  --text-main: #f8fbff;
  --text-muted: #d6e0f5;
}

body.authenticated-shell .bg-overlay {
  background:
    radial-gradient(circle at 18% 18%, rgba(148, 197, 255, 0.10), transparent 34%),
    radial-gradient(circle at 84% 12%, rgba(56, 189, 248, 0.10), transparent 34%),
    linear-gradient(120deg, rgba(8, 18, 38, 0.46), rgba(10, 22, 44, 0.58));
  backdrop-filter: blur(2px) saturate(0.9);
  -webkit-backdrop-filter: blur(2px) saturate(0.9);
}

body.authenticated-shell .glass {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.06)),
    rgba(12, 22, 42, 0.44);
  border-color: rgba(255, 255, 255, 0.24);
}

body.authenticated-shell .topbar,
body.authenticated-shell .sidebar,
body.authenticated-shell .kpi-card,
body.authenticated-shell .panel,
body.authenticated-shell .ticket-column,
body.authenticated-shell .archived-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.055)),
    rgba(10, 20, 40, 0.48);
}

body.authenticated-shell small,
body.authenticated-shell .text-muted,
body.authenticated-shell .kpi-card small,
body.authenticated-shell .archived-description {
  color: rgba(226, 235, 255, 0.82);
}

body.public-shell .auth-card.glass {
  background:
    linear-gradient(145deg, var(--layer-1), var(--layer-2)),
    var(--glass-bg);
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
  padding: 18px;
}

.auth-card {
  width: min(450px, 96vw);
  max-width: 450px;
  padding: clamp(16px, 2.8vw, 28px);
  display: grid;
  gap: 12px;
  background:
    linear-gradient(145deg, var(--layer-1), var(--layer-2)),
    var(--glass-bg);
  margin: 0;
}

.auth-brand {
  justify-content: center;
}

.auth-subtitle {
  margin: 0;
  color: var(--text-muted);
  text-align: center;
}

.app-shell {
  --sidebar-width: 290px;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: clamp(10px, 1.6vw, 24px);
  padding: clamp(10px, 1.7vw, 26px);
  transition: grid-template-columns .24s ease, gap .24s ease;
  width: 100vw;
  max-width: 1400px;
  margin: 0 auto;
  overflow-x: hidden;
}

.app-shell.collapsed {
  --sidebar-width: 92px;
}

.glass {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  will-change: transform;
}

.sidebar {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  overflow: hidden;
  transition: width .24s ease, padding .24s ease;
}

.sidebar.collapsed {
  width: 92px;
  padding-left: 10px;
  padding-right: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-collapsed {
  justify-content: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.2);
}

.brand-mark-collapsed {
  width: 24px;
  min-width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 0.82rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.brand small {
  color: var(--text-muted);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.menu {
  display: grid;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  text-decoration: none;
  border-radius: 12px;
  padding: 10px 11px;
  border: 1px solid transparent;
  overflow: hidden;
  min-width: 0;
}

.menu-icon {
  width: 24px;
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  line-height: 1;
}

.menu-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .18s ease, max-width .18s ease, transform .18s ease;
  max-width: 100%;
  font-size: 0.9rem;
  font-weight: 560;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.menu-item:hover,
.menu-item.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.auth-box {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-top: 14px;
}

.auth-box h3 {
  margin: 0 0 7px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

.auth-box p {
  margin: 0 0 6px;
  font-size: 0.84rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
  word-break: break-all;
}

.auth-box small {
  display: block;
  margin-bottom: 10px;
  font-size: 0.74rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.auth-form {
  display: grid;
  gap: 8px;
}

.toggle-btn {
  margin-top: auto;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  white-space: nowrap;
  max-width: 100%;
  padding: 10px 12px;
}

.toggle-icon {
  width: 20px;
  min-width: 20px;
  text-align: center;
  font-size: 1rem;
  line-height: 1;
}

.toggle-label {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.sidebar.collapsed .menu-item {
  justify-content: center;
  padding-left: 6px;
  padding-right: 6px;
  gap: 0;
}

.sidebar.collapsed .menu-label {
  opacity: 0;
  max-width: 0;
  transform: translateX(-4px);
}

.sidebar.collapsed .toggle-btn {
  padding-left: 8px;
  padding-right: 8px;
  gap: 0;
}

.sidebar.collapsed .toggle-label {
  opacity: 0;
  max-width: 0;
  transform: translateX(-4px);
}

input,
textarea,
select,
button {
  width: 100%;
  font: inherit;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.12);
  transition: box-shadow 0.18s ease, transform 0.12s ease, border-color 0.18s ease;
}

/* Placeholder readability (match select text tone) */
input::placeholder,
textarea::placeholder {
  color: var(--text-main);
  opacity: 0.9;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: var(--text-main);
  opacity: 0.9;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

input::-moz-placeholder,
textarea::-moz-placeholder {
  color: var(--text-main);
  opacity: 0.9;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

input:-moz-placeholder,
textarea:-moz-placeholder {
  color: var(--text-main);
  opacity: 0.9;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

input:-ms-input-placeholder,
textarea:-ms-input-placeholder,
input::-ms-input-placeholder,
textarea::-ms-input-placeholder {
  color: var(--text-main);
  opacity: 0.9;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(185, 230, 255, 0.8);
  box-shadow: var(--focus-glow);
}

textarea {
  min-height: 84px;
  resize: vertical;
}

button {
  cursor: pointer;
  font-weight: 600;
}

/* Create ticket button: processing feedback */
.ticket-submit-btn {
  transition: background 180ms ease, border-color 180ms ease, filter 180ms ease, transform 120ms ease;
}

.ticket-submit-btn.processing {
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.12) 18%,
    rgba(255, 255, 255, 0.06) 36%,
    rgba(255, 255, 255, 0.06) 100%
  );
  background-size: 220% 100%;
  animation: helpon-shimmer 1.05s linear infinite;
  border-color: rgba(255, 255, 255, 0.18);
  filter: saturate(0.9) brightness(0.9);
}

@keyframes helpon-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Minimal Glass Select (div + ul) */
.glass-select {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  appearance: none !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  padding: 10px 35px 10px 15px !important;
  font-size: 0.9rem !important;
  cursor: pointer !important;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  /* Ensure dropdown can float above other glass layers */
  z-index: 10000;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white'%3E%3Cpath d='M0 3l6 6 6-6z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 15px center !important;
  background-size: 12px !important;
  transition: all 0.2s ease !important;
}

.glass-select:focus {
  border-color: rgba(255, 255, 255, 0.6) !important;
  outline: none;
}

.glass-select::after {
  content: "";
}

.glass-select span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Allow the dropdown menu to grow wider than the trigger so long option text is fully readable */
.glass-select-menu {
  min-width: 100% !important;
  width: max-content !important;
}

.glass-select-menu {
  position: absolute !important;
  left: 0;
  top: calc(100% + 8px);
  z-index: 9999 !important;
  list-style: none;
  margin: 0;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
  display: grid;
  gap: 6px;
  max-height: 220px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.glass-select-menu::-webkit-scrollbar {
  width: 6px;
}

.glass-select-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.glass-select-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.glass-select-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

.glass-select-menu li {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 5px;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
}

.glass-select-menu li:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Prevent dropdown clipping inside the ticket creation card */
.glass.panel,
.ticket-form,
.select-row,
.route-container,
.main-content {
  overflow: visible !important;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.06);
}

.danger-btn {
  background: rgba(255, 69, 58, 0.2);
}

.archive-btn {
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(147, 197, 253, 0.35);
  color: var(--text-main);
}

.archive-btn:hover:not(:disabled) {
  background: rgba(96, 165, 250, 0.28);
  border-color: rgba(147, 197, 253, 0.52);
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0 !important;
  max-width: 100%;
  width: 100%;
  transition: width .24s ease;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  padding-right: 20px;
  position: relative;
  z-index: 1000 !important;
}

.topbar h2 {
  margin: 0 0 4px;
}

.topbar p {
  margin: 0;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-actions-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
}

.clock {
  font-size: 1rem;
  white-space: nowrap;
  padding: 0 15px;
  color: var(--text-muted);
}

.notif-wrap {
  position: relative;
  z-index: 40;
}

.notif-bell {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.notif-bell:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.notif-icon {
  font-size: 1.05rem;
}

.notif-count {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 76, 109, 0.95);
  color: #0b0f14;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.bell-ring {
  animation: ring 0.5s ease-in-out infinite;
}

.notif-dropdown {
  position: absolute;
  right: 0;
  top: 44px;
  margin-top: 15px;
  width: 360px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.55);
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 9999 !important;
  transition: all 0.3s ease-in-out;
  transform: translateY(0);
}

/* Animação de entrada (quando ng-show se torna true e remove a classe ng-hide) */
.notif-dropdown.ng-hide-remove {
  opacity: 0;
  transform: translateY(-15px);
}
.notif-dropdown.ng-hide-remove-active {
  opacity: 1;
  transform: translateY(0);
}

/* Animação de saída (quando ng-show se torna false e adiciona a classe ng-hide) */
.notif-dropdown.ng-hide-add {
  opacity: 1;
  transform: translateY(0);
}
.notif-dropdown.ng-hide-add-active {
  opacity: 0;
  transform: translateY(-15px);
}

/* Animação de saída (quando ng-show se torna false e adiciona a classe ng-hide) */
.notif-dropdown.ng-hide-add {
  opacity: 1;
  transform: translateX(-50%) translateY(0) !important;
}
.notif-dropdown.ng-hide-add-active {
  opacity: 0;
  transform: translateX(-50%) translateY(-15px) !important;
}

select option[disabled] {
  color: var(--text-muted);
  font-style: italic;
}

/* Responsividade para telas menores */
@media (max-width: 600px) {
  .notif-dropdown {
    width: 90vw;
    left: auto;
    right: -10px; /* Ajuste para não sair da tela à direita no mobile */
    transform: translateX(0) translateY(0);
  }

  .notif-dropdown.ng-hide-remove {
    transform: translateX(0) translateY(-15px);
  }
  .notif-dropdown.ng-hide-remove-active {
    transform: translateX(0) translateY(0);
  }

  .notif-dropdown.ng-hide-add {
    transform: translateX(0) translateY(0);
  }
  .notif-dropdown.ng-hide-add-active {
    transform: translateX(0) translateY(-15px);
  }
}

@keyframes ring {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-10deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(6deg); }
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
  position: sticky;
  top: 0;
  z-index: 2;
  gap: 10px;
}

.notif-title-text {
  flex: 1;
  text-align: left;
}

.notif-trash {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
  color: #ffffff;
}

.notif-trash:hover {
  background: rgba(255, 0, 0, 0.2);
  transform: scale(1.08);
}

.notif-markall {
  flex: 1;
  text-align: right;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.notif-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.notif-list::-webkit-scrollbar {
  width: 8px;
}

.notif-list::-webkit-scrollbar-track {
  background: transparent;
}

.notif-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.notif-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
  background-clip: padding-box;
}

.notif-item {
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  margin: 8px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.92);
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.notif-item.unread {
  border-color: rgba(142, 247, 196, 0.22);
  box-shadow: 0 0 0 1px rgba(142, 247, 196, 0.14) inset;
}

.notif-title {
  font-weight: 800;
  margin: 0 0 2px;
  color: #ffffff;
}

.notif-content {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.notif-meta {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.5);
}

.notif-empty {
  padding: 10px;
  color: rgba(255, 255, 255, 0.65);
}

.notif-empty-center {
  text-align: center;
  padding: 22px 10px;
  width: 100%;
  opacity: 0.7;
}

.toast-stack {
  position: fixed !important;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 94vw);
  display: grid;
  gap: 10px;
  z-index: 99999 !important;
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.toast-title {
  display: block;
  margin-bottom: 4px;
}

.toast-content {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}

.toast-info {
  border-color: rgba(79, 160, 255, 0.22);
}

.toast-warning {
  border-color: rgba(255, 210, 122, 0.26);
}

.toast-critical {
  border-color: rgba(255, 76, 109, 0.26);
}

.toast-comment {
  border-color: rgba(142, 247, 196, 0.22);
}

.role-badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.role-admin {
  color: #ffd5e3;
  background: rgba(255, 64, 129, 0.24);
  border-color: rgba(255, 64, 129, 0.45);
  box-shadow: 0 0 14px rgba(255, 64, 129, 0.32);
}

.role-agent {
  color: #d9ecff;
  background: rgba(79, 160, 255, 0.24);
  border-color: rgba(79, 160, 255, 0.45);
  box-shadow: 0 0 14px rgba(79, 160, 255, 0.25);
}

.role-user {
  color: #e6ebf3;
  background: rgba(148, 163, 184, 0.22);
  border-color: rgba(148, 163, 184, 0.4);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.status-dot.online {
  background: #22c55e;
}

.status-dot.offline {
  background: #ef4444;
}

.message-bar {
  padding: 8px 12px;
  font-size: 0.9rem;
}

.register-box summary {
  cursor: pointer;
  color: var(--text-main);
}

.register-grid {
  margin-top: 10px;
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.register-grid::-webkit-scrollbar {
  width: 6px;
}

.register-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.register-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

@media (max-width: 600px) {
  .register-grid {
    max-height: 50vh;
  }
}

.route-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.welcome-dashboard {
  display: grid;
  gap: clamp(14px, 2vw, 22px);
  width: 100%;
  min-width: 0;
}

.welcome-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
  padding: clamp(20px, 4vw, 42px);
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
    var(--glass-bg);
}

.welcome-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

.welcome-eyebrow {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.welcome-title {
  margin: 0;
  max-width: 760px;
  color: var(--text-main);
  font-size: clamp(2rem, 5vw, 4.8rem);
  font-weight: 850;
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
}

.welcome-lead {
  margin: 0;
  max-width: 780px;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.45vw, 1.18rem);
  line-height: 1.72;
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.welcome-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  max-width: 100%;
  padding: 12px 18px;
  border-radius: 14px;
  color: #061624;
  background: linear-gradient(135deg, #7dd3fc, #c4b5fd, #f0abfc);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.24), 0 0 24px rgba(125, 211, 252, 0.2);
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 0.14s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.welcome-primary-action:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.28), 0 0 28px rgba(125, 211, 252, 0.28);
}

.welcome-hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  padding: clamp(16px, 2vw, 22px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background:
    linear-gradient(160deg, rgba(84, 246, 255, 0.12), rgba(139, 92, 246, 0.08)),
    var(--layer-2);
}

.welcome-panel-kicker {
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 999px;
  color: #dff8ff;
  background: rgba(84, 246, 255, 0.12);
  border: 1px solid rgba(84, 246, 255, 0.22);
  font-size: 0.74rem;
  font-weight: 800;
}

.welcome-hero-panel strong {
  color: var(--text-main);
  font-size: clamp(1.05rem, 1.8vw, 1.45rem);
  line-height: 1.35;
}

.welcome-hero-panel p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.welcome-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.welcome-feature-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  min-height: 190px;
  padding: 18px;
  border-radius: 18px;
  background:
    linear-gradient(150deg, var(--layer-1), var(--layer-2)),
    var(--glass-bg);
}

.welcome-card-index {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.welcome-feature-card h3 {
  margin: 0;
  color: var(--text-main);
  font-size: 1.02rem;
  line-height: 1.25;
}

.welcome-feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.58;
}

.welcome-use-cases {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 28px);
  align-items: start;
  padding: clamp(18px, 3vw, 28px);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05)),
    var(--glass-bg);
}

.welcome-use-cases h2 {
  margin: 8px 0 0;
  color: var(--text-main);
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.welcome-use-case-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.welcome-use-case-list span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.86rem;
  line-height: 1.25;
}

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

.kpi-card {
  padding: 14px;
}

.kpi-card h3,
.kpi-card small {
  margin: 0;
  color: var(--text-muted);
}

.metric {
  margin: 6px 0;
  font-size: clamp(1.3rem, 2.3vw, 2rem);
  font-weight: 800;
}

.panel {
  padding: 14px;
}

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

.mini-chart {
  width: 100%;
  height: 180px;
}

.mini-chart line {
  stroke: rgba(255, 255, 255, 0.24);
  stroke-width: 2;
}

.mini-chart rect {
  fill: url(#barGradient);
  fill: rgba(116, 201, 255, 0.75);
}

.mini-chart text {
  fill: #eef3ff;
  font-size: 12px;
  text-anchor: middle;
}

.automation-list {
  margin: 0;
  padding-left: 18px;
}

.ticket-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow-wrap: break-word;
  max-height: 40vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 12px !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.ticket-form::-webkit-scrollbar {
  width: 6px;
}

.ticket-form::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.ticket-form::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.ticket-form > * {
  flex: 1 1 0;
  min-width: 150px;
  box-sizing: border-box;
}

.ticket-form textarea,
.ticket-form button {
  flex: 1 1 100%;
}

.select-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 15px !important;
  width: 100% !important;
}

.select-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 0 !important;
  min-width: 0 !important;
}

.select-col label {
  color: #ffffff !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  opacity: 1 !important;
  margin-bottom: 8px !important;
  display: block !important;
}

.select-col .glass-select {
  width: 100%;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.insights-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.insights-card h4 {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.78);
}

.insights-value {
  margin: 0 0 4px;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.insights-card small {
  color: rgba(255, 255, 255, 0.62);
}

.insights-blue {
  border-left: 4px solid rgba(79, 160, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(79, 160, 255, 0.12) inset, 0 10px 30px rgba(79, 160, 255, 0.08);
}

.insights-green {
  border-left: 4px solid rgba(142, 247, 196, 0.95);
  box-shadow: 0 0 0 1px rgba(142, 247, 196, 0.12) inset, 0 10px 30px rgba(142, 247, 196, 0.08);
}

.insights-red {
  border-left: 4px solid rgba(255, 76, 109, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 76, 109, 0.12) inset, 0 10px 30px rgba(255, 76, 109, 0.08);
}

.insights-neutral {
  border-left: 4px solid rgba(255, 255, 255, 0.25);
}

body.authenticated-shell .insights-card {
  position: relative;
  overflow: hidden;
  border-left-width: 5px;
  border-left-style: solid;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.115), rgba(255, 255, 255, 0.055)),
    rgba(10, 20, 40, 0.50);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.105);
}

body.authenticated-shell .insights-card::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 42%;
  pointer-events: none;
  opacity: 0.42;
  background: radial-gradient(circle at 0% 50%, var(--insight-accent-soft), transparent 68%);
}

body.authenticated-shell .insights-card > * {
  position: relative;
  z-index: 1;
}

body.authenticated-shell .insights-blue {
  --insight-accent: rgba(56, 189, 248, 0.95);
  --insight-accent-soft: rgba(56, 189, 248, 0.24);
  border-left-color: var(--insight-accent);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(56, 189, 248, 0.18) inset,
    0 0 22px rgba(56, 189, 248, 0.10);
}

body.authenticated-shell .insights-green {
  --insight-accent: rgba(52, 211, 153, 0.95);
  --insight-accent-soft: rgba(52, 211, 153, 0.24);
  border-left-color: var(--insight-accent);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(52, 211, 153, 0.18) inset,
    0 0 22px rgba(52, 211, 153, 0.10);
}

body.authenticated-shell .insights-red {
  --insight-accent: rgba(251, 113, 133, 0.95);
  --insight-accent-soft: rgba(251, 113, 133, 0.24);
  border-left-color: var(--insight-accent);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(251, 113, 133, 0.20) inset,
    0 0 24px rgba(251, 113, 133, 0.12);
}

body.authenticated-shell .insights-neutral {
  --insight-accent: rgba(251, 191, 36, 0.92);
  --insight-accent-soft: rgba(251, 191, 36, 0.20);
  border-left-color: var(--insight-accent);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(251, 191, 36, 0.16) inset,
    0 0 22px rgba(251, 191, 36, 0.09);
}

body.authenticated-shell .insights-value {
  color: #f8fbff;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.12);
}

body.authenticated-shell .insights-card h4 {
  color: rgba(238, 245, 255, 0.92);
}

body.authenticated-shell .insights-card small {
  color: rgba(214, 224, 245, 0.82);
}

body.authenticated-shell .kpi-card {
  position: relative;
  overflow: hidden;
  border-left: 5px solid rgba(255, 255, 255, 0.18);
}

body.authenticated-shell .kpi-mttr {
  border-left-color: rgba(56, 189, 248, 0.9);
}

body.authenticated-shell .kpi-sla {
  border-left-color: rgba(52, 211, 153, 0.9);
}

body.authenticated-shell .kpi-backlog {
  border-left-color: rgba(251, 191, 36, 0.9);
}

body.authenticated-shell .kpi-resolved {
  border-left-color: rgba(129, 140, 248, 0.9);
}

@media (max-width: 900px) {
  .insights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.kanban {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: start;
}

.kanban-column {
  padding: 12px;
}

.ticket-card {
  transition: transform 220ms ease, opacity 220ms ease, box-shadow 220ms ease;
}

.kanban.bump .ticket-card {
  animation: list-bump 220ms ease;
}

.insights-grid.bump .insights-card {
  animation: list-bump 220ms ease;
}

.kanban-empty {
  margin-top: 10px;
  padding: 14px 12px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.7);
  display: grid;
  gap: 6px;
  justify-items: start;
}

.kanban-empty-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(142, 247, 196, 0.12);
  border: 1px solid rgba(142, 247, 196, 0.18);
  color: rgba(142, 247, 196, 0.95);
  font-weight: 900;
}

.kanban-empty p {
  margin: 0;
  font-weight: 700;
}

.kanban-empty small {
  color: rgba(255, 255, 255, 0.55);
}

.notif-empty {
  display: grid;
  justify-items: start;
  gap: 6px;
}

.notif-empty-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

@keyframes list-bump {
  from { transform: translateY(6px); opacity: 0.88; }
  to { transform: translateY(0); opacity: 1; }
}

.kanban-column header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ticket-card {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.ticket-card p {
  margin: 8px 0;
}

.ticket-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.ticket-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.requester-info-btn,
.ticket-info-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  line-height: 1;
  position: relative;
}

.ticket-info-btn {
  font-size: 0.86rem;
  font-weight: 700;
}

.requester-info-btn::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow:
    -6px 0 0 currentColor,
    6px 0 0 currentColor;
  transform: translateY(-0.5px);
}

.requester-info-btn:hover,
.ticket-info-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.ticket-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.ticket-description-preview {
  display: -webkit-box;
  margin: 7px 0 2px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.requester-info-popover,
.ticket-info-popover {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 14px;
  width: 100%;
  min-width: 0;
  background:
    linear-gradient(145deg, var(--layer-1), var(--layer-2)),
    rgba(15, 23, 42, 0.45);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.requester-info-header,
.ticket-info-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.requester-info-header strong,
.ticket-info-header strong {
  display: block;
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.25;
}

.requester-info-header small,
.ticket-info-header small {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.requester-info-close {
  width: 28px;
  min-width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  line-height: 1;
}

.requester-info-grid,
.ticket-info-grid {
  display: grid;
  gap: 7px;
}

.requester-info-row,
.ticket-info-row {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.requester-info-row span,
.ticket-info-row span {
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.25;
}

.requester-info-row strong,
.ticket-info-row strong {
  color: var(--text-main);
  font-size: 0.78rem;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.ticket-info-description {
  white-space: pre-wrap;
}

.requester-info-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.assignee-tag {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.queue-tag {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  margin-right: 6px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #d9ecff;
  border-radius: 999px;
  border: 1px solid rgba(79, 160, 255, 0.35);
  background: rgba(79, 160, 255, 0.16);
}

.queue-filter-bar {
  display: grid;
  gap: 8px;
}

.queue-filter-bar h3 {
  margin: 0;
}

.queue-filter-select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-radius: 10px;
  padding: 10px 12px;
}

.badge {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

select option {
  background-color: #1a1f2b !important;
  color: white;
}

.ticket-meta,
.ticket-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.ticket-actions {
  flex-wrap: wrap;
}

.ticket-actions button {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  max-width: 100%;
}

.comments-panel {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.comments-panel h5 {
  margin: 0 0 8px;
  color: var(--text-main);
}

.details-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.details-tab-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border-radius: 999px;
  font-size: 0.78rem;
  padding: 5px 10px;
  cursor: pointer;
}

.details-tab-btn.active {
  color: var(--text-main);
  background: rgba(79, 160, 255, 0.22);
  border-color: rgba(79, 160, 255, 0.4);
}

.comments-thread {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
  display: grid;
  gap: 8px;
}

.comment-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
  align-items: start;
}

.comment-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(79, 160, 255, 0.35);
}

.comment-body {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-meta small {
  color: var(--text-muted);
}

.comment-body p {
  margin: 0;
  white-space: pre-wrap;
}

.comments-empty {
  margin: 4px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.comment-form {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.priority-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.priority-display label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.priority-display .badge {
  font-size: 0.85rem;
}

.profile-form {
  display: grid;
  gap: 16px;
}

.profile-form-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.profile-form-header h4,
.profile-form-header p {
  margin: 0;
}

.profile-form-header h4 {
  font-size: 1rem;
  line-height: 1.25;
}

.profile-form-header p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.profile-readonly-note {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profile-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.profile-field label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.field-hint {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.profile-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-form-actions button {
  flex: 1 1 180px;
}

.profile-edit-btn {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
}

.profile-form-message {
  margin: 0;
  color: #ffd27a;
  font-size: 0.85rem;
  line-height: 1.45;
}

.profile-form input[readonly],
.profile-form select:disabled {
  opacity: 0.82;
  cursor: default;
}

.comment-form textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
}

.history-thread {
  max-height: 220px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.history-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  align-items: start;
}

.history-icon {
  color: var(--text-muted);
  font-size: 0.65rem;
  margin-top: 2px;
}

.history-body {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  padding-left: 8px;
}

.history-body p {
  margin: 0;
  color: #dfe8ff;
}

.history-body small {
  color: var(--text-muted);
}

.is-new-comment {
  animation: comment-in 240ms ease;
}

.bounce-btn:active {
  animation: bounce-click .25s ease;
}

.lock-note {
  margin: 0;
  font-size: 0.86rem;
  color: #ffd6a8;
}

.mobile-profile-logout {
  display: none;
}

.priority-urgente .badge {
  background: rgba(255, 76, 109, 0.3);
}

.priority-alta .badge {
  background: rgba(255, 175, 64, 0.3);
}

.priority-media .badge {
  background: rgba(79, 160, 255, 0.3);
}

.priority-baixa .badge {
  background: rgba(56, 189, 132, 0.3);
}

.severity-alta {
  border-image: var(--neon-high) 1;
}

.severity-critica {
  box-shadow: 0 0 0 1px rgba(255, 46, 99, 0.7), 0 0 24px rgba(255, 46, 99, 0.34);
}

.sla.ok {
  color: #8ef7c4;
}

.sla.critical {
  color: #ffd27a;
  animation: pulse 1.2s ease-in-out infinite;
}

.sla.warning {
  color: #ffd27a;
}

.sla.breached {
  color: #ff8fb7;
}

.sla.closed {
  color: #8ef7c4;
  border-bottom: 1px solid rgba(142, 247, 196, 0.35);
}

.sla.paused {
  color: rgba(255, 255, 255, 0.58);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.35);
}

.archived-page {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.archived-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.archived-hero h3,
.archived-hero p {
  margin: 0;
}

.archived-hero p {
  color: var(--text-muted);
  line-height: 1.45;
}

.archived-count {
  display: grid;
  gap: 4px;
  min-width: 110px;
  padding: 10px 12px;
  text-align: center;
}

.archived-count small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.archived-count strong {
  font-size: 1.5rem;
}

.archived-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 10px;
  align-items: center;
}

.archived-timeline {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow: hidden;
}

.archived-timeline::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 22px;
  bottom: 22px;
  width: 1px;
  background: rgba(255, 255, 255, 0.22);
}

.archived-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.archived-timeline-marker {
  width: 14px;
  height: 14px;
  margin: 12px auto 0;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 18px rgba(125, 211, 252, 0.35);
  z-index: 1;
}

.archived-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  padding-bottom: 58px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, var(--layer-1), var(--layer-2)),
    rgba(15, 23, 42, 0.42);
}

.archived-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.archived-card-header > div {
  min-width: 0;
}

.archived-card-header h4 {
  margin: 4px 0;
  font-size: 0.98rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.archived-card-header small {
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.archived-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  min-width: 0;
}

.archived-meta-grid div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.archived-meta-grid span {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.archived-meta-grid strong {
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.archived-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.archived-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.archived-card-actions button {
  width: auto;
  min-width: 130px;
}

.archived-details {
  padding: 10px;
  border-radius: 14px;
}

.archived-delete-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: auto;
  min-width: 142px;
  max-width: calc(100% - 24px);
  min-height: 38px;
  padding: 8px 14px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.22);
  border: 1px solid rgba(248, 113, 113, 0.52);
  color: #ffe4e6;
  box-shadow: 0 10px 24px rgba(127, 29, 29, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  z-index: 2;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.archived-delete-btn:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.34);
  border-color: rgba(252, 165, 165, 0.72);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(127, 29, 29, 0.34);
}

.archived-delete-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.archived-delete-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.archived-empty {
  display: grid;
  gap: 6px;
}

.archived-empty h3,
.archived-empty p {
  margin: 0;
}

.archived-empty p {
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar,
  .sidebar.collapsed {
    width: 100%;
  }

  .profile-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-form-header {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .archived-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .archived-toolbar {
    grid-template-columns: 1fr;
  }

  .archived-timeline {
    padding: 12px;
  }

  .archived-timeline::before {
    left: 19px;
  }

  .archived-timeline-item {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .archived-card-header {
    flex-direction: column;
  }

  .archived-card-actions button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .archived-card {
    padding-bottom: 56px;
  }

  .archived-delete-btn {
    right: 10px;
    bottom: 10px;
    min-width: 0;
    max-width: calc(100% - 20px);
    min-height: 36px;
    padding: 8px 12px;
  }
}

@media (max-width: 520px) {
  .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .profile-form-actions {
    flex-direction: column;
  }

  .profile-edit-btn {
    width: 100%;
  }
}

@keyframes bounce-click {
  0% { transform: scale(1); }
  50% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

@keyframes comment-in {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

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

/* [LAYER 1 e 2] Mobile Header Hierarchy (< 768px) */
@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 10px;
  }

  .topbar > div:first-child {
    order: 1;
    text-align: center;
  }

  /* Clock at the top */
  .clock {
    order: -1;
    width: 100%;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    padding: 0;
  }

  .topbar-actions {
    order: 2;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
  }

  /* [LAYER 3] Bell + Profile Horizontal Centering */
  .user-actions-container {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 12px;
  }

  /* [LAYER 2] CLOSING ACCESSIBILITY (The "Workaround") */
  .notif-dropdown {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: 140px !important; /* Start 20px below the bell/profile container */
    width: 92vw !important;
    max-width: 400px !important;
    transform: translateX(-50%) translateY(0) !important;
    z-index: 10 !important; /* Lower than the bell icon so it can be clicked to close */
  }

  .notif-wrap {
    z-index: 999999 !important; /* Ensure bell is clickable above the dropdown */
  }

  .notif-dropdown.ng-hide-remove {
    transform: translateX(-50%) translateY(-15px) !important;
  }
  .notif-dropdown.ng-hide-remove-active {
    transform: translateX(-50%) translateY(0) !important;
  }

  .notif-dropdown.ng-hide-add {
    transform: translateX(-50%) translateY(0) !important;
  }
  .notif-dropdown.ng-hide-add-active {
    transform: translateX(-50%) translateY(-15px) !important;
  }
}

/* [LAYER 2] Foco em Telas Críticas (< 480px) */
@media screen and (max-width: 480px) {
  /* Sidebar fixa no bottom para poupar espaço horizontal */
  .app-shell {
    grid-template-columns: 1fr;
    padding-bottom: 80px;
  }
  .app-shell.collapsed {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    flex-direction: row;
    padding: 10px;
    border-radius: 22px 22px 0 0;
    z-index: 1000;
    border-bottom: none;
    border-left: none;
    border-right: none;
  }

  .sidebar .brand, .sidebar .auth-box, .sidebar .toggle-btn {
    display: none !important;
  }

  .mobile-profile-logout {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding: 14px;
    border-radius: 18px;
  }

  .mobile-profile-logout div {
    display: grid;
    gap: 4px;
  }

  .mobile-profile-logout strong {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.25;
  }

  .mobile-profile-logout small {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
    word-break: break-all;
  }

  .mobile-logout-btn {
    min-height: 44px;
  }

  .menu {
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
  }

  /* Auth screen mobile optimizations */
  .auth-screen {
    padding: 12px;
    min-height: 100vh;
    padding-bottom: 20vh; /* Space for keyboard */
  }

  .auth-card {
    width: min(380px, 92vw);
    max-width: 380px;
  }

  .menu-item {
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    flex: 1;
    text-align: center;
  }

  .menu-label {
    font-size: 0.7rem;
    max-width: none;
    opacity: 1;
    transform: none;
  }

  /* Cartões de Chamados: Empilhamento vertical */
  .ticket-head,
  .ticket-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .ticket-head-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .requester-info-popover,
  .ticket-info-popover {
    width: 100%;
  }

  /* Notificações: Ajuste perfeito para telas < 375px (ex: 320px) */
}

/* MTTR Analysis Section Styles */
.mttr-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.mttr-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
}

.mttr-toggle-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.mttr-toggle.open .mttr-toggle-arrow {
  transform: rotate(180deg);
}

.mttr-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.mttr-toggle-text strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.mttr-toggle-text small {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

.mttr-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 12px;
}

.mttr-header {
  margin: 0 0 4px;
}

.mttr-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.mttr-header small {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.mttr-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fcd34d;
  font-size: 0.85rem;
}

.mttr-warning-icon {
  font-size: 1.1rem;
}

.mttr-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.mttr-mini-card {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.mttr-mini-card small {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.mttr-metric {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.mttr-classification {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.mttr-status-badge {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mttr-status-great {
  background: rgba(34, 197, 94, 0.25);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.45);
}

.mttr-status-good {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.45);
}

.mttr-status-attention {
  background: rgba(251, 191, 36, 0.25);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.45);
}

.mttr-status-bad {
  background: rgba(249, 115, 22, 0.25);
  color: #fdba74;
  border: 1px solid rgba(249, 115, 22, 0.45);
}

.mttr-status-critical {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.mttr-status-unknown {
  background: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.mttr-interpretation {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.mttr-breakdown-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mttr-breakdown-section h4 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.mttr-severity-section {
  margin-top: 4px;
}

.mttr-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mttr-breakdown-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mttr-breakdown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
}

.mttr-breakdown-info strong {
  font-size: 0.9rem;
  font-weight: 600;
}

.mttr-breakdown-info small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mttr-breakdown-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.mttr-avg {
  color: var(--text-main);
}

.mttr-median {
  color: var(--text-muted);
}

.mttr-status {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.mttr-bar {
  width: 80px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.mttr-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(116, 201, 255, 0.8), rgba(139, 92, 246, 0.8));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.mttr-compact-list {
  gap: 6px;
}

.mttr-compact-row {
  grid-template-columns: auto auto auto 1fr;
  gap: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mttr-compact-row strong {
  font-size: 0.85rem;
  font-weight: 600;
}

.mttr-compact-row small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mttr-compact-row span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
}

/* MTTR Responsive Styles */
@media (max-width: 768px) {
  .welcome-hero {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .welcome-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .welcome-feature-card {
    min-height: 170px;
  }

  .welcome-use-cases {
    grid-template-columns: 1fr;
  }

  .mttr-toggle {
    padding: 10px 12px;
    gap: 10px;
  }

  .mttr-toggle-arrow {
    font-size: 1.1rem;
  }

  .mttr-toggle-text strong {
    font-size: 0.9rem;
  }

  .mttr-toggle-text small {
    font-size: 0.75rem;
  }

  .mttr-overview-grid {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
  }

  .mttr-breakdown-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mttr-breakdown-info {
    min-width: auto;
  }

  .mttr-breakdown-metrics {
    flex-wrap: wrap;
  }

  .mttr-bar {
    width: 100%;
  }

  .mttr-compact-row {
    grid-template-columns: auto auto 1fr;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .welcome-dashboard {
    gap: 12px;
  }

  .welcome-hero {
    padding: 18px;
    border-radius: 18px;
  }

  .welcome-title {
    font-size: clamp(2rem, 11vw, 2.7rem);
    line-height: 1.05;
  }

  .welcome-lead,
  .welcome-hero-panel p {
    font-size: 0.94rem;
    line-height: 1.62;
  }

  .welcome-actions,
  .welcome-primary-action {
    width: 100%;
  }

  .welcome-feature-grid {
    grid-template-columns: 1fr;
  }

  .welcome-feature-card {
    min-height: auto;
    padding: 16px;
    border-radius: 16px;
  }

  .welcome-use-cases {
    padding: 16px;
    border-radius: 16px;
  }

  .welcome-use-case-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .welcome-use-case-list span {
    width: 100%;
    border-radius: 14px;
  }

  .dashboard-layout {
    display: flex;
    flex-direction: column;
  }

  .dashboard-layout .grid-kpi {
    display: contents;
  }

  .dashboard-layout .kpi-mttr {
    order: 1;
    margin-bottom: 6px;
  }

  .dashboard-layout .mttr-toggle {
    order: 2;
    margin-top: -2px;
    margin-bottom: 10px;
    padding: 9px 12px;
    min-height: 44px;
    border-radius: 16px;
    align-items: center;
  }

  .dashboard-layout .mttr-toggle-arrow {
    width: 18px;
    min-width: 18px;
    font-size: 0.9rem;
  }

  .dashboard-layout .mttr-toggle-text {
    gap: 2px;
  }

  .dashboard-layout .mttr-toggle-text strong {
    font-size: 0.9rem;
    line-height: 1.15;
  }

  .dashboard-layout .mttr-toggle-text small {
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .dashboard-layout .mttr-panel {
    order: 3;
    margin-top: 0;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 18px;
  }

  .dashboard-layout .mttr-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dashboard-layout .mttr-mini-card {
    padding: 10px;
    border-radius: 14px;
    min-height: auto;
  }

  .dashboard-layout .mttr-mini-card small {
    font-size: 0.72rem;
  }

  .dashboard-layout .mttr-metric {
    font-size: 1.15rem;
    line-height: 1.2;
  }

  .dashboard-layout .kpi-sla {
    order: 4;
    margin-bottom: 10px;
  }

  .dashboard-layout .kpi-backlog {
    order: 5;
    margin-bottom: 10px;
  }

  .dashboard-layout .kpi-resolved {
    order: 6;
    margin-bottom: 10px;
  }

  .dashboard-layout .charts-grid {
    order: 7;
  }

  .mttr-overview-grid {
    grid-template-columns: 1fr;
  }

  .mttr-metric {
    font-size: 1.2rem;
  }

  .mttr-breakdown-section h4 {
    font-size: 0.85rem;
  }

  .mttr-compact-row {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .mttr-compact-row strong,
  .mttr-compact-row small,
  .mttr-compact-row span {
    display: block;
  }
}

@media (min-width: 481px) {
  .dashboard-layout {
    display: block;
  }
  .dashboard-layout .grid-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  .dashboard-layout .kpi-mttr,
  .dashboard-layout .kpi-sla,
  .dashboard-layout .kpi-backlog,
  .dashboard-layout .kpi-resolved,
  .dashboard-layout .mttr-toggle,
  .dashboard-layout .mttr-panel,
  .dashboard-layout .charts-grid {
    order: 0;
  }
  .dashboard-layout .mttr-toggle {
    margin-top: 24px;
  }
}
