:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --border: #d8dee8;
  --text: #1a2332;
  --muted: #5c6b7f;
  --accent: #2563eb;
  --accent-dim: #1d4ed8;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --ok: #059669;
  --scrollbar-size: 6px;
  --scrollbar-thumb: rgba(0, 0, 0, 0.16);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 0.24);
  --app-safe-top: 0px;
  --app-safe-bottom: 0px;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
  overflow-y: scroll;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Kaydirma cubuklari: ince, acik gri; mobilde her zaman gorunur */
*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

/* Masaustu: cubuk yalnizca kaydirilabilir alanin uzerine gelince */
@media (hover: hover) and (pointer: fine) {
  * {
    scrollbar-color: transparent transparent;
  }

  *::-webkit-scrollbar-thumb {
    background: transparent;
    transition: background 0.15s ease;
  }

  *:hover {
    scrollbar-color: var(--scrollbar-thumb) transparent;
  }

  *:hover::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
  }

  *:hover::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
  }
}

#app {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-boot-loading {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
}

.app-boot-loading__text {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
  width: 100%;
  background: var(--surface);
  box-sizing: border-box;
}

/* Yukleme ve mobil shell: ust guvenli alan */
html.app--safe-top #app {
  padding-top: 0;
  box-sizing: border-box;
}

html.app--safe-top .app-boot-loading {
  padding-top: var(--app-safe-top);
  box-sizing: border-box;
}

.app-topbar__push-dot {
  position: absolute;
  top: 0.4rem;
  right: 0.45rem;
  z-index: 3;
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 2px var(--surface);
  cursor: pointer;
}

.app-topbar__inner {
  display: flex;
  align-items: center;
  column-gap: 2rem;
  row-gap: 0.5rem;
  width: 100%;
  max-width: none;
  padding: 0.55rem 1rem;
  box-sizing: border-box;
  min-height: 3.25rem;
}

.app-topbar__brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.app-topbar__brand:hover .app-topbar__hive,
.app-topbar__brand:hover .app-topbar__wordmark-text {
  color: var(--accent);
}

.app-topbar__brand:hover .app-topbar__brand-mark {
  border-color: rgba(37, 99, 235, 0.65);
}

.app-topbar__brand-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.2rem;
  margin-right: 0.35rem;
  border: 1px solid #1e293b;
  border-radius: 6px;
  line-height: 0;
  background: #0f172a;
  box-sizing: border-box;
}

.app-topbar__brand-mark-img {
  display: block;
  height: 1.35rem;
  width: auto;
  max-width: 1.75rem;
  object-fit: contain;
}

.app-topbar__wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.app-topbar__wordmark-text {
  color: inherit;
}

.app-topbar__hive {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.app-topbar__tabs {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0 0 0 200px;
}

.app-topbar__hint {
  align-self: center;
  padding: 0.35rem 0.5rem;
  margin: 0;
}

.app-topbar__actions {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.app-page {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem clamp(1rem, 2.5vw, 1.5rem) 4rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.btn-icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  color: var(--muted);
  line-height: 1;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-icon-circle:hover {
  background: #e5e7eb;
  color: var(--text);
}

.btn-icon-circle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.main-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  flex-wrap: nowrap;
  align-items: center;
}

.main-tabs button,
.main-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: transparent;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
  text-decoration: none;
}

.main-tabs button:hover,
.main-tabs a:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.03);
}

.main-tabs button.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.main-tabs button i,
.main-tabs a i {
  font-size: 0.8rem;
}

.main-tabs__label {
  display: inline;
}

.main-tabs__label-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.main-tabs__icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.main-tabs__badge {
  position: absolute;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.22rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
}

.main-tabs__badge--icon {
  display: none;
  top: -0.42rem;
  right: -0.5rem;
}

.main-tabs__badge--label {
  top: -0.55rem;
  right: -0.45rem;
}

.main-tabs button.main-tabs__item--mobile-only {
  display: none;
}

.app-topbar__actions--desktop-only {
  display: inline-flex;
}

.whatsapp-thread-back {
  display: none;
}

.tab-panel--profile {
  display: none;
}

.tab-panel {
  background: var(--surface);
  padding: 0;
  margin-bottom: 2rem;
}

.tab-panel > .page-head {
  padding-top: 2rem;
}

.tab-panel--settings {
  text-align: left;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 1.75rem;
}

.page-head__start {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
}

.page-head__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--muted);
}

.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.tab-panel--settings-logs .page-head {
  flex: 0 0 auto;
  margin-bottom: 1rem;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(12.5rem, 15rem) minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0 1rem 0.5rem 0;
  margin: 0;
  border-right: 1px solid var(--border);
}

.settings-nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem 0.5rem 0.7rem;
  background: transparent;
  color: var(--muted);
  border: none;
  border-left: 3px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.settings-nav button:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

.settings-nav button.active {
  color: var(--text);
  background: rgba(37, 99, 235, 0.08);
  border-left-color: var(--accent);
}

.settings-panels {
  padding: 0 0 0 1.25rem;
  min-width: 0;
}

.settings-group {
  min-width: 0;
}

.tab-panel--settings-logs {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  height: calc(100vh - 7.5rem);
}

.tab-panel--settings-logs .page-head {
  flex: 0 0 auto;
}

.tab-panel--settings-logs .settings-layout {
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
  height: 100%;
}

.tab-panel--settings-logs .settings-panels {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.tab-panel--settings-logs .settings-group--logs {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.tab-panel--settings-logs .app-log-field {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  margin-top: 0;
}

.tab-panel--settings-logs .app-log-field > .hint {
  flex: 0 0 auto;
}

.tab-panel--settings-logs .app-log-head {
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  input,
  textarea,
  select {
    font-size: 16px;
  }

  .tab-panel--settings-logs {
    height: calc(100vh - 10rem - var(--app-safe-bottom));
  }

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

  .settings-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0.85rem 0.25rem;
    margin: 0 -0.85rem 0.5rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    gap: 1.25rem;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 0.85rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }

  .settings-nav::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .settings-nav button {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    padding: 0.55rem 0.6rem;
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .settings-nav button.active {
    background: transparent;
    border-left: none;
    border-bottom-color: var(--accent);
  }

  .settings-panels {
    padding: 1rem 0 0;
  }
}

.telegram-learned-chat {
  margin-bottom: 1.5rem;
}

.telegram-learned-chat-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.telegram-learned-count {
  color: var(--muted);
  font-weight: 400;
}

.telegram-learned-note-cell {
  white-space: pre-wrap;
  word-break: break-word;
}

.panel-table-wrap {
  overflow-x: auto;
}

code.mono {
  background: rgba(0, 0, 0, 0.04);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}

/* ----------- Ders programi (schedule) ----------- */

.schedule-table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  table-layout: fixed;
}

.schedule-table thead th {
  background: #f7f9fc;
  text-align: center;
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.4rem;
  font-weight: 600;
  color: var(--text);
}

.schedule-table tbody td,
.schedule-table tbody th {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: top;
}

.schedule-table tbody td:last-child,
.schedule-table thead th:last-child {
  border-right: none;
}

.schedule-hour-col {
  width: 4.5rem;
  background: #f7f9fc;
  text-align: center;
  vertical-align: middle !important;
  font-weight: 600;
  color: var(--muted);
  border-right: 1px solid var(--border);
}

.schedule-day-name {
  font-size: 0.85rem;
}

.schedule-day-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-height: 2.5rem;
  text-align: center;
}

.schedule-ctx-menu {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  min-width: 13rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  text-align: left;
}

.schedule-ctx-menu > li {
  margin: 0;
  padding: 0;
  text-align: left;
}

.schedule-ctx-menu__item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
}

.schedule-ctx-menu__item > span {
  flex: 1 1 auto;
  text-align: left;
}

.schedule-ctx-menu__item .fa-fw {
  flex: 0 0 1.1rem;
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  text-align: left;
  color: var(--muted);
}

.schedule-ctx-menu__item--danger .fa-fw {
  color: var(--danger);
}

.schedule-ctx-menu__item--danger:not(:disabled):hover {
  background: #fef2f2;
}

.schedule-ctx-menu__item--danger:not(:disabled):hover .fa-fw {
  color: var(--danger-hover);
}

.schedule-btn-danger {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
}

.schedule-btn-danger:hover:not(:disabled) {
  background: var(--danger-hover) !important;
  border-color: var(--danger-hover) !important;
}

.analytics-toolbar-row {
  margin-bottom: 1rem;
  align-items: center;
  gap: 0.75rem 1rem;
}

.analytics-stat-pill {
  display: inline-block;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
}

.analytics-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.analytics-section-head .analytics-report-section-title {
  margin: 0;
}

.analytics-section-head .side-subtitle {
  margin: 0;
}

.analytics-stat-pill strong {
  color: var(--text);
  font-weight: 600;
}

.analytics-toolbar-row .panel-section-title {
  flex: 0 0 auto;
  margin-right: 0.25rem;
}

.analytics-toolbar__filters {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.analytics-toolbar__select {
  min-width: 8.5rem;
}

.analytics-toolbar__actions {
  margin-left: auto;
  align-items: center;
  flex-wrap: nowrap;
}

.analytics-filter-label {
  margin-left: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.split-dropdown {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  vertical-align: middle;
}

.split-dropdown .btn-secondary.split-dropdown__main {
  border-radius: 6px 0 0 6px;
}

.split-dropdown .btn-secondary.split-dropdown__caret {
  margin-left: -1px;
  border-radius: 0 6px 6px 0;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  min-width: 2rem;
}

.split-dropdown__menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 2px;
  min-width: 12rem;
  max-height: 14rem;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 5;
  list-style: none;
  padding: 0.35rem 0;
  margin: 0;
}

.split-dropdown__menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.85rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text);
}

.split-dropdown__menu-item:hover {
  background: #f1f5f9;
}

.analytics-meta {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
}

.analytics-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-top: 1.5rem;
}

.analytics-dblclick-hint {
  margin: 0;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.reports-breadcrumb {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  margin-bottom: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  min-width: 0;
  flex: 1 1 auto;
}

.reports-report-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
}

.reports-mobile-back {
  display: none;
}

.reports-report-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}

.reports-report-actions .split-dropdown {
  flex-shrink: 0;
}

.overnight-stay-date-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
}

.overnight-stay-date-input {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.overnight-stay-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-bottom: 1rem;
}

.overnight-stay-section + .overnight-stay-section {
  margin-top: 1.25rem;
}

.overnight-stay-range-hint {
  white-space: nowrap;
}

.overnight-stay-missing-hint {
  margin-bottom: 0.75rem;
}

.overnight-stay-row--clickable {
  cursor: pointer;
}

.overnight-stay-cikis-yok {
  color: var(--danger, #c0392b);
  font-weight: 600;
}

.overnight-stay-issue-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.overnight-stay-issue-tag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--surface-muted, rgba(0, 0, 0, 0.06));
  color: var(--text-muted, #666);
}

.panel-root--overnight-stay-detail .side-panel {
  max-width: min(560px, 100vw);
}

.panel-root--overnight-stay-detail .side-panel-body.overnight-stay-detail-body {
  overflow: hidden;
}

.overnight-stay-detail-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  overflow: hidden;
}

.overnight-stay-detail-anomalies {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.overnight-stay-detail-anomalies .analytics-report-section-title {
  flex-shrink: 0;
  margin: 0;
}

.overnight-stay-detail-anomalies__grid {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: auto;
  margin: 0;
}

.overnight-stay-detail-gc {
  flex: 0 0 auto;
  min-height: 0;
}

.overnight-stay-detail-gc .analytics-report-section-title {
  margin-top: 0;
}

.overnight-stay-detail-user {
  margin: 0.15rem 0 0;
  font-weight: 600;
}

.overnight-stay-detail-gc-range {
  margin: 0 0 0.5rem;
}

.reports-breadcrumb__link {
  display: inline;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  box-shadow: none;
  appearance: none;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-weight: 400;
}

.reports-breadcrumb__link:hover {
  text-decoration: underline;
}

.reports-breadcrumb__sep {
  color: var(--muted);
  user-select: none;
}

.reports-breadcrumb__current {
  color: var(--text);
  font-weight: 500;
}

.reports-file-grid {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.5rem 1.25rem;
  margin-top: 0.75rem;
  padding: 0.25rem 0;
}

.reports-file-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 6.5rem;
  padding: 0.625rem 0.375rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  background: transparent;
  cursor: pointer;
  text-align: center;
  outline: none;
  transition: background 0.12s, border-color 0.12s;
}

.reports-file-tile:hover,
.reports-file-tile:focus-visible {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.2);
}

.reports-file-tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.75rem;
  font-size: 2.75rem;
  color: #d4a017;
  line-height: 1;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.06));
}

.reports-file-tile__name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 0.35rem;
  width: 100%;
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--text);
  word-break: break-word;
}

.reports-file-tile__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.35rem);
  transform: translateX(-50%);
  z-index: 20;
  min-width: 11rem;
  max-width: 16rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s, visibility 0.12s;
}

.reports-file-tile:hover .reports-file-tile__tip,
.reports-file-tile:focus-visible .reports-file-tile__tip {
  opacity: 1;
  visibility: visible;
}

.reports-file-tile__tip-line {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text);
}

.reports-file-tile__tip-line + .reports-file-tile__tip-line {
  margin-top: 0.35rem;
}

.reports-file-tile__tip-hint {
  color: var(--muted);
  font-size: 0.6875rem;
}

.reports-ctx-menu {
  min-width: 9.5rem;
}

.analytics-report-section-title {
  margin-top: 0;
}

.analytics-report-table-wrap + .analytics-report-section-title {
  margin-top: 1.5rem;
}

.analytics-row-clickable {
  cursor: pointer;
}

.analytics-row-clickable:hover td {
  background: rgba(37, 99, 235, 0.06);
}

.analytics-detail-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}

.analytics-detail-subtitle {
  font-weight: 600;
  color: var(--text);
}

.analytics-detail-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100vh - 14rem);
  overflow: auto;
}

.analytics-detail-table-wrap .analytics-detail-table {
  font-size: 0.8125rem;
}

.analytics-detail-table-wrap .analytics-detail-table th,
.analytics-detail-table-wrap .analytics-detail-table td {
  white-space: nowrap;
  vertical-align: top;
}

.panel-root--fullscreen {
  z-index: 10055;
}

.panel-root--fullscreen .side-panel--fullscreen {
  position: fixed;
  inset: 0;
  width: 100% !important;
  max-width: 100% !important;
  height: 100vh;
  max-height: 100vh;
  transform: none !important;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  z-index: 10060;
}

.panel-root--fullscreen .side-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.panel-root--fullscreen .panel-table-wrap {
  max-height: none;
}

.panel-root--analytics-detail-fullscreen .side-panel--analytics-detail-fullscreen {
  position: fixed;
  inset: 0;
  width: 100% !important;
  max-width: 100% !important;
  height: 100vh;
  max-height: 100vh;
  transform: none !important;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  z-index: 10060;
}

.panel-root--analytics-detail-fullscreen .analytics-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-root--analytics-detail-fullscreen .side-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.panel-root--analytics-detail-fullscreen .analytics-detail-table-wrap {
  max-height: none;
  height: 100%;
}

.schedule-ctx-menu__item:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.08);
}

.schedule-ctx-menu__item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.schedule-day-date {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 400;
}

.schedule-day-holiday-name {
  font-size: 0.7rem;
  color: var(--danger);
  font-weight: 500;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-table thead th.schedule-day--holiday {
  background: #fef2f2;
}

.schedule-table thead th.schedule-day--today {
  background: rgba(37, 99, 235, 0.1);
}

.schedule-cell {
  position: relative;
  height: 3.4rem;
  padding: 0.3rem 0.3rem 1.6rem;
  background: #fff;
  transition: background 0.15s ease;
}

.schedule-cell:hover {
  background: rgba(37, 99, 235, 0.04);
}

.schedule-cell--holiday {
  background: #fff7f7;
}

.schedule-cell--holiday:hover {
  background: #fde8e8;
}

.schedule-entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: 100%;
  overflow: hidden;
}

.schedule-entry-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  box-sizing: border-box;
  background: rgba(37, 99, 235, 0.12);
  color: var(--text);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.schedule-entry-chip__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-entry-chip__instructor {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  letter-spacing: -0.03em;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.schedule-entry-chip--owner {
  padding-left: 0.3rem;
}

.schedule-filter-toolbar-btn {
  position: relative;
}

.schedule-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  margin-left: 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  line-height: 1;
  vertical-align: middle;
}

.schedule-filter-chips {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.schedule-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.75rem 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.schedule-filter-chip:hover {
  background: #f8fafc;
}

.schedule-filter-chip-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--instructor-color);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15);
}

.schedule-filter-chip-label {
  white-space: nowrap;
}

.schedule-filter-chip--active {
  border-width: 2px;
  border-color: var(--instructor-color);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08);
  background: #f8fafc;
}

.schedule-cell-action {
  position: absolute;
  bottom: 0.25rem;
  right: 0.25rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 0;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.schedule-cell-action--more {
  font-size: 0.85rem;
}

.schedule-cell-action:hover,
.schedule-cell-action:focus-visible {
  background: transparent;
  color: var(--accent);
  border: none;
}

.schedule-cell--holiday .schedule-cell-action {
  background: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .schedule-cell-action {
    opacity: 0;
    pointer-events: none;
  }

  .schedule-cell:hover .schedule-cell-action,
  .schedule-cell-action:focus-visible {
    opacity: 1;
    pointer-events: auto;
  }
}

.schedule-hour-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.25rem;
}

/* Mobil gun-bazli ajanda gorunumu (varsayilan: gizli, mobilde acilir) */
.schedule-mobile-view {
  display: none;
  touch-action: pan-y;
}

.schedule-mobile-agenda {
  touch-action: pan-y;
}

.schedule-day-chips {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.schedule-day-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.5rem 0.25rem;
  background: #f7f9fc;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  min-width: 0;
}

.schedule-day-chip-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
}

.schedule-day-chip-date {
  font-size: 1rem;
  font-weight: 600;
}

.schedule-day-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.schedule-day-chip.active .schedule-day-chip-name {
  color: rgba(255, 255, 255, 0.85);
}

.schedule-day-chip--today:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}

.schedule-day-chip--today:not(.active) .schedule-day-chip-name {
  color: var(--accent);
}

.schedule-day-chip--holiday:not(.active) {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.schedule-day-chip--holiday:not(.active) .schedule-day-chip-name {
  color: #991b1b;
}

.schedule-mobile-day-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.schedule-mobile-hour-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.schedule-mobile-hour-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.schedule-mobile-hour-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

  border-bottom: none;
}

.schedule-mobile-hour-row--holiday {
  background: #fff7f7;
}

.schedule-mobile-hour-label {
  flex: 0 0 3.5rem;
  font-weight: 600;
  color: var(--muted);
}

.schedule-mobile-hour-entries {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.schedule-mobile-cell-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  border: none;
  width: auto;
  height: auto;
  min-width: auto;
  padding: 0.15rem;
  border-radius: 0;
  font: inherit;
  font-size: 0.95rem;
  box-shadow: none;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.schedule-mobile-cell-btn--more {
  font-size: 1rem;
}

.schedule-mobile-cell-btn:hover {
  background: transparent;
  color: var(--accent);
  border: none;
}

.schedule-mobile-hour-row--active .schedule-mobile-cell-btn--more {
  color: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  .schedule-mobile-cell-btn {
    opacity: 0;
    pointer-events: none;
  }

  .schedule-mobile-hour-line:hover .schedule-mobile-cell-btn,
  .schedule-mobile-cell-btn:focus-visible {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 720px) {
  .schedule-hour-fields {
    grid-template-columns: 1fr;
  }
}

/* ----------- Side panel (panel-root + soldan) ----------- */

.panel-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.panel-root--schedule-entries {
  z-index: 1010;
}

.panel-root--schedule-form {
  z-index: 1011;
}

.panel-root--schedule-owner-picker {
  z-index: 1015;
}

.panel-root--portal-user {
  z-index: 1008;
}

.panel-root--portal-user-hard-delete {
  z-index: 1009;
}

.panel-root--erp-member {
  z-index: 1016;
}

.panel-root--schedule-filter {
  z-index: 1007;
}

.panel-root--guest-passages {
  z-index: 1012;
}

.panel-root--erp-giris-cikis {
  z-index: 1013;
}

.panel-root--guest-passages .side-panel.side-panel--guest-passages {
  width: min(560px, 100vw);
}

.panel-root--erp-giris-cikis .side-panel.side-panel--erp-giris-cikis {
  width: min(520px, 100vw);
}

.erp-giris-cikis-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin: 0 0 0.5rem;
}

.erp-giris-cikis-toolbar .field {
  margin: 0;
}

.erp-giris-cikis-field-inline {
  flex: 0 1 auto;
  min-width: 9rem;
}

.erp-giris-cikis-hint {
  flex-shrink: 0;
  margin-bottom: 0.75rem;
}

.erp-giris-cikis-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.erp-giris-cikis-body > .hint {
  flex-shrink: 0;
}

.erp-giris-cikis-toolbar {
  flex-shrink: 0;
}

.erp-giris-cikis-header-user {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.erp-giris-cikis-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: auto;
}

.erp-giris-cikis-row--inside {
  background: rgba(22, 163, 74, 0.06);
}

.erp-giris-cikis-status {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  background: #f3f4f6;
  color: #4b5563;
}

.erp-giris-cikis-status--inside {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.guest-passages-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin: 0 0 0.5rem;
}

.guest-passages-toolbar .field {
  margin-bottom: 0;
}

.guest-passages-toolbar label {
  padding-top: 0;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.guest-passages-field-inline {
  flex: 0 0 auto;
  min-width: 0;
}

.guest-passages-field-inline input[type="date"] {
  min-width: 11rem;
}

.guest-passages-field-grow {
  flex: 1 1 200px;
  min-width: 0;
}

.guest-passages-refresh {
  flex-shrink: 0;
}

.guest-passages-hint {
  margin: 0 0 0.65rem;
}

.side-panel-header--guest-passages {
  align-items: flex-start;
}

.side-panel-header--guest-passages .side-panel-header-actions {
  padding-top: 0.15rem;
}

.guest-passages-header-instr {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
}

.guest-passages-table-wrap .guest-passages-table {
  width: 100%;
  table-layout: fixed;
}

.guest-passages-table-wrap .guest-passages-table th,
.guest-passages-table-wrap .guest-passages-table td {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.guest-passages-table-wrap .guest-passages-table td.mono {
  word-break: break-all;
}

.panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
}

.side-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(480px, 100vw);
  max-width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
  transition: transform 0.22s ease;
}

.side-panel.side-panel--picker {
  width: min(460px, 100vw);
}

.side-panel.side-panel--schedule-owner-picker {
  width: min(420px, 100vw);
}

.side-panel.side-panel--erp-member {
  width: min(460px, 100vw);
}

.schedule-owner-lookup {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.schedule-owner-lookup input {
  flex: 1 1 auto;
  min-width: 0;
  background: #f8fafc;
  color: var(--text);
  cursor: default;
}

.schedule-owner-lookup__open {
  flex: 0 0 auto;
  min-width: 2.5rem;
  padding: 0 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.schedule-owner-lookup__open:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.schedule-owner-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.schedule-owner-picker-row {
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.schedule-owner-picker-row:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.04);
}

.schedule-owner-picker-row--active {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  font-weight: 600;
}

.panel-enter-active .side-panel,
.panel-leave-active .side-panel {
  transition: transform 0.28s ease !important;
}

.panel-enter-from .side-panel,
.panel-leave-to .side-panel {
  transform: translateX(100%) !important;
}

.panel-enter-active .panel-backdrop,
.panel-leave-active .panel-backdrop {
  transition: opacity 0.28s ease;
}

.panel-enter-from .panel-backdrop,
.panel-leave-to .panel-backdrop {
  opacity: 0;
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.side-panel-header h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.side-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

.panel-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.panel-header-icon:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.side-panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1.25rem 1.5rem 2rem;
}

.side-subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.side-subtitle:first-of-type {
  margin-top: 0;
}

.side-panel-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.tbl-pick-actions {
  width: 2.25rem;
  padding: 0.25rem 0.4rem;
}

.btn-row-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-row-dots:hover {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
}

.settings-secret-fieldline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.15rem 0.5rem;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
  box-sizing: border-box;
  min-height: 2.35rem;
}

.settings-secret-fieldline:focus-within {
  border-bottom-color: var(--accent);
}

.settings-secret-fieldline__lock {
  flex-shrink: 0;
  width: 1.35rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1;
}

.settings-secret-fieldline__mask {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  color: var(--text);
  line-height: 1.35;
}

.settings-secret-fieldline__menu {
  flex-shrink: 0;
}

.entry-actions-cell.tbl-pick-actions {
  width: 3rem;
  min-width: 3rem;
  vertical-align: middle;
  text-align: center;
}

.entry-actions-wrap {
  position: relative;
  display: inline-flex;
  justify-content: center;
  width: 100%;
}

.entry-actions-kebab:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
}

/* Kayit islemleri yan paneli */
.panel-root--entry-actions {
  z-index: 1022;
}

.panel-root--entry-actions .side-panel.side-panel--entry-actions {
  width: min(400px, 100vw);
}

.entry-actions-panel-who {
  margin: 0 0 1rem;
  padding: 0.65rem 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.entry-actions-panel-who-phone {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.entry-actions-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.entry-actions-panel-delete {
  color: var(--danger) !important;
  border-color: rgba(220, 38, 38, 0.35) !important;
}

.entries-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 0.75rem;
}

.entries-toolbar .toolbar-actions {
  margin-left: auto;
}

.entries-count {
  color: var(--muted);
  font-weight: 400;
  margin-left: 0.25rem;
}

.panel-root--schedule-entries .panel-table-wrap td.entries-col-owner {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Kayitlar tablosu: uzun ad veya telefon tabloyu genisletip yatay scroll cikarmasin */
.panel-root--schedule-entries .panel-table-wrap {
  overflow-x: hidden;
  max-width: 100%;
  min-width: 0;
}

.panel-root--schedule-entries .panel-table-wrap table {
  table-layout: fixed;
}

.panel-root--schedule-entries .panel-table-wrap th,
.panel-root--schedule-entries .panel-table-wrap td {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.panel-root--schedule-entries .panel-table-wrap td.mono {
  word-break: break-all;
}

.schedule-holiday-banner {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  margin: 0 0 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 6px;
  font-size: 0.825rem;
}

/* ============= Mobil (max-width: 720px) ============= */
@media (max-width: 720px) {
  html {
    overflow: hidden;
    scrollbar-gutter: auto;
    height: 100%;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    overflow: hidden;
    min-height: 0;
    height: 100%;
  }

  #app {
    padding: 0;
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh;
    overflow: hidden;
  }

  .app-page {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: calc(1rem + var(--app-safe-top)) 0.85rem calc(5.85rem + var(--app-safe-bottom));
    max-width: 1200px;
  }

  .app-topbar {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    z-index: 200;
    border: none;
    border-top: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.1);
  }

  .app-topbar__inner {
    padding: 0.55rem 0.65rem calc(0.55rem + var(--app-safe-bottom));
    gap: 0;
    min-height: 4.35rem;
    align-items: stretch;
  }

  .app-topbar__brand {
    display: none;
  }

  .app-topbar__tabs {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 0.5rem;
  }

  .app-topbar__tabs::-webkit-scrollbar {
    display: none;
  }

  .app-topbar__tabs .main-tabs {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.2rem;
    width: max-content;
    min-width: 100%;
    margin: 0;
    padding: 0;
    justify-content: center;
    box-sizing: border-box;
  }

  .app-topbar__tabs--scroll .main-tabs {
    justify-content: flex-start;
    min-width: 0;
  }

  .main-tabs button,
  .main-tabs a {
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.28rem;
    padding: 0.45rem 0.72rem;
    min-width: 3.65rem;
    min-height: 3.15rem;
    font-size: 0;
    border-bottom: none;
    border-top: none;
    border-radius: 10px;
    text-align: center;
    scroll-snap-align: center;
  }

  .main-tabs button i,
  .main-tabs a i {
    font-size: 1.2rem;
    line-height: 1;
  }

  .main-tabs__label {
    display: block;
    font-size: 0.62rem;
    line-height: 1.35;
    font-weight: 400;
    letter-spacing: 0.01em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .main-tabs__badge--label {
    display: none;
  }

  .main-tabs__badge--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main-tabs button.active {
    color: var(--accent);
    background: rgba(37, 99, 235, 0.1);
  }

  .main-tabs button.main-tabs__item--mobile-only {
    display: inline-flex;
  }

  .app-topbar__actions--desktop-only {
    display: none !important;
  }

  .tab-panel--profile {
    display: block;
  }

  .app--wa-thread .app-topbar {
    display: none;
  }

  .app--wa-thread .tab-panel--whatsapp > .page-head {
    display: none;
  }

  #app.app--wa-thread .app-page {
    padding: 0;
    padding-top: 0;
    padding-bottom: 0;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: hidden;
  }

  .app--wa-thread#app {
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .alert {
    bottom: calc(5.35rem + var(--app-safe-bottom));
  }

  .alert-ok {
    bottom: calc(8rem + var(--app-safe-bottom));
  }

  .tab-panel {
    padding: 0;
    margin-bottom: 0;
  }

  .tab-panel > .page-head {
    padding-top: 0;
  }

  /* Sayfa basligi mobilde tek satir */
  .page-head {
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
  }

  .page-head__title {
    font-size: 0.95rem;
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-head__actions {
    margin-left: auto;
    flex-wrap: nowrap;
    gap: 0.25rem;
    justify-content: flex-end;
  }

  .toolbar {
    margin-bottom: 0.85rem;
  }

  /* Schedule: desktop tablo gizle, mobil ajanda goster */
  .schedule-table-wrap {
    display: none;
  }

  .schedule-mobile-view {
    display: block;
  }

  .toolbar-actions {
    margin-left: auto;
    flex-wrap: nowrap;
    gap: 0.25rem;
    justify-content: flex-end;
  }

  .panel-section-title {
    font-size: 0.95rem;
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Sidepaneller tam ekran */
  .side-panel {
    width: 100% !important;
    max-width: 100% !important;
    transition: none !important;
  }

  .panel-enter-active .side-panel,
  .panel-leave-active .side-panel {
    transition: none !important;
  }

  .panel-enter-from .side-panel,
  .panel-leave-to .side-panel {
    transform: none !important;
  }

  .panel-enter-active .panel-backdrop,
  .panel-leave-active .panel-backdrop {
    transition: none !important;
  }

  .panel-enter-from .panel-backdrop,
  .panel-leave-to .panel-backdrop {
    opacity: 1;
  }

  .side-panel.side-panel--picker {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Stack peek mobilde gereksiz: alt panel form altina tamamen kayar */
  .panel-root--schedule-entries .side-panel,
  .panel-root--schedule-form .side-panel,
  .panel-root--schedule-owner-picker .side-panel,
  .panel-root--entry-actions .side-panel,
  .panel-root--portal-user .side-panel,
  .panel-root--portal-user-hard-delete .side-panel,
  .panel-root--erp-member .side-panel,
  .panel-root--schedule-filter .side-panel,
  .panel-root--dashboard-help .side-panel,
  .panel-root--settings-secret .side-panel,
  .panel-root--whatsapp-advanced .side-panel,
  .panel-root--guest-passages .side-panel,
  .panel-root--erp-giris-cikis .side-panel,
  .panel-root--whatsapp-report-conv .side-panel,
  .panel-root--whatsapp-report-columns .side-panel,
  .panel-root--overnight-stay-report-filter .side-panel,
  .panel-root--overnight-stay-detail .side-panel,
  .panel-root--analytics-detail .side-panel {
    transform: none !important;
  }

  .side-panel-header {
    padding: calc(1rem + var(--app-safe-top)) 1rem 0.75rem;
  }

  .side-panel-body {
    padding: 1rem 1rem 1.5rem;
  }

  .side-panel-footer {
    padding: 0.85rem 1rem calc(0.85rem + var(--app-safe-bottom));
  }

  /* Settings: baslik + Kaydet ayni satirda */
  .tab-panel--settings .page-head {
    flex-wrap: nowrap;
    align-items: center;
    margin-bottom: 1rem;
  }

  /* Tooltips dokunmaticda gereksiz */
  .btn-grid-hint::after {
    display: none !important;
  }

  /* Tablolar mobilde yatay scroll */
  .panel-table-wrap {
    overflow-x: auto;
  }

  .reports-mobile-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
  }

  .reports-mobile-back:hover {
    background: rgba(0, 0, 0, 0.06);
  }

  .page-head .reports-mobile-back + .page-head__title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .page-head .reports-breadcrumb {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
    font-size: 0.75rem;
    flex-wrap: nowrap;
  }

  .reports-report-actions {
    width: auto;
    margin-left: auto;
    flex-shrink: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.15rem;
  }

  .reports-report-actions .split-dropdown .btn-secondary.split-dropdown__main {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .reports-report-actions .split-dropdown .btn-secondary.split-dropdown__caret {
    min-width: 1.65rem;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
  }

  .reports-breadcrumb__current {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 auto;
  }

  .analytics-report-table-wrap + .analytics-report-section-title {
    margin-top: 1.25rem;
  }

  .analytics-report-table-wrap {
    overflow-x: visible;
    margin: 0 -0.15rem;
  }

  .analytics-report-table thead {
    display: none;
  }

  .analytics-report-table tbody tr {
    display: block;
    margin-bottom: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: #fff;
    overflow: hidden;
  }

  .analytics-report-table tbody tr:hover td {
    background: transparent;
  }

  .analytics-report-table tbody tr.analytics-row-clickable:active {
    background: rgba(37, 99, 235, 0.04);
  }

  .analytics-report-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: right;
    white-space: normal;
    word-break: break-word;
  }

  .analytics-report-table tbody td:last-child {
    border-bottom: none;
  }

  .analytics-report-table tbody td:first-child {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.35;
    text-align: left;
    background: #f7f9fc;
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0.75rem;
  }

  .analytics-report-table tbody td:not(:first-child)::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--muted);
    font-size: 0.75rem;
    text-align: left;
    flex-shrink: 0;
    max-width: 42%;
  }

  .analytics-report-table tbody td:not(:first-child) {
    font-size: 0.8125rem;
  }

  .whatsapp-report-row--has-summary {
    margin-bottom: 0;
    border-radius: 0.5rem 0.5rem 0 0;
  }

  .whatsapp-report-summary-row {
    display: block;
    margin-top: 0;
    margin-bottom: 0.65rem;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    background: #fff;
  }

  .whatsapp-report-summary-cell {
    display: block !important;
    text-align: left !important;
    padding: 0.45rem 0.75rem 0.65rem !important;
    border-bottom: none !important;
    background: transparent !important;
  }

  .whatsapp-report-summary-cell::before {
    display: none !important;
  }

  .analytics-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding-top: 1rem;
  }

  .analytics-dblclick-hint {
    margin-left: 0;
    text-align: left;
    white-space: normal;
    font-size: 0.75rem;
  }

  .analytics-meta {
    font-size: 0.75rem;
    line-height: 1.45;
  }

  .analytics-report-section-title {
    font-size: 0.9375rem;
    margin-bottom: 0.35rem;
  }

  .analytics-stat-pill {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }

  .analytics-section-head {
    margin-bottom: 0.5rem;
    gap: 0.5rem;
  }

  .reports-file-grid {
    justify-content: center;
  }

  .reports-file-tile__tip {
    display: none;
  }
}

@media (max-width: 380px) {
  .schedule-day-chip-date {
    font-size: 0.85rem;
  }

  .schedule-day-chip {
    padding: 0.4rem 0.15rem;
  }

  .schedule-mobile-hour-label {
    flex: 0 0 3rem;
    font-size: 0.75rem;
  }
}

.panel-section-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.toolbar-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.job-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.job-actions .btn-grid-hint {
  position: relative;
  background: transparent;
  border: none;
  padding: 0.4rem;
  border-radius: 50%;
  color: var(--muted);
  line-height: 1;
}

.job-actions .btn-grid-hint:hover {
  background: #e5e7eb;
  color: var(--text);
}

.btn-grid-hint::after {
  content: attr(data-hint);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.btn-grid-hint:hover::after,
.btn-grid-hint:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  padding-top: 0.55rem;
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.55rem 0.15rem 0.5rem;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

input[type="date"],
input[type="number"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="url"] {
  width: 100%;
  min-height: 2.65rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.35;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="date"].mono,
input[type="number"].mono,
input[type="search"].mono,
input[type="email"].mono,
input[type="tel"].mono,
input[type="url"].mono {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.875rem;
}

input[type="date"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

input[type="date"]:disabled,
input[type="number"]:disabled,
input[type="search"]:disabled,
input[type="email"]:disabled,
input[type="tel"]:disabled,
input[type="url"]:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background: #f1f5f9;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.55;
}

input[type="date"]:hover::-webkit-calendar-picker-indicator {
  opacity: 0.88;
}

input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
  opacity: 0.55;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.75;
  margin-left: 2px;
}

select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.1rem;
}

select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field {
  margin-bottom: 1.35rem;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dim);
}

.btn-secondary {
  background: #e8ecf2;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #dde3eb;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn-text {
  background: transparent;
  color: var(--accent);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}

.btn-text:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-dim);
}

.btn-text:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 500;
}

tr:hover td {
  background: rgba(37, 99, 235, 0.04);
}

.app-phone-lookup-toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + var(--app-safe-bottom));
  transform: translateX(-50%);
  z-index: 20010;
  min-width: 8rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.2);
  pointer-events: none;
}

.app-phone-lookup-toast--found {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.app-phone-lookup-toast--notfound {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.alert {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1rem;
  z-index: 20000;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: min(680px, calc(100% - 2rem));
  padding: 0.75rem 0.85rem 0.75rem 1.1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
  touch-action: pan-y;
}

.alert__text {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.45;
}

.alert__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  opacity: 0.72;
  cursor: pointer;
}

.alert__close:hover,
.alert__close:focus-visible {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  bottom: 4.5rem;
}

.hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.55;
}

.mono {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}

.dashboard-week-hint {
  margin-bottom: 0.35rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.dashboard-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: var(--surface);
}

.dashboard-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.dashboard-card__head .dashboard-card__title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}

.dashboard-card__info {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.12rem;
  margin: -0.12rem -0.12rem 0 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dashboard-card__info:hover {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.dashboard-card__value {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.dashboard-card__meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
}

.side-panel-heading-text {
  flex: 1;
  min-width: 0;
}

.dashboard-help-body {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
}

.dashboard-help-para {
  margin: 0 0 1rem;
}

.dashboard-help-para:last-child {
  margin-bottom: 0;
}

.portal-user-row--inactive td {
  color: var(--muted);
}

.portal-user-entry-actions {
  gap: 0.15rem;
  justify-content: flex-end;
}

.entry-actions-cell.portal-user-actions-cell {
  width: auto;
  min-width: 6.35rem;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}

.portal-user-hard-delete-body .portal-user-hard-delete-list {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
  line-height: 1.55;
}

.portal-user-name-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.portal-user-presence-dot {
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
}

.portal-user-presence-dot--inside {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.portal-user-presence-dot--outside {
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

.portal-user-presence-dot--unknown {
  background: #9ca3af;
  box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.2);
}

.portal-user-actions-row {
  display: none;
}

@media (max-width: 720px) {
  .portal-user-actions-row {
    display: table-row;
  }

  .portal-users-table-wrap {
    overflow-x: visible;
  }

  .portal-users-col-desktop,
  .portal-users-col-actions--desktop {
    display: none !important;
    width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: hidden !important;
  }

  .portal-users-table {
    table-layout: auto;
    width: 100%;
    font-size: 0.8rem;
  }

  .portal-users-table th,
  .portal-users-table td {
    padding: 0.5rem 0.35rem;
    vertical-align: middle;
  }

  .portal-users-table th:nth-child(1),
  .portal-users-table td:nth-child(1),
  .portal-users-table th:nth-child(2),
  .portal-users-table td:nth-child(2) {
    max-width: none;
    width: 32%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .portal-users-table th:nth-child(3),
  .portal-users-table td:nth-child(3) {
    width: 36%;
  }

  .portal-user-row {
    cursor: pointer;
  }

  .portal-user-row--open > td {
    border-bottom-color: transparent;
    background: rgba(37, 99, 235, 0.05);
  }

  .portal-user-actions-row__cell {
    padding: 0.35rem 0.35rem 0.6rem;
    border-top: none;
    background: rgba(37, 99, 235, 0.05);
  }

  .portal-user-actions-mobile {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.15rem 0 0.05rem;
  }

  .portal-user-actions-mobile .btn-row-dots {
    width: 2rem;
    height: 2rem;
    font-size: 0.82rem;
  }

  .portal-users-table .portal-users-col-phone {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
  }
}

.whatsapp-layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(12.5rem, 15rem) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 0;
}

.tab-panel--whatsapp {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: -4rem;
}

.tab-panel--whatsapp > .page-head {
  position: sticky;
  top: calc(3.25rem);
  z-index: 150;
  flex-shrink: 0;
  background: var(--surface);
}

.tab-panel--whatsapp .page-head__actions .btn-grid-hint {
  position: relative;
}

.tab-panel--whatsapp .page-head__actions .btn-grid-hint::after {
  bottom: auto;
  top: calc(100% + 6px);
  z-index: 200;
}

.tab-panel--whatsapp .page-head__actions .btn-text.is-active {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.1);
}

@media (max-width: 720px) {
  .tab-panel--whatsapp > .page-head {
    top: 0;
    z-index: 160;
  }
}

.whatsapp-sidebar {
  position: sticky;
  top: 115px;
  align-self: start;
  height: calc(100vh - 185px);
  min-height: 0;
  padding: 0 1rem 0.5rem 0;
  margin: 0;
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
  overflow-y: auto;
  box-sizing: border-box;
}

.whatsapp-conv-closed-badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  line-height: 1.2;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted);
}

.whatsapp-conv-list__item--closed {
  opacity: 0.88;
}

.whatsapp-conv-list__item--closed.active {
  opacity: 1;
}

.whatsapp-thread-closed-label {
  font-size: 0.78rem;
  white-space: nowrap;
}

.whatsapp-push-status {
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
}

.whatsapp-push-status--ok {
  color: var(--ok, #3dd68c);
}

.profile-push-retry {
  margin: 0 1rem 0.75rem 2.75rem;
}

.whatsapp-conv-select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 0.35rem;
  background: rgba(0, 0, 0, 0.04);
  font-size: 0.82rem;
}

.whatsapp-conv-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
}

.whatsapp-conv-list-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.whatsapp-conv-list-more {
  text-align: center;
  padding: 0.35rem 0.5rem 0.65rem;
  margin: 0;
}

.whatsapp-conv-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.whatsapp-conv-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  cursor: pointer;
  border: none;
}

.whatsapp-conv-list li.whatsapp-conv-list__item--selected {
  background: rgba(37, 99, 235, 0.08);
}

.whatsapp-conv-check {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  margin-top: 0.15rem;
  cursor: pointer;
}

.whatsapp-conv-check input {
  margin: 0;
}

.whatsapp-conv-body {
  flex: 1 1 auto;
  min-width: 0;
}

.whatsapp-conv-list li:hover {
  background: rgba(0, 0, 0, 0.04);
}

.whatsapp-conv-list li.active {
  background: rgba(37, 99, 235, 0.1);
}

.whatsapp-conv-title {
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whatsapp-conv-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  min-width: 0;
}

.whatsapp-conv-assignee-inline {
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 45%;
}



.whatsapp-conv-meta,
.whatsapp-conv-preview {
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.whatsapp-conv-call {
  font-size: 0.76rem;
  color: #1d4ed8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whatsapp-conv-call i {
  margin-right: 0.25rem;
}

.whatsapp-companion-calls {
  flex-shrink: 0;
  margin: 0 1rem 0.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.04);
}

.whatsapp-companion-calls__title {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.whatsapp-companion-calls__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.whatsapp-companion-calls__item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  font-size: 0.78rem;
  padding: 0.2rem 0;
}

.whatsapp-companion-calls__dir {
  font-weight: 500;
}

.whatsapp-companion-calls__dur {
  color: var(--text);
}

.whatsapp-companion-calls__when {
  margin-left: auto;
}

.whatsapp-conv-assignee {
  font-size: 0.78rem;
  color: var(--muted);
}

.whatsapp-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 0 0 0 1.25rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
}

.whatsapp-thread {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  border: none;
  border-radius: 0;
}

.whatsapp-thread--empty {
  align-items: center;
  justify-content: center;
}

.whatsapp-thread-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  text-align: center;
}

.whatsapp-thread-empty__icon {
  font-size: 2.5rem;
  color: var(--muted);
  opacity: 0.55;
}

.whatsapp-thread-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 0.4rem;
  row-gap: 0.08rem;
  flex-shrink: 0;
  padding: 0.65rem 0.65rem 0.65rem 0.35rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 110px;
  background: white;
}

.whatsapp-thread-back {
  grid-row: 1 / -1;
  grid-column: 1;
  align-self: center;
}

.whatsapp-thread-head-swipe {
  grid-column: 2;
  grid-row: 1 / -1;
  position: relative;
  overflow: hidden;
  min-width: 0;
  align-self: stretch;
}

.whatsapp-thread-head-swipe-content {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  background: var(--surface);
  transition: transform 0.2s ease;
}

.whatsapp-thread-head-swipe--enabled .whatsapp-thread-head-swipe-content {
  touch-action: pan-y;
}

.whatsapp-thread-head-swipe-content--dragging {
  transition: none;
}

.whatsapp-thread-dial-btn--reveal {
  position: absolute;
  right: 0;
  top: 50%;
  z-index: 0;
  transform: translateY(-50%);
}

.whatsapp-thread-head-reveal-actions {
  display: none;
}

.whatsapp-thread-head-reveal-btn {
  white-space: nowrap;
}

.whatsapp-thread-head-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.whatsapp-thread-head-number {
  font-size: 0.72rem;
  line-height: 1.15;
  margin-top: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.whatsapp-thread-head-actions {
  grid-row: 1 / -1;
  grid-column: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.2rem;
  flex-shrink: 0;
  padding-right: 0;
}

.whatsapp-thread-menu-wrap {
  position: relative;
  display: block;
  flex-shrink: 0;
}

.whatsapp-thread-head-action--desktop {
  display: none !important;
}

.whatsapp-thread-menu-btn {
  color: var(--text);
}

.whatsapp-thread-menu-btn:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
}

.whatsapp-thread-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 50;
  min-width: 11.5rem;
  margin: 0.2rem 0 0;
  padding: 0.35rem 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.whatsapp-thread-menu__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}

.whatsapp-thread-menu__item:hover:not(:disabled) {
  background: #f1f5f9;
}

.whatsapp-thread-menu__item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.whatsapp-thread-avatar-wrap {
  position: relative;
  grid-row: 1 / -1;
  grid-column: 1;
  align-self: center;
  flex-shrink: 0;
  width: 2.85rem;
  height: 2.85rem;
  margin-right: 0.4rem;
}

.whatsapp-thread-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  min-width: 2.85rem;
  min-height: 2.85rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.18);
  color: var(--muted);
  overflow: hidden;
  flex-shrink: 0;
}

.whatsapp-thread-avatar__placeholder {
  font-size: 1.15rem;
  line-height: 1;
}

.whatsapp-thread-avatar-ai {
  position: absolute;
  left: -0.3rem;
  bottom: -0.25rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: #1d4ed8;
  color: #fff;
  font-size: 0.68rem;
  line-height: 1;
  border: 2px solid var(--surface, #fff);
  pointer-events: none;
}

.whatsapp-thread-dial-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.whatsapp-thread-dial-btn:hover {
  background: #15803d;
}

.whatsapp-thread-dial-btn .fa-phone {
  transform: rotate(90deg);
  font-size: 0.95rem;
}

.whatsapp-ai-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.whatsapp-assignment-order-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.whatsapp-assignment-order-list > li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-subtle, rgba(127, 127, 127, 0.2));
}

.whatsapp-assignment-order-list__label {
  flex: 1;
}

.whatsapp-assignment-order-list__actions {
  display: inline-flex;
  gap: 0.15rem;
}

.whatsapp-assignment-order {
  display: grid;
  gap: 1rem;
}

  margin: 0 0 0.65rem;
}

.whatsapp-round-robin-list,
.whatsapp-round-robin-excluded-list {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.whatsapp-round-robin-list {
  counter-reset: wa-rr;
}

.whatsapp-round-robin-list > li {
  counter-increment: wa-rr;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0;
}

.whatsapp-round-robin-list > li::before {
  content: counter(wa-rr) ".";
  min-width: 1.35rem;
  color: var(--muted, #6b7280);
  font-family: ui-monospace, monospace;
  font-size: 0.88rem;
}

.whatsapp-round-robin-excluded {
  margin-top: 0.5rem;
}

.whatsapp-round-robin-excluded-list > li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0;
  color: var(--muted, #6b7280);
}

.whatsapp-round-robin-list__item--next {
  font-weight: 600;
}

.whatsapp-round-robin-list__label {
  margin-right: 0.15rem;
}

.whatsapp-round-robin-list__badge {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.whatsapp-thread-avatar--clickable {
  cursor: pointer;
}

.whatsapp-thread-avatar--clickable .whatsapp-thread-avatar__img {
  cursor: zoom-in;
}

.whatsapp-thread-avatar--clickable:hover {
  opacity: 0.9;
}

.whatsapp-thread-avatar:disabled {
  cursor: default;
}

.whatsapp-thread-avatar__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.whatsapp-thread-avatar__img--ready {
  opacity: 1;
}

.whatsapp-thread-head-name {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.whatsapp-thread-head-assignee {
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.whatsapp-thread-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.whatsapp-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.15rem 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-sizing: border-box;
}

.whatsapp-messages-load-older {
  display: flex;
  justify-content: center;
  padding: 0.25rem 0 0.5rem;
  flex-shrink: 0;
}

.whatsapp-messages-load-older__btn {
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  background: var(--surface);
}

.whatsapp-messages-end {
  flex-shrink: 0;
  width: 100%;
  height: 0;
  overflow: hidden;
}

.whatsapp-msg {
  width: fit-content;
  max-width: 70%;
  align-self: flex-start;
  padding: 0.45rem 0.65rem;
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.04);
  -webkit-user-select: text;
  user-select: text;
}

.whatsapp-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  max-width: 85%;
  align-self: flex-start;
}

.whatsapp-msg-row--out {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.whatsapp-msg-row .whatsapp-msg {
  max-width: 100%;
  align-self: auto;
}

.whatsapp-msg-row--out .whatsapp-msg {
  align-self: auto;
}

.whatsapp-msg-source-tip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.58rem;
  line-height: 1.1;
  color: var(--muted);
  padding: 0.1rem 0.15rem;
  user-select: none;
  text-align: center;
  max-width: 4.5rem;
}

.whatsapp-msg-source-tip__row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.2rem;
}

.whatsapp-msg-source-tip i {
  font-size: 0.9rem;
  opacity: 0.85;
}

.whatsapp-msg-source-tip__time {
  font-size: 0.58rem;
  opacity: 0.9;
  white-space: nowrap;
}

.whatsapp-msg--out {
  align-self: flex-end;
  background: rgba(37, 99, 235, 0.12);
}

.whatsapp-msg--out.whatsapp-msg--out-wa {
  background: rgba(16, 122, 87, 0.16);
}

.whatsapp-msg-row--out > .whatsapp-msg--out {
  align-self: auto;
}

.whatsapp-msg-meta {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.whatsapp-msg-media {
  margin-bottom: 0.25rem;
}

.whatsapp-msg-image {
  display: block;
  max-width: min(100%, 16rem);
  max-height: 14rem;
  border-radius: 0.35rem;
  object-fit: contain;
  cursor: zoom-in;
}

.whatsapp-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.88);
}

.whatsapp-image-lightbox__img {
  max-width: min(96vw, 100%);
  max-height: 92vh;
  object-fit: contain;
  border-radius: 0.35rem;
}

.whatsapp-image-lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

.whatsapp-image-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.whatsapp-msg-image.is-broken,
.whatsapp-msg-video.is-broken,
.whatsapp-msg-audio.is-broken {
  display: none;
}

.whatsapp-msg-image.is-broken ~ .whatsapp-msg-media-fallback,
.whatsapp-msg-video.is-broken ~ .whatsapp-msg-media-fallback,
.whatsapp-msg-audio.is-broken ~ .whatsapp-msg-media-fallback {
  display: block;
}

.whatsapp-msg-audio {
  display: block;
  width: min(100%, 14rem);
  min-width: 10rem;
  min-height: 2.5rem;
  height: auto;
}

.whatsapp-msg-media-fallback {
  display: none;
  font-size: 0.8rem;
  color: var(--muted);
}

.whatsapp-msg-video {
  display: block;
  max-width: min(100%, 16rem);
  max-height: 14rem;
  border-radius: 0.35rem;
}

.whatsapp-msg-location a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--primary, #2563eb);
  text-decoration: none;
}

.whatsapp-msg-location a:hover {
  text-decoration: underline;
}

.whatsapp-compose-file {
  display: none;
}

.whatsapp-compose-tools {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

.whatsapp-compose-tools .btn-text {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.whatsapp-session-break {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 1rem 0;
  padding: 0 0.25rem;
}

.whatsapp-session-break__line {
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}

.whatsapp-session-break__text {
  flex: 0 1 auto;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
  max-width: 14rem;
}

.whatsapp-assignment-notice {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0 1rem;
  padding: 0 0.35rem;
}

.whatsapp-assignment-notice__card {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  max-width: min(100%, 24rem);
  padding: 0.6rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.07);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.whatsapp-assignment-notice__icon {
  flex-shrink: 0;
  margin-top: 0.12rem;
  font-size: 0.85rem;
  color: var(--accent);
}

.whatsapp-assignment-notice__text {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text);
  line-height: 1.45;
  text-align: left;
}

.whatsapp-call-event {
  display: flex;
  justify-content: center;
  margin: 0.65rem 0;
  padding: 0 0.35rem;
}

.whatsapp-call-event--clickable {
  cursor: pointer;
}

.whatsapp-call-event__card {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  max-width: min(100%, 22rem);
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(22, 163, 74, 0.22);
  background: rgba(22, 163, 74, 0.07);
}

.whatsapp-call-event--clickable:hover .whatsapp-call-event__card,
.whatsapp-call-event--clickable:focus-visible .whatsapp-call-event__card {
  border-color: rgba(22, 163, 74, 0.45);
  background: rgba(22, 163, 74, 0.12);
}

.whatsapp-call-event--has-notes .whatsapp-call-event__card {
  border-color: rgba(22, 163, 74, 0.35);
}

.whatsapp-call-event__icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 0.82rem;
  color: #16a34a;
  transform: rotate(90deg);
}

.whatsapp-call-event__body {
  min-width: 0;
}

.whatsapp-call-event__title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
}

.whatsapp-call-event__meta {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
}

.whatsapp-call-event__notes {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.whatsapp-call-event__hint {
  margin: 0.25rem 0 0;
  font-size: 0.7rem;
}

.panel-root--whatsapp-call-note {
  z-index: 120;
}

.whatsapp-compose {
  position: sticky;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  padding: 0.75rem 0;
  margin-bottom: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  box-sizing: border-box;
}

.whatsapp-compose textarea {
  flex: 1;
  resize: none;
  min-height: 2.5rem;
  max-height: 7rem;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: 0.5rem;
  font: inherit;
  line-height: 1.4;
  box-sizing: border-box;
  background: transparent;
  outline: none;
}

.whatsapp-send-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, opacity 0.12s;
}

.whatsapp-send-btn:hover:not(:disabled) {
  background: #1d4ed8;
}

.whatsapp-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.whatsapp-qr-img {
  max-width: 220px;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
}

.whatsapp-qr-panel {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 18rem;
  padding: 1.5rem 1rem 2rem;
}

.whatsapp-qr-panel__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 22rem;
  gap: 0.35rem;
}

.whatsapp-qr-panel__icon {
  font-size: 2.5rem;
  color: #25d366;
  margin-bottom: 0.25rem;
}

.whatsapp-qr-panel__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.whatsapp-qr-panel__img {
  margin-top: 0.75rem;
  max-width: min(100%, 240px);
}

.whatsapp-qr-panel__help {
  margin-top: 0.5rem;
  line-height: 1.45;
}

.whatsapp-qr-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-top: 0.65rem;
}

.whatsapp-qr-panel__refresh,
.whatsapp-qr-panel__hide {
  font-size: 0.9rem;
}

.whatsapp-qr-panel__refresh:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.whatsapp-connection-panel-show {
  color: #25d366;
}

.whatsapp-status-error {
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  background: rgba(220, 53, 69, 0.12);
  color: #b02a37;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.whatsapp-status-warn {
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  background: rgba(255, 193, 7, 0.15);
  color: #856404;
  font-size: 0.85rem;
}

.whatsapp-diagnostics {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.whatsapp-diagnostics > div + div {
  margin-top: 0.2rem;
}

.whatsapp-log-field,
.app-log-field {
  margin-top: 0.5rem;
}

.whatsapp-log-head,
.app-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.whatsapp-log-panel,
.app-log-panel {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted, #f8f9fa);
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.whatsapp-log-line,
.app-log-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  padding: 0.15rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.whatsapp-log-line:last-child,
.app-log-line:last-child {
  border-bottom: none;
}

.whatsapp-log-line--error .whatsapp-log-msg,
.app-log-line--error .app-log-msg {
  color: #b02a37;
}

.whatsapp-log-line--warn .whatsapp-log-msg,
.app-log-line--warn .app-log-msg {
  color: #856404;
}

.whatsapp-log-time,
.app-log-time {
  color: var(--text-muted, #6c757d);
  flex: 0 0 auto;
}

.whatsapp-log-src,
.app-log-src {
  color: var(--text-muted, #6c757d);
  flex: 0 0 auto;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.whatsapp-log-msg,
.app-log-msg {
  flex: 1 1 12rem;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 720px) {
  .whatsapp-layout {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .tab-panel--whatsapp {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: calc(-5.85rem - var(--app-safe-bottom));
    padding-top: 0;
    height: auto;
  }

  .tab-panel--whatsapp > .page-head {
    flex-shrink: 0;
  }

  .app--wa-thread .tab-panel--whatsapp {
    margin-bottom: 0;
    padding: 0;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: auto;
  }

  .app--wa-thread .whatsapp-layout {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    display: flex;
    flex-direction: column;
  }

  .app--wa-thread .whatsapp-layout--thread .whatsapp-main {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: hidden;
  }

  .app--wa-thread .whatsapp-thread {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: hidden;
  }

  .app--wa-thread .whatsapp-thread-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .app--wa-thread .whatsapp-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem 0.85rem;
  }

  .app--wa-thread .whatsapp-thread-head {
    position: relative;
    top: auto;
    z-index: 40;
    flex-shrink: 0;
    background: var(--surface);
    margin-left: 0;
    margin-right: 0;
    padding: calc(0.65rem + var(--app-safe-top)) 0.65rem 0.65rem 0.25rem;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  }

  .app--wa-thread .whatsapp-thread-head-assignee {
    display: none;
  }

  #app.app--wa-thread .whatsapp-compose {
    position: relative;
    flex-shrink: 0;
    bottom: auto;
    z-index: 40;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    padding-bottom: max(0.75rem, var(--app-safe-bottom));
    box-shadow: 0 -1px 0 rgba(15, 23, 42, 0.04);
  }

  .whatsapp-sidebar {
    position: static;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: 100%;
    max-height: none;
    border-right: none;
    border-bottom: none;
    padding: 0;
    overflow: hidden;
  }

  .whatsapp-conv-list-wrap {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
  }

  .whatsapp-conv-list {
    flex: 0 0 auto;
    overflow: visible;
    min-height: 0;
  }

  .whatsapp-main {
    display: none;
    padding: 0;
    min-height: 0;
    height: auto;
  }

  .whatsapp-layout--thread .whatsapp-sidebar {
    display: none;
  }

  .whatsapp-layout--thread .whatsapp-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
  }

  .whatsapp-thread-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
  }

  .whatsapp-thread-back:hover {
    background: rgba(0, 0, 0, 0.06);
  }

  .whatsapp-thread-head {
    flex: 0 0 auto;
    gap: 0.35rem;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }

  .whatsapp-thread-back {
    grid-column: 1;
  }

  .whatsapp-thread-avatar-wrap {
    grid-column: 2;
  }

  .whatsapp-thread-head-swipe {
    grid-column: 3;
    transition: padding-bottom 0.2s ease;
  }

  .app--mobile-shell .whatsapp-thread-head-reveal-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    padding: 0.15rem 0 0;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    pointer-events: none;
  }

  .whatsapp-thread-head-swipe:has(.whatsapp-thread-dial-btn--reveal) .whatsapp-thread-head-reveal-actions {
    right: 2.6rem;
  }

  .whatsapp-thread-head-swipe--open {
    padding-bottom: 1.75rem;
  }

  .whatsapp-thread-head-swipe--open .whatsapp-thread-head-reveal-actions {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .whatsapp-thread-head-actions {
    grid-column: 4;
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .whatsapp-thread {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
  }

  .profile-page {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }

  .tab-panel--profile .page-head {
    margin-bottom: 1rem;
  }

  .profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 0.25rem 0;
  }

  .profile-avatar {
    flex: 0 0 auto;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
  }

  .profile-name {
    margin: 0 0 0.2rem;
    font-size: 1.15rem;
    font-weight: 600;
  }

  .profile-roles {
    margin: 0;
  }

  .profile-companion-badge {
    margin: 0 0 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1d4ed8;
  }

  .profile-companion-perms__list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0 0 0 1.75rem;
    font-size: 0.82rem;
  }

  .profile-companion-perms__list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-top: 1px solid var(--border);
  }

  .profile-companion-perms__list li span:first-child i {
    width: 1rem;
    margin-right: 0.35rem;
    text-align: center;
  }

  .profile-companion-perms__ok {
    color: #15803d;
    font-weight: 500;
    padding-right: 0.75rem;
  }

  .profile-companion-perms__no {
    color: #b45309;
    font-weight: 500;
    padding-right: 0.75rem;
  }

  .profile-companion-perms .profile-push-retry {
    margin: 0.5rem 0 0 1.75rem;
  }

  .profile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    box-sizing: border-box;
  }

  .profile-menu li {
    width: 100%;
  }

  .profile-menu li + li {
    border-top: 1px solid var(--border);
  }

  .profile-menu__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
    padding: 0.9rem 1rem;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
  }

  .profile-menu__link span {
    flex: 1 1 auto;
  }

  .profile-menu__external {
    font-size: 0.75rem;
    color: var(--muted);
  }

  .profile-menu__link--danger {
    color: #b02a37;
  }
}

.whatsapp-report-user-block {
  margin-bottom: 1.5rem;
}

.whatsapp-report-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.whatsapp-report-section-title__name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.whatsapp-report-count-pill {
  flex-shrink: 0;
  margin-left: auto;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.whatsapp-report-user-block--flat {
  margin-bottom: 0;
}

.whatsapp-report-columns-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.whatsapp-report-columns-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.whatsapp-report-columns-hint {
  margin: 0.25rem 0 0;
}

.panel-root--whatsapp-report-columns {
  z-index: 1008;
}

.panel-root--whatsapp-report-columns .side-panel.side-panel--whatsapp-report-columns {
  width: min(380px, 100vw);
}

.whatsapp-report-summary {
  max-width: none;
  white-space: normal;
  font-size: 0.85rem;
  line-height: 1.35;
}

.whatsapp-report-summary-row td {
  padding: 0.45rem 0.75rem 0.65rem;
  border-top: none;
  background: transparent;
}

.whatsapp-report-row--has-summary td {
  border-bottom: none;
}

.whatsapp-report-summary-inline {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
  white-space: normal;
}

.whatsapp-report-satisfaction {
  min-width: 5rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

.whatsapp-report-satisfaction-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.whatsapp-report-duration--warm {
  color: #b45309;
  font-weight: 500;
}

.whatsapp-report-duration--warn {
  color: #c2410c;
  font-weight: 600;
}

.whatsapp-report-duration--bad {
  color: #b91c1c;
  font-weight: 600;
}

.whatsapp-report-duration--critical {
  color: #991b1b;
  font-weight: 700;
  background: rgba(185, 28, 28, 0.08);
}

.whatsapp-report-thumb-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1;
}

.whatsapp-report-thumb-row .hint {
  margin: 0;
  line-height: 1;
}

.whatsapp-report-thumb-row i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.whatsapp-report-thumb {
  font-size: 0.9rem;
}

.whatsapp-report-thumb--up {
  color: #15803d;
}

.whatsapp-report-thumb--down {
  color: #b91c1c;
}

.whatsapp-report-thumb--neutral {
  color: var(--muted);
}

.whatsapp-report-stars {
  display: inline-flex;
  gap: 0.08rem;
}

.whatsapp-report-star {
  font-size: 0.75rem;
  color: #d1d5db;
}

.whatsapp-report-star--on {
  color: #eab308;
}

.whatsapp-report-issues {
  text-align: center;
}

.whatsapp-report-issues-icon {
  font-size: 1rem;
}

.whatsapp-report-issues-icon--yes {
  color: #b91c1c;
}

.whatsapp-report-issues-icon--no {
  color: #15803d;
}

.whatsapp-report-mismatch {
  margin-top: 0.25rem;
  color: #b45309;
  font-size: 0.78rem;
  font-weight: 600;
}

.whatsapp-report-row--mismatch {
  background: rgba(234, 179, 8, 0.08);
}

.whatsapp-report-row--open {
  background: rgba(22, 163, 74, 0.06);
}

.whatsapp-report-table th.whatsapp-report-th--sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.whatsapp-report-table th.whatsapp-report-th--sortable:hover {
  color: var(--text);
  background: rgba(37, 99, 235, 0.05);
}

.whatsapp-report-table th.whatsapp-report-th--sorted {
  color: var(--text);
}

.whatsapp-report-sort-icon {
  margin-left: 0.2rem;
  font-size: 0.62rem;
  vertical-align: middle;
}

.whatsapp-report-sort-icon--idle {
  opacity: 0.3;
}

.whatsapp-report-row--clickable {
  cursor: pointer;
}

.whatsapp-report-row--clickable:hover {
  background: rgba(37, 99, 235, 0.05);
}

.whatsapp-report-row--clickable.whatsapp-report-row--open:hover {
  background: rgba(22, 163, 74, 0.1);
}

.panel-root--whatsapp-report-conv {
  z-index: 1008;
}

.panel-root--whatsapp-close {
  z-index: 1020;
}

.panel-root--whatsapp-report-conv .side-panel.side-panel--whatsapp-report-conv {
  width: min(560px, 100vw);
}

.whatsapp-report-conv-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.whatsapp-report-conv-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
}

.whatsapp-report-conv-notes {
  flex-shrink: 0;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.02);
}

.whatsapp-report-conv-notes__title {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.whatsapp-report-conv-notes__list {
  display: grid;
  grid-template-columns: minmax(5.5rem, auto) minmax(0, 1fr);
  gap: 0.35rem 0.75rem;
  margin: 0;
}

.whatsapp-report-conv-notes__list dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.whatsapp-report-conv-notes__list dd {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text);
}

.whatsapp-report-conv-notes__note {
  white-space: pre-wrap;
}

.whatsapp-report-conv-notes__warn {
  color: #b45309;
}

.whatsapp-report-conv-notes__summary {
  margin: 0.65rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.whatsapp-report-conv-body > .hint {
  flex-shrink: 0;
}

.door-access-empty {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}

.door-open-doors {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.door-open-doors__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 0.65rem 0.75rem;
  align-items: end;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.door-open-doors__remove {
  align-self: center;
  margin-bottom: 0.35rem;
}

@media (max-width: 720px) {
  .door-open-doors__row {
    grid-template-columns: 1fr;
  }

  .door-open-doors__remove {
    justify-self: start;
    margin-bottom: 0;
  }
}

.door-access-page {
  max-width: 42rem;
}

.door-access-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.door-access-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
}

.door-access-list__main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.door-access-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.door-access-tag {
  font-size: 0.68rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted);
}

.schedule-extra-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.35rem;
}

.schedule-extra-tags__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.whatsapp-report-conv-messages {
  flex: 0 0 auto;
  min-height: auto;
  height: auto;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  background: var(--surface);
  box-sizing: border-box;
}

.whatsapp-report-status {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  background: #f3f4f6;
  color: #4b5563;
}

.whatsapp-report-status--open {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.whatsapp-report-mismatch-summary {
  color: #b45309;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.whatsapp-close-analysis__badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.whatsapp-close-analysis__badge--iyi {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.whatsapp-close-analysis__badge--orta {
  background: rgba(234, 179, 8, 0.15);
  color: #a16207;
}

.whatsapp-close-analysis__badge--kotu {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.whatsapp-close-analysis__summary {
  white-space: pre-wrap;
  line-height: 1.45;
}

.wa-category-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.wa-category-hint summary {
  cursor: pointer;
  color: var(--muted);
}

.wa-category-hint__list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
  line-height: 1.5;
}

.whatsapp-advanced-body .field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.whatsapp-advanced-body .field-row .field {
  flex: 1 1 8rem;
  min-width: 0;
}

.whatsapp-advanced-actions {
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.whatsapp-advanced-db-sync {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.whatsapp-advanced-db-sync .field-row {
  margin-bottom: 0.75rem;
}

.whatsapp-advanced-maint {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.whatsapp-advanced-maint-actions {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.whatsapp-advanced-result {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2, var(--bg));
  overflow: hidden;
}

.whatsapp-advanced-result__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.whatsapp-advanced-result__pre {
  margin: 0;
  padding: 0.75rem;
  max-height: min(50vh, 28rem);
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.companion-locations-age-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.companion-locations-age-btn {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2, var(--bg));
}

.companion-locations-age-btn--active {
  border-color: var(--accent, #3b82f6);
  background: color-mix(in srgb, var(--accent, #3b82f6) 12%, transparent);
}

.companion-locations-map {
  width: 100%;
  height: min(60vh, 520px);
  min-height: 240px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.companion-locations-map .leaflet-container {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
}

.companion-locations-table td[data-label="Harita"] {
  white-space: nowrap;
}

.phone-chip-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.5rem;
  
  border-radius: var(--radius);
  background: var(--surface-2, var(--bg));
  cursor: text;
}

.phone-chip-input__field {
  flex: 1 1 8rem;
  min-width: 7rem;
  border: none;
  background: transparent;
  padding: 0.25rem 0.15rem;
  font-size: 0.9rem;
  color: inherit;
  outline: none;
}

.phone-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.35rem 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.85rem;
}

.phone-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.phone-chip__remove:hover {
  background: color-mix(in srgb, var(--danger, #dc2626) 12%, transparent);
  color: var(--danger, #dc2626);
}

.wa-test-learnings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.wa-test-learnings__item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2, var(--bg));
}

.wa-test-learnings__text {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.atl-date-input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text);
}

.atl {
  display: grid;
  gap: 1.25rem;
  width: 100%;
}

.atl-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.atl-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.atl-play:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.12);
}

.atl-play:disabled {
  opacity: 0.4;
  cursor: default;
}

.atl-toolbar__tail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.atl-time {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.atl-speed {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 0.45rem;
  background: var(--bg);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
}

.atl-speed:disabled {
  opacity: 0.5;
  cursor: default;
}

.atl-scrub {
  display: grid;
  gap: 0.45rem;
  padding: 0 0.15rem;
}

.atl-rail {
  position: relative;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.atl-rail__dot {
  position: absolute;
  top: 50%;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: #2563eb;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.atl-rail__dot--future {
  opacity: 0.2;
}

.atl-rail__head {
  position: absolute;
  top: 50%;
  width: 3px;
  height: 1rem;
  background: #dc2626;
  border-radius: 2px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}

.atl-range {
  width: 100%;
  margin: 0;
  accent-color: #2563eb;
}

.atl-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  gap: 1rem;
  align-items: start;
}

.atl-focus {
  display: grid;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.atl-focus__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.atl-focus__contact {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.atl-focus__line {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.atl-focus__assignee {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.atl-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.atl-section-title__count {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  opacity: 0.7;
}

.atl-queue__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.atl-queue__item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.atl-queue__item--picked {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  box-shadow: inset 3px 0 0 #2563eb;
}

.atl-queue__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
}

.atl-queue__item--picked .atl-queue__rank {
  background: #2563eb;
  color: #fff;
}

.atl-queue__name {
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atl-queue__kind {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.atl-queue__picked {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #1d4ed8;
  white-space: nowrap;
}

.atl-people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.atl-people__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.atl-person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.atl-person--stack {
  flex-direction: column;
  align-items: stretch;
}

.atl-person__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.atl-person__name {
  font-size: 0.88rem;
  font-weight: 600;
}

.atl-person__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.atl-person__meta {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
}

.atl-pill {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.18);
  color: var(--muted);
  white-space: nowrap;
}

.atl-pill--on {
  background: rgba(22, 163, 74, 0.15);
  color: #15803d;
}

.atl-pill--off {
  background: rgba(148, 163, 184, 0.15);
  color: var(--muted);
}

.atl-pill--warn {
  background: rgba(234, 179, 8, 0.18);
  color: #a16207;
}

.atl-side {
  display: grid;
  gap: 0.5rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  max-height: 32rem;
  overflow: hidden;
}

.atl-empty {
  margin: 0;
  padding: 0.5rem 0;
}

.atl-events {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: calc(32rem - 2rem);
}

.atl-event {
  border-bottom: 1px solid var(--border);
}

.atl-event:last-child {
  border-bottom: none;
}

.atl-event--future {
  opacity: 0.38;
}

.atl-event--focus .atl-event__btn {
  background: rgba(37, 99, 235, 0.08);
}

.atl-event__btn {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0.1rem 0.65rem;
  width: 100%;
  padding: 0.55rem 0.35rem;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
}

.atl-event__btn:hover {
  background: rgba(148, 163, 184, 0.08);
}

.atl-event__time {
  grid-row: 1 / 3;
  align-self: center;
  font-size: 0.72rem;
  color: var(--muted);
}

.atl-event__contact {
  font-size: 0.85rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atl-event__line {
  font-size: 0.76rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .atl-body {
    grid-template-columns: 1fr;
  }

  .atl-side {
    max-height: none;
  }

  .atl-events {
    max-height: 20rem;
  }
}

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

  .atl-focus__assignee {
    align-self: flex-start;
  }

  .atl-queue__item {
    grid-template-columns: 2rem minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .atl-queue__kind,
  .atl-queue__picked {
    grid-column: 2;
  }
}
