@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --c-primary: #55c6be;
  --c-primary-glow: rgba(85, 198, 190, 0.3);
  --c-dark: #10293f;
  --c-accent: #e36860;
  --c-highlight: #f7bc61;
  --c-neutral: #b7c5ca;
  --c-surface: #f7f9fb;
  --c-glass: rgba(255, 255, 255, 0.72);
  --c-glass-border: rgba(255, 255, 255, 0.3);
  --c-text: #334155;
  --c-text-muted: #64748b;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: #0c1f30;
  color: var(--c-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.page-centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ══ App shell ══ */

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
}

/* ── Sidebar ── */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 230px;
  height: 100vh;
  background: rgba(14, 36, 56, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(85, 198, 190, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 200;
  padding: 0 16px 20px;
  animation: sidebar-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sidebar-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.sidebar__top {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border-bottom: 1px solid rgba(85, 198, 190, 0.06);
  margin: 0 -16px;
  padding: 0 20px;
}

.sidebar__brand-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
  transform: translateY(6px);
}

/* ── Sidebar nav ── */

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.sidebar__link:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar__link.is-active {
  color: #fff;
  background: rgba(85, 198, 190, 0.15);
}

.sidebar__link-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* ── Sidebar CTA ── */

.sidebar__cta {
  width: 100%;
  justify-content: center;
}

/* ── Sidebar stats ── */

.sidebar__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sidebar__stat {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.sidebar__stat-value {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--c-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.sidebar__stat-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Sidebar footer ── */

.sidebar__bottom {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar__footer-text {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
  letter-spacing: 0.03em;
}

/* ── Top bar (mobile only) ── */

.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  background: rgba(14, 36, 56, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(85, 198, 190, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar__brand {
  display: flex;
  align-items: center;
}

.topbar__brand-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.topbar__menu {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 22px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.15s;
}

.topbar__menu:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ── Tabs (mobile fallback) ── */

.tabs--mobile {
  display: none;
}

/* ── Main wrapper (centers content in remaining space) ── */

.main-wrap {
  margin-left: 230px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Status header ── */

.status-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  height: 48px;
  padding: 0 32px;
  background: rgba(14, 36, 56, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(85, 198, 190, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
  animation: fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.status-header__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  cursor: default;
  transition: all 0.3s ease;
}

.status-header__pill[data-status="online"] {
  border-color: rgba(52, 199, 89, 0.2);
  color: rgba(255, 255, 255, 0.8);
}

.status-header__pill[data-status="error"] {
  border-color: rgba(227, 104, 96, 0.25);
  color: rgba(255, 255, 255, 0.8);
}

.status-header__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-neutral);
  transition: background 0.3s, box-shadow 0.3s;
  flex-shrink: 0;
}

.status-header__dot[data-state="online"] {
  background: #34c759;
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.5);
}

.status-header__dot[data-state="error"] {
  background: var(--c-accent);
  box-shadow: 0 0 8px rgba(227, 104, 96, 0.4);
}

.status-header__dot[data-state="loading"] {
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.status-header__pill--has-tooltip {
  position: relative;
  cursor: default;
}

.status-header__model-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 6px 12px;
  border-radius: 8px;
  background: #10293f;
  color: #55c6be;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.02em;
}

.status-header__model-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: #10293f;
}

.status-header__pill--has-tooltip:hover .status-header__model-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Main ── */

.main {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 32px 64px;
}

body.settings-embed {
  background: transparent;
}

body.settings-embed .bg-canvas,
body.settings-embed .sidebar,
body.settings-embed .topbar,
body.settings-embed .status-header,
body.settings-embed .main__title-row {
  display: none !important;
}

body.settings-embed .app {
  min-height: auto;
  display: block;
}

body.settings-embed .main-wrap {
  margin-left: 0;
  min-height: auto;
}

body.settings-embed .main {
  max-width: none;
  margin: 0;
  padding: 0;
}

body.settings-embed .panel {
  animation: none;
}

.main__title-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-embed-shell {
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 20px 60px rgba(12, 31, 48, 0.14);
}

.settings-embed-frame {
  width: 100%;
  border: none;
  display: block;
  background: transparent;
}

.settings-embed-empty {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(16, 41, 63, 0.08);
  color: var(--c-text);
}

.main__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  animation: fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.main__title-row h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
}

.main__subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Buttons ── */

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--c-primary);
  color: var(--c-dark);
  font-weight: 800;
}

.btn--primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--c-primary-glow);
}

.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  color: var(--c-text-muted);
  border: 1px solid rgba(16, 41, 63, 0.12);
}

.btn--ghost:hover {
  background: rgba(16, 41, 63, 0.04);
}

.btn--small {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn--icon {
  padding: 5px 8px;
  min-width: 30px;
  justify-content: center;
}

/* ── Tabs ── */

.tabs {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 20px;
}

.tabs__btn {
  flex: 1;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tabs__btn:hover {
  color: rgba(255, 255, 255, 0.7);
}

.tabs__btn.is-active {
  background: var(--c-glass);
  color: var(--c-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ── Panel ── */

.panel {
  background: var(--c-glass);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--c-glass-border);
  border-radius: 18px;
  padding: 24px;
  animation: fade-up 0.5s 0.14s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.panel[hidden] { display: none; }
.panel__subpanel[hidden] { display: none; }

/* ── Sub-tabs ── */

.panel__subtabs {
  display: flex;
  gap: 4px;
  background: rgba(16, 41, 63, 0.04);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}

.panel__subtab {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.panel__subtab:hover {
  color: var(--c-dark);
  background: rgba(255, 255, 255, 0.4);
}

.panel__subtab.is-active {
  background: #fff;
  color: var(--c-dark);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.panel__intro {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--c-text-muted);
}

/* ── Search ── */

.panel__toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.search {
  position: relative;
}

.search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.4;
  pointer-events: none;
}

.search__input {
  width: 100%;
  border: 1px solid rgba(16, 41, 63, 0.08);
  border-radius: 10px;
  padding: 10px 14px 10px 38px;
  font-size: 14px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.2s ease;
}

.search__input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(85, 198, 190, 0.12);
  background: #fff;
}

.search__input::placeholder {
  color: var(--c-text-muted);
}

/* ── Filter chips ── */

.panel__filters {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid rgba(16, 41, 63, 0.08);
  background: rgba(255, 255, 255, 0.4);
  color: var(--c-text-muted);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  border-color: var(--c-primary);
  color: var(--c-dark);
}

.chip.is-active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

/* ── Count ── */

.panel__count {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--c-text-muted);
}

/* ── Templates grid ── */

.panel__grid {
  display: grid;
  gap: 10px;
}

/* ── Card ── */

.card {
  border: 1px solid rgba(16, 41, 63, 0.06);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.25s ease;
}

.card:hover {
  border-color: rgba(85, 198, 190, 0.18);
  box-shadow: 0 4px 20px rgba(85, 198, 190, 0.08);
  transform: translateY(-1px);
}

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

.card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-dark);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(85, 198, 190, 0.1);
  color: #2a9d8f;
  white-space: nowrap;
  flex-shrink: 0;
}

.card__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.card__actions button {
  border: none;
  background: transparent;
  color: var(--c-text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.card__actions button:hover {
  background: rgba(16, 41, 63, 0.05);
  color: var(--c-dark);
}

.card__actions button[data-action="delete"]:hover {
  background: rgba(227, 104, 96, 0.08);
  color: var(--c-accent);
}

.card__actions button[data-action="copy"]:hover {
  background: rgba(85, 198, 190, 0.1);
  color: #2a9d8f;
}

.card__text {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--c-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__text.is-expanded {
  -webkit-line-clamp: unset;
}

.card__toggle {
  border: none;
  background: none;
  color: var(--c-primary);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 0;
  margin-top: 2px;
}

.card__toggle:hover {
  text-decoration: underline;
}

/* ── Empty state ── */

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--c-text-muted);
}

.empty__icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--c-dark);
}

.empty__text {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
}

/* ── Pagination ── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
}

.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--c-text-muted);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.pagination__btn:hover:not(:disabled):not(.is-active) {
  background: rgba(16, 41, 63, 0.04);
  color: var(--c-dark);
}

.pagination__btn.is-active {
  background: var(--c-primary);
  color: #fff;
}

.pagination__btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* ── Suggestions grid ── */

.suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.suggestions-grid > .pagination {
  grid-column: 1 / -1;
}

.sug-card {
  border: 1px solid rgba(85, 198, 190, 0.12);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.25s ease;
}

.sug-card:hover {
  border-color: var(--c-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(85, 198, 190, 0.12);
}

.sug-card__icon {
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
  display: block;
  color: var(--c-primary);
}

.sug-card__icon svg {
  width: 100%;
  height: 100%;
}

.sug-card h4 {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-dark);
}

.sug-card p {
  margin: 0;
  font-size: 11px;
  color: var(--c-text-muted);
  line-height: 1.4;
}

.sug-card__count {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--c-primary);
  color: #fff;
  margin-bottom: 6px;
}

.sug-card__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(85, 198, 190, 0.1);
}

.sug-card__tpl {
  display: block;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(85, 198, 190, 0.1);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  color: #2a7a72;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sug-card__tpl:hover {
  background: rgba(85, 198, 190, 0.08);
  border-color: var(--c-primary);
  transform: translateX(3px);
}

/* ── Toast ── */

.toast-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 9000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  max-width: 340px;
}

.toast--success { background: var(--c-primary); color: var(--c-dark); }
.toast--error { background: var(--c-accent); }
.toast--fade-out { animation: toast-out 0.3s ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(8px); }
}

/* ══ Template modal ══ */

.tpl-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 31, 48, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8500;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tpl-overlay[hidden] { display: none; }
.tpl-overlay.is-open { opacity: 1; }

.tpl-modal {
  background: #fff;
  border-radius: 20px;
  width: 94%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.tpl-overlay.is-open .tpl-modal {
  transform: scale(1) translateY(0);
}

.tpl-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px 0;
}

.tpl-modal__head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.tpl-modal__x {
  background: none;
  border: none;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.tpl-modal__x:hover {
  background: var(--c-surface);
  color: var(--c-dark);
}

.tpl-modal__body {
  padding: 18px 24px 24px;
  display: grid;
  gap: 14px;
}

.field { display: grid; gap: 5px; }

.field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(16, 41, 63, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--c-surface);
  transition: all 0.2s ease;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(85, 198, 190, 0.1);
  outline: none;
  background: #fff;
}

.field textarea { min-height: 110px; }

/* ── AI bar ── */

.ai-bar {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.ai-bar__btn {
  border: 1px solid rgba(85, 198, 190, 0.2);
  background: rgba(85, 198, 190, 0.04);
  color: #2a9d8f;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-bar__btn:hover {
  background: rgba(85, 198, 190, 0.1);
  border-color: var(--c-primary);
}

.ai-bar__btn:disabled { opacity: 0.4; cursor: not-allowed; }

.ai-bar__btn--review {
  border-color: rgba(247, 188, 97, 0.25);
  background: rgba(247, 188, 97, 0.04);
  color: #a17215;
}

.ai-bar__btn--review:hover {
  background: rgba(247, 188, 97, 0.1);
  border-color: var(--c-highlight);
}

/* ── AI result ── */

.ai-result {
  border: 1px solid rgba(85, 198, 190, 0.15);
  background: rgba(85, 198, 190, 0.03);
  border-radius: 12px;
  padding: 14px 16px;
  animation: fade-up 0.25s ease;
}

.ai-result[hidden] { display: none; }

.ai-result__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ai-result__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #2a9d8f;
}

.ai-result__close {
  background: none;
  border: none;
  font-size: 16px;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.ai-result__close:hover { background: rgba(0, 0, 0, 0.04); }

.ai-result__text {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--c-text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.ai-result__apply {
  border: none;
  background: var(--c-primary);
  color: var(--c-dark);
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.15s;
}

.ai-result__apply:hover { filter: brightness(1.08); }

/* ── Modal message ── */

.tpl-modal__msg {
  margin: 0;
  font-size: 12px;
  min-height: 16px;
  color: transparent;
  transition: color 0.2s;
}

.tpl-modal__msg[data-state="error"] { color: var(--c-accent); }
.tpl-modal__msg[data-state="info"] { color: var(--c-text-muted); }
.tpl-modal__msg[data-state="success"] { color: var(--c-primary); }

.tpl-modal__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Confirm modal ── */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 31, 48, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8000;
  animation: confirmFadeIn 0.2s ease;
}

@keyframes confirmFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.confirm-box {
  background: #fff;
  border-radius: 18px;
  padding: 28px 24px 24px;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: confirmSlideIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes confirmSlideIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.confirm-box__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(85, 198, 190, 0.1);
  color: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.confirm-box__icon--danger {
  background: rgba(227, 104, 96, 0.1);
  color: var(--c-accent);
}

.confirm-box h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--c-dark);
}

.confirm-box p {
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--c-text-muted);
  line-height: 1.55;
}

.confirm-box__actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.btn--danger {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}

.btn--danger:hover {
  background: #d05a52;
  border-color: #d05a52;
}

/* ══ Dashboard ══ */

.dash__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

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

.dash__quick-filters {
  display: flex;
  gap: 4px;
  background: rgba(16, 41, 63, 0.06);
  border-radius: 8px;
  padding: 3px;
}

.dash__quick-btn {
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.dash__quick-btn:hover { color: var(--c-text); }

.dash__quick-btn.is-active {
  background: #fff;
  color: var(--c-dark);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.dash__period-sep {
  width: 1px;
  height: 22px;
  background: rgba(16, 41, 63, 0.1);
}

.dash__month-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash__month-arrow {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(16, 41, 63, 0.12);
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--c-text-muted);
  transition: all 0.2s;
}

.dash__month-arrow:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.dash__month-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.dash__month-label {
  border: none;
  background: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-dark);
  min-width: 120px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.dash__month-label:hover {
  background: rgba(16, 41, 63, 0.06);
}

.dash__month-label.is-active {
  background: #fff;
  color: var(--c-dark);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.dash__report-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid rgba(16, 41, 63, 0.12);
  border-radius: 8px;
  background: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text);
  cursor: pointer;
  transition: all 0.2s;
}

.dash__report-btn:hover {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
  box-shadow: 0 4px 14px var(--c-primary-glow);
}

.dash__report-btn svg { opacity: 0.6; }
.dash__report-btn:hover svg { opacity: 1; }

/* Report Modal */
#report-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: reportFadeIn 0.2s ease;
}
@keyframes reportFadeIn { from { opacity: 0; } to { opacity: 1; } }

.report-modal {
  background: #fff;
  border-radius: 14px;
  width: 92vw;
  height: 90vh;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.report-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}

.report-modal__title {
  font-weight: 700;
  font-size: 15px;
  color: #10293f;
}

.report-modal__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-modal__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--c-primary, #55c6be);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.report-modal__btn:hover { filter: brightness(1.1); }

.report-modal__close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}
.report-modal__close:hover {
  background: #fee2e2;
  color: #e74c3c;
  border-color: #fca5a5;
}

.report-modal__iframe {
  flex: 1;
  border: none;
  width: 100%;
}

.dash__kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.dash__kpi {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(16, 41, 63, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.2s ease;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.dash__kpi:hover {
  border-color: rgba(85, 198, 190, 0.18);
  transform: translateY(-1px);
}

.dash__kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dash__kpi-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash__kpi-icon {
  width: 18px;
  height: 18px;
  opacity: 0.4;
}

.dash__kpi-icon svg { width: 100%; height: 100%; }

.dash__kpi-value {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--c-dark);
  line-height: 1;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash__kpi-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--c-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash__kpi-sub b {
  color: var(--c-primary);
  font-weight: 700;
}

.dash__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.dash__card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(16, 41, 63, 0.06);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.dash__row > .dash__card {
  margin-bottom: 0;
}

.dash__card-title {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash__card-title svg {
  opacity: 0.5;
  flex-shrink: 0;
}

/* ── Info tooltip (?) ── */

.dash__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(16, 41, 63, 0.08);
  color: var(--c-text-muted);
  font-size: 10px;
  font-weight: 700;
  cursor: default;
  vertical-align: middle;
  margin-left: 4px;
  flex-shrink: 0;
  transition: background 0.2s;
}

.dash__info:hover {
  background: var(--c-primary);
  color: #fff;
}

.dash__info--sm {
  width: 14px;
  height: 14px;
  font-size: 9px;
}

.dash__info-tip {
  position: fixed;
  z-index: 9999;
  background: var(--c-dark);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  padding: 10px 14px;
  border-radius: 10px;
  max-width: 260px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transition: opacity 0.15s ease-out;
}

.dash__info-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--c-dark);
}

/* ── Breakdown bars ── */

.dash__breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash__bk-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash__bk-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-dark);
  width: 90px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash__bk-track {
  flex: 1;
  height: 8px;
  background: rgba(16, 41, 63, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.dash__bk-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.dash__bk-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text-muted);
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

.dash__bk-empty {
  font-size: 12px;
  color: var(--c-text-muted);
  text-align: center;
  padding: 14px 0;
}

/* ── Lists ── */

.dash__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash__list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  transition: background 0.15s;
}

.dash__list-item:hover {
  background: rgba(255, 255, 255, 0.7);
}

.dash__list-rank {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.dash__list-rank--1 { background: var(--c-primary); }
.dash__list-rank--2 { background: #60a5fa; }
.dash__list-rank--3 { background: var(--c-highlight); }
.dash__list-rank--other { background: rgba(16,41,63,0.12); color: var(--c-text-muted); }

.dash__list-name {
  font-weight: 600;
  color: var(--c-dark);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash__list-bar-wrap {
  width: 50px;
  height: 5px;
  background: rgba(16, 41, 63, 0.05);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.dash__list-bar {
  height: 100%;
  background: var(--c-primary);
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.dash__list-count {
  font-weight: 700;
  color: var(--c-primary);
  flex-shrink: 0;
  font-size: 12px;
}

.dash__list-empty {
  font-size: 12px;
  color: var(--c-text-muted);
  text-align: center;
  padding: 18px 0;
}

.dash__selector-health {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash__selector-live-note {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--c-text-muted);
}

.dash__selector-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
}

.dash__selector-summary strong {
  font-size: 12px;
  font-weight: 800;
}

.dash__selector-summary span {
  font-size: 11px;
  color: var(--c-text-muted);
}

.dash__selector-summary--ok {
  background: rgba(85, 198, 190, 0.1);
  border-color: rgba(85, 198, 190, 0.25);
}

.dash__selector-summary--ok strong {
  color: #2a9d8f;
}

.dash__selector-summary--alert {
  background: rgba(227, 104, 96, 0.1);
  border-color: rgba(227, 104, 96, 0.25);
}

.dash__selector-summary--alert strong {
  color: var(--c-accent);
}

.dash__selector-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(16, 41, 63, 0.06);
}

.dash__selector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.dash__selector-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash__selector-dot--ok { background: var(--c-primary); }
.dash__selector-dot--alert { background: var(--c-accent); }
.dash__selector-dot--unknown { background: rgba(16, 41, 63, 0.25); }

.dash__selector-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash__selector-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--c-dark);
}

.dash__selector-desc {
  font-size: 11px;
  color: var(--c-text-muted);
}

.dash__selector-pill {
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 8px;
  flex-shrink: 0;
}

.dash__selector-pill--ok {
  background: rgba(85, 198, 190, 0.14);
  color: #2a9d8f;
}

.dash__selector-pill--alert {
  background: rgba(227, 104, 96, 0.14);
  color: var(--c-accent);
}

.dash__selector-pill--unknown {
  background: rgba(16, 41, 63, 0.08);
  color: var(--c-text-muted);
}

.dash__selector-metric {
  font-size: 11px;
  color: var(--c-text-muted);
}

.dash__selector-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

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

.dash__selector-intro-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(16, 41, 63, 0.08);
}

.dash__selector-intro-card strong {
  font-size: 12px;
  color: var(--c-dark);
}

.dash__selector-intro-card span {
  font-size: 11px;
  color: var(--c-text-muted);
  line-height: 1.45;
}

.dash__selector-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid rgba(16, 41, 63, 0.08);
  background: rgba(255, 255, 255, 0.45);
}

.dash__selector-stat strong {
  font-size: 20px;
  line-height: 1;
  color: var(--c-dark);
}

.dash__selector-stat span {
  font-size: 11px;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.dash__selector-stat--alert strong { color: var(--c-accent); }
.dash__selector-stat--ok strong { color: #2a9d8f; }
.dash__selector-stat--unknown strong { color: var(--c-text-muted); }

.dash__selector-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash__selector-section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--c-dark);
}

.dash__selector-section-helper {
  font-size: 11px;
  color: var(--c-text-muted);
  margin-top: -6px;
}

.dash__selector-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash__selector-impact,
.dash__selector-action,
.dash__selector-tech {
  font-size: 11px;
  color: var(--c-text-muted);
  line-height: 1.45;
}

.dash__selector-impact strong,
.dash__selector-action strong,
.dash__selector-tech strong {
  color: var(--c-dark);
}

.dash__selector-tech {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  background: rgba(16, 41, 63, 0.04);
  border-radius: 8px;
  padding: 8px 9px;
  overflow-wrap: anywhere;
}

.dash__selector-more {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash__selector-more summary {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text-muted);
  cursor: pointer;
  list-style: none;
}

.dash__selector-more summary::-webkit-details-marker {
  display: none;
}

.dash__selector-more summary::before {
  content: '+ ';
}

.dash__selector-more[open] summary::before {
  content: '- ';
}

.dash__selector-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0 4px;
  flex-wrap: wrap;
}

.dash__selector-pagination-label {
  font-size: 11px;
  color: var(--c-text-muted);
}

.dash__selector-pagination-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dash__selector-page-btn {
  border: 1px solid rgba(16, 41, 63, 0.1);
  background: rgba(255, 255, 255, 0.6);
  color: var(--c-dark);
  border-radius: 8px;
  height: 30px;
  min-width: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dash__selector-page-btn:hover:not(:disabled) {
  background: rgba(85, 198, 190, 0.1);
  border-color: rgba(85, 198, 190, 0.35);
}

.dash__selector-page-btn.is-active {
  background: rgba(85, 198, 190, 0.16);
  border-color: rgba(85, 198, 190, 0.45);
  color: #2a9d8f;
}

.dash__selector-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 780px) {
  .dash__selector-intro {
    grid-template-columns: 1fr;
  }

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

  .dash__selector-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Chart ── */

.dash__chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 130px;
  padding: 4px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.dash__chart-bars::-webkit-scrollbar { height: 4px; }
.dash__chart-bars::-webkit-scrollbar-thumb { background: rgba(16,41,63,0.12); border-radius: 4px; }

.dash__chart-bars--compact { gap: 2px; }
.dash__chart-bars--compact .dash__col { min-width: 16px; flex: 1 0 16px; }
.dash__chart-bars--compact .dash__col-bar { max-width: 22px; }
.dash__chart-bars--compact .dash__col-day { font-size: 8px; }

/* ── Chart tooltip ── */

.dash__tooltip {
  position: absolute;
  z-index: 999;
  background: var(--c-dark);
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12px;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  min-width: 160px;
  animation: tooltip-in 0.15s ease-out;
}

@keyframes tooltip-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dash__tooltip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: var(--c-dark);
  border-radius: 2px;
  transform: translateX(-50%) rotate(45deg);
}

.dash__tooltip-day {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.dash__tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  color: rgba(255, 255, 255, 0.7);
}

.dash__tooltip-row b {
  margin-left: auto;
  color: #fff;
  font-weight: 700;
}

.dash__tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dash__tooltip-total {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.dash__tooltip-total b {
  color: var(--c-primary);
  font-weight: 800;
}

.dash__col {
  flex: 1 0 20px;
  min-width: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.dash__col--today .dash__col-day { color: var(--c-primary); font-weight: 800; }
.dash__col--today .dash__col-bar { box-shadow: 0 0 12px rgba(85,198,190,0.25); }

.dash__col-val {
  font-size: 9px;
  font-weight: 700;
  color: var(--c-text-muted);
  min-height: 12px;
}

.dash__col-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 4px 4px 2px 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.dash__seg { min-height: 0; }
.dash__seg--rewrites { background: var(--c-primary); }
.dash__seg--inserted { background: #60a5fa; }
.dash__seg--opens { background: rgba(16,41,63,0.08); }
.dash__seg--empty { background: rgba(16, 41, 63, 0.05); flex: 1; min-height: 3px; border-radius: 6px; }

.dash__col-day {
  font-size: 10px;
  font-weight: 600;
  color: var(--c-text-muted);
}

.dash__col-date {
  font-size: 8px;
  color: rgba(100,116,139,0.5);
  margin-top: -2px;
}

.dash__chart-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(16, 41, 63, 0.05);
}

.dash__legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--c-text-muted);
}

.dash__legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
}

/* ── NPS Dashboard section ── */

.dash__card-link {
  margin-left: auto;
  color: var(--c-text-muted);
  opacity: 0.6;
  transition: opacity 0.2s;
}
.dash__card-link:hover { opacity: 1; }

/* ── CSAT Dashboard ── */

.dash__csat-empty {
  font-size: 13px;
  color: var(--c-text-muted);
  text-align: center;
  padding: 20px 0;
}
.dash__csat-empty code {
  font-size: 11px;
  background: rgba(16,41,63,0.06);
  padding: 2px 6px;
  border-radius: 4px;
}
.dash__csat-hint {
  font-size: 11px;
  color: var(--c-text-soft);
  margin-top: 6px;
}

.dash__csat-score {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}

.dash__csat-gauge {
  display: flex;
  align-items: baseline;
  gap: 2px;
  min-width: 80px;
}

.dash__csat-number {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
}

.dash__csat-scale {
  font-size: 18px;
  font-weight: 600;
  color: var(--c-text-muted);
}

.dash__csat-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash__csat-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  width: fit-content;
}

.dash__csat-total {
  font-size: 13px;
  color: var(--c-text-muted);
}

.dash__csat-rates {
  font-size: 12px;
  font-weight: 600;
}

.dash__csat-section-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash__csat-dist {
  margin-bottom: 16px;
  border-top: 1px solid rgba(16, 41, 63, 0.08);
  padding-top: 14px;
}

.dash__csat-dist-row {
  display: grid;
  grid-template-columns: 20px 1fr 28px auto;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.dash__csat-dist-label {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.dash__csat-dist-desc {
  font-size: 10px;
  color: var(--c-text-soft);
  white-space: nowrap;
}

.dash__csat-agents {
  margin-bottom: 16px;
  border-top: 1px solid rgba(16, 41, 63, 0.08);
  padding-top: 14px;
}

.dash__csat-agent {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.dash__csat-agent + .dash__csat-agent {
  border-top: 1px solid rgba(16, 41, 63, 0.05);
}

.dash__csat-agent-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
}

.dash__csat-agent-avg {
  font-size: 14px;
  font-weight: 800;
}

.dash__csat-agent-count {
  font-size: 11px;
  color: var(--c-text-muted);
  min-width: 50px;
  text-align: right;
}

.dash__csat-recent {
  border-top: 1px solid rgba(16, 41, 63, 0.08);
  padding-top: 14px;
}

.dash__csat-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
}
.dash__csat-item + .dash__csat-item {
  border-top: 1px solid rgba(16, 41, 63, 0.05);
}

.dash__csat-item-score {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.dash__csat-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.dash__csat-item-meta {
  font-size: 11px;
  color: var(--c-text-muted);
}

/* ── Insights ── */

.dash__insights {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Problem cards (static) */
.dash__insight-problem {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  border-left: 3px solid var(--c-primary);
  animation: insightIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dash__insight--alert { border-left-color: var(--c-accent); }
.dash__insight--warn { border-left-color: var(--c-highlight); }
.dash__insight--success { border-left-color: var(--c-primary); }

@keyframes insightIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash__insight-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.dash__insight-title {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--c-dark);
  line-height: 1.35;
  margin-bottom: 3px;
}

.dash__insight-text {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--c-text-muted);
  margin: 0;
}

/* Tips carousel */
.dash__tips-carousel {
  background: linear-gradient(135deg, rgba(85,198,190,0.06) 0%, rgba(96,165,250,0.06) 100%);
  border: 1px solid rgba(85, 198, 190, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}

.dash__tips-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.dash__tips-header svg { opacity: 0.7; }

.dash__tips-counter {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: var(--c-text-muted);
  opacity: 0.6;
}

.dash__tips-track {
  position: relative;
  min-height: 60px;
}

.dash__tips-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.dash__tips-slide.is-active {
  position: relative;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dash__tips-slide.is-exit {
  opacity: 0;
  transform: translateY(-6px);
}

.dash__tips-slide strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--c-dark);
  margin-bottom: 4px;
  line-height: 1.35;
}

.dash__tips-slide p {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--c-text);
  margin: 0;
}

.dash__tips-bar {
  height: 2px;
  background: rgba(85, 198, 190, 0.15);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.dash__tips-bar-fill {
  height: 100%;
  background: var(--c-primary);
  border-radius: 2px;
  width: 0%;
  animation: tipProgress 8s linear forwards;
}

.dash__tips-carousel:hover .dash__tips-bar-fill {
  animation-play-state: paused;
}

@keyframes tipProgress {
  from { width: 0%; }
  to { width: 100%; }
}

.dash__insight-footer {
  text-align: right;
  font-size: 9px;
  color: rgba(16, 41, 63, 0.72);
  opacity: 0.9;
  font-style: italic;
  margin: 4px 0 0;
}

/* ── Feedbacks / Sugestões ── */

.dash__feedback-item {
  padding: 12px 0;
}

.dash__feedback-item + .dash__feedback-item {
  border-top: 1px solid rgba(16, 41, 63, 0.05);
}

.dash__feedback-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.dash__feedback-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dash__feedback-agent {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-dark);
}

.dash__feedback-date {
  font-size: 10px;
  color: var(--c-text-muted);
}

.dash__feedback-text {
  font-size: 12.5px;
  font-style: italic;
  color: var(--c-text);
  line-height: 1.5;
  padding: 8px 12px;
  background: rgba(85, 198, 190, 0.05);
  border-left: 3px solid var(--c-primary);
  border-radius: 0 8px 8px 0;
  margin: 0;
}

.dash__csat-item-feedback {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  font-style: italic;
  color: var(--c-text);
  line-height: 1.45;
  padding: 6px 10px;
  background: rgba(85, 198, 190, 0.06);
  border-left: 3px solid var(--c-primary);
  border-radius: 0 6px 6px 0;
}

@media (max-width: 768px) {
  .dash__row { grid-template-columns: 1fr; }
  .dash__kpis { grid-template-columns: repeat(2, 1fr); }
  .dash__csat-dist-row { grid-template-columns: 20px 1fr 28px auto; }
}

/* ── Spinner ── */

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(42, 157, 143, 0.25);
  border-top-color: #2a9d8f;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */

/* ── Sidebar user ── */

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar__user-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__logout-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.sidebar__logout-btn:hover {
  color: #e36860;
  background: rgba(227, 104, 96, 0.1);
}

/* ── Users list ── */

.users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.users__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(16, 41, 63, 0.06);
  border-radius: 12px;
  transition: background 0.15s, box-shadow 0.15s;
}

.users__item:hover {
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.users__info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.users__avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--c-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.users__name {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--c-dark);
}

.users__you {
  font-size: 11px;
  font-weight: 500;
  color: var(--c-primary);
}

.users__username {
  display: block;
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 1px;
}

.users__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.users__status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.users__status--active {
  background: rgba(85, 198, 190, 0.12);
  color: #2a9d8f;
}

.users__status--inactive {
  background: rgba(227, 104, 96, 0.12);
  color: #e36860;
}

.users__action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(16, 41, 63, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--c-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.users__action-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--c-primary);
  border-color: var(--c-primary);
}

.users__action-btn--danger:hover {
  color: #e36860;
  border-color: #e36860;
  background: rgba(227, 104, 96, 0.06);
}

.field__hint {
  display: block;
  font-size: 11px;
  color: var(--c-text-muted);
  margin-top: 4px;
}

/* ── Agents table ── */
.dash__agents-table-wrap {
  overflow-x: auto;
}

.dash__agents-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dash__agents-th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-muted);
  border-bottom: 1px solid rgba(16, 41, 63, 0.08);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.dash__agents-th:hover,
.dash__agents-th.is-active {
  color: var(--c-primary);
}

.dash__agents-sort {
  font-size: 9px;
  margin-left: 2px;
}

.dash__agents-row {
  transition: background 0.15s;
}

.dash__agents-row:hover {
  background: rgba(85, 198, 190, 0.06);
}

.dash__agents-row td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(16, 41, 63, 0.04);
}

.dash__agents-name {
  font-weight: 600;
  color: var(--c-dark);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash__agents-select {
  width: 100%;
  max-width: 280px;
  padding: 8px 12px;
  border: 1px solid rgba(16, 41, 63, 0.12);
  border-radius: 8px;
  background: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-dark);
  cursor: pointer;
  transition: border-color 0.2s;
}

.dash__agents-select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-glow);
}

.dash__agents-csat-list {
  margin-top: 16px;
}

.dash__agents-csat-list-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash__agents-feedback-row td {
  padding-top: 0 !important;
  border-bottom: 1px solid rgba(16, 41, 63, 0.04);
}

.dash__agents-feedback-inline {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(85, 198, 190, 0.06);
  border-left: 2px solid var(--c-primary);
  font-size: 12px;
  font-style: italic;
  color: var(--c-dark);
  line-height: 1.4;
}

.dash__agents-feedback-inline svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--c-primary);
}

.dash__agents-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(16, 41, 63, 0.06);
}

.dash__agents-pager-btn {
  border: 1px solid rgba(16, 41, 63, 0.12);
  border-radius: 6px;
  background: #fff;
  padding: 5px 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-dark);
  cursor: pointer;
  transition: all 0.2s;
}

.dash__agents-pager-btn:hover:not(:disabled) {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.dash__agents-pager-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.dash__agents-pager-info {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-muted);
}

.dash__agents-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(16, 41, 63, 0.12);
  border-radius: 8px;
  background: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-dark);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}

.dash__agents-back:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  box-shadow: 0 2px 8px rgba(85, 198, 190, 0.1);
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .sidebar.is-open { display: flex; width: 260px; }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 150; }
  .topbar { display: flex; }
  .tabs--mobile { display: flex; }
  .main-wrap { margin-left: 0; }
  .status-header { padding: 8px 16px; }
  .main { padding: 20px 16px 48px; }
  .main__title-row { flex-direction: column; }
  .suggestions-grid { grid-template-columns: 1fr; }
  .users__item { flex-direction: column; align-items: flex-start; }
  .users__actions { align-self: flex-end; }
}


/* ══ Login ══ */

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

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 48px 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card__logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-card__logo img {
  height: 80px;
  width: 80px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.login-card__title {
  font-size: 22px;
  font-weight: 800;
  color: #10293f;
  text-align: center;
  margin: 0 0 4px;
}

.login-card__sub {
  font-size: 13px;
  color: #64748b;
  text-align: center;
  margin: 0 0 28px;
}

.login-field {
  margin-bottom: 18px;
}

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #10293f;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-input-wrap {
  position: relative;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
}

.login-input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.login-input-wrap input:focus {
  border-color: #55c6be;
  box-shadow: 0 0 0 3px rgba(85, 198, 190, 0.15);
}

.login-input-wrap input::placeholder {
  color: #8896a4;
}

.login-error {
  color: #e36860;
  font-size: 13px;
  font-weight: 600;
  min-height: 20px;
  margin: 0 0 8px;
  text-align: center;
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: #55c6be;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  box-shadow: 0 4px 14px rgba(85, 198, 190, 0.3);
}

.login-btn:hover {
  background: #47b5ad;
  box-shadow: 0 6px 20px rgba(85, 198, 190, 0.4);
}

.login-btn:active {
  transform: scale(0.98);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-card__footer {
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  margin: 24px 0 0;
}

/* ── About section ── */

.login-about {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 440px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 18px 22px;
  opacity: 0;
  transform: translateY(10px);
  animation: aboutSlide 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.6s forwards;
}

@keyframes aboutSlide {
  to { opacity: 1; transform: translateY(0); }
}

.login-about__desc {
  font-size: 11.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.38);
  margin: 0 0 14px;
  letter-spacing: 0.01em;
}

.login-about__desc strong {
  color: rgba(85, 198, 190, 0.75);
  font-weight: 600;
}

.login-about__pills {
  display: flex;
  gap: 6px;
}

.login-about__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.login-about__pill svg {
  color: rgba(85, 198, 190, 0.5);
}

@media (max-width: 768px) {
  .login-wrap {
    flex-direction: column;
    gap: 0;
  }
  .login-about {
    position: static;
    width: 100%;
    max-width: 400px;
    margin: 24px auto 0;
    text-align: center;
  }
  .login-about__pills {
    justify-content: center;
  }
}

/* ══ NPS ══ */

.nps-app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  padding: 24px 16px;
}

/* ══ Card ══ */

.nps-card {
  background: var(--c-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  animation: nps-fadeUp 0.5s ease-out both;
}

.nps-card--hidden {
  display: none;
}

@keyframes nps-fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nps-card__body {
  padding: 32px 28px;
}

/* ══ Brand ══ */

.nps-card__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 28px 0;
}

.nps-card__logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--c-primary), #3ba8a0);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
}

.nps-card__brand-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--c-dark);
  letter-spacing: -0.3px;
}

/* ══ Typography ══ */

.nps-card__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--c-dark);
  letter-spacing: -0.4px;
}

.nps-card__title--sm {
  font-size: 18px;
}

.nps-card__subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--c-text-muted);
  line-height: 1.5;
}

/* ══ Score scale ══ */

.nps-scale {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.nps-score {
  width: 42px;
  height: 42px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: var(--c-text);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nps-score:hover {
  border-color: var(--c-primary);
  background: rgba(85, 198, 190, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--c-primary-glow);
}

.nps-score--detractor { border-color: var(--c-accent); background: rgba(227, 104, 96, 0.08); color: var(--c-accent); }
.nps-score--passive   { border-color: var(--c-highlight); background: rgba(247, 188, 97, 0.08); color: #c8910a; }
.nps-score--promoter  { border-color: var(--c-primary); background: rgba(85, 198, 190, 0.1); color: #2a9d8f; }

.nps-score--selected {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 6px 20px var(--c-primary-glow);
}
.nps-score--selected.nps-score--detractor { background: var(--c-accent); color: #fff; box-shadow: 0 6px 20px rgba(227,104,96,0.35); }
.nps-score--selected.nps-score--passive   { background: var(--c-highlight); color: #fff; box-shadow: 0 6px 20px rgba(247,188,97,0.35); }
.nps-score--selected.nps-score--promoter  { background: var(--c-primary); color: #fff; box-shadow: 0 6px 20px var(--c-primary-glow); }

.nps-scale__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
  color: var(--c-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ══ Feedback step ══ */

.nps-feedback__emoji {
  font-size: 42px;
  margin-bottom: 12px;
}

.nps-field {
  position: relative;
  margin-bottom: 20px;
}

.nps-textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--c-text);
  resize: vertical;
  transition: border-color 0.2s;
  line-height: 1.5;
}

.nps-textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-glow);
}

.nps-textarea::placeholder {
  color: var(--c-text-muted);
}

.nps-field__count {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 11px;
  color: var(--c-text-muted);
  pointer-events: none;
}

/* ══ Actions ══ */

.nps-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.nps-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nps-btn--primary {
  background: linear-gradient(135deg, var(--c-primary), #3ba8a0);
  color: #fff;
  box-shadow: 0 4px 14px var(--c-primary-glow);
}

.nps-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--c-primary-glow);
}

.nps-btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.nps-btn--ghost {
  background: transparent;
  color: var(--c-text-muted);
  padding: 10px 14px;
}

.nps-btn--ghost:hover {
  color: var(--c-text);
  background: rgba(0, 0, 0, 0.04);
}

.nps-skip {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  background: none;
  border: none;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: var(--c-text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.nps-skip:hover {
  color: var(--c-text);
}

/* ══ Thank you ══ */

.nps-thanks {
  text-align: center;
  padding: 48px 28px;
}

.nps-thanks__check {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  color: var(--c-primary);
}

.nps-thanks__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: nps-circle 0.6s 0.2s ease-out forwards;
}

.nps-thanks__tick {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: nps-tick 0.4s 0.7s ease-out forwards;
}

@keyframes nps-circle {
  to { stroke-dashoffset: 0; }
}

@keyframes nps-tick {
  to { stroke-dashoffset: 0; }
}

.nps-thanks__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(85, 198, 190, 0.1);
  color: #2a9d8f;
  font-size: 13px;
  font-weight: 600;
}

/* ══ Footer ══ */

.nps-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

/* ══ Loading state ══ */

.nps-btn--loading {
  pointer-events: none;
  position: relative;
  color: transparent !important;
}

.nps-btn--loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: nps-spin 0.6s linear infinite;
}

@keyframes nps-spin {
  to { transform: rotate(360deg); }
}

/* ══ Mobile ══ */

@media (max-width: 480px) {
  .nps-app { padding: 16px 10px; }
  .nps-card__body { padding: 24px 18px; }
  .nps-card__brand { padding: 16px 18px 0; }
  .nps-card__title { font-size: 19px; }
  .nps-score { width: 36px; height: 36px; font-size: 13px; border-radius: 8px; }
  .nps-scale { gap: 4px; }
  .nps-actions { flex-direction: column-reverse; }
  .nps-btn { justify-content: center; }
}
