:root {
  --tf-bg: #f8f3f7;
  --tf-ink: #18212b;
  --tf-muted: #66727d;
  --tf-line: #e2dce6;
  --tf-card: #ffffff;
  --tf-primary: #7a3cff;
  --tf-primary-dark: #5f2fcb;
  --tf-secondary: #00a98f;
  --tf-accent: #f05d8e;
  --tf-warm: #ffb703;
  --tf-danger: #b43b50;
  --tf-focus: rgba(122, 60, 255, 0.2);
}

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

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body {
  background:
    linear-gradient(135deg, rgba(122, 60, 255, 0.1) 0 10%, transparent 10% 100%),
    linear-gradient(35deg, transparent 0 62%, rgba(0, 169, 143, 0.13) 62% 69%, transparent 69% 100%),
    linear-gradient(155deg, transparent 0 74%, rgba(255, 183, 3, 0.18) 74% 79%, transparent 79% 100%),
    repeating-linear-gradient(115deg, transparent 0 26px, rgba(240, 93, 142, 0.07) 26px 29px),
    var(--tf-bg);
  color: var(--tf-ink);
  font-size: 15px;
  min-height: 100vh;
}

body.tf-theme-marble,
.tf-theme-preview-marble {
  background-color: #f3f4f5;
  background-image:
    linear-gradient(118deg, transparent 0 43%, rgba(109, 119, 130, 0.09) 44%, transparent 46%),
    linear-gradient(24deg, transparent 0 66%, rgba(165, 173, 180, 0.11) 67%, transparent 69%),
    repeating-linear-gradient(154deg, rgba(255, 255, 255, 0.62) 0 18px, rgba(226, 229, 232, 0.3) 19px 21px, rgba(255, 255, 255, 0.48) 22px 48px);
}

body.tf-theme-wood,
.tf-theme-preview-wood {
  background-color: #e8e2da;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.36) 0 22px, rgba(122, 106, 92, 0.1) 23px 25px, rgba(255, 255, 255, 0.12) 26px 48px),
    repeating-linear-gradient(2deg, transparent 0 38px, rgba(104, 89, 76, 0.055) 39px 40px);
}

body.tf-theme-brick,
.tf-theme-preview-brick {
  background-color: #e8e9ea;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, transparent 24px, rgba(125, 132, 139, 0.07) 25px, transparent 26px);
  background-position: 0 0, 0 0, 0 21px;
  background-size: 52px 42px, 52px 42px, 52px 42px;
}

body.tf-theme-blush,
.tf-theme-preview-blush {
  background-color: #f4e9ec;
  background-image:
    linear-gradient(132deg, transparent 0 34%, rgba(209, 164, 178, 0.13) 35%, transparent 38%),
    linear-gradient(36deg, transparent 0 61%, rgba(193, 175, 181, 0.12) 62%, transparent 65%),
    repeating-linear-gradient(118deg, rgba(255, 255, 255, 0.34) 0 24px, rgba(244, 226, 232, 0.3) 25px 48px);
}

.tf-theme-preview-flow {
  background:
    linear-gradient(135deg, rgba(122, 60, 255, 0.2) 0 24%, transparent 24% 100%),
    linear-gradient(35deg, transparent 0 55%, rgba(0, 169, 143, 0.2) 55% 68%, transparent 68% 100%),
    #f8f3f7;
}

.admin-shell,
.admin-shell > section,
.modal-content,
.mini-row,
.mini-panel,
.appointment-card,
.history-summary,
.top-actions {
  min-width: 0;
  max-width: 100%;
}

.form-control,
.form-select,
.btn,
textarea {
  min-width: 0;
}

.admin-shell {
  display: grid;
  gap: 1rem;
}

.top-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.top-actions .btn {
  white-space: nowrap;
}

.quick-stats {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.app-navbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--tf-line);
  box-shadow: 0 10px 30px rgba(24, 33, 43, 0.07);
  backdrop-filter: blur(10px);
}

.navbar-brand {
  color: var(--tf-primary);
}

.nav-link {
  color: var(--tf-muted);
  border-radius: 8px;
  padding-inline: 0.75rem;
}

.nav-link:hover {
  background: #f1eaff;
  color: var(--tf-primary);
}

.page-head {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(110deg, #ffffff 0 62%, rgba(255, 183, 3, 0.18) 62% 100%),
    #ffffff;
  border: 1px solid var(--tf-line);
  border-left: 5px solid var(--tf-accent);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 16px 40px rgba(24, 33, 43, 0.08);
}

.page-head h1 {
  font-weight: 800;
}

.page-head::after {
  content: "";
  position: absolute;
  inset: auto -20px -34px auto;
  width: 220px;
  height: 96px;
  background:
    repeating-linear-gradient(135deg, rgba(122, 60, 255, 0.24) 0 10px, transparent 10px 20px),
    linear-gradient(90deg, rgba(0, 169, 143, 0.28), rgba(240, 93, 142, 0.22));
  transform: rotate(-8deg);
  pointer-events: none;
  opacity: 0.75;
}

.page-head .btn-primary {
  box-shadow: 0 10px 24px rgba(122, 60, 255, 0.24);
}

.section-card,
.bg-white.border.rounded-2 {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: var(--tf-line) !important;
  border-radius: 8px !important;
  box-shadow: 0 16px 40px rgba(24, 33, 43, 0.07);
}

.stat-card {
  background:
    linear-gradient(180deg, #ffffff, #fbf8ff);
  border: 1px solid var(--tf-line);
  border-radius: 8px;
  padding: 1rem;
  min-height: 96px;
  box-shadow: 0 12px 24px rgba(24, 33, 43, 0.055);
}

.stat-card:nth-child(2) {
  background: linear-gradient(180deg, #ffffff, #f4fbf9);
}

.stat-card:nth-child(3) {
  background: linear-gradient(180deg, #ffffff, #fff8e5);
}

.stat-card:nth-child(4) {
  background: linear-gradient(180deg, #ffffff, #fff2f7);
}

.stat-label {
  color: var(--tf-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 750;
  line-height: 1.1;
}

.btn-primary {
  --bs-btn-bg: var(--tf-primary);
  --bs-btn-border-color: var(--tf-primary);
  --bs-btn-hover-bg: var(--tf-primary-dark);
  --bs-btn-hover-border-color: var(--tf-primary-dark);
}

.btn-outline-secondary {
  --bs-btn-color: #344454;
  --bs-btn-border-color: #cfd7df;
  --bs-btn-hover-bg: #344454;
  --bs-btn-hover-border-color: #344454;
}

.btn-outline-primary {
  --bs-btn-color: var(--tf-primary);
  --bs-btn-border-color: var(--tf-primary);
  --bs-btn-hover-bg: var(--tf-primary);
  --bs-btn-hover-border-color: var(--tf-primary);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--tf-primary);
  box-shadow: 0 0 0 0.22rem var(--tf-focus);
}

.table {
  --bs-table-bg: transparent;
}

.table-responsive {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table thead th {
  color: var(--tf-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.table td,
.table th {
  vertical-align: middle;
}

.appointment-board {
  display: grid;
  gap: 0.75rem;
}

.appointment-card {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.95fr);
  padding: 1rem;
  border: 1px solid var(--tf-line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(122, 60, 255, 0.07), transparent 34%),
    #ffffff;
}

.appointment-card h3 {
  font-size: 1.1rem;
  margin: 0.35rem 0;
}

.appointment-actions,
.inline-action {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.appointment-actions .form-control {
  max-width: 155px;
}

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

.management-grid > *,
.compact-form > *,
.appointment-create-form > * {
  min-width: 0;
}

.compact-form {
  grid-template-columns: 1fr 1fr 1.1fr 0.65fr 0.8fr auto;
  align-items: center;
}

.stack-list {
  display: grid;
  gap: 0.55rem;
}

.mini-row,
.mini-panel {
  padding: 0.75rem;
  border: 1px solid var(--tf-line);
  border-radius: 8px;
  background: #fffafd;
}

.shop-row {
  background:
    linear-gradient(90deg, rgba(0, 169, 143, 0.08), transparent 34%),
    #ffffff;
}

.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.team-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.team-pills span {
  background: #f1eaff;
  border: 1px solid #e0d2ff;
  border-radius: 999px;
  color: var(--tf-primary-dark);
  font-size: 0.78rem;
  line-height: 1;
  padding: 0.35rem 0.55rem;
}

.badge-access-active {
  background: #dff7f1;
  color: #08705f;
}

.badge-access-suspended {
  background: #f9dfdf;
  color: var(--tf-danger);
}

.badge-commercial-paid,
.badge-commercial-trial {
  background: #dff7f1;
  color: #08705f;
}

.badge-commercial-trial {
  background: #eee8ff;
  color: var(--tf-primary-dark);
}

.badge-commercial-expired,
.badge-commercial-suspended {
  background: #f9dfdf;
  color: var(--tf-danger);
}

.chat-panel {
  min-height: 420px;
}

.message {
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--tf-line);
}

.message-bot {
  background: #eef5f3;
  border-color: #c9e4dd;
}

.message-client {
  background: #fff7ed;
  border-color: #f1d2ad;
}

.bot-context-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--tf-line);
  border-radius: 8px;
  background: #fafbfc;
}

.quick-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quick-actions .btn {
  border-radius: 999px;
  padding-inline: 0.9rem;
}

.chat-input-form {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.compact-actions .btn,
.compact-actions .form-control {
  min-height: 31px;
}

.appointment-create-form {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(190px, 1.4fr) minmax(170px, 1fr) minmax(150px, 0.8fr) minmax(190px, 1fr) minmax(160px, 1fr) minmax(140px, 0.7fr);
  align-items: end;
}

.history-summary {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.history-summary div {
  min-width: 145px;
  padding: 0.75rem;
  border: 1px solid var(--tf-line);
  border-radius: 8px;
  background: #fafbfc;
}

.history-summary span {
  display: block;
  color: var(--tf-muted);
  font-size: 0.78rem;
}

.history-summary strong {
  display: block;
  font-size: 1.1rem;
}

.customer-appointment {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--tf-line);
  border-radius: 8px;
  background: #ffffff;
}

.empty-state {
  padding: 1.25rem;
  border: 1px dashed var(--tf-line);
  border-radius: 8px;
  background: #fafbfc;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  padding: 1.25rem;
  place-items: center;
}

.auth-main {
  padding: 0 !important;
}

.auth-page {
  background:
    linear-gradient(135deg, rgba(122, 60, 255, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(0, 169, 143, 0.13), transparent 38%),
    #f4f6fa;
}

.login-stage {
  background: #ffffff;
  border: 1px solid var(--tf-line);
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(24, 33, 43, 0.13);
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(340px, 1fr);
  max-width: 860px;
  min-height: 520px;
  overflow: hidden;
  width: 100%;
}

.login-brand-panel {
  background:
    linear-gradient(155deg, transparent 0 68%, rgba(0, 169, 143, 0.28) 68% 75%, transparent 75%),
    linear-gradient(35deg, transparent 0 76%, rgba(240, 93, 142, 0.24) 76% 83%, transparent 83%),
    #090f1d;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
}

.login-brand {
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 850;
  text-decoration: none;
}

.login-brand-panel h1 {
  font-size: 2rem;
  font-weight: 850;
  line-height: 1.12;
  margin: 0.65rem 0;
}

.login-brand-panel p,
.login-security-note,
.login-kicker {
  color: #b8c1d0;
}

.login-kicker,
.login-security-note {
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.login-form-panel {
  align-self: center;
  padding: 2.5rem;
}

.login-form-panel h2 {
  font-size: 1.75rem;
  font-weight: 850;
  margin: 0.35rem 0;
}

.login-form-panel .form-control {
  font-size: 1rem;
  min-height: 48px;
}

.login-help {
  color: var(--tf-muted);
  font-size: 0.82rem;
  margin: 1.2rem 0 0;
  text-align: center;
}

@media (max-width: 767.98px) {
  .login-shell {
    padding: 0.75rem;
  }

  .login-stage {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .login-brand-panel {
    min-height: 180px;
    padding: 1.35rem;
  }

  .login-brand-panel h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
  }

  .login-security-note {
    display: none;
  }

  .login-form-panel {
    padding: 1.35rem;
  }

  main.container-fluid {
    padding-inline: 0.6rem !important;
    padding-top: 0.65rem !important;
  }

  .admin-shell {
    gap: 0.65rem;
  }

  .page-head {
    padding: 0.75rem;
  }

  .quick-stats,
  .appointment-card,
  .management-grid,
  .compact-form {
    grid-template-columns: 1fr;
  }

  .quick-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .top-actions {
    width: 100%;
    gap: 0.4rem;
  }

  .top-actions .btn {
    flex: 1 1 140px;
    padding-block: 0.42rem;
  }

  .appointment-actions,
  .inline-action {
    align-items: stretch;
    flex-direction: column;
  }

  .appointment-actions .btn,
  .appointment-actions .form-control,
  .inline-action .btn,
  .inline-action .form-control {
    max-width: none;
    width: 100%;
  }

  .mini-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .customer-appointment {
    flex-direction: column;
  }

  .bot-context-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-input-form {
    grid-template-columns: 1fr;
  }

  .appointment-create-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991.98px) {
  .appointment-card,
  .management-grid {
    grid-template-columns: 1fr;
  }

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

  .compact-form .btn {
    grid-column: 1 / -1;
  }

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

@media (max-width: 575.98px) {
  body {
    font-size: 13px;
  }

  .page-head {
    align-items: stretch !important;
    gap: 0.55rem !important;
  }

  .page-head h1 {
    font-size: 1.25rem;
    margin-bottom: 0.1rem !important;
  }

  .page-head p {
    display: none;
  }

  .page-head::after {
    height: 58px;
    opacity: 0.52;
    width: 150px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(88px, 1.4fr) repeat(3, minmax(0, 0.8fr));
  }

  .top-actions .btn {
    font-size: 0.72rem;
    min-height: 32px;
    padding-inline: 0.35rem;
    width: 100%;
    white-space: normal;
  }

  .history-summary,
  .compact-form,
  .appointment-create-form {
    grid-template-columns: 1fr;
  }

  .quick-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .stat-card {
    min-height: 56px;
    padding: 0.55rem;
  }

  .stat-label {
    font-size: 0.68rem;
  }

  .stat-value {
    font-size: 1.08rem;
  }

  .bg-white.border.rounded-2 {
    padding: 0.75rem !important;
  }

  .bg-white.border.rounded-2 h2 {
    font-size: 1.02rem;
  }

  .bg-white.border.rounded-2 p {
    font-size: 0.82rem;
  }

  .history-summary {
    display: grid;
  }

  .history-summary div {
    min-width: 0;
  }

  .table {
    font-size: 0.86rem;
  }

  .table-responsive {
    overflow-x: visible;
  }

  .mobile-stack-table,
  .mobile-stack-table tbody,
  .mobile-stack-table tr,
  .mobile-stack-table td {
    display: block;
    width: 100%;
  }

  .mobile-stack-table thead {
    display: none;
  }

  .mobile-stack-table tr {
    background: #ffffff;
    border: 1px solid var(--tf-line);
    border-radius: 8px;
    margin-bottom: 0.7rem;
    padding: 0.35rem 0;
  }

  .mobile-stack-table td {
    border: 0;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(82px, 0.42fr) minmax(0, 1fr);
    padding: 0.45rem 0.7rem;
    word-break: break-word;
  }

  .mobile-stack-table td::before {
    color: var(--tf-muted);
    content: attr(data-label);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .modal-dialog {
    margin-inline: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .modal-body.row {
    margin-inline: 0;
  }
}

@media (max-width: 379.98px) {
  .stat-card {
    min-height: 60px;
  }
}

/* TurnoFlow admin workspace */
.tf-workspace {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 180px minmax(0, 1fr);
  margin-inline: auto;
  max-width: 1440px;
  width: 100%;
}

.tf-sidebar {
  align-self: start;
  background: #090f1d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  gap: 1.25rem;
  min-height: calc(100vh - 110px);
  padding: 1.1rem 0.85rem;
  position: sticky;
  top: 1rem;
}

.tf-sidebar-brand {
  align-items: center;
  color: #ffffff;
  display: flex;
  font-size: 1.05rem;
  font-weight: 800;
  gap: 0.65rem;
  min-width: 0;
  padding-inline: 0.65rem;
  text-decoration: none;
}

.tf-sidebar-brand > span:last-child,
.tf-mobile-brand > span:last-child {
  display: grid;
  min-width: 0;
}

.tf-sidebar-brand strong,
.tf-mobile-brand strong {
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.tf-sidebar-brand small,
.tf-mobile-brand small {
  color: #9ca7b7;
  font-size: 0.64rem;
  font-weight: 600;
}

.tf-business-logo,
.tf-business-logo-fallback {
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  flex: 0 0 42px;
  height: 42px;
  object-fit: cover;
  width: 42px;
}

.tf-business-logo-fallback {
  align-items: center;
  background: #6f3dff;
  color: #ffffff;
  display: flex;
  font-size: 1rem;
  justify-content: center;
}

.tf-sidebar-nav {
  display: grid;
  gap: 0.45rem;
}

.tf-sidebar-nav a,
.tf-mobile-nav a {
  text-decoration: none;
}

.tf-sidebar-nav a {
  border-radius: 8px;
  color: #aeb7c5;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.7rem 0.8rem;
}

.tf-sidebar-nav a:hover,
.tf-sidebar-nav a.active {
  background: #33265f;
  color: #d7c9ff;
}

.tf-mobile-nav {
  display: none;
}

.tf-mobile-brand {
  display: none;
}

.tf-branding-form {
  border-top: 1px solid var(--tf-line);
  display: grid;
  gap: 0.75rem;
  padding-top: 0.85rem;
}

.tf-branding-heading {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.tf-branding-heading > div {
  display: grid;
}

.tf-branding-heading span,
.tf-theme-option small {
  color: var(--tf-muted);
  font-size: 0.78rem;
}

.tf-branding-logo-preview {
  border: 1px solid var(--tf-line);
  border-radius: 50%;
  height: 52px;
  object-fit: cover;
  width: 52px;
}

.tf-theme-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tf-theme-option {
  border: 1px solid var(--tf-line);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.45rem;
  position: relative;
}

.tf-theme-option input {
  opacity: 0;
  position: absolute;
}

.tf-theme-option:has(input:checked) {
  border-color: var(--tf-primary);
  box-shadow: 0 0 0 2px var(--tf-focus);
}

.tf-theme-option:has(input:focus-visible) {
  outline: 2px solid var(--tf-primary);
  outline-offset: 2px;
}

.tf-theme-preview {
  border: 1px solid rgba(24, 33, 43, 0.1);
  border-radius: 6px;
  display: block;
  height: 54px;
  width: 100%;
}

.tf-theme-option strong {
  font-size: 0.82rem;
}

.tf-logo-upload-row {
  align-items: end;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.tf-logo-upload-row > label:first-child {
  min-width: 0;
}

.tf-remove-logo {
  margin-bottom: 0.45rem;
  white-space: nowrap;
}

.tf-main {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.tf-hero,
.tf-panel,
.tf-data-card,
.tf-mini-section {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--tf-line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(24, 33, 43, 0.06);
  max-width: 100%;
  min-width: 0;
}

.tf-hero {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem;
}

.tf-hero h1 {
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0.1rem 0 0.35rem;
}

.tf-hero p,
.tf-panel-head p,
.tf-appointment-body p {
  color: var(--tf-muted);
  margin: 0;
}

.tf-hero-actions,
.tf-action-row,
.tf-panel-head,
.tf-pagination-row,
.tf-card-title-row,
.tf-inline-form,
.tf-appointment-actions {
  display: flex;
  gap: 0.55rem;
}

.tf-hero-actions,
.tf-action-row {
  flex-wrap: wrap;
}

.tf-panel {
  padding: 1rem;
  scroll-margin-top: 1rem;
}

.tf-panel-head {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.tf-panel-head.compact {
  margin-bottom: 0.55rem;
}

.tf-panel-head h2,
.tf-panel-head h3,
.tf-mini-section h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
}

.tf-stats-grid,
.tf-money-grid,
.tf-card-grid,
.tf-split-grid {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.tf-stats-grid,
.tf-money-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.tf-card-grid.single {
  grid-template-columns: 1fr;
}

.tf-split-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
}

.tf-filter-bar {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto;
}

.tf-pagination-row {
  align-items: center;
  color: var(--tf-muted);
  font-size: 0.88rem;
  justify-content: space-between;
  margin-top: 0.75rem;
}

.tf-appointment-list,
.tf-stack {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}

.tf-appointment-item {
  align-items: start;
  background: #ffffff;
  border: 1px solid var(--tf-line);
  border-left: 4px solid var(--tf-primary);
  border-radius: 8px;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 76px minmax(0, 1fr) minmax(260px, 0.95fr);
  padding: 0.85rem;
}

.tf-appointment-time {
  background: #f4f0ff;
  border-radius: 8px;
  color: var(--tf-primary-dark);
  display: grid;
  min-height: 66px;
  place-items: center;
  text-align: center;
}

.tf-appointment-time strong {
  font-size: 1.12rem;
  line-height: 1;
}

.tf-appointment-time span,
.tf-card-title-row span,
.tf-compact-row span {
  color: var(--tf-muted);
  display: block;
  font-size: 0.82rem;
}

.tf-appointment-body h3 {
  font-size: 1.02rem;
  font-weight: 800;
  margin: 0.35rem 0 0.15rem;
}

.tf-appointment-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tf-inline-form {
  align-items: center;
  flex-wrap: wrap;
}

.tf-inline-form .form-control {
  max-width: 150px;
}

.tf-move-form .form-control {
  max-width: 190px;
}

.tf-data-card {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
}

.tf-card-title-row {
  align-items: flex-start;
  justify-content: space-between;
}

.tf-card-title-row strong {
  display: block;
  font-size: 0.98rem;
}

.tf-edit-grid,
.tf-inline-edit {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.tf-edit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
}

.tf-edit-grid .btn {
  grid-column: 1 / -1;
}

.tf-list-table-wrap {
  min-width: 0;
  overflow-x: auto;
}

.tf-list-table th {
  white-space: nowrap;
}

.tf-detail-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.tf-detail-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--tf-line);
  border-radius: 8px;
  min-width: 0;
  padding: 1rem;
}

.tf-detail-form {
  display: grid;
  gap: 0.75rem;
}

.tf-detail-form label {
  color: var(--tf-muted);
  display: grid;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 0.35rem;
}

.tf-detail-history {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tf-detail-history-row {
  align-items: center;
  border-top: 1px solid var(--tf-line);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding-top: 0.65rem;
}

.tf-detail-history-row strong,
.tf-detail-history-row span {
  display: block;
}

.tf-detail-history-row span:not(.badge) {
  color: var(--tf-muted);
  font-size: 0.85rem;
}

.tf-mini-section {
  padding: 0.85rem;
}

.tf-compact-row {
  align-items: start;
  border-top: 1px solid var(--tf-line);
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  padding-block: 0.7rem;
}

.tf-compact-row:first-of-type {
  border-top: 0;
}

.tf-inline-edit {
  grid-template-columns: 0.8fr 0.8fr 0.8fr auto;
}

.tf-subtitle {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
}

.tf-money-grid div {
  background: #fafbfc;
  border: 1px solid var(--tf-line);
  border-radius: 8px;
  padding: 0.85rem;
}

.tf-money-grid span {
  color: var(--tf-muted);
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.tf-money-grid strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1.15;
  margin-top: 0.2rem;
}

.tf-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.tf-agenda-panel {
  padding: 1.25rem;
}

.tf-agenda-heading {
  align-items: center;
}

.tf-count-pill {
  background: #dcf8f0;
  border-radius: 999px;
  color: #069675;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.55rem 1.05rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.tf-schedule-list {
  display: grid;
  gap: 0.75rem;
}

.tf-schedule-row {
  border: 0;
  display: block;
  min-width: 0;
}

.tf-schedule-row > summary,
.tf-schedule-static {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 1rem;
  grid-template-columns: 74px minmax(180px, 1fr) minmax(110px, 0.38fr) minmax(116px, 0.35fr);
  list-style: none;
  min-width: 0;
}

.tf-schedule-row > summary::-webkit-details-marker {
  display: none;
}

.tf-schedule-time {
  color: #69748a;
  font-weight: 800;
  text-align: center;
}

.tf-schedule-pill {
  align-items: center;
  background: #e1f8f3;
  border-radius: 8px;
  display: grid;
  gap: 0.4rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  min-height: 50px;
  min-width: 0;
  padding: 0.7rem 1rem;
}

.tf-schedule-pill strong,
.tf-schedule-pill span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tf-schedule-pill span {
  color: #069675;
  font-size: 0.86rem;
  font-weight: 800;
}

.tf-schedule-state,
.tf-detail-button {
  align-items: center;
  border-radius: 8px;
  display: flex;
  font-size: 0.82rem;
  font-weight: 800;
  justify-content: center;
  min-height: 50px;
  padding: 0.65rem 0.8rem;
  text-align: center;
}

.tf-schedule-state {
  background: #f3f5fb;
  color: #66728a;
}

.tf-detail-button {
  background: #f7f6fd;
  color: #66728a;
}

.tf-schedule-row[open] > summary .tf-detail-button {
  background: #ede8ff;
  color: var(--tf-primary-dark);
}

.tf-schedule-detail {
  background: #ffffff;
  border: 1px solid var(--tf-line);
  border-radius: 8px;
  display: grid;
  gap: 0.85rem;
  margin: 0.6rem 0 0 74px;
  padding: 0.85rem;
}

.tf-schedule-detail p {
  color: var(--tf-muted);
  margin: 0.15rem 0 0;
}

.tf-next-label {
  background: #ffffff;
  border: 1px solid #81ddc8;
  border-radius: 999px;
  color: #067c63;
  display: inline-block;
  font-size: 0.68rem;
  margin-left: 0.45rem;
  padding: 0.15rem 0.42rem;
  text-transform: uppercase;
}

.tf-schedule-row.is-next > summary {
  border-left: 3px solid #12a985;
  padding-left: 0.35rem;
}

.tf-appointment-actions {
  align-items: stretch;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.tf-checkout-form {
  align-items: end;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(150px, 220px) minmax(180px, max-content);
  justify-content: end;
}

.tf-checkout-form label,
.tf-move-form label {
  color: var(--tf-muted);
  display: grid;
  font-size: 0.76rem;
  font-weight: 700;
  gap: 0.25rem;
}

.tf-primary-appointment-action {
  display: flex;
  justify-content: flex-end;
}

.tf-secondary-actions {
  border-top: 1px solid var(--tf-line);
  padding-top: 0.65rem;
}

.tf-secondary-actions > summary {
  color: var(--tf-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  list-style-position: inside;
  text-align: right;
}

.tf-secondary-actions > div {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.65rem;
}

.tf-secondary-actions form {
  margin: 0;
}

.tf-secondary-actions .tf-move-form {
  align-items: end;
  display: flex;
  gap: 0.45rem;
}

.tf-schedule-row.is-pending .tf-schedule-pill {
  background: #eee8ff;
}

.tf-schedule-row.is-pending .tf-schedule-pill span {
  color: var(--tf-primary-dark);
}

.tf-schedule-row.is-paid .tf-schedule-pill {
  background: #e1f8f3;
}

.tf-schedule-row.is-blocked .tf-schedule-pill {
  background: #eef1f5;
}

.tf-schedule-row.is-blocked .tf-schedule-pill span {
  color: #66728a;
}

.tf-schedule-row.is-blocked .tf-schedule-static {
  cursor: default;
}

.tf-schedule-static form {
  margin: 0;
  min-width: 0;
}

.tf-schedule-row.is-blocked .tf-detail-button {
  cursor: pointer;
}

.tf-agenda-sections {
  display: grid;
  gap: 1.25rem;
}

.tf-agenda-group {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.tf-group-heading {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.tf-group-heading h3 {
  font-size: 1rem;
  font-weight: 900;
  margin: 0;
}

.tf-group-heading span {
  background: #f3f5fb;
  border-radius: 999px;
  color: #66728a;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.4rem 0.75rem;
  white-space: nowrap;
}

.empty-state.compact {
  padding: 0.8rem 1rem;
}

@media (max-width: 1199.98px) {
  .tf-workspace {
    grid-template-columns: 154px minmax(0, 1fr);
  }

  .tf-stats-grid,
  .tf-money-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tf-appointment-item,
  .tf-split-grid {
    grid-template-columns: 1fr;
  }

  .tf-appointment-actions {
    justify-content: flex-start;
  }

  .tf-schedule-row > summary,
  .tf-schedule-static {
    grid-template-columns: 68px minmax(0, 1fr) minmax(104px, 0.35fr);
  }

  .tf-detail-button {
    grid-column: 2 / -1;
  }

  .tf-theme-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .tf-workspace {
    display: block;
  }

  .tf-sidebar {
    display: none;
  }

  .tf-mobile-nav {
    background: #090f1d;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.8rem;
    max-width: 100%;
    overflow-x: visible;
    padding: 0.45rem;
    position: sticky;
    top: 0.5rem;
    z-index: 5;
  }

  .tf-mobile-brand {
    align-items: center;
    background: rgba(9, 15, 29, 0.96);
    border-radius: 8px 8px 0 0;
    color: #ffffff;
    display: flex;
    gap: 0.65rem;
    margin-bottom: -0.8rem;
    padding: 0.65rem 0.75rem 1.1rem;
  }

  .tf-mobile-brand + .tf-mobile-nav {
    border-radius: 0 0 8px 8px;
  }

  .tf-mobile-nav a {
    border-radius: 8px;
    color: #aeb7c5;
    flex: 1 1 92px;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 0.55rem 0.7rem;
    text-align: center;
  }

  .tf-mobile-nav a.active,
  .tf-mobile-nav a:hover {
    background: #33265f;
    color: #d7c9ff;
  }

  .tf-main {
    gap: 0.8rem;
  }

  .tf-card-grid,
  .tf-filter-bar,
  .tf-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .app-navbar .container-fluid {
    padding-inline: 0.75rem !important;
  }

  .navbar-nav {
    max-width: 100%;
    overflow-x: auto;
  }

  .tf-hero,
  .tf-panel-head,
  .tf-card-title-row,
  .tf-pagination-row {
    align-items: stretch;
    flex-direction: column;
  }

  .tf-hero-actions .btn,
  .tf-action-row .btn,
  .tf-panel-head > .btn {
    width: 100%;
  }

  .tf-stats-grid,
  .tf-money-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tf-appointment-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .tf-appointment-time {
    align-items: center;
    display: flex;
    justify-content: space-between;
    min-height: 0;
    padding: 0.65rem;
  }

  .tf-appointment-actions,
  .tf-inline-form,
  .tf-inline-edit,
  .tf-compact-row,
  .tf-edit-grid {
    grid-template-columns: 1fr;
  }

  .tf-list-table thead {
    display: none;
  }

  .tf-list-table,
  .tf-list-table tbody,
  .tf-list-table tr,
  .tf-list-table td {
    display: block;
    width: 100%;
  }

  .tf-list-table tr {
    border-bottom: 1px solid var(--tf-line);
    padding-block: 0.65rem;
  }

  .tf-list-table td {
    border: 0;
    padding: 0.2rem 0;
    text-align: left !important;
  }

  .tf-list-table td::before {
    color: var(--tf-muted);
    content: attr(data-label) ": ";
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .tf-list-table td:last-child::before {
    content: "";
  }

  .tf-detail-history-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .tf-appointment-actions {
    align-items: stretch;
  }

  .tf-appointment-actions .btn,
  .tf-appointment-actions .form-control,
  .tf-inline-form .btn,
  .tf-inline-form .form-control {
    max-width: none;
    width: 100%;
  }

  .tf-agenda-panel {
    padding: 0.85rem;
  }

  .tf-count-pill {
    align-self: flex-start;
  }

  .tf-schedule-row > summary,
  .tf-schedule-static {
    align-items: stretch;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 0.45rem;
  }

  .tf-schedule-time {
    background: #f7f6fd;
    border-radius: 8px;
    padding: 0.45rem;
    text-align: left;
  }

  .tf-schedule-pill {
    grid-column: 2;
    grid-template-columns: 1fr;
  }

  .tf-schedule-state {
    font-size: 0.72rem;
    grid-column: 1;
    min-height: 42px;
    overflow-wrap: anywhere;
    padding: 0.4rem;
  }

  .tf-detail-button {
    grid-column: 2;
    min-height: 42px;
  }

  .tf-schedule-static form,
  .tf-schedule-static .tf-detail-button {
    width: 100%;
  }

  .tf-schedule-detail {
    padding: 0.75rem;
    margin-left: 0;
  }

  .tf-checkout-form {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .tf-checkout-form .btn,
  .tf-primary-appointment-action .btn {
    min-height: 46px;
    width: 100%;
  }

  .tf-primary-appointment-action {
    display: block;
  }

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

  .tf-logo-upload-row {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  .tf-remove-logo {
    margin-bottom: 0;
    white-space: normal;
  }

  .tf-secondary-actions > summary {
    padding-block: 0.35rem;
    text-align: left;
  }

  .tf-secondary-actions > div {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .tf-secondary-actions form,
  .tf-secondary-actions .btn {
    width: 100%;
  }

  .tf-secondary-actions .tf-move-form {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .tf-stats-grid,
  .tf-money-grid {
    grid-template-columns: 1fr;
  }

  .tf-schedule-row > summary,
  .tf-schedule-static {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .tf-theme-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tf-day-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tf-day-option {
  margin: 0;
  min-width: 0;
  position: relative;
}

.tf-day-option input {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.tf-day-option span {
  align-items: center;
  background: #f7f6fd;
  border: 1px solid var(--tf-line);
  border-radius: 8px;
  color: var(--tf-muted);
  cursor: pointer;
  display: flex;
  font-size: 0.78rem;
  font-weight: 700;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.45rem 0.35rem;
  text-align: center;
}

.tf-day-option input:checked + span {
  background: #33265f;
  border-color: #33265f;
  color: #fff;
}

.tf-day-option input:focus-visible + span {
  box-shadow: 0 0 0 0.2rem rgb(111 61 255 / 20%);
  outline: 2px solid #6f3dff;
}

.tf-record-details > summary {
  cursor: pointer;
  list-style: none;
}

.tf-record-details > summary::-webkit-details-marker {
  display: none;
}

.tf-record-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tf-record-details[open] > summary .btn {
  background: #f1edff;
  border-color: #6f3dff;
  color: #4e2ab5;
}

.tf-filter-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
}

.tf-filter-summary::-webkit-details-marker {
  display: none;
}

.tf-filter-summary > span:first-child {
  display: grid;
}

.tf-range-actions,
.tf-search-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tf-search-row .form-control {
  max-width: 34rem;
}

.tf-owner-search {
  max-width: 22rem;
}

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

  .tf-filter-summary,
  .tf-search-row {
    align-items: stretch;
    flex-direction: column;
  }

  .tf-search-row .form-control,
  .tf-owner-search {
    max-width: none;
    width: 100%;
  }
}
