/**
 * TelccFree — Modern dashboard navbar (single-row, responsive)
 */

:root {
  --telc-nav-h: 56px;
  --telc-nav-bg: rgba(255, 255, 255, 0.94);
  --telc-nav-border: rgba(226, 232, 240, 0.95);
  --telc-nav-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 4px 20px rgba(15, 23, 42, 0.06);
}

body.telc-dashboard-page {
  padding-top: calc(var(--telc-nav-h) + 3px);
}

body.telc-dashboard-page > .telc-exercise-topbar {
  display: none !important;
}

/* ── Shell ── */
.navbar,
.navbar.telc-navbar__inner {
  position: fixed;
  top: 3px;
  left: 0;
  right: 0;
  z-index: 2000;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.75rem !important;
  width: 100%;
  max-width: 100%;
  min-height: var(--telc-nav-h);
  height: var(--telc-nav-h);
  margin: 0;
  padding: 0 1rem;
  box-sizing: border-box;
  background: var(--telc-nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--telc-nav-border);
  box-shadow: var(--telc-nav-shadow);
  overflow: visible;
}

@media (min-width: 768px) {
  .navbar,
  .navbar.telc-navbar__inner {
    padding: 0 1.5rem;
  }
}

/* ── Brand (left) ── */
.navbar-brand,
.telc-navbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(58vw, 360px);
  margin: 0;
  text-decoration: none;
  color: inherit;
}

.telc-brand-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.12rem;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(56vw, 340px);
}

.telc-brand-stack .navbar-brand,
.telc-brand-stack .telc-navbar__brand {
  max-width: 100%;
}

body.telc-dashboard-page .navbar,
body.telc-dashboard-page .navbar.telc-navbar__inner {
  min-height: calc(var(--telc-nav-h) + 10px);
  height: auto;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

body.telc-dashboard-page {
  padding-top: calc(var(--telc-nav-h) + 14px);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e91e8c, #1976d2);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  box-shadow: 0 4px 12px -6px rgba(25, 90, 200, 0.5);
}

.brand-copy {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.05rem;
  min-width: 0;
  line-height: 1.15;
}

.brand-name {
  font-family: "Poppins", "Inter", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #1a2b4a;
  white-space: nowrap;
}

html.dark .brand-name,
body.dark .brand-name {
  color: #f3f6fb;
}

.brand-level {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  background: linear-gradient(135deg, #e91e8c, #1976d2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (min-width: 640px) {
  .brand-badge {
    font-size: 12px;
    height: 30px;
    padding: 0 12px;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .brand-name {
    font-size: 0.84rem;
  }

  .brand-level {
    font-size: 0.9rem;
  }
}

@media (max-width: 420px) {
  .brand-level {
    display: none;
  }
}

/* ── Actions (right) ── */
.navbar-actions.telc-header-utils {
  display: flex;
  flex: 0 1 auto !important;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  margin: 0 0 0 auto;
  padding: 0;
  width: auto !important;
  min-width: 0;
  flex-wrap: nowrap !important;
}

.telc-navbar__controls {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem;
  min-width: 0;
}

@media (min-width: 640px) {
  .telc-navbar__controls {
    gap: 0.5rem;
  }
}

/* Search */
.navbar-actions .telc-dashboard-search-wrap,
.navbar-actions .telc-search-wrap {
  order: 0;
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: 9rem;
}

.navbar-actions .telc-search-field {
  display: block !important;
  position: relative;
  width: 100%;
  max-width: 9rem;
}

.navbar-actions .telc-search-input {
  height: 34px;
  padding: 0 0.65rem 0 2rem;
  font-size: 0.8125rem;
  border-radius: 10px;
}

.navbar-actions .telc-search-field__icon {
  padding-left: 0.55rem;
}

@media (min-width: 640px) {
  .navbar-actions .telc-dashboard-search-wrap,
  .navbar-actions .telc-search-wrap {
    max-width: 11rem;
  }

  .navbar-actions .telc-search-field {
    max-width: 11rem;
  }

  .navbar-actions .telc-dashboard-search-wrap:focus-within,
  .navbar-actions .telc-search-wrap:focus-within {
    max-width: 14rem;
  }

  .navbar-actions .telc-search-field:focus-within {
    max-width: 14rem;
  }

  .navbar-actions .telc-search-input {
    height: 36px;
    font-size: 0.875rem;
  }
}

/* Language */
.navbar-actions .telc-lang-mount,
.navbar-actions .telc-lang-mount--navbar {
  display: inline-flex;
  flex-shrink: 0;
}

.navbar-actions .telc-lang-trigger {
  min-height: 34px;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 10px;
}

@media (min-width: 640px) {
  .navbar-actions .telc-lang-trigger {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Theme toggle */
.navbar-actions .telc-theme-capsule,
.navbar-actions #telcThemeToggle {
  width: 34px;
  height: 34px;
  margin: 0 !important;
  flex-shrink: 0;
  cursor: pointer;
}

.navbar-actions .telc-theme-capsule__track {
  min-width: 34px;
  min-height: 34px;
  width: 34px;
  height: 34px;
  padding: 3px;
  border-radius: 10px;
}

.navbar-actions .telc-theme-capsule__btn {
  width: 26px;
  height: 26px;
  font-size: 13px;
}

@media (min-width: 640px) {
  .navbar-actions .telc-theme-capsule,
  .navbar-actions #telcThemeToggle {
    width: 36px;
    height: 36px;
  }

  .navbar-actions .telc-theme-capsule__track {
    min-width: 36px;
    min-height: 36px;
    width: 36px;
    height: 36px;
  }

  .navbar-actions .telc-theme-capsule__btn {
    width: 28px;
    height: 28px;
  }
}

/* Portal / home button */
.navbar-actions .telc-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
  height: 34px;
  padding: 0 0.65rem;
  margin: 0;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid rgba(37, 99, 235, 0.18);
  box-shadow: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.navbar-actions .telc-home-btn .fa-house,
.navbar-actions .telc-home-btn i[class*="fa-house"] {
  font-size: 0.95em;
  color: inherit;
}

.navbar-actions .telc-home-btn:hover {
  background: #dbeafe;
  border-color: rgba(37, 99, 235, 0.35);
  color: #1d4ed8;
  transform: translateY(-1px);
}

.navbar-actions .telc-home-btn:active {
  transform: translateY(0);
  background: #bfdbfe;
}

@media (min-width: 640px) {
  .navbar-actions .telc-home-btn {
    height: 36px;
    padding: 0 0.875rem;
    gap: 0.5rem;
    font-size: 13px;
    font-weight: 700;
    border-radius: 12px;
  }
}

@media (max-width: 420px) {
  .navbar-actions .telc-home-btn span.telc-home-btn__label,
  .navbar-actions .telc-home-btn:not([data-telc-portal]) {
    /* keep icon + short label */
  }

  .navbar-actions .telc-lang-label {
    display: none;
  }
}

/* Hero offset under fixed nav */
body.telc-dashboard-page .hero {
  margin-top: 0 !important;
  padding-top: 1rem;
}

html.dark .navbar,
html.dark .navbar.telc-navbar__inner {
  background: rgba(15, 23, 42, 0.94);
  border-bottom-color: rgba(51, 65, 85, 0.85);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.28);
}

html.dark .navbar-actions .telc-home-btn {
  background: rgba(30, 58, 138, 0.35);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.22);
}

html.dark .navbar-actions .telc-home-btn:hover {
  background: rgba(30, 64, 175, 0.45);
  color: #bfdbfe;
}

@media (max-width: 767px) {
  body.telc-dashboard-page {
    padding-top: calc(var(--telc-nav-h) + 52px);
  }

  body.telc-dashboard-page .navbar,
  body.telc-dashboard-page .navbar.telc-navbar__inner {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0.4rem;
    height: auto !important;
    min-height: 0;
    padding: 0.45rem 0.75rem 0.5rem;
    flex-wrap: unset !important;
  }

  .telc-brand-stack {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    align-items: center;
    max-width: none;
    min-width: 0;
  }

  .telc-brand-stack .telc-brand-telegram,
  .navbar > .telc-brand-telegram {
    display: none;
  }

  .navbar-actions.telc-header-utils {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    width: auto !important;
  }

  .telc-navbar__controls {
    gap: 0.3rem;
  }

  .navbar-actions .telc-dashboard-search-wrap,
  .navbar-actions .telc-search-wrap {
    display: none;
  }

  .telc-navbar__row2 {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    width: 100%;
  }

  .telc-navbar__row2 .telc-dashboard-search-wrap,
  .telc-navbar__row2 .telc-search-wrap {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }

  .telc-navbar__row2 .telc-search-field {
    max-width: none;
    width: 100%;
  }

  .telc-navbar__row2 .telc-brand-telegram,
  .telc-navbar__row2 [data-telc-tg-cta] {
    display: inline-flex;
    flex: 0 0 auto;
    height: 34px;
    padding: 0 0.7rem;
    font-size: 0.75rem;
  }

  .telc-navbar__row2 .telc-brand-telegram__ar {
    display: none;
  }

  .navbar-actions .telc-home-btn .telc-home-btn__label {
    display: none;
  }

  .navbar-actions .telc-home-btn {
    width: 34px;
    padding: 0;
  }
}

@media (min-width: 768px) {
  .telc-navbar__row2 {
    display: none;
  }
}
