
:root {
  --bg: #06111f;
  --bg-soft: #0b1b31;
  --panel: rgba(7, 22, 42, 0.92);
  --panel-2: rgba(10, 28, 52, 0.96);
  --line: rgba(111, 158, 255, 0.15);
  --text: #eef4ff;
  --text-strong: #ffffff;
  --text-glow: 0 0 10px rgba(255,255,255,.28), 0 0 22px rgba(173,216,255,.12);
  --muted: #b7c7df;
  --blue: #4c88ff;
  --green: #3dd598;
  --amber: #ffb648;
  --red: #ff6b7a;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(62,118,255,.18), transparent 22%),
    radial-gradient(circle at bottom right, rgba(25,184,160,.12), transparent 20%),
    linear-gradient(180deg, #04101d 0%, #071523 100%);
  color: var(--text);
  min-height: 100%;
}
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.auth-shell, .app-shell { min-height: 100vh; }
.auth-shell { display: grid; grid-template-columns: 1.1fr 0.9fr; }
.auth-hero {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}
.auth-hero h1 { font-size: 54px; line-height: 1.02; margin: 0; color: var(--text-strong); text-shadow: var(--text-glow); }
.auth-hero p { color: var(--muted); font-size: 18px; max-width: 680px; }
.auth-card {
  align-self: center;
  margin: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 28px;
  width: min(480px, calc(100% - 48px));
}
.auth-card h2 { margin-top: 0; color: var(--text-strong); text-shadow: var(--text-glow); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { color: var(--muted); font-size: 13px; }
.field input, .field select, .field textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: #04111f;
  color: var(--text-strong);
  padding: 13px 14px;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(122, 175, 255, .45);
  box-shadow: 0 0 0 3px rgba(76,136,255,.16);
}
.field textarea { min-height: 110px; resize: vertical; }

.primary-btn, .secondary-btn, .danger-btn, .ghost-btn {
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 12px 16px;
  transition: .2s ease;
}
.primary-btn { background: linear-gradient(135deg, #4c88ff, #5e6dff); color: white; }
.secondary-btn {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
  color: var(--text-strong);
}
.danger-btn {
  background: rgba(255,107,122,.14);
  border-color: rgba(255,107,122,.24);
  color: #ffd5da;
}
.ghost-btn {
  background: transparent;
  border-color: rgba(255,255,255,.08);
  color: #d7e5ff;
}
.primary-btn:hover, .secondary-btn:hover, .danger-btn:hover, .ghost-btn:hover { transform: translateY(-1px); }

.credentials-box {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 16px;
}
.credentials-box code { display: block; margin-top: 6px; color: #d9ebff; }

.error, .success, .hint {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
}
.error {
  background: rgba(255,107,122,.14);
  color: #ffd5da;
  border: 1px solid rgba(255,107,122,.18);
}
.success {
  background: rgba(61,213,152,.12);
  color: #cef7e7;
  border: 1px solid rgba(61,213,152,.18);
}
.hint {
  background: rgba(76,136,255,.12);
  color: #e3efff;
  border: 1px solid rgba(76,136,255,.18);
}

.app-shell { display: grid; grid-template-columns: 300px 1fr; }
.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(3, 12, 24, 0.75);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.brand-card, .sidebar-card, .content-card, .metric-card, .alert-card, .ticket-card, .timeline-card, .donut-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.brand-card { padding: 20px; }
.brand-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand-title h2 { margin: 0; font-size: 28px; color: var(--text-strong); text-shadow: var(--text-glow); }

.role-badge, .status-badge, .priority-badge {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.role-badge {
  background: rgba(76,136,255,.14);
  border-color: rgba(76,136,255,.25);
  color: var(--text-strong);
}
.status-open {
  background: rgba(255,182,72,.14);
  border-color: rgba(255,182,72,.24);
  color: #ffd699;
}
.status-in_progress {
  background: rgba(76,136,255,.14);
  border-color: rgba(76,136,255,.24);
  color: #e2ecff;
}
.status-closed {
  background: rgba(61,213,152,.14);
  border-color: rgba(61,213,152,.24);
  color: #cbf8e5;
}
.priority-badge {
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}
.priority-low { background: rgba(61,213,152,.16); border-color: rgba(61,213,152,.34); color: #baf7df; }
.priority-medium { background: rgba(255,182,72,.18); border-color: rgba(255,182,72,.38); color: #ffe0a3; }
.priority-high, .priority-critical { background: rgba(255,107,122,.18); border-color: rgba(255,107,122,.40); color: #ffd0d6; }
.priority-critical { box-shadow: 0 0 0 1px rgba(255,107,122,.16), 0 0 20px rgba(255,107,122,.14); }
.priority-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.announcement-priority-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.07);
}
.announcement-priority-strip strong { color:#fff; }

.nav-group { display: flex; flex-direction: column; gap: 8px; }
.nav-btn {
  text-align: left;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: #d6e4ff;
}
.nav-btn.active, .nav-btn:hover {
  background: rgba(76,136,255,.12);
  color: white;
  border-color: rgba(76,136,255,.2);
}
.sidebar-footer { margin-top: auto; }

.content {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.topbar h1 { margin: 0; font-size: 34px; color: var(--text-strong); text-shadow: var(--text-glow); }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.content-card { padding: 18px; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.metric-card {
  padding: 18px;
}
.metric-clickable {
  text-align: left;
  cursor: pointer;
  transition: .2s ease;
}
.metric-clickable:hover,
.donut-card:hover,
.alert-card:hover {
  transform: translateY(-2px);
  border-color: rgba(76,136,255,.28);
}
.metric-card small { color: #d8e7ff; }
.metric-card h3 {
  font-size: 40px;
  margin: 8px 0 0;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255,255,255,.25), 0 0 24px rgba(123,174,255,.2);
  letter-spacing: .3px;
}
.metric-subtitle {
  margin-top: 8px;
  color: #d2def2;
  font-size: 12px;
}

.two-col { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.chart-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.donut-grid { display: flex; gap: 20px; flex-wrap: wrap; }
.donut-card {
  padding: 12px;
  background: rgba(255,255,255,.02);
  cursor: pointer;
  transition: .2s ease;
}
.donut {
  --pct: 50;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(var(--blue) calc(var(--pct) * 1%), rgba(255,255,255,.08) 0);
  display: grid;
  place-items: center;
  position: relative;
  animation: spin-in 1s ease;
}
.donut::after {
  content: '';
  position: absolute;
  inset: 16px;
  background: #06111f;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.05);
}
.donut > div { position: relative; z-index: 1; text-align: center; }
.donut strong {
  display: block;
  font-size: 32px;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255,255,255,.28), 0 0 24px rgba(123,174,255,.2);
}
.donut span {
  color: #eff6ff;
  font-size: 12px;
  text-shadow: 0 0 8px rgba(255,255,255,.12);
}

@keyframes spin-in {
  from { transform: scale(.8) rotate(-80deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.alert-list, .timeline-list, .ticket-list, .user-list, .email-config-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.alert-card, .timeline-card, .ticket-card { padding: 16px; }
.alert-card { cursor: pointer; transition: .2s ease; }
.meta { color: #d2def2; font-size: 13px; }
.ticket-card-head, .row-between {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.ticket-card h3, .timeline-card h3 {
  margin: 0 0 8px;
  color: var(--text-strong);
}
.ticket-card p, .timeline-card p { color: #eef5ff; }
.ticket-actions, .inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.ticket-toolbar {
  display: grid;
  grid-template-columns: 1.6fr .6fr;
  gap: 14px;
  margin-bottom: 16px;
}
.search-field, .status-field { margin: 0; }

.detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.detail-pill {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 8px 10px;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.detail-pill strong {
  font-size: 12px;
  color: #d6e4ff;
}
.detail-pill span {
  font-size: 13px;
  color: #ffffff;
}

.table-like { display: grid; gap: 10px; }
.table-row {
  display: grid;
  grid-template-columns: 1.1fr .8fr .8fr .8fr .9fr auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.05);
}
.section-title {
  margin: 0 0 12px;
  color: var(--text-strong);
  text-shadow: var(--text-glow);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}
.modal {
  width: min(1080px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #08172b;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.08);
  padding: 22px;
  box-shadow: var(--shadow);
}
.modal-header h2 { margin: 0; color: var(--text-strong); text-shadow: var(--text-glow); }

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tab-btn {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  color: #d6e4ff;
}
.tab-btn.active {
  background: rgba(76,136,255,.16);
  color: white;
  border-color: rgba(76,136,255,.22);
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.kv-grid div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.03);
}
.kv-grid strong { color: #f7fbff; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.footer-note { color: var(--muted); font-size: 12px; margin-top: 12px; }

@media (max-width: 1200px) {
  .auth-shell, .app-shell, .two-col { grid-template-columns: 1fr; }
  .metrics-grid, .three-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-row, .ticket-toolbar { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .auth-hero { padding: 28px; }
  .form-grid, .metrics-grid, .three-col, .kv-grid { grid-template-columns: 1fr; }
  .content { padding: 14px; }
}


.chat-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
}

.chat-sidebar-panel,
.chat-main-panel {
  min-height: 72vh;
}

.chat-thread-list,
.chat-message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-thread-card {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.025);
  color: var(--text);
  transition: .2s ease;
}

.chat-thread-card:hover,
.chat-thread-card.active {
  border-color: rgba(76,136,255,.28);
  background: rgba(76,136,255,.10);
  transform: translateY(-1px);
}

.chat-preview {
  color: #e7f1ff;
  font-size: 13px;
  margin: 8px 0;
  line-height: 1.4;
}

.chat-unread-badge {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, #4c88ff, #5e6dff);
  color: white;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(76,136,255,.35);
}

.chat-header {
  margin-bottom: 16px;
}

.chat-message-list {
  max-height: 52vh;
  overflow: auto;
  padding-right: 6px;
}

.chat-bubble {
  max-width: 78%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: var(--shadow);
}

.chat-bubble.mine {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(76,136,255,.22), rgba(94,109,255,.18));
  border-color: rgba(76,136,255,.28);
}

.chat-bubble.theirs {
  align-self: flex-start;
  background: rgba(255,255,255,.04);
}

.chat-bubble p {
  margin: 10px 0 0;
  white-space: pre-wrap;
  color: #ffffff;
}

.chat-reply-form {
  margin-top: 16px;
}

@media (max-width: 1200px) {
  .chat-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .metrics-grid,
  .two-col,
  .ticket-toolbar,
  .auth-shell,
  .app-shell {
    grid-template-columns: 1fr !important;
  }

  .chat-bubble {
    max-width: 100%;
  }
}


/* v3 vibrant navigation and route accents */
.app-shell.route-dashboard .content-card,.app-shell.route-dashboard .metric-card,.app-shell.route-dashboard .donut-card{border-color:rgba(61,213,152,.22)}
.app-shell.route-tickets .content-card,.app-shell.route-tickets .ticket-card{border-color:rgba(255,182,72,.22)}
.app-shell.route-chat .content-card,.app-shell.route-chat .chat-thread-card,.app-shell.route-chat .chat-bubble{border-color:rgba(255,92,138,.18)}
.app-shell.route-email .content-card{border-color:rgba(136,106,255,.22)}
.app-shell.route-settings .content-card{border-color:rgba(76,136,255,.28)}

.nav-btn{display:flex;align-items:center;justify-content:space-between;position:relative;overflow:hidden;background:linear-gradient(90deg,rgba(255,255,255,.02),rgba(255,255,255,.01));}
.nav-btn::before{content:'';position:absolute;inset:0;background:linear-gradient(120deg,transparent,rgba(255,255,255,.08),transparent);transform:translateX(-120%);transition:transform .55s ease}
.nav-btn:hover::before,.nav-btn.active::before{transform:translateX(120%)}
.nav-btn-inner{display:flex;align-items:center;gap:10px;font-weight:700;letter-spacing:.2px}
.nav-icon{font-size:18px;filter:drop-shadow(0 0 10px rgba(255,255,255,.22));}
.nav-unread-badge,.chat-unread-badge-hot{min-width:24px;height:24px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;padding:0 7px;background:linear-gradient(135deg,#ff3f69,#ff7a59);color:#fff;font-size:12px;font-weight:800;box-shadow:0 0 0 3px rgba(255,63,105,.14),0 0 18px rgba(255,63,105,.35)}
.topbar h1,.section-title,.brand-title h2{background:linear-gradient(90deg,#fff,#8dc7ff 35%,#a9ffe1 68%,#ffd57b);-webkit-background-clip:text;background-clip:text;color:transparent;text-shadow:none}
.metric-card,.content-card,.ticket-card,.alert-card,.timeline-card,.donut-card,.chat-thread-card{position:relative;overflow:hidden}
.metric-card::after,.content-card::after,.ticket-card::after,.alert-card::after,.timeline-card::after,.donut-card::after,.chat-thread-card::after{content:'';position:absolute;inset:-1px;background:linear-gradient(135deg,rgba(255,255,255,.08),transparent 30%,rgba(76,136,255,.12),transparent 70%,rgba(61,213,152,.10));pointer-events:none;mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);padding:1px;-webkit-mask-composite:xor;mask-composite:exclude;border-radius:inherit}
.metric-card{animation:float-card 5s ease-in-out infinite}
.metric-card:nth-child(2){animation-delay:.5s}.metric-card:nth-child(3){animation-delay:1s}.metric-card:nth-child(4){animation-delay:1.5s}
@keyframes float-card{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
.chat-thread-card.active{background:linear-gradient(135deg,rgba(255,63,105,.14),rgba(76,136,255,.12));border-color:rgba(255,99,145,.32)}
.chat-bubble.mine{background:linear-gradient(135deg,rgba(76,136,255,.22),rgba(94,109,255,.15))}
.chat-bubble.theirs{background:linear-gradient(135deg,rgba(255,255,255,.05),rgba(61,213,152,.07))}
.primary-btn{box-shadow:0 10px 24px rgba(76,136,255,.22)}
.primary-btn:hover,.secondary-btn:hover,.danger-btn:hover,.ghost-btn:hover{box-shadow:0 12px 28px rgba(0,0,0,.25)}

.digest-overlay{position:fixed;inset:0;background:rgba(2,7,18,.78);backdrop-filter:blur(12px);display:flex;align-items:center;justify-content:center;padding:28px;z-index:60}
.digest-panel{width:min(1180px,100%);max-height:calc(100vh - 56px);overflow:auto;background:linear-gradient(180deg,rgba(6,20,40,.98),rgba(5,16,31,.98));border:1px solid rgba(121,176,255,.2);border-radius:30px;box-shadow:0 30px 80px rgba(0,0,0,.48);padding:26px}
.digest-kicker{font-size:12px;text-transform:uppercase;letter-spacing:.24em;color:#89b6ff;margin-bottom:8px}
.digest-header h2{margin:0 0 8px;font-size:34px;color:#fff}
.digest-header p{margin:0;color:#dce8ff;max-width:780px}
.digest-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:20px}
.digest-card{background:linear-gradient(180deg,rgba(10,27,52,.95),rgba(8,20,39,.96));border:1px solid rgba(120,170,255,.16);border-radius:24px;padding:18px;box-shadow:0 20px 40px rgba(0,0,0,.26);animation:digest-pop .45s ease both}
.digest-card h3{margin:12px 0 8px;color:#fff}
.digest-card p{color:#eaf3ff;margin:10px 0 0}
.digest-card:nth-child(2){animation-delay:.08s}.digest-card:nth-child(3){animation-delay:.16s}.digest-card:nth-child(4){animation-delay:.24s}.digest-card:nth-child(5){animation-delay:.32s}.digest-card:nth-child(6){animation-delay:.40s}
@keyframes digest-pop{from{opacity:0;transform:translateY(16px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}

@media (max-width: 980px){.digest-grid{grid-template-columns:1fr}.nav-btn-inner span:last-child{font-size:13px}}


/* --- Login branding cleanup fix --- */
.auth-shell {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.auth-bg-logo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-bg-logo img {
  width: min(42vw, 620px);
  max-width: 620px;
  opacity: 0.045;
  filter: grayscale(1) brightness(1.35);
  transform: translateX(-8%) translateY(2%);
}

.auth-hero,
.auth-card {
  position: relative;
  z-index: 2;
}

.auth-hero {
  max-width: 980px;
}

.auth-brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.auth-inline-logo {
  width: 90px;
  height: auto;
  object-fit: contain;
  opacity: 0.96;
  filter: brightness(1.08);
  flex: 0 0 auto;
}

.auth-brand-name {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.01em;
  text-shadow: var(--text-glow);
}

.auth-brand-subtitle {
  margin-top: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #d9e6ff;
}

.credentials-box {
  display: none !important;
}

/* Remove any accidental previous foreground logo layers */
.login-logo,
.auth-shell > .login-logo,
.auth-hero > .login-logo {
  display: none !important;
}

@media (max-width: 980px) {
  .auth-bg-logo img {
    width: min(64vw, 520px);
    opacity: 0.035;
    transform: none;
  }

  .auth-brand-row {
    gap: 14px;
  }

  .auth-inline-logo {
    width: 72px;
  }

  .auth-brand-name {
    font-size: 20px;
  }

  .auth-brand-subtitle {
    letter-spacing: 0.14em;
  }
}


/* Ticket assignment enhancements */
.ticket-toolbar-admin {
  grid-template-columns: 1.4fr .55fr .75fr;
}

.assigned-agent-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(61, 213, 152, 0.28);
  box-shadow: 0 18px 38px rgba(18, 118, 92, 0.28);
  animation: assignedPulse 3.2s ease-in-out infinite;
}

.assigned-agent-card::after {
  content: '';
  position: absolute;
  inset: auto -20% -55% auto;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(61,213,152,.18), transparent 62%);
  pointer-events: none;
}

.assigned-agent-name {
  color: #aef5d6;
  font-weight: 700;
}

@keyframes assignedPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@media (max-width: 1200px) {
  .ticket-toolbar-admin {
    grid-template-columns: 1fr;
  }
}


/* Mobile responsive navigation */
.mobile-topbar,
.mobile-nav-overlay,
.mobile-sidebar-head {
  display: none;
}

@media (max-width: 900px) {
  html, body {
    overflow-x: hidden;
  }

  .auth-shell {
    grid-template-columns: 1fr !important;
    min-height: 100vh;
  }

  .auth-hero {
    padding: 22px 18px 8px;
    gap: 14px;
  }

  .auth-hero h1 {
    font-size: 38px;
    line-height: 1.06;
  }

  .auth-hero p {
    font-size: 15px;
    max-width: none;
  }

  .auth-brand-row {
    gap: 12px;
    align-items: center;
  }

  .auth-inline-logo {
    width: 64px;
  }

  .auth-brand-name {
    font-size: 20px;
  }

  .auth-brand-subtitle {
    font-size: 10px;
    letter-spacing: .14em;
  }

  .auth-card {
    width: calc(100% - 24px);
    margin: 0 12px 18px;
    padding: 20px;
    border-radius: 22px;
  }

  .app-shell {
    grid-template-columns: 1fr !important;
    min-height: 100vh;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(7, 22, 42, 0.92);
    border: 1px solid rgba(111, 158, 255, 0.15);
    box-shadow: var(--shadow);
    position: sticky;
    top: 10px;
    z-index: 25;
  }

  .mobile-menu-btn {
    padding: 10px 14px;
    flex: 0 0 auto;
  }

  .mobile-topbar-title {
    font-weight: 800;
    color: var(--text-strong);
    text-align: right;
    font-size: 15px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(86vw, 340px);
    height: 100vh;
    z-index: 40;
    transform: translateX(-110%);
    transition: transform .28s ease;
    border-right: 1px solid rgba(111, 158, 255, 0.18);
    backdrop-filter: blur(14px);
    overflow-y: auto;
    padding-top: 12px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-sidebar-head {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;
  }

  .mobile-close-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    padding: 0;
  }

  .mobile-nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.52);
    opacity: 0;
    pointer-events: none;
    transition: opacity .24s ease;
    z-index: 35;
  }

  .app-shell.mobile-nav-open .mobile-nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .content {
    padding: 12px;
    width: 100%;
    min-width: 0;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar h1 {
    font-size: 26px;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .primary-btn,
  .topbar-actions .secondary-btn,
  .topbar-actions .ghost-btn,
  .topbar-actions .danger-btn {
    width: 100%;
  }

  .metrics-grid,
  .two-col,
  .three-col,
  .ticket-toolbar,
  .ticket-toolbar-admin,
  .chat-layout,
  .form-grid,
  .kv-grid,
  .digest-grid {
    grid-template-columns: 1fr !important;
  }

  .ticket-card-head,
  .row-between {
    flex-direction: column;
    align-items: flex-start;
  }

  .ticket-actions,
  .inline-actions {
    width: 100%;
  }

  .ticket-actions button,
  .inline-actions button {
    flex: 1 1 100%;
  }

  .chat-sidebar-panel,
  .chat-main-panel {
    min-height: auto;
  }

  .chat-message-list {
    max-height: none;
  }

  .chat-bubble {
    max-width: 100%;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
    padding: 18px;
  }

  .digest-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .digest-panel {
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    padding: 18px;
  }

  .digest-header h2 {
    font-size: 26px;
  }
}

@media (max-width: 560px) {
  .auth-hero h1 {
    font-size: 30px;
  }

  .brand-title h2 {
    font-size: 24px;
  }

  .metric-card h3 {
    font-size: 32px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .nav-btn {
    padding: 13px 14px;
  }
}

.status-new {
  background: rgba(76,136,255,.14);
  border-color: rgba(76,136,255,.24);
  color: #e2ecff;
}
.status-assigned {
  background: rgba(124,92,255,.16);
  border-color: rgba(124,92,255,.28);
  color: #ede7ff;
}
.status-waiting_user {
  background: rgba(255,182,72,.16);
  border-color: rgba(255,182,72,.28);
  color: #ffe6bc;
}
.status-waiting_vendor {
  background: rgba(255,107,122,.14);
  border-color: rgba(255,107,122,.24);
  color: #ffd5da;
}
.status-resolved {
  background: rgba(61,213,152,.14);
  border-color: rgba(61,213,152,.24);
  color: #cbf8e5;
}

.timeline-card {
  position: relative;
  overflow: hidden;
}
.timeline-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #4c88ff, #3dd598);
  opacity: .9;
}
.ticket-card-head h3,
.timeline-card h3 {
  padding-left: 8px;
}
.ticket-card {
  backdrop-filter: blur(8px);
}
.modal .content-card {
  background: rgba(11,27,49,.88);
}


.ticket-relation-panel {
  margin: 14px 0 16px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.025);
}
.ticket-relation-panel-head,
.relation-visual-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.ticket-relation-panel-head strong,
.relation-visual-head h3 {
  color: var(--text-strong);
  margin: 0;
}
.relation-manage-btn { padding: 8px 12px; }
.ticket-relations-preview,
.relation-column,
.relation-visual-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.relation-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.relation-label,
.relation-column-title {
  font-size: 12px;
  color: #c8d8f5;
  min-width: 62px;
  font-weight: 700;
  letter-spacing: .2px;
}
.relation-badge-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.relation-badge {
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.04);
  color: var(--text-strong);
  padding: 7px 12px;
  font-size: 12px;
  line-height: 1;
}
.relation-badge:hover { transform: translateY(-1px); }
.relation-parent { border-color: rgba(255,182,72,.28); }
.relation-child { border-color: rgba(61,213,152,.28); }
.relation-related { border-color: rgba(76,136,255,.28); }
.ticket-relations-empty,
.relation-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 6px 0;
}
.relation-visual-card {
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 20px;
  padding: 16px;
  background: rgba(255,255,255,.025);
}
.relation-visual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.relation-column {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(4,17,31,.55);
  min-height: 100px;
}
.relation-support-grid { margin-top: 14px; }

@media (max-width: 760px) {
  .relation-visual-grid { grid-template-columns: 1fr; }
  .ticket-relation-panel-head,
  .relation-visual-head { align-items: flex-start; flex-direction: column; }
}


.ticket-card-badges {
  align-items: center;
}

.ticket-update-count {
  min-width: 28px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, #4c88ff, #5e6dff);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(76,136,255,.35);
}

.detail-structure-card {
  background: rgba(11,27,49,.92);
}

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

.structure-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.structure-item strong {
  font-size: 12px;
  color: #d9e8ff;
}

.structure-item span {
  color: #ffffff;
  line-height: 1.5;
}

.structure-item-wide {
  grid-column: 1 / -1;
}

.section-tight-head {
  margin-bottom: 12px;
}

.section-tight-head h3 {
  margin: 0;
}

.ticket-update-summary {
  color: #d9e8ff;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.08);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.03);
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.conversation-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.025);
}

.conversation-card.public {
  border-color: rgba(76,136,255,.22);
}

.conversation-card.private {
  border-color: rgba(255,182,72,.24);
}

.conversation-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.conversation-tag {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.conversation-tag.public {
  background: rgba(76,136,255,.12);
  border-color: rgba(76,136,255,.22);
  color: #e8f1ff;
}

.conversation-tag.private {
  background: rgba(255,182,72,.12);
  border-color: rgba(255,182,72,.24);
  color: #ffe6bc;
}

.conversation-card p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.6;
}

@media (max-width: 760px) {
  .ticket-structure-grid {
    grid-template-columns: 1fr;
  }

  .conversation-head {
    flex-direction: column;
  }
}


.detail-ticket-header-card { background: rgba(11,27,49,.92); }
.detail-ticket-mini-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:12px; }
.detail-ticket-mini-grid .structure-item-wide { grid-column: 1 / -1; }
.detail-conversation-split { display:grid; grid-template-columns: 1fr 1fr; gap:16px; }
.update-entry-card h3 { margin-bottom: 8px; }
.ticket-update-count { border: none; cursor: pointer; }
.ticket-update-count:hover { transform: translateY(-1px); }
@media (max-width: 900px) { .detail-conversation-split, .detail-ticket-mini-grid { grid-template-columns: 1fr; } }


.ticket-detail-shell {
  padding: 20px;
}
.ticket-detail-topbar h1 {
  margin: 14px 0 6px;
  font-size: 30px;
}
.ticket-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr);
  gap: 18px;
}
.ticket-detail-main,
.ticket-detail-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ticket-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.ticket-detail-overview .ticket-structure-grid {
  margin-top: 0;
}
.ticket-structure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.structure-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.structure-item strong {
  color: #dbe8ff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.structure-item span {
  color: #ffffff;
  line-height: 1.5;
  word-break: break-word;
}
.structure-item-wide {
  grid-column: 1 / -1;
}
.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.conversation-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.conversation-card.private {
  border-color: rgba(255,182,72,.16);
  background: rgba(255,182,72,.06);
}
.conversation-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.conversation-tag {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.08);
}
.conversation-tag.private {
  background: rgba(255,182,72,.12);
  color: #ffe1b4;
}
.conversation-tag.public {
  background: rgba(76,136,255,.12);
  color: #e6efff;
}
.conversation-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.note-replies-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.note-reply-item,
.note-replies-empty {
  margin-left: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}
.section-tight-head {
  margin-bottom: 14px;
}
.ticket-update-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  color: #dce9ff;
  font-size: 12px;
}
@media (max-width: 1200px) {
  .ticket-detail-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .ticket-structure-grid {
    grid-template-columns: 1fr;
  }
}

.ticket-conversation-shell {
  margin-bottom: 18px;
}

.ticket-conversation-topbar {
  align-items: center;
}

.ticket-conversation-topbar p {
  margin: 6px 0 0;
  max-width: 980px;
  color: #d9e7ff;
}

.ticket-conversation-card {
  padding: 22px;
}

.ticket-conversation-head {
  align-items: center;
}

.ticket-conversation-list {
  min-height: 220px;
}

.ticket-inline-reply-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.ticket-inline-reply-form textarea {
  min-height: 120px;
}

.note-reply-item {
  background: rgba(76,136,255,.06);
  border-color: rgba(76,136,255,.14);
}

.note-replies-empty {
  color: #c9d8f0;
}

@media (max-width: 760px) {
  .ticket-conversation-topbar {
    align-items: flex-start;
  }
}


/* v4 animated sidebar tabs */
.nav-btn{
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  min-height: 56px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .28s ease;
}

.nav-btn .nav-btn-inner{
  position: relative;
  z-index: 2;
}

.nav-btn .nav-icon{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(76,136,255,.16), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 0 18px rgba(76,136,255,.08);
  font-size: 16px;
  flex: 0 0 34px;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.nav-btn:hover{
  transform: translateX(2px);
  border-color: rgba(120,175,255,.24);
  box-shadow: 0 12px 26px rgba(0,0,0,.22);
}

.nav-btn:hover .nav-icon{
  transform: scale(1.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 24px rgba(76,136,255,.16);
}

.nav-btn.active{
  color: #ffffff;
  border-color: rgba(130,185,255,.34);
  background:
    linear-gradient(135deg, rgba(76,136,255,.20), rgba(20,65,140,.12)),
    linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 0 0 1px rgba(76,136,255,.10),
    0 14px 30px rgba(0,0,0,.26),
    0 0 26px rgba(76,136,255,.14);
}

.nav-btn.active .nav-icon{
  background: linear-gradient(135deg, rgba(76,136,255,.34), rgba(61,213,152,.18));
  border-color: rgba(170,214,255,.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 0 0 1px rgba(255,255,255,.03),
    0 0 20px rgba(76,136,255,.26);
  animation: nav-icon-pulse 2.4s ease-in-out infinite;
}

.nav-btn.active::after{
  content:'';
  position:absolute;
  inset:0;
  border-radius:18px;
  background:
    linear-gradient(120deg, transparent 0%, rgba(255,255,255,.10) 20%, transparent 42%),
    radial-gradient(circle at 18% 50%, rgba(76,136,255,.22), transparent 34%);
  background-size: 240% 100%, auto;
  pointer-events:none;
  animation: nav-active-sheen 3.2s linear infinite;
}

@keyframes nav-active-sheen{
  0%{background-position: 200% 0, 0 0;}
  100%{background-position: -60% 0, 0 0;}
}

@keyframes nav-icon-pulse{
  0%,100%{transform:scale(1); filter:drop-shadow(0 0 10px rgba(255,255,255,.18));}
  50%{transform:scale(1.04); filter:drop-shadow(0 0 16px rgba(140,198,255,.28));}
}


/* stable card look for tabs + troubleshooting */
.nav-group{
  gap: 10px;
}

.nav-btn{
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(8,24,46,.96), rgba(5,18,36,.96));
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.03);
}

.nav-btn .nav-btn-inner{
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.nav-btn:hover,
.nav-btn.active{
  transform: none !important;
}

.nav-btn .nav-icon{
  transition: box-shadow .25s ease, background .25s ease, border-color .25s ease;
}

.nav-btn:hover .nav-icon,
.nav-btn.active .nav-icon{
  transform: none !important;
}

.nav-btn.active{
  background:
    linear-gradient(135deg, rgba(76,136,255,.22), rgba(20,65,140,.16)),
    linear-gradient(180deg, rgba(8,24,46,.98), rgba(6,18,36,.98));
}

.nav-btn.active::after{
  animation: nav-active-sheen 3.8s linear infinite;
}

.troubleshooting-shell .ticket-toolbar .field{
  background: linear-gradient(180deg, rgba(8,24,46,.92), rgba(6,18,36,.92));
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.02);
}

.troubleshooting-results-count{
  color: #eef4ff;
  font-weight: 600;
}

#troubleshootingTopicBar{
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
}

#troubleshootingTopicBar::-webkit-scrollbar{
  height: 8px;
}

#troubleshootingTopicBar::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.16);
  border-radius: 999px;
}

.troubleshooting-topic-chip,
.troubleshooting-topic-chip:hover,
.troubleshooting-topic-chip:focus,
.troubleshooting-topic-chip:active{
  transform: none !important;
}

.troubleshooting-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
}

.troubleshooting-card{
  background:
    radial-gradient(circle at top right, rgba(76,136,255,.12), transparent 32%),
    linear-gradient(180deg, rgba(8,24,46,.98), rgba(5,18,36,.98));
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 14px 30px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.03);
  transform: none !important;
  animation: none !important;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.troubleshooting-card:hover{
  transform: none !important;
  border-color: rgba(120,175,255,.22);
  box-shadow: 0 14px 30px rgba(0,0,0,.22), 0 0 0 1px rgba(76,136,255,.08);
}

.troubleshooting-card-head{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.troubleshooting-card h3{
  margin: 0 0 8px;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255,255,255,.12);
}

.troubleshooting-card-index{
  color: #d7e5ff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  flex: 0 0 auto;
}

.troubleshooting-symptoms{
  color: #cfddf3;
  margin: 0 0 12px;
}

.troubleshooting-steps{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.troubleshooting-step{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}

.troubleshooting-step strong{
  color: #ffffff;
  min-width: 18px;
}

.troubleshooting-step span{
  color: #e6efff;
}

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

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


/* mobile-only dashboard and menu fixes */
@media (max-width: 900px) {
  html, body {
    overflow-x: hidden !important;
  }

  .app-shell,
  .content,
  .content-card,
  .ticket-card,
  .metric-card,
  .alert-card,
  .donut-card,
  .sidebar,
  .mobile-topbar {
    max-width: 100%;
  }

  .mobile-topbar {
    display: grid !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    position: sticky;
    top: 8px;
    z-index: 30;
  }

  .mobile-topbar-title {
    min-width: 0;
    text-align: left;
    line-height: 1.2;
    font-size: 14px;
    white-space: normal;
    overflow: visible;
    word-break: break-word;
  }

  .mobile-menu-btn {
    min-width: 50px;
    min-height: 46px;
    padding: 10px 12px;
  }

  .sidebar {
    width: min(94vw, 380px) !important;
    padding: 14px 14px 18px !important;
  }

  .brand-card,
  .sidebar-card {
    padding: 16px !important;
  }

  .brand-title {
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
  }

  .brand-title h2 {
    font-size: 26px;
    line-height: 1.1;
    word-break: break-word;
  }

  .role-badge {
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }

  .nav-group {
    gap: 10px !important;
  }

  .nav-btn {
    width: 100%;
    min-height: 58px;
    padding: 14px 14px !important;
    align-items: center;
    border-radius: 18px;
  }

  .nav-btn .nav-btn-inner {
    min-width: 0;
    width: calc(100% - 36px);
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
  }

  .nav-btn .nav-icon {
    flex: 0 0 34px;
  }

  .nav-btn .nav-btn-inner span:last-child {
    display: block;
    min-width: 0;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word;
    line-height: 1.2;
    font-size: 14px;
  }

  .nav-unread-badge {
    margin-left: 8px;
    flex: 0 0 auto;
  }

  .sidebar-footer p {
    font-size: 13px;
    line-height: 1.45;
  }

  .content {
    padding: 12px !important;
    gap: 14px;
  }

  .content-card {
    padding: 15px !important;
    border-radius: 18px;
  }

  .topbar {
    gap: 12px;
  }

  .topbar > div:first-child {
    width: 100%;
    min-width: 0;
  }

  .topbar h1 {
    font-size: 24px !important;
    line-height: 1.15;
    white-space: normal;
    word-break: break-word;
    margin-bottom: 6px;
  }

  .topbar p {
    font-size: 13px;
    line-height: 1.45;
  }

  .topbar-actions {
    display: grid !important;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
  }

  .topbar-actions .primary-btn,
  .topbar-actions .secondary-btn,
  .topbar-actions .ghost-btn,
  .topbar-actions .danger-btn {
    width: 100% !important;
    justify-content: center;
  }

  .metrics-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .metric-card {
    padding: 14px !important;
    min-height: 120px;
  }

  .metric-card small {
    font-size: 11px;
    line-height: 1.25;
    display: block;
  }

  .metric-card h3 {
    font-size: 28px !important;
    line-height: 1.05;
    margin-top: 8px;
    word-break: break-word;
  }

  .metric-subtitle {
    font-size: 11px;
    line-height: 1.35;
  }

  .two-col,
  .three-col,
  .ticket-toolbar,
  .ticket-toolbar-admin,
  .chat-layout,
  .form-grid,
  .kv-grid,
  .digest-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .donut-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .donut-card {
    padding: 10px !important;
  }

  .donut {
    width: 118px !important;
    height: 118px !important;
    margin: 0 auto;
  }

  .donut::after {
    inset: 14px !important;
  }

  .donut strong {
    font-size: 24px !important;
  }

  .donut span {
    font-size: 11px !important;
    line-height: 1.25;
    display: block;
    max-width: 72px;
    margin: 0 auto;
  }

  .alert-card,
  .ticket-card,
  .timeline-card {
    padding: 14px !important;
  }

  .ticket-card h3,
  .timeline-card h3,
  .alert-card strong {
    white-space: normal;
    word-break: break-word;
    line-height: 1.25;
  }

  .meta,
  .ticket-card p,
  .timeline-card p,
  .muted {
    line-height: 1.45;
    word-break: break-word;
  }

  .detail-pill {
    min-width: calc(50% - 6px);
    flex: 1 1 calc(50% - 6px);
  }

  .table-row {
    padding: 12px;
    border-radius: 16px;
  }

  .modal {
    width: 100%;
    max-height: 94vh;
  }
}

@media (max-width: 640px) {
  .sidebar {
    width: min(96vw, 400px) !important;
  }

  .metrics-grid,
  .donut-grid {
    grid-template-columns: 1fr !important;
  }

  .metric-card {
    min-height: auto;
  }

  .metric-card h3 {
    font-size: 30px !important;
  }

  .detail-pill {
    min-width: 100%;
    flex: 1 1 100%;
  }

  .brand-title h2 {
    font-size: 24px;
  }

  .topbar h1 {
    font-size: 22px !important;
  }

  .nav-btn .nav-btn-inner span:last-child {
    font-size: 13.5px;
  }
}


/* mobile tabs full fix */
@media (max-width: 900px) {
  .mobile-topbar {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    position: sticky;
    top: 8px;
    z-index: 100;
    width: 100%;
    min-width: 0;
  }

  .mobile-menu-btn {
    min-width: 48px;
    width: 48px;
    height: 46px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex: 0 0 48px;
  }

  .mobile-topbar-title {
    min-width: 0;
    width: 100%;
    text-align: left;
    line-height: 1.2;
    font-size: 14px;
    font-weight: 800;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word;
  }

  .sidebar {
    width: min(94vw, 380px) !important;
    padding: 14px 14px 28px !important;
  }

  .mobile-sidebar-head {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(3, 12, 24, 0.92);
    padding-bottom: 8px;
  }

  .mobile-close-btn {
    width: 42px;
    height: 42px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex: 0 0 42px;
  }

  .brand-card {
    padding: 16px !important;
    border-radius: 20px;
  }

  .brand-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .brand-title h2 {
    font-size: 24px !important;
    line-height: 1.08;
    margin: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
  }

  .brand-card .muted {
    word-break: break-word;
  }

  .role-badge {
    width: fit-content;
    max-width: 100%;
    white-space: normal !important;
    text-align: left;
    line-height: 1.2;
  }

  .nav-group {
    display: flex;
    flex-direction: column;
    gap: 10px !important;
    width: 100%;
  }

  .nav-btn {
    width: 100%;
    min-height: 62px;
    padding: 12px 14px !important;
    border-radius: 18px;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .nav-btn .nav-btn-inner {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .nav-btn .nav-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    margin: 0;
  }

  .nav-btn .nav-btn-inner span:last-child {
    display: block;
    min-width: 0;
    width: 100%;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word;
    line-height: 1.22;
    font-size: 14px !important;
    font-weight: 700;
  }

  .nav-unread-badge {
    flex: 0 0 auto;
    align-self: center;
    margin-left: 8px;
  }

  .sidebar-card,
  .sidebar-footer {
    padding: 16px !important;
    border-radius: 20px;
  }

  .sidebar-footer strong,
  .sidebar-footer p {
    display: block;
    width: 100%;
    word-break: break-word;
  }

  .sidebar-footer p {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 12px;
  }

  .sidebar-footer .danger-btn,
  .sidebar-footer .secondary-btn,
  .sidebar-footer .ghost-btn,
  .sidebar-footer .primary-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .mobile-topbar {
    padding: 12px;
    gap: 10px;
  }

  .mobile-topbar-title {
    font-size: 13.5px;
  }

  .sidebar {
    width: min(96vw, 400px) !important;
    padding: 12px 12px 30px !important;
  }

  .brand-title h2 {
    font-size: 22px !important;
  }

  .nav-btn {
    min-height: 60px;
    padding: 12px !important;
  }

  .nav-btn .nav-btn-inner {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
  }

  .nav-btn .nav-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 15px;
  }

  .nav-btn .nav-btn-inner span:last-child {
    font-size: 13px !important;
    line-height: 1.2;
  }

  .nav-unread-badge {
    min-width: 22px;
    height: 22px;
    font-size: 11px;
    padding: 0 6px;
  }
}

/* dashboard analytics and knowledge base */
.advanced-analytics-card{padding:18px}
.analytics-big-number{font-size:52px;font-weight:800;line-height:1;color:#fff;text-shadow:var(--text-glow);margin:12px 0}
.analytics-big-number span{font-size:18px;margin-left:8px;color:#cfe0ff}
.analytic-stat-row{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.analytic-stat-pill{flex:1 1 140px;padding:14px 16px;border-radius:18px;background:rgba(61,213,152,.08);border:1px solid rgba(61,213,152,.18);display:flex;flex-direction:column;gap:4px}
.analytic-stat-pill.danger{background:rgba(255,107,122,.08);border-color:rgba(255,107,122,.18)}
.analytic-stat-pill strong{font-size:28px;color:#fff}
.mini-chart{display:flex;flex-direction:column;gap:12px}
.mini-bar-row{display:grid;grid-template-columns:minmax(90px,150px) 1fr auto;gap:10px;align-items:center}
.mini-bar-row span,.mini-bar-row strong{font-size:13px}
.mini-bar-track{height:10px;border-radius:999px;background:rgba(255,255,255,.06);overflow:hidden;border:1px solid rgba(255,255,255,.05)}
.mini-bar-fill{height:100%;border-radius:inherit;background:linear-gradient(90deg,#4c88ff,#3dd598)}
.trend-line-card{display:flex;flex-direction:column;gap:10px}
.trend-svg{width:100%;height:220px;background:linear-gradient(180deg,rgba(255,255,255,.02),rgba(255,255,255,.005));border-radius:18px;border:1px solid rgba(255,255,255,.06);padding:8px;overflow:visible}
.trend-line{fill:none;stroke-width:2.5}
.trend-line.tickets{stroke:#7cb0ff}
.trend-line.responses{stroke:#3dd598}
.trend-label-row{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;font-size:11px;color:#cad8ee}
.trend-label-row span{text-align:center}
.trend-legend{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:#d7e5ff}
.trend-dot{display:inline-block;width:10px;height:10px;border-radius:999px;margin-right:6px;vertical-align:middle}
.trend-dot.tickets{background:#7cb0ff}.trend-dot.responses{background:#3dd598}
.agent-efficiency-list{display:flex;flex-direction:column;gap:12px}
.agent-efficiency-card{padding:14px;border-radius:18px;background:rgba(255,255,255,.025);border:1px solid rgba(255,255,255,.06)}
.kb-suggestion-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.kb-suggestion-card{padding:14px;border-radius:18px;background:rgba(255,255,255,.025);border:1px solid rgba(255,255,255,.06)}
.kb-summary{margin:10px 0 8px}
.kb-step-list{margin:0;padding-left:18px;color:#eef4ff;font-size:13px;line-height:1.45}
.kb-step-list li{margin:0 0 6px}
.alert-card.unseen{border-color:rgba(255,182,72,.3);box-shadow:0 0 0 1px rgba(255,182,72,.08),var(--shadow)}
.alert-card.seen{opacity:.82}

/* chat and conversation icons + attachments */
.message-role-icon{display:inline-flex;align-items:center;justify-content:center;margin-right:8px;font-size:15px}
.chat-attachment-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.chat-attachment-chip{display:inline-flex;align-items:center;gap:10px;padding:10px 12px;border-radius:14px;text-decoration:none;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);color:#fff;max-width:100%}
.chat-attachment-chip:hover{border-color:rgba(76,136,255,.3);transform:translateY(-1px)}
.chat-attachment-icon{font-size:18px}
.chat-attachment-meta{display:flex;flex-direction:column;min-width:0}
.chat-attachment-meta strong,.chat-attachment-meta small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-attachment-meta small{color:#c8d8ef}
.conversation-card.mine,.note-reply-item.mine{border-color:rgba(76,136,255,.2);background:rgba(76,136,255,.06)}
.conversation-card.theirs,.note-reply-item.theirs{border-color:rgba(61,213,152,.16)}

/* digest footer */
.digest-card-footer{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:14px}
.digest-card.high,.digest-card.critical{border-color:rgba(255,107,122,.22)}
.digest-card.medium{border-color:rgba(255,182,72,.18)}

@media (max-width: 900px){
  .kb-suggestion-grid,.trend-label-row{grid-template-columns:1fr !important}
  .trend-svg{height:180px}
  .mini-bar-row{grid-template-columns:1fr}
  .analytics-big-number{font-size:38px}
}

/* PHONE APP MODE ONLY - does not change desktop/PC layout */
html.is-phone,
body.is-phone {
  width: 100%;
  min-width: 0;
  overflow-x: hidden !important;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body.is-phone .app-shell {
  display: block !important;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

body.is-phone .content {
  width: 100% !important;
  min-width: 0 !important;
  padding: calc(10px + env(safe-area-inset-top)) 10px 18px !important;
  gap: 12px;
}

body.is-phone .mobile-topbar {
  display: grid !important;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 100;
  width: 100%;
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 20px;
  background: rgba(6, 17, 31, .94);
  border: 1px solid rgba(111, 158, 255, .22);
  box-shadow: 0 14px 34px rgba(0,0,0,.38);
  backdrop-filter: blur(14px);
}

body.is-phone .mobile-menu-btn {
  width: 54px !important;
  height: 50px !important;
  min-width: 54px !important;
  padding: 0 !important;
  border-radius: 17px;
  font-size: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
body.is-phone .mobile-menu-btn::before {
  content: '☰';
  font-size: 23px;
  line-height: 1;
}
body.is-phone .mobile-topbar-title {
  min-width: 0;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 900;
  color: #fff;
  text-align: left;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  word-break: break-word;
}

body.is-phone .mobile-nav-overlay {
  display: block !important;
  position: fixed;
  inset: 0;
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, .64);
  backdrop-filter: blur(4px);
  transition: opacity .22s ease;
}
body.is-phone .app-shell.mobile-nav-open .mobile-nav-overlay {
  opacity: 1;
  pointer-events: auto;
}

body.is-phone .sidebar {
  position: fixed !important;
  inset: 0 auto 0 0;
  z-index: 200;
  width: min(92vw, 390px) !important;
  height: 100dvh !important;
  padding: calc(10px + env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom)) !important;
  transform: translateX(-105%);
  transition: transform .26s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(5, 16, 31, .98), rgba(8, 23, 43, .98));
  border-right: 1px solid rgba(111, 158, 255, .24);
  box-shadow: 18px 0 44px rgba(0,0,0,.48);
  -webkit-overflow-scrolling: touch;
}
body.is-phone .sidebar.open {
  transform: translateX(0);
}
body.is-phone .mobile-sidebar-head {
  display: flex !important;
  justify-content: flex-end;
  position: sticky;
  top: 0;
  z-index: 3;
  padding-bottom: 8px;
  background: linear-gradient(180deg, rgba(5,16,31,.98), rgba(5,16,31,.78));
}
body.is-phone .mobile-close-btn {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px;
  padding: 0 !important;
  border-radius: 16px;
  font-size: 20px;
}
body.is-phone .brand-card,
body.is-phone .sidebar-card {
  padding: 15px !important;
  border-radius: 20px !important;
}
body.is-phone .brand-title {
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
body.is-phone .brand-title h2 {
  font-size: 24px !important;
  line-height: 1.05;
}
body.is-phone .brand-card .muted {
  overflow-wrap: anywhere;
  font-size: 13px;
}
body.is-phone .nav-group {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 10px;
}
body.is-phone .nav-btn {
  min-height: 62px;
  width: 100%;
  padding: 13px 12px !important;
  border-radius: 19px !important;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: rgba(255,255,255,.035);
  border-color: rgba(255,255,255,.07);
}
body.is-phone .nav-btn.active {
  background: linear-gradient(135deg, rgba(76,136,255,.24), rgba(61,213,152,.10));
  border-color: rgba(76,136,255,.36);
  box-shadow: 0 12px 28px rgba(76,136,255,.12);
}
body.is-phone .nav-btn-inner {
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
}
body.is-phone .nav-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(76,136,255,.13);
  border: 1px solid rgba(76,136,255,.18);
  font-size: 18px;
}
body.is-phone .nav-btn-inner span:last-child {
  font-size: 14px;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
}
body.is-phone .nav-unread-badge,
body.is-phone .chat-unread-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  font-size: 11px;
}
body.is-phone .sidebar-footer {
  margin-top: auto !important;
}
body.is-phone .sidebar-footer p {
  font-size: 12.5px;
  line-height: 1.45;
}
body.is-phone .sidebar-footer .danger-btn {
  width: 100%;
  min-height: 48px;
}

body.is-phone .topbar {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}
body.is-phone .topbar h1 {
  font-size: 24px !important;
  line-height: 1.08;
}
body.is-phone .topbar p,
body.is-phone .meta,
body.is-phone .muted {
  font-size: 13px;
  line-height: 1.4;
}
body.is-phone .topbar-actions,
body.is-phone .ticket-actions,
body.is-phone .inline-actions {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 9px;
  width: 100%;
}
body.is-phone button,
body.is-phone .primary-btn,
body.is-phone .secondary-btn,
body.is-phone .danger-btn,
body.is-phone .ghost-btn,
body.is-phone a.secondary-btn,
body.is-phone a.ghost-btn {
  min-height: 46px;
}
body.is-phone .topbar-actions > *,
body.is-phone .ticket-actions > *,
body.is-phone .inline-actions > * {
  width: 100%;
  justify-content: center;
  text-align: center;
}

body.is-phone .content-card,
body.is-phone .metric-card,
body.is-phone .alert-card,
body.is-phone .ticket-card,
body.is-phone .timeline-card,
body.is-phone .donut-card,
body.is-phone .chat-thread-card,
body.is-phone .agent-efficiency-card,
body.is-phone .kb-suggestion-card {
  width: 100%;
  max-width: 100%;
  border-radius: 20px !important;
  padding: 15px !important;
  overflow-wrap: anywhere;
}
body.is-phone .metrics-grid,
body.is-phone .three-col,
body.is-phone .two-col,
body.is-phone .kv-grid,
body.is-phone .detail-grid,
body.is-phone .ticket-toolbar,
body.is-phone .ticket-toolbar-admin,
body.is-phone .chat-layout,
body.is-phone .troubleshooting-grid,
body.is-phone .kb-suggestion-grid,
body.is-phone .digest-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}
body.is-phone .metric-card h3 {
  font-size: 34px !important;
}
body.is-phone .donut-grid,
body.is-phone .chart-wrap {
  display: grid !important;
  grid-template-columns: 1fr !important;
  justify-items: stretch;
}
body.is-phone .donut-card,
body.is-phone .donut-card .donut {
  margin-left: auto;
  margin-right: auto;
}

body.is-phone .ticket-card-head,
body.is-phone .row-between,
body.is-phone .digest-card-footer {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
}
body.is-phone .detail-pill {
  min-width: 0 !important;
  width: 100%;
}
body.is-phone .table-row {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px;
}
body.is-phone .table-like,
body.is-phone .ticket-list,
body.is-phone .timeline-list,
body.is-phone .alert-list,
body.is-phone .user-list,
body.is-phone .email-config-list {
  width: 100%;
  min-width: 0;
}
body.is-phone input,
body.is-phone select,
body.is-phone textarea {
  font-size: 16px !important;
  min-height: 46px;
}
body.is-phone .form-grid {
  grid-template-columns: 1fr !important;
}
body.is-phone .field,
body.is-phone .field.full {
  min-width: 0;
}

body.is-phone .chat-sidebar-panel,
body.is-phone .chat-main-panel {
  min-height: auto !important;
}
body.is-phone .chat-message-list {
  max-height: none !important;
  overflow: visible !important;
  padding-right: 0;
}
body.is-phone .chat-bubble {
  max-width: 100% !important;
  width: 100%;
}
body.is-phone .conversation-card,
body.is-phone .note-reply-item {
  overflow-wrap: anywhere;
}
body.is-phone .chat-attachment-chip {
  width: 100%;
}

body.is-phone .modal-backdrop {
  align-items: stretch !important;
  justify-content: stretch !important;
  padding: calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom)) !important;
  z-index: 300;
}
body.is-phone .modal {
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  border-radius: 20px !important;
  padding: 15px !important;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
body.is-phone .tabs {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
body.is-phone .tab-btn {
  min-height: 44px;
  padding: 9px 10px;
}
body.is-phone .trend-label-row,
body.is-phone .mini-bar-row {
  grid-template-columns: 1fr !important;
}
body.is-phone .trend-svg {
  height: 170px !important;
}
body.is-phone pre,
body.is-phone table {
  max-width: 100%;
  overflow-x: auto;
}
body.is-phone .auth-shell {
  display: grid !important;
  grid-template-columns: 1fr !important;
  min-height: 100dvh;
}
body.is-phone .auth-hero {
  padding: calc(22px + env(safe-area-inset-top)) 16px 8px !important;
}
body.is-phone .auth-hero h1 {
  font-size: 32px !important;
}
body.is-phone .auth-card {
  width: calc(100% - 20px) !important;
  margin: 0 10px 18px !important;
  padding: 18px !important;
}


/* Phone-only complete app menu fix: keeps desktop unchanged */
.mobile-logout-nav {
  display: none;
}

body.is-phone .mobile-logout-nav {
  display: flex;
  color: #ffd5da;
  border-color: rgba(255,107,122,.28);
  background: linear-gradient(135deg, rgba(255,107,122,.18), rgba(255,255,255,.035));
}

body.is-phone .mobile-logout-nav .nav-icon {
  filter: drop-shadow(0 0 12px rgba(255,107,122,.35));
}

body.is-phone .sidebar {
  width: min(92vw, 390px);
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(12px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
}

body.is-phone .mobile-sidebar-head {
  display: flex;
  flex: 0 0 auto;
}

body.is-phone .brand-card {
  flex: 0 0 auto;
}

body.is-phone .nav-group {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
}

body.is-phone .nav-btn {
  min-height: 58px;
  flex: 0 0 auto;
}

body.is-phone .sidebar-footer {
  display: none !important;
}

body.is-phone .app-shell.mobile-nav-open .mobile-nav-overlay {
  opacity: 1;
  pointer-events: auto;
}

body.is-phone .content {
  min-width: 0;
  width: 100%;
}

body.is-phone .modal,
body.is-phone .digest-panel {
  max-width: 100%;
}

/* Audit module - additive only */
.app-shell.route-audit .content-card,
.app-shell.route-audit .metric-card,
.app-shell.route-audit .ticket-card {
  border-color: rgba(255, 214, 123, .26);
}

.audit-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.audit-action-card {
  text-align: left;
  min-height: 120px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(circle at top left, rgba(255,214,123,.18), transparent 32%),
    linear-gradient(135deg, rgba(10,28,52,.96), rgba(6,17,31,.96));
  color: var(--text-strong);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: .2s ease;
}

.audit-action-card:hover,
.audit-action-card.active {
  transform: translateY(-2px);
  border-color: rgba(255,214,123,.32);
  box-shadow: 0 20px 44px rgba(0,0,0,.38), 0 0 28px rgba(255,214,123,.08);
}

.audit-action-card span {
  display: block;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.25;
}

.audit-action-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.audit-filter-card {
  padding: 16px;
}

.audit-filter-grid {
  grid-template-columns: 1.4fr .55fr .65fr .55fr .35fr;
  align-items: end;
}

.audit-tabs {
  margin-bottom: 0;
}

.audit-metrics-grid .metric-card h3 {
  font-size: 34px;
}

.audit-group-grid {
  align-items: stretch;
}

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

.audit-ai-card textarea {
  min-height: 150px;
}

.audit-ai-answer {
  margin-top: 16px;
  background: linear-gradient(180deg, rgba(76,136,255,.12), rgba(61,213,152,.08));
  border: 1px solid rgba(122, 175, 255, .22);
  border-radius: 18px;
  padding: 16px;
}

.audit-ai-answer strong {
  color: #fff;
  display: block;
  margin-bottom: 8px;
}

.audit-ai-answer p {
  margin: 0;
  color: #eef5ff;
  line-height: 1.6;
  white-space: pre-wrap;
}

@media (max-width: 1200px) {
  .audit-action-grid,
  .audit-filter-grid,
  .audit-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .audit-action-grid,
  .audit-filter-grid,
  .audit-group-grid {
    grid-template-columns: 1fr;
  }
  .audit-action-card {
    min-height: 96px;
  }
}


/* Audit tab usability fixes */
.audit-scroll-list {
  max-height: min(72vh, 980px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scroll-behavior: smooth;
}

.audit-scroll-list::-webkit-scrollbar,
.audit-modal-scroll::-webkit-scrollbar {
  width: 10px;
}

.audit-scroll-list::-webkit-scrollbar-thumb,
.audit-modal-scroll::-webkit-scrollbar-thumb {
  background: rgba(122, 175, 255, .32);
  border-radius: 999px;
}

.audit-clickable-card {
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.audit-clickable-card:hover,
.audit-clickable-card:focus {
  transform: translateY(-2px);
  border-color: rgba(255, 214, 123, .42);
  background: linear-gradient(180deg, rgba(255,214,123,.08), rgba(76,136,255,.06));
  outline: none;
}

.audit-open-hint {
  margin-top: 12px;
  font-size: 12px;
  color: #ffd67b;
  opacity: .9;
}

.audit-modal-scroll {
  max-height: 46vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
}

.audit-detail-header h3 {
  margin-top: 0;
}

.audit-detail-grid {
  margin-top: 16px;
}

@media (max-width: 900px) {
  .audit-scroll-list {
    max-height: 68vh;
  }

  .audit-modal-scroll {
    max-height: 40vh;
  }
}

/* Audit timing enhancements */
.audit-four-col {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.audit-ticket-card .detail-grid .detail-pill span {
  word-break: break-word;
}

@media (max-width: 1400px) {
  .audit-four-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .audit-four-col {
    grid-template-columns: 1fr;
  }
}


/* Assets / Inventory module */
.app-shell.route-assets .content-card,
.app-shell.route-assets .asset-card {
  border-color: rgba(61, 213, 152, .24);
}

.asset-toolbar {
  display: grid;
  grid-template-columns: 1.5fr .55fr .55fr;
  gap: 14px;
  margin-bottom: 16px;
}

.asset-list-scroll {
  max-height: min(72vh, 820px);
  overflow: auto;
  padding-right: 6px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.asset-card {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: linear-gradient(180deg, rgba(10, 28, 52, .96), rgba(6, 18, 35, .96));
  border: 1px solid rgba(111, 158, 255, .16);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px;
  transition: .2s ease;
}

.asset-card:hover {
  transform: translateY(-2px);
  border-color: rgba(61, 213, 152, .34);
  box-shadow: 0 22px 54px rgba(0,0,0,.38), 0 0 26px rgba(61,213,152,.10);
}

.asset-card h3 {
  margin: 12px 0 6px;
  color: var(--text-strong);
}

.asset-mini-grid {
  margin: 14px 0;
}

.asset-problem-line {
  margin-top: 10px;
  color: #eaf4ff;
  line-height: 1.45;
}

.asset-detail-layout {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
}

.asset-detail-hero {
  grid-column: 1 / -1;
}

.asset-detail-hero h2 {
  margin: 10px 0 6px;
  color: var(--text-strong);
  font-size: 32px;
}

.asset-history-card {
  grid-column: 1 / -1;
}

.asset-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 6px;
}

.asset-history-list.compact {
  max-height: 240px;
  margin-top: 12px;
}

.asset-history-row {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 1.4fr auto;
  gap: 8px 12px;
  align-items: center;
  color: var(--text);
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  padding: 12px;
  transition: .2s ease;
}

.asset-history-row:hover {
  background: rgba(76,136,255,.11);
  border-color: rgba(76,136,255,.24);
  transform: translateY(-1px);
}

.asset-history-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.inline-link-btn {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: #9fd2ff;
  padding: 0;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.asset-ticket-context {
  border-color: rgba(61, 213, 152, .25);
}

.asset-status-active { background: rgba(61,213,152,.12); color: #cbf8e5; border-color: rgba(61,213,152,.24); }
.asset-status-in_repair { background: rgba(255,182,72,.12); color: #ffe1b4; border-color: rgba(255,182,72,.24); }
.asset-status-retired,
.asset-status-lost { background: rgba(255,107,122,.12); color: #ffd0d6; border-color: rgba(255,107,122,.24); }
.asset-status-spare { background: rgba(76,136,255,.14); color: #dce9ff; border-color: rgba(76,136,255,.24); }

@media (max-width: 1100px) {
  .asset-grid,
  .asset-detail-layout,
  .asset-toolbar {
    grid-template-columns: 1fr;
  }

  .asset-history-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .asset-list-scroll {
    max-height: 68vh;
  }

  .asset-detail-hero h2 {
    font-size: 24px;
  }
}


/* Asset assigned user selector */
.asset-user-picker-field select.asset-user-select {
  max-height: 260px;
}

.asset-picker-help {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 6px;
}

.asset-manual-user-wrap {
  margin-top: -4px;
}

.asset-manual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 760px) {
  .asset-manual-grid {
    grid-template-columns: 1fr;
  }
}

/* Change Management module */
.app-shell.route-changes .content-card,
.app-shell.route-changes .ticket-card,
.app-shell.route-changes .metric-card {
  border-color: rgba(255, 182, 72, .24);
}
.change-toolbar {
  display: grid;
  grid-template-columns: 1.4fr .7fr .7fr;
  gap: 14px;
}
.change-request-list,
.change-timeline-list,
.change-related-ticket-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.change-list-card .change-request-list {
  max-height: 70vh;
  overflow: auto;
  padding-right: 6px;
}
.change-request-card,
.change-mini-card,
.asset-change-card {
  width: 100%;
  text-align: left;
  color: inherit;
}
.change-request-card:hover,
.change-mini-card:hover,
.asset-change-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,182,72,.38);
}
.change-detail-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.change-detail-hero h1 {
  margin: 12px 0 8px;
  color: var(--text-strong);
}
.change-workflow-actions {
  margin-top: 16px;
}
.change-ticket-multiselect {
  min-height: 170px;
}
.change-ticket-multiselect option {
  padding: 8px;
}
.change-status-draft { background: rgba(183,199,223,.12); color: #e8f0ff; border-color: rgba(183,199,223,.22); }
.change-status-pending_approval { background: rgba(255,182,72,.14); color: #ffe1b4; border-color: rgba(255,182,72,.26); }
.change-status-approved { background: rgba(76,136,255,.14); color: #dce8ff; border-color: rgba(76,136,255,.26); }
.change-status-in_progress { background: rgba(136,106,255,.16); color: #eee8ff; border-color: rgba(136,106,255,.28); }
.change-status-completed { background: rgba(61,213,152,.14); color: #cbf8e5; border-color: rgba(61,213,152,.26); }
.change-status-failed { background: rgba(255,107,122,.14); color: #ffd5da; border-color: rgba(255,107,122,.26); }
.change-risk-low { background: rgba(61,213,152,.12); color: #cbf8e5; }
.change-risk-medium { background: rgba(255,182,72,.12); color: #ffe1b4; }
.change-risk-high { background: rgba(255,107,122,.12); color: #ffd0d6; }
@media (max-width: 1000px) {
  .change-toolbar { grid-template-columns: 1fr; }
  .change-list-card .change-request-list { max-height: 62vh; }
}

/* Custom dashboard and workflow enhancements */
.analytics-click-card,
.kb-dashboard-card {
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
}
.analytics-click-card:hover,
.kb-dashboard-card:hover {
  transform: translateY(-2px);
  border-color: rgba(76,136,255,.32);
  box-shadow: 0 24px 60px rgba(0,0,0,.42), 0 0 28px rgba(76,136,255,.10);
}
.kb-suggestion-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  max-height: 360px;
  overflow: auto;
  padding-right: 6px;
}
.kb-modal-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  max-height: 65vh;
  overflow: auto;
  margin-top: 16px;
}
.kb-suggestion-card {
  min-height: 160px;
}
.change-workflow-actions .hint {
  margin: 0;
}

.related-asset-picker-list {
  max-height: 58vh;
  overflow: auto;
  padding-right: 6px;
}
.related-asset-select-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}
.asset-row-main {
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  padding: 0;
}
@media (max-width: 760px) {
  .related-asset-select-row {
    grid-template-columns: 1fr;
  }
}

.change-user-process-card {
  border-color: rgba(76,136,255,.24);
  background: linear-gradient(135deg, rgba(76,136,255,.10), rgba(61,213,152,.06)), var(--panel);
}
.change-process-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
@media (max-width: 900px) {
  .change-process-steps { grid-template-columns: 1fr; }
}


.chat-recipient-help {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.chat-recipient-list {
  display: block;
  max-height: 390px;
  overflow: hidden;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.16);
}

.chat-recipient-virtual-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  max-height: 300px;
  overflow: auto;
  padding-right: 4px;
}

.chat-recipient-more {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(76,136,255,.10);
  border: 1px solid rgba(76,136,255,.16);
  color: var(--muted);
  font-size: 12px;
}

.chat-recipient-check {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
  cursor: pointer;
}

.chat-recipient-check:hover {
  border-color: rgba(76,136,255,.28);
  background: rgba(76,136,255,.08);
}

.chat-recipient-check small {
  color: var(--muted);
  font-size: 11px;
}

.chat-recipient-list-tall {
  max-height: 390px;
}

.chat-recipient-check {
  grid-template-columns: auto 1fr;
}

.chat-recipient-check span {
  color: var(--text-strong);
  font-weight: 700;
}

.chat-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  max-height: 110px;
  overflow: auto;
  align-items: center;
  padding: 10px;
  margin: 8px 0 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.025);
}

.chat-selected-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(76,136,255,.14);
  border: 1px solid rgba(76,136,255,.25);
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
}


/* Admin pre-entry digest responsive safety */
.digest-count {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}
.digest-ticket-scroll {
  max-height: min(58vh, 620px);
  overflow-y: auto;
  padding-right: 8px;
  -webkit-overflow-scrolling: touch;
}
.digest-ticket-scroll::-webkit-scrollbar {
  width: 10px;
}
.digest-ticket-scroll::-webkit-scrollbar-thumb {
  background: rgba(121,176,255,.28);
  border-radius: 999px;
}
@media (max-width: 760px) {
  .digest-ticket-scroll {
    max-height: 60vh;
  }
}
body.is-phone .digest-ticket-scroll {
  max-height: calc(100dvh - 250px);
}


/* Priority visual polish for prompts, announcements and pre-entry ticket digest */
.digest-card.low { border-color: rgba(61,213,152,.30); box-shadow: 0 20px 40px rgba(0,0,0,.26), inset 4px 0 0 rgba(61,213,152,.72); }
.digest-card.medium { border-color: rgba(255,182,72,.30); box-shadow: 0 20px 40px rgba(0,0,0,.26), inset 4px 0 0 rgba(255,182,72,.76); }
.digest-card.high, .digest-card.critical { border-color: rgba(255,107,122,.34); box-shadow: 0 20px 40px rgba(0,0,0,.26), inset 4px 0 0 rgba(255,107,122,.82); }
.digest-ticket-scroll { max-height: min(58vh, 620px); overflow:auto; padding-right:8px; }
.digest-panel { overflow:hidden; display:flex; flex-direction:column; }
.digest-panel .digest-ticket-scroll { min-height:0; }
@media (max-width: 760px) {
  .announcement-priority-strip { align-items:flex-start; }
  .priority-legend { width:100%; }
}

/* Developer credit banners and QR branding */
.auth-public-frame {
  position: relative;
  min-height: 100vh;
  padding-top: 54px;
  padding-bottom: 58px;
  overflow: hidden;
}

.developer-credit-banner {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  color: #ffffff;
  letter-spacing: .04em;
  font-weight: 800;
  text-align: center;
  background:
    linear-gradient(90deg, rgba(76,136,255,.18), rgba(61,213,152,.12), rgba(94,109,255,.18)),
    rgba(3, 12, 24, .84);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 0 22px rgba(76,136,255,.22), inset 0 0 20px rgba(255,255,255,.03);
  backdrop-filter: blur(14px);
  overflow: hidden;
  z-index: 8;
}

.developer-credit-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.18) 42%, transparent 70%);
  transform: translateX(-120%);
  animation: developer-shine 4.8s ease-in-out infinite;
  pointer-events: none;
}

.developer-credit-top,
.developer-credit-bottom {
  position: fixed;
  left: 0;
  right: 0;
}

.developer-credit-top { top: 0; }
.developer-credit-bottom { bottom: 0; }

.developer-credit-app {
  position: sticky;
  top: 0;
  border-radius: 18px;
  margin-bottom: 4px;
}

.developer-credit-glow,
.developer-credit-phone,
.developer-credit-separator {
  position: relative;
  z-index: 1;
  text-shadow: 0 0 8px rgba(255,255,255,.85), 0 0 18px rgba(76,136,255,.55), 0 0 32px rgba(61,213,152,.25);
}

.developer-credit-phone { color: #eaf6ff; }
.developer-credit-separator { color: rgba(255,255,255,.75); }

.developer-qr-corner {
  position: fixed;
  right: 18px;
  bottom: 72px;
  width: 118px;
  padding: 10px;
  display: grid;
  gap: 6px;
  place-items: center;
  text-decoration: none;
  color: #ffffff;
  background: rgba(3, 12, 24, .86);
  border: 1px solid rgba(111,158,255,.26);
  border-radius: 22px;
  box-shadow: 0 18px 44px rgba(0,0,0,.42), 0 0 28px rgba(76,136,255,.24);
  backdrop-filter: blur(16px);
  z-index: 10;
  animation: developer-float 4s ease-in-out infinite;
}

.developer-qr-corner img {
  width: 92px;
  height: 92px;
  border-radius: 12px;
  background: #ffffff;
  padding: 6px;
  box-shadow: 0 0 18px rgba(255,255,255,.25);
}

.developer-qr-corner span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(255,255,255,.6);
}

@keyframes developer-shine {
  0%, 48% { transform: translateX(-120%); }
  72%, 100% { transform: translateX(120%); }
}

@keyframes developer-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (max-width: 760px) {
  .auth-public-frame {
    padding-top: 50px;
    padding-bottom: 60px;
  }
  .developer-credit-banner {
    min-height: 38px;
    font-size: 12px;
    gap: 6px;
    padding: 8px 10px;
    flex-wrap: wrap;
  }
  .developer-credit-app {
    position: relative;
    top: auto;
  }
  .developer-qr-corner {
    right: 10px;
    bottom: 66px;
    width: 92px;
    padding: 8px;
    border-radius: 18px;
  }
  .developer-qr-corner img {
    width: 68px;
    height: 68px;
  }
  .developer-qr-corner span {
    font-size: 9px;
  }
}

/* FAQ Deployment Center */
.faq-hero {
  background:
    radial-gradient(circle at top right, rgba(61,213,152,.16), transparent 28%),
    radial-gradient(circle at bottom left, rgba(76,136,255,.18), transparent 26%),
    linear-gradient(135deg, rgba(8,24,46,.96), rgba(5,18,36,.98));
  overflow: hidden;
  position: relative;
}
.faq-hero::after {
  content: '';
  position: absolute;
  inset: -80px;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.07), transparent);
  transform: translateX(-70%);
  animation: faq-sheen 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes faq-sheen {
  0%, 55% { transform: translateX(-70%) rotate(8deg); opacity: 0; }
  70% { opacity: 1; }
  100% { transform: translateX(70%) rotate(8deg); opacity: 0; }
}
.faq-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  min-height: 620px;
  overflow: hidden;
}
.faq-toolbar {
  flex: 0 0 auto;
}
.faq-topic-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-behavior: smooth;
  white-space: nowrap;
  scrollbar-width: thin;
}
.faq-topic-chip {
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 0 auto;
  transform: none !important;
}
.faq-scroll-panel {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 8px;
  scroll-behavior: smooth;
}
.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-content: start;
}
.faq-card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(circle at top left, rgba(76,136,255,.18), transparent 36%),
    radial-gradient(circle at bottom right, rgba(61,213,152,.10), transparent 35%),
    linear-gradient(180deg, rgba(9,29,55,.98), rgba(5,18,36,.98));
  box-shadow: 0 18px 38px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.04);
  cursor: pointer;
  animation: faq-card-rise .42s ease both;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}
.faq-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.08), transparent 42%);
  opacity: .35;
  pointer-events: none;
}
.faq-card:hover {
  transform: translateY(-3px);
  border-color: rgba(125,190,255,.36);
  box-shadow: 0 22px 44px rgba(0,0,0,.30), 0 0 0 1px rgba(76,136,255,.14), 0 0 28px rgba(76,136,255,.15);
}
@keyframes faq-card-rise {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.faq-card h3 {
  margin: 0;
  color: #ffffff;
  font-size: 20px;
  line-height: 1.2;
  text-shadow: 0 0 12px rgba(255,255,255,.18), 0 0 24px rgba(76,136,255,.12);
  position: relative;
  z-index: 1;
}
.faq-summary {
  color: #d8e7ff;
  margin: 0;
  line-height: 1.45;
  position: relative;
  z-index: 1;
}
.faq-command-preview {
  margin-top: auto;
  border-radius: 16px;
  border: 1px solid rgba(76,136,255,.18);
  background: rgba(0,0,0,.22);
  padding: 12px;
  overflow: auto;
  position: relative;
  z-index: 1;
}
.faq-command-preview code,
.faq-code-block code {
  display: block;
  color: #eaf5ff;
  font-family: Consolas, Monaco, 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.faq-open-btn {
  width: 100%;
  position: relative;
  z-index: 1;
}
.faq-modal-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.faq-code-block {
  display: grid;
  gap: 10px;
  border-radius: 18px;
  border: 1px solid rgba(76,136,255,.18);
  background: rgba(0,0,0,.24);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.faq-code-block code {
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.06);
}
@media (max-width: 1200px) {
  .faq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faq-shell { height: calc(100vh - 190px); }
}
@media (max-width: 760px) {
  .faq-grid { grid-template-columns: 1fr; }
  .faq-shell { height: auto; min-height: 0; max-height: none; }
  .faq-scroll-panel { overflow: visible; padding-right: 0; }
}
