/* ===== V2.13 · Одобрена компактна визия за цялата платформа ===== */
:root,
body.theme-classic {
  --bg: #f3f8f7;
  --page-top: #fbfdfd;
  --card: #ffffff;
  --card-soft: #f7fbfa;
  --border: #d8e8e5;
  --border-strong: #bdd7d3;
  --text: #12233f;
  --muted: #66778a;
  --primary: #079b9a;
  --primary-2: #47c9c1;
  --primary-dark: #087879;
  --primary-soft: #e9f8f6;
  --accent: #0b8585;
  --accent-soft: #e4f6f3;
  --input-bg: #ffffff;
  --shadow: 0 7px 22px rgba(38, 96, 94, 0.08);
  --radius: 8px;
}

body {
  background: #f6faf9;
  color: var(--text);
  letter-spacing: 0;
}

.page-shell {
  padding: 0 18px 18px;
}

.container {
  max-width: 1480px;
}

.app-header {
  margin: 0 -18px 8px;
  padding: 9px max(18px, calc((100vw - 1480px) / 2 + 18px));
  border: 0;
  border-bottom: 1px solid #d5ebe8;
  border-radius: 0;
  background: linear-gradient(105deg, #ffffff 0%, #effaf8 54%, #dff6f3 100%);
  box-shadow: 0 4px 16px rgba(42, 107, 102, 0.06);
}

body[class*="theme-"] .app-header {
  border-color: var(--border);
  background: linear-gradient(105deg, var(--card) 0%, var(--primary-soft) 58%, var(--accent-soft) 100%);
}

.brand-wrap {
  gap: 9px;
}

.brand-logo {
  width: 48px;
  height: 48px;
}

.brand-logo img {
  filter: none;
}

.brand-text h1 {
  color: #102542;
  font-size: 22px;
  font-weight: 800;
}

.brand-subtitle {
  color: #576b7d;
  font-size: 12px;
}

.brand-author-script {
  color: #138b8a;
  font-size: 14px;
}

.header-actions {
  gap: 10px;
}

.header-icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #d9e9e7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #078d8d;
  box-shadow: 0 4px 14px rgba(50, 111, 107, 0.08);
}

.header-icon-button:hover,
.header-icon-button.active {
  color: #067979;
  border-color: #a9d7d2;
  background: #ffffff;
  transform: translateY(-1px);
}

.header-icon-button .lucide {
  width: 21px;
  height: 21px;
}

.header-icon-label {
  display: none;
}

.tabs-nav {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  margin: 0 0 12px;
  padding: 0;
  border: 1px solid #dbe9e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(51, 102, 99, 0.06);
}

.tab-button,
.tab-button:not(.active) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px 10px;
  border: 0;
  border-right: 1px solid #e6efed;
  border-radius: 0;
  background: #ffffff;
  color: #135f70;
  box-shadow: none;
  font-size: 12.5px;
}

.tab-button:last-child {
  border-right: 0;
}

.tab-button .lucide {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: #079899;
}

.tab-button.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #49cbc2 0%, #0a9292 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.tab-button.active .lucide {
  color: #ffffff;
}

.app-card {
  padding: 15px 17px;
  border: 1px solid #dbe9e7;
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.section-heading {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e4efed;
}

.section-heading h2 {
  color: #087777;
  font-size: 18px;
  font-weight: 800;
}

.section-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

h3 {
  color: #0c696d;
  font-size: 15px;
}

label {
  margin-top: 5px;
  color: #285e65;
  font-size: 11.5px;
}

input,
select,
textarea {
  min-height: 35px;
  padding: 7px 10px;
  border-color: #bfd7d4;
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
}

textarea {
  min-height: 70px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #24aaa6;
  box-shadow: 0 0 0 3px rgba(32, 169, 164, 0.12);
}

button {
  min-height: 35px;
  border-radius: 8px;
  font-size: 13px;
}

.btn-primary,
button.btn-primary,
#generateProtocolButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(135deg, #35c5bb 0%, #078f90 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(8, 143, 144, 0.16);
}

.btn-secondary,
button.btn-secondary {
  background: #eef9f7;
  color: #08797a;
  border: 1px solid #a8d6d1;
  box-shadow: none;
}

.btn-ghost,
button.btn-ghost {
  color: #446a70;
  background: #f5f9f8;
  border: 1px solid #d9e6e4;
  box-shadow: none;
}

.form-row {
  gap: 8px;
}

.button-row {
  margin-top: 9px;
}

.result-box {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f7fbfa;
}

.client-mode-tabs,
.report-mode-tabs {
  padding: 3px;
  border: 1px solid #cfe2df;
  border-radius: 8px;
  background: #f4faf9;
  box-shadow: none;
}

.client-mode-button,
.report-mode-button {
  min-height: 34px;
  border-radius: 6px;
}

.client-mode-button.active,
.report-mode-button.active {
  color: #ffffff !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, #37c4bb 0%, #078e8f 100%);
}

.table-wrap {
  border: 1px solid #dbe8e6;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.services-table th,
.report-table th,
.settings-table th {
  padding: 8px 9px;
  color: #17656c;
  background: #eff9f7;
  font-size: 11.5px;
}

.services-table td,
.report-table td,
.settings-table td {
  padding: 7px 9px;
  border-color: #e5eeec;
  font-size: 12px;
}

.schedule-layout {
  gap: 12px;
}

.schedule-day {
  border-radius: 8px;
  border-color: #d9e8e5;
  box-shadow: none;
}

.schedule-day h4 {
  color: #176a70;
  background: #f0f9f7;
}

.compact-filters {
  gap: 7px;
  padding: 7px;
  border: 1px solid #dce9e7;
  border-radius: 8px;
  background: #f7fbfa;
}

.status-pill,
.sub-status-active {
  border-radius: 999px;
  color: #277a50;
  background: #e9f8ef;
}

/* Профилът е единният център за данни и настройки. */
.profile-card {
  padding-bottom: 16px;
}

.profile-main-heading {
  margin-bottom: 12px;
}

.profile-topline {
  grid-template-columns: auto minmax(260px, 1fr);
  gap: 12px 18px;
  align-items: center;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid #dceae8;
  border-radius: 8px;
  background: linear-gradient(105deg, #ffffff 0%, #f5fbfa 62%, #ebf8f6 100%);
  box-shadow: 0 5px 16px rgba(45, 103, 99, 0.06);
}

.profile-avatar-panel {
  grid-row: 1;
}

.profile-avatar {
  width: 84px;
  height: 84px;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 15px rgba(37, 98, 94, 0.14);
}

.profile-avatar-actions {
  gap: 5px;
}

.profile-identity-summary {
  grid-column: 2;
  min-width: 0;
}

.profile-identity-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.profile-identity-title strong {
  color: #12233f;
  font-size: 20px;
}

.profile-active-badge {
  padding: 4px 9px;
  border-radius: 999px;
  color: #24754f;
  background: #e7f7ed;
  font-size: 10.5px;
  font-weight: 800;
}

.profile-identity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 8px;
  color: #52677a;
  font-size: 12px;
}

.profile-identity-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.profile-identity-meta .lucide {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #079393;
}

.profile-main-grid {
  grid-column: 1 / -1;
  padding-top: 10px;
  border-top: 1px solid #e1ecea;
}

.profile-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.profile-dashboard-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  gap: 10px;
  align-items: center;
  min-height: 88px;
  padding: 12px;
  border: 1px solid #dbe9e7;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 5px 15px rgba(45, 98, 94, 0.06);
  text-align: left;
}

.profile-dashboard-card:hover,
.profile-dashboard-card.active {
  opacity: 1;
  border-color: #68c5be;
  background: #f5fbfa;
  box-shadow: 0 6px 18px rgba(22, 133, 129, 0.10);
}

.profile-dashboard-card.active {
  box-shadow: inset 3px 0 0 #0b9998, 0 6px 18px rgba(22, 133, 129, 0.10);
}

.profile-dashboard-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #078f90;
  background: #e9f8f6;
}

.profile-dashboard-icon .lucide {
  width: 22px;
  height: 22px;
}

.profile-dashboard-card > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.profile-dashboard-card strong {
  color: #15253f;
  font-size: 13.5px;
}

.profile-dashboard-card small {
  color: #68798a;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.3;
}

.profile-dashboard-arrow {
  width: 17px;
  height: 17px;
  color: #079393;
}

.profile-dashboard-card-wide {
  grid-column: 1 / -1;
}

.profile-section-grid {
  display: block;
}

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

.profile-dashboard-panel.active {
  display: block;
}

.profile-mini-section.profile-dashboard-panel,
.profile-settings-panels .settings-block {
  margin: 0;
  padding: 13px 2px 2px;
  border: 0;
  border-top: 1px solid #dfecea;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.profile-mini-section h3,
.profile-settings-panels .settings-block > h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
}

.profile-mini-section h3 .lucide {
  width: 18px;
  height: 18px;
}

.profile-panel-save-row button {
  flex: 0 0 auto;
  min-width: 190px;
}

.profile-panel-save-row .lucide {
  width: 16px;
  height: 16px;
}

.profile-settings-source {
  display: none !important;
}

.profile-settings-panels .theme-settings-block {
  max-width: none;
}

.profile-settings-panels .theme-picker-grid {
  max-width: 760px;
}

.profile-settings-panels .legal-block {
  max-width: none;
}

.subscription-overview,
.subscription-modules {
  border-radius: 8px;
}

.legal-doc {
  border-radius: 8px;
}

body.theme-dark .profile-topline,
body.theme-dark .profile-dashboard-card {
  background: var(--card);
  border-color: var(--border);
}

body.theme-dark .profile-dashboard-card.active {
  background: var(--card-soft);
}

body.theme-dark .profile-identity-title strong,
body.theme-dark .profile-dashboard-card strong {
  color: var(--text);
}

@media (max-width: 1100px) {
  .tab-button,
  .tab-button:not(.active) {
    gap: 5px;
    padding-inline: 6px;
    font-size: 11px;
  }

  .tab-button .lucide {
    width: 18px;
    height: 18px;
  }

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

  .profile-dashboard-card-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .page-shell {
    padding: 0 8px 10px;
  }

  .app-header {
    margin: 0 -8px 7px;
    padding: 7px 10px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .brand-text h1 {
    font-size: 17px;
  }

  .brand-author-script {
    font-size: 12px;
  }

  .header-actions {
    gap: 6px;
  }

  .header-icon-button {
    width: 38px;
    height: 38px;
  }

  .mobile-menu-bar {
    margin-bottom: 7px;
  }

  .mobile-menu-toggle {
    border: 1px solid #b8d8d4;
    border-radius: 8px;
    color: #087b7c;
    background: #ffffff;
  }

  .tabs-nav {
    display: flex;
    gap: 4px;
    padding: 8px;
    border-radius: 0 8px 8px 0;
  }

  .tab-button,
  .tab-button:not(.active) {
    justify-content: flex-start;
    width: 100%;
    min-height: 42px;
    border: 1px solid #e1ecea;
    border-radius: 7px;
    font-size: 12px;
  }

  .app-card {
    padding: 11px;
  }

  .section-heading {
    margin-bottom: 7px;
    padding-bottom: 6px;
  }

  .section-heading h2 {
    font-size: 16px;
  }

  input,
  select,
  textarea {
    min-height: 36px;
    font-size: 13px;
  }

  .profile-topline {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .profile-avatar {
    width: 66px;
    height: 66px;
  }

  .profile-identity-title strong {
    font-size: 16px;
  }

  .profile-identity-meta {
    display: grid;
    gap: 4px;
    margin-top: 5px;
    font-size: 10.5px;
  }

  .profile-main-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .profile-name-col {
    grid-column: 1 / -1;
  }

  .profile-dashboard-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .profile-dashboard-card {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    min-height: 72px;
    padding: 9px;
  }

  .profile-dashboard-icon {
    width: 34px;
    height: 34px;
  }

  .profile-dashboard-icon .lucide {
    width: 18px;
    height: 18px;
  }

  .profile-dashboard-card strong {
    font-size: 11.5px;
  }

  .profile-dashboard-card small,
  .profile-dashboard-arrow {
    display: none;
  }

  .profile-dashboard-card-wide {
    grid-column: 1;
  }

  .profile-data-grid,
  .profile-bank-grid {
    grid-template-columns: 1fr !important;
  }

  .profile-data-grid > *,
  .profile-bank-grid > * {
    grid-column: 1 / -1 !important;
  }

  .profile-panel-save-row button {
    width: 100%;
    min-width: 0;
  }

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

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

  .profile-topline {
    grid-template-columns: 1fr;
  }

  .profile-avatar-panel,
  .profile-identity-summary,
  .profile-main-grid {
    grid-column: 1;
  }

  .profile-avatar-panel {
    justify-self: center;
  }

  .profile-identity-summary {
    text-align: center;
  }

  .profile-identity-title,
  .profile-identity-meta > span {
    justify-content: center;
  }

  .profile-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .profile-dashboard-card-wide {
    grid-column: 1;
  }
}

/* ===== 2026-06-24 · Compact pass: мащаб, профил, облик, потвърждения ===== */
:root {
  --shell-max: 1360px;
  --control-height: 32px;
  --compact-radius: 8px;
  --compact-gap: 8px;
}

html {
  background: var(--bg);
}

body {
  font-size: 13px;
  line-height: 1.32;
  background:
    radial-gradient(circle at 82% 0%, color-mix(in srgb, var(--primary-soft) 78%, transparent) 0, transparent 34%),
    linear-gradient(180deg, var(--page-top, #f8fcfb) 0%, var(--bg) 100%);
}

.page-shell {
  padding: 0 14px 14px;
}

.container {
  width: min(100%, var(--shell-max));
  max-width: var(--shell-max);
  margin: 0 auto;
}

.app-header {
  margin: 0 0 8px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--compact-radius) var(--compact-radius);
  background: linear-gradient(105deg, var(--card) 0%, var(--primary-soft) 62%, var(--accent-soft) 100%);
}

.brand-wrap {
  min-height: 54px;
}

.brand-logo {
  width: 42px;
  height: 42px;
}

.brand-text h1 {
  font-size: 19px;
}

.brand-subtitle {
  font-size: 11.5px;
}

.brand-author-script {
  font-size: 12.5px;
}

.header-icon-button {
  width: 38px;
  height: 38px;
  border-radius: var(--compact-radius);
}

.header-icon-button .lucide {
  width: 18px;
  height: 18px;
}

.tabs-nav {
  margin-bottom: 10px;
  border-color: var(--border);
  border-radius: var(--compact-radius);
}

.tab-button,
.tab-button:not(.active) {
  min-height: 44px;
  padding: 6px 9px;
  color: var(--primary-dark);
  background: var(--card);
  border-color: var(--border);
  font-size: 12px;
}

.tab-button .lucide {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.tab-button.active {
  background: linear-gradient(135deg, var(--primary-2) 0%, var(--primary) 100%);
  color: #fff;
}

.app-card {
  padding: 12px 14px;
  border-color: var(--border);
  border-radius: var(--compact-radius);
}

.section-heading {
  margin-bottom: 8px;
  padding-bottom: 7px;
}

.section-heading h2 {
  font-size: 17px;
  color: var(--primary-dark);
}

label {
  margin-top: 4px;
  font-size: 11px;
  color: var(--primary-dark);
}

input,
select,
textarea {
  min-height: var(--control-height);
  padding: 6px 9px;
  border-color: var(--border-strong);
  border-radius: var(--compact-radius);
  background: var(--input-bg);
  font-size: 12.5px;
}

textarea {
  min-height: 58px;
}

button,
.btn-primary,
.btn-secondary,
.btn-ghost {
  min-height: var(--control-height);
  border-radius: var(--compact-radius);
}

.form-row,
.profile-field-grid,
.compact-filters {
  gap: var(--compact-gap);
}

.result-box {
  padding: 7px 9px;
  border-color: var(--border);
  background: var(--card-soft);
}

.table-wrap,
.schedule-day,
.client-mode-tabs,
.report-mode-tabs {
  border-color: var(--border);
  background: var(--card);
}

.services-table th,
.report-table th,
.settings-table th {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.services-table td,
.report-table td,
.settings-table td {
  border-color: var(--border);
}

body[class*="theme-"] .tabs-nav,
body[class*="theme-"] .tab-button:not(.active),
body[class*="theme-"] .app-card,
body[class*="theme-"] .table-wrap,
body[class*="theme-"] .schedule-day,
body[class*="theme-"] .profile-dashboard-card,
body[class*="theme-"] .confirmation-link-card,
body[class*="theme-"] .confirmation-friendly-link,
body[class*="theme-"] .client-mode-tabs,
body[class*="theme-"] .report-mode-tabs {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

body[class*="theme-"] .tab-button:not(.active) .lucide,
body[class*="theme-"] .profile-dashboard-icon,
body[class*="theme-"] .profile-dashboard-arrow,
body[class*="theme-"] .confirmation-send-channel-button,
body[class*="theme-"] .confirmation-friendly-link {
  color: var(--primary-dark);
}

body[class*="theme-"] .profile-dashboard-icon,
body[class*="theme-"] .confirmation-link-card-brand,
body[class*="theme-"] .confirmation-secure-mark,
body[class*="theme-"] .confirmation-send-channel-button,
body[class*="theme-"] .confirmation-friendly-link,
body[class*="theme-"] .confirmation-preview-item,
body[class*="theme-"] .confirmation-text-preview {
  background: var(--primary-soft);
  border-color: var(--border);
}

body[class*="theme-"] .profile-dashboard-card:hover,
body[class*="theme-"] .profile-dashboard-card.active {
  background: var(--card-soft);
  border-color: var(--primary);
}

body[class*="theme-"] .profile-dashboard-card.active {
  box-shadow: inset 3px 0 0 var(--primary), var(--shadow);
}

body[class*="theme-"] .tab-button.active,
body[class*="theme-"] .client-mode-button.active,
body[class*="theme-"] .report-mode-button.active,
body[class*="theme-"] .confirmation-open-link-button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-2) 0%, var(--primary) 100%);
}

body.theme-dark {
  background:
    radial-gradient(circle at 82% 0%, rgba(76, 118, 144, .22) 0, transparent 34%),
    linear-gradient(180deg, var(--page-top) 0%, var(--bg) 100%);
}

body.theme-dark .tab-button.active,
body.theme-dark .client-mode-button.active,
body.theme-dark .report-mode-button.active,
body.theme-dark .confirmation-open-link-button {
  color: #10202a;
}

/* Профил */
#profileTab .profile-main-heading {
  display: none;
}

#profileTab .profile-card {
  padding: 12px;
}

#profileTab .profile-topline {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 16px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border-color: var(--border);
  background: linear-gradient(105deg, var(--card) 0%, var(--card-soft) 70%, var(--primary-soft) 100%);
}

#profileTab .profile-avatar {
  width: 78px;
  height: 78px;
}

#profileTab .profile-avatar-actions {
  gap: 5px;
}

#profileTab .icon-mini-button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-color: var(--border);
  color: var(--primary-dark);
  background: var(--card);
}

#profileTab .profile-identity-title strong {
  font-size: 18px;
}

#profileTab .profile-active-badge {
  padding: 3px 8px;
  font-size: 10px;
}

#profileTab .profile-identity-meta {
  gap: 7px 15px;
  margin-top: 6px;
  font-size: 11.5px;
}

#profileTab .profile-main-grid {
  grid-template-columns: minmax(260px, 1fr) minmax(130px, .18fr) minmax(150px, .18fr);
  gap: 7px;
  padding-top: 8px;
}

#profileTab .profile-dashboard-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 10px;
}

#profileTab .profile-dashboard-card {
  grid-template-columns: 38px minmax(0, 1fr) 16px;
  gap: 9px;
  min-height: 72px;
  padding: 10px;
  border-color: var(--border);
  box-shadow: 0 4px 14px rgba(34, 86, 82, .055);
}

#profileTab .profile-dashboard-icon {
  width: 38px;
  height: 38px;
}

#profileTab .profile-dashboard-icon .lucide {
  width: 19px;
  height: 19px;
}

#profileTab .profile-dashboard-card strong {
  font-size: 13px;
}

#profileTab .profile-dashboard-card small {
  font-size: 10.2px;
}

#profileTab .profile-mini-section.profile-dashboard-panel,
#profileTab .profile-settings-panels .settings-block {
  padding-top: 10px;
}

#profileTab .profile-data-grid {
  grid-template-columns: minmax(260px, 1fr) minmax(170px, .36fr) minmax(260px, .8fr);
}

#profileTab .profile-bank-grid {
  grid-template-columns: repeat(3, minmax(130px, .35fr)) minmax(280px, 1fr);
}

#profileTab .profile-panel-save-row {
  margin-top: 8px;
}

#profileTab .profile-panel-save-row button {
  min-width: 168px;
}

#profileTab .theme-picker-grid {
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  max-width: 680px;
}

#profileTab .theme-option-button {
  min-height: 52px;
  border-color: var(--border);
  background: var(--card);
}

/* Потвърждения */
#confirmationsTab .app-card {
  max-width: 1180px;
  margin-inline: auto;
}

#confirmationsTab #confirmationForm {
  gap: 7px 10px;
}

@media (min-width: 769px) {
  #confirmationsTab #confirmationForm.confirmation-electronic-mode,
  #confirmationsTab #confirmationForm.confirmation-status-mode {
    width: min(100%, 1040px);
    margin-inline: auto;
  }

  #confirmationsTab .confirmation-top-fields {
    grid-template-columns: minmax(250px, 1fr) minmax(150px, .36fr) minmax(180px, .4fr);
    gap: 7px;
  }

  #confirmationsTab .confirmation-communication-details,
  #confirmationsTab .confirmation-link-options {
    grid-template-columns: minmax(230px, .7fr) minmax(260px, 1fr);
    gap: 7px;
  }

  #confirmationsTab .confirmation-participant-fields,
  #confirmationsTab .confirmation-phone-row {
    gap: 7px;
  }
}

#confirmationsTab .confirmation-preview-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

#confirmationsTab .confirmation-preview-item {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: var(--compact-radius);
  background: var(--card-soft);
}

#confirmationsTab .confirmation-preview-item strong {
  font-size: 10.5px;
  color: var(--primary-dark);
}

#confirmationsTab .confirmation-text-preview {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--compact-radius);
  background: var(--card-soft);
  line-height: 1.38;
}

#confirmationsTab .confirmation-link-result {
  max-width: 760px;
  margin: 8px auto 2px;
}

#confirmationsTab .confirmation-link-card {
  border-color: var(--border);
  border-radius: 10px;
  box-shadow: 0 7px 18px rgba(40, 101, 97, .08);
}

#confirmationsTab .confirmation-link-card h3 {
  margin: 11px 12px 8px;
  font-size: 16px;
  color: var(--primary-dark);
}

#confirmationsTab .confirmation-link-card-brand {
  grid-template-columns: 42px minmax(0, 1fr) 34px;
  padding: 9px 11px;
}

#confirmationsTab .confirmation-link-card-brand img {
  width: 40px;
  height: 40px;
}

#confirmationsTab .confirmation-link-card > p {
  margin: 10px 12px;
  font-size: 12.5px;
  line-height: 1.42;
}

#confirmationsTab .confirmation-open-link-button {
  width: min(430px, calc(100% - 24px));
  min-height: 38px;
}

#confirmationsTab .confirmation-friendly-link {
  width: min(470px, calc(100% - 24px));
}

#confirmationsTab .confirmation-share-actions {
  width: min(560px, calc(100% - 24px));
  gap: 8px;
}

#confirmationsTab .confirmation-share-actions .confirmation-send-channel-button {
  min-height: 36px;
}

#confirmationsTab .confirmation-link-meta {
  padding: 0 12px 10px;
}

@media (max-width: 1200px) {
  :root {
    --shell-max: 1120px;
  }

  .tabs-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #profileTab .profile-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .page-shell {
    padding: 0 10px 12px;
  }

  .app-header {
    padding: 7px 10px;
  }

  .app-card {
    padding: 11px 10px;
  }

  #profileTab .profile-topline,
  #profileTab .profile-main-grid,
  #profileTab .profile-dashboard-grid,
  #profileTab .profile-data-grid,
  #profileTab .profile-bank-grid,
  #confirmationsTab .confirmation-preview-summary {
    grid-template-columns: 1fr;
  }

  #profileTab .profile-main-grid > *,
  #profileTab .profile-data-grid > *,
  #profileTab .profile-bank-grid > * {
    grid-column: 1 / -1 !important;
  }

  #profileTab .theme-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  #confirmationsTab .confirmation-link-result {
    max-width: 100%;
  }
}

/* ===== 2026-06-25 · STEP 1 ONLY: общ мащаб, центриране и компактност =====
   Само визуален слой. Без промяна на функции, логики, PDF/Word генериране или данни. */
:root {
  --shell-max: 1180px;
  --control-height: 30px;
  --compact-gap: 6px;
  --compact-radius: 8px;
}

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

body {
  font-size: 12.5px;
  line-height: 1.28;
}

.page-shell {
  padding: 0 12px 12px !important;
}

.container,
.tab-panel.active,
.app-header,
.tabs-nav {
  width: min(100%, var(--shell-max)) !important;
  max-width: var(--shell-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

.app-header {
  margin-top: 0 !important;
  margin-bottom: 8px !important;
  padding: 6px 12px !important;
  min-height: unset !important;
}

.brand-wrap {
  min-height: 48px !important;
  gap: 8px !important;
}

.brand-logo {
  width: 38px !important;
  height: 38px !important;
}

.brand-text h1 {
  font-size: 18px !important;
  line-height: 1.05 !important;
}

.brand-subtitle {
  font-size: 11px !important;
}

.brand-author-script {
  font-size: 12px !important;
  margin-top: 2px !important;
}

.header-actions {
  gap: 7px !important;
}

.header-icon-button {
  width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
}

.header-icon-button .lucide,
.header-icon-button svg {
  width: 17px !important;
  height: 17px !important;
}

.tabs-nav {
  margin-bottom: 9px !important;
}

.tab-button,
.tab-button:not(.active) {
  min-height: 40px !important;
  padding: 5px 8px !important;
  gap: 6px !important;
  font-size: 11.5px !important;
}

.tab-button .lucide,
.tab-button svg {
  width: 17px !important;
  height: 17px !important;
}

.app-card {
  width: 100%;
  max-width: var(--shell-max);
  margin-left: auto;
  margin-right: auto;
  padding: 10px 12px !important;
  border-radius: var(--compact-radius) !important;
}

.app-card + .app-card,
.result-box + .app-card,
.table-wrap + .app-card {
  margin-top: 9px !important;
}

.section-heading {
  margin-bottom: 7px !important;
  padding-bottom: 6px !important;
}

.section-heading h2 {
  font-size: 16px !important;
  line-height: 1.15 !important;
}

.section-heading p {
  font-size: 11.5px !important;
}

h3 {
  margin-bottom: 5px !important;
  font-size: 14px !important;
}

p {
  margin-top: 0;
  margin-bottom: 6px !important;
}

label {
  margin-top: 3px !important;
  margin-bottom: 2px !important;
  font-size: 10.8px !important;
  line-height: 1.15 !important;
}

input,
select,
textarea {
  min-height: var(--control-height) !important;
  padding: 5px 8px !important;
  border-radius: var(--compact-radius) !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}

textarea {
  min-height: 50px !important;
}

button,
.btn-primary,
.btn-secondary,
.btn-ghost {
  min-height: var(--control-height) !important;
  padding: 6px 10px !important;
  border-radius: var(--compact-radius) !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}

.form-row,
.two-cols,
.three-cols,
.four-cols,
.five-cols,
.compact-filters,
.button-row {
  gap: var(--compact-gap) !important;
}

.button-row {
  margin-top: 7px !important;
}

.result-box,
.locked-module-note,
.confirmation-text-preview,
.online-placeholder {
  padding: 7px 9px !important;
  border-radius: var(--compact-radius) !important;
  font-size: 12px !important;
  line-height: 1.32 !important;
}

.table-wrap {
  border-radius: var(--compact-radius) !important;
}

.services-table th,
.report-table th,
.settings-table th,
.confirmations-table th,
.services-table td,
.report-table td,
.settings-table td,
.confirmations-table td {
  padding: 6px 8px !important;
  font-size: 11.5px !important;
}

/* Desktop: формите остават четими, но не заемат усещане за огромен екран. */
@media (min-width: 769px) {
  .tab-panel.active > .app-card,
  #serviceTab > .app-card,
  #scheduleTab > .app-card,
  #reportsTab > .app-card,
  #clientsTab > .app-card,
  #paymentRequestTab > .app-card,
  #explanationsTab > .app-card,
  #confirmationsTab > .app-card,
  #profileTab > .app-card {
    max-width: var(--shell-max) !important;
  }

  #confirmationsTab #confirmationForm {
    max-width: 1080px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    gap: 7px 12px !important;
  }

  #confirmationsTab .confirmation-top-fields,
  #confirmationsTab .confirmation-participant-fields,
  #confirmationsTab .confirmation-phone-row {
    gap: 6px !important;
  }

  #confirmationsTab .confirmation-link-result,
  #confirmationsTab .confirmation-link-card {
    max-width: 820px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  #profileTab .profile-card {
    max-width: 1120px !important;
  }

  #profileTab .profile-topline {
    padding: 11px 13px !important;
    gap: 10px 14px !important;
  }

  #profileTab .profile-avatar {
    width: 74px !important;
    height: 74px !important;
  }

  #profileTab .profile-identity-title strong {
    font-size: 18px !important;
  }

  #profileTab .profile-dashboard-grid {
    gap: 8px !important;
  }

  #profileTab .profile-dashboard-card {
    min-height: 74px !important;
    padding: 10px !important;
    grid-template-columns: 36px minmax(0, 1fr) 16px !important;
    gap: 8px !important;
  }

  #profileTab .profile-dashboard-icon {
    width: 36px !important;
    height: 36px !important;
  }

  #profileTab .profile-dashboard-icon .lucide {
    width: 19px !important;
    height: 19px !important;
  }

  #profileTab .profile-dashboard-card strong {
    font-size: 12.5px !important;
  }

  #profileTab .profile-dashboard-card small {
    font-size: 10px !important;
  }
}

@media (min-width: 1201px) {
  .tabs-nav {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1200px) {
  :root {
    --shell-max: 1040px;
  }
}

@media (max-width: 768px) {
  :root {
    --control-height: 34px;
  }

  .page-shell {
    padding: 0 8px 10px !important;
  }

  .container,
  .tab-panel.active,
  .app-header,
  .tabs-nav {
    width: 100% !important;
    max-width: 100% !important;
  }

  .app-header {
    padding: 7px 9px !important;
  }

  .brand-wrap {
    min-height: 44px !important;
  }

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

  .tab-button,
  .tab-button:not(.active) {
    min-height: 40px !important;
    font-size: 12px !important;
  }

  input,
  select,
  textarea {
    font-size: 13px !important;
  }
}

/* ===== STEP 2 · Профил по одобрения модел + глобален Облик ===== */
/* Темите се управляват централизирано чрез CSS variables върху body/html. */
html.theme-classic,
body.theme-classic {
  --bg: #f3f8f7;
  --page-top: #fbfdfd;
  --card: #ffffff;
  --card-soft: #f7fbfa;
  --border: #d8e8e5;
  --border-strong: #bdd7d3;
  --text: #12233f;
  --muted: #66778a;
  --primary: #079b9a;
  --primary-2: #47c9c1;
  --primary-dark: #087879;
  --primary-soft: #e9f8f6;
  --accent: #0b8585;
  --accent-soft: #e4f6f3;
  --input-bg: #ffffff;
  --shadow: 0 7px 22px rgba(38, 96, 94, 0.08);
}

html.theme-blue,
body.theme-blue {
  --bg: #edf3f8;
  --page-top: #f6f9fc;
  --card: #ffffff;
  --card-soft: #f6f9fc;
  --border: #c7d6e4;
  --border-strong: #aebfd1;
  --text: #26384d;
  --muted: #65768a;
  --primary: #3f79a8;
  --primary-2: #6ea4c8;
  --primary-dark: #2f638f;
  --primary-soft: #e6f0f7;
  --accent: #4f89b5;
  --accent-soft: #edf5fb;
  --input-bg: #ffffff;
  --shadow: 0 7px 22px rgba(56, 91, 125, 0.11);
}

html.theme-purple,
body.theme-purple {
  --bg: #f1edf7;
  --page-top: #fbf8fd;
  --card: #ffffff;
  --card-soft: #faf7fc;
  --border: #d9cde4;
  --border-strong: #c5b3d2;
  --text: #3e3447;
  --muted: #74667d;
  --primary: #7b5a9e;
  --primary-2: #a079b3;
  --primary-dark: #664882;
  --primary-soft: #f0e8f5;
  --accent: #8f6aa8;
  --accent-soft: #f6eef8;
  --input-bg: #ffffff;
  --shadow: 0 7px 22px rgba(105, 78, 125, 0.11);
}

html.theme-warm,
body.theme-warm {
  --bg: #f4ecdf;
  --page-top: #fffaf2;
  --card: #ffffff;
  --card-soft: #fff8ed;
  --border: #dfcfbb;
  --border-strong: #cbb79d;
  --text: #493b31;
  --muted: #7d6d5f;
  --primary: #b67858;
  --primary-2: #c99a68;
  --primary-dark: #8f6048;
  --primary-soft: #f7eadf;
  --accent: #b7895e;
  --accent-soft: #fbf1e6;
  --input-bg: #ffffff;
  --shadow: 0 7px 22px rgba(126, 94, 66, 0.11);
}

html.theme-dark,
body.theme-dark {
  --bg: #111820;
  --page-top: #1a222d;
  --card: #1d2732;
  --card-soft: #24303c;
  --border: #3a4856;
  --border-strong: #516171;
  --text: #e2e8ee;
  --muted: #aab6c2;
  --primary: #6f9fbd;
  --primary-2: #72b7aa;
  --primary-dark: #9bc7db;
  --primary-soft: #203647;
  --accent: #8ab79f;
  --accent-soft: #24372f;
  --input-bg: #17212b;
  --shadow: 0 10px 24px rgba(0,0,0,.28);
}

body[class*="theme-"] {
  background: radial-gradient(circle at 82% 0%, color-mix(in srgb, var(--primary-soft) 55%, transparent) 0, transparent 34%), linear-gradient(180deg, var(--page-top) 0%, var(--bg) 100%) !important;
  color: var(--text) !important;
}

body[class*="theme-"] .app-header {
  background: linear-gradient(105deg, var(--card) 0%, var(--primary-soft) 58%, var(--accent-soft) 100%) !important;
  border-color: var(--border) !important;
}

body[class*="theme-"] .brand-text h1,
body[class*="theme-"] .profile-identity-title strong,
body[class*="theme-"] .profile-dashboard-card strong,
body[class*="theme-"] .section-heading h2,
body[class*="theme-"] h3 {
  color: var(--text) !important;
}

body[class*="theme-"] .brand-subtitle,
body[class*="theme-"] .section-heading p,
body[class*="theme-"] .profile-dashboard-card small,
body[class*="theme-"] .profile-identity-meta,
body[class*="theme-"] .muted,
body[class*="theme-"] small {
  color: var(--muted) !important;
}

body[class*="theme-"] .brand-author-script,
body[class*="theme-"] label,
body[class*="theme-"] .tab-button:not(.active),
body[class*="theme-"] .profile-dashboard-arrow,
body[class*="theme-"] .lucide {
  color: var(--primary-dark) !important;
}

body[class*="theme-"] .app-card,
body[class*="theme-"] .tabs-nav,
body[class*="theme-"] .tab-button:not(.active),
body[class*="theme-"] .profile-topline,
body[class*="theme-"] .profile-dashboard-card,
body[class*="theme-"] .profile-mini-section,
body[class*="theme-"] .settings-block,
body[class*="theme-"] .table-wrap,
body[class*="theme-"] .result-box,
body[class*="theme-"] .schedule-day,
body[class*="theme-"] .client-mode-tabs,
body[class*="theme-"] .report-mode-tabs,
body[class*="theme-"] .confirmation-link-card,
body[class*="theme-"] .confirmation-text-preview,
body[class*="theme-"] .theme-option-button,
body[class*="theme-"] .subscription-overview,
body[class*="theme-"] .subscription-modules,
body[class*="theme-"] .legal-doc {
  background-color: var(--card) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

body[class*="theme-"] input,
body[class*="theme-"] select,
body[class*="theme-"] textarea {
  background: var(--input-bg) !important;
  color: var(--text) !important;
  border-color: var(--border-strong) !important;
}

body[class*="theme-"] input:focus,
body[class*="theme-"] select:focus,
body[class*="theme-"] textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent) !important;
}

body[class*="theme-"] .profile-dashboard-icon,
body[class*="theme-"] .confirmation-link-card-brand,
body[class*="theme-"] .confirmation-secure-mark,
body[class*="theme-"] .confirmation-friendly-link,
body[class*="theme-"] .confirmation-preview-item,
body[class*="theme-"] .status-pill,
body[class*="theme-"] .profile-active-badge {
  background: var(--primary-soft) !important;
  color: var(--primary-dark) !important;
  border-color: var(--border) !important;
}

body[class*="theme-"] .tab-button.active,
body[class*="theme-"] .client-mode-button.active,
body[class*="theme-"] .report-mode-button.active,
body[class*="theme-"] .btn-primary,
body[class*="theme-"] button.btn-primary,
body[class*="theme-"] .confirmation-open-link-button,
body[class*="theme-"] #generateProtocolButton {
  background: linear-gradient(135deg, var(--primary-2) 0%, var(--primary) 100%) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

body[class*="theme-"] .btn-secondary,
body[class*="theme-"] button.btn-secondary,
body[class*="theme-"] .header-icon-button {
  background: var(--card) !important;
  color: var(--primary-dark) !important;
  border-color: var(--border) !important;
}

body[class*="theme-"] .btn-ghost,
body[class*="theme-"] button.btn-ghost {
  background: var(--card-soft) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

body[class*="theme-"] .services-table th,
body[class*="theme-"] .report-table th,
body[class*="theme-"] .settings-table th,
body[class*="theme-"] .confirmations-table th,
body[class*="theme-"] .schedule-day h4 {
  background: var(--primary-soft) !important;
  color: var(--primary-dark) !important;
  border-color: var(--border) !important;
}

body[class*="theme-"] .services-table td,
body[class*="theme-"] .report-table td,
body[class*="theme-"] .settings-table td,
body[class*="theme-"] .confirmations-table td {
  border-color: var(--border) !important;
}

body.theme-dark .tab-button.active,
body.theme-dark .client-mode-button.active,
body.theme-dark .report-mode-button.active,
body.theme-dark .btn-primary,
body.theme-dark .confirmation-open-link-button,
body.theme-dark #generateProtocolButton {
  color: #10202a !important;
}

/* Профил — доближаване до одобрения dashboard модел без промяна на логиката. */
#profileTab .profile-card {
  padding: 18px !important;
  border-radius: 16px !important;
  border-color: var(--border) !important;
  background: var(--card) !important;
}

#profileTab .profile-topline {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-areas:
    "avatar summary"
    "avatar fields" !important;
  gap: 10px 18px !important;
  align-items: center !important;
  margin: 0 0 14px !important;
  padding: 18px 20px !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  background: linear-gradient(110deg, var(--card) 0%, var(--card-soft) 70%, var(--primary-soft) 100%) !important;
  box-shadow: var(--shadow) !important;
}

#profileTab .profile-avatar-panel {
  grid-area: avatar !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

#profileTab .profile-avatar {
  width: 92px !important;
  height: 92px !important;
  border-radius: 22px !important;
  border: 3px solid color-mix(in srgb, var(--card) 82%, white) !important;
  background: linear-gradient(135deg, var(--primary-2) 0%, var(--primary) 100%) !important;
  color: #ffffff !important;
  font-size: 22px !important;
  box-shadow: 0 10px 25px color-mix(in srgb, var(--primary) 18%, transparent) !important;
}

#profileTab .profile-avatar.has-photo {
  background-size: cover !important;
  background-position: center !important;
}

#profileTab .profile-avatar-actions {
  display: grid !important;
  grid-template-columns: 34px !important;
  gap: 6px !important;
}

#profileTab .icon-mini-button {
  width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border) !important;
  background: var(--card) !important;
  color: var(--primary-dark) !important;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 10%, transparent) !important;
}

#profileTab .profile-identity-summary {
  grid-area: summary !important;
  align-self: end !important;
}

#profileTab .profile-identity-title strong {
  font-size: 22px !important;
  line-height: 1.12 !important;
}

#profileTab .profile-active-badge {
  padding: 4px 10px !important;
  border-radius: 999px !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
}

#profileTab .profile-identity-meta {
  gap: 8px 22px !important;
  margin-top: 8px !important;
  font-size: 12px !important;
}

#profileTab .profile-main-grid {
  grid-area: fields !important;
  display: grid !important;
  grid-template-columns: minmax(240px, 1fr) minmax(130px, 170px) minmax(150px, 190px) !important;
  gap: 8px !important;
  align-self: start !important;
  padding-top: 10px !important;
  border-top: 1px solid var(--border) !important;
}

#profileTab .profile-main-grid label,
#profileTab .profile-data-grid label,
#profileTab .profile-bank-grid label,
#profileTab .profile-password-grid label {
  margin-top: 0 !important;
}

#profileTab .profile-dashboard-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin: 0 0 14px !important;
}

#profileTab .profile-dashboard-card {
  min-height: 82px !important;
  padding: 14px !important;
  grid-template-columns: 46px minmax(0, 1fr) 18px !important;
  gap: 12px !important;
  border-radius: 14px !important;
  border: 1px solid var(--border) !important;
  background: var(--card) !important;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 7%, transparent) !important;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease, background .16s ease !important;
}

#profileTab .profile-dashboard-card:hover {
  transform: translateY(-1px) !important;
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border)) !important;
  background: var(--card-soft) !important;
}

#profileTab .profile-dashboard-card.active {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
  box-shadow: inset 4px 0 0 var(--primary), 0 8px 20px color-mix(in srgb, var(--primary) 10%, transparent) !important;
}

#profileTab .profile-dashboard-icon {
  width: 46px !important;
  height: 46px !important;
  border-radius: 12px !important;
}

#profileTab .profile-dashboard-icon .lucide {
  width: 21px !important;
  height: 21px !important;
}

#profileTab .profile-dashboard-card strong {
  font-size: 14px !important;
}

#profileTab .profile-dashboard-card small {
  font-size: 11px !important;
  line-height: 1.3 !important;
}

#profileTab .profile-dashboard-card-wide {
  grid-column: 1 / -1 !important;
}

#profileTab .profile-mini-section.profile-dashboard-panel,
#profileTab .profile-settings-panels .settings-block {
  padding: 14px !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  background: var(--card) !important;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 6%, transparent) !important;
}

#profileTab .profile-mini-section h3,
#profileTab .profile-settings-panels .settings-block > h3 {
  padding-bottom: 8px !important;
  border-bottom: 1px solid var(--border) !important;
}

#profileTab .profile-data-grid {
  grid-template-columns: minmax(280px, 1fr) minmax(160px, .35fr) minmax(260px, .75fr) minmax(150px, .32fr) !important;
  gap: 8px !important;
}

#profileTab .profile-bank-grid {
  grid-template-columns: minmax(120px, .32fr) minmax(120px, .32fr) minmax(150px, .4fr) minmax(260px, .9fr) minmax(220px, .75fr) !important;
  gap: 8px !important;
}

#profileTab .theme-picker-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(90px, 1fr)) !important;
  gap: 10px !important;
  max-width: 760px !important;
}

#profileTab .theme-option-button {
  border-radius: 12px !important;
  min-height: 74px !important;
  background: var(--card) !important;
  border-color: var(--border) !important;
}

#profileTab .theme-option-button.active {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent) !important;
}

@media (max-width: 1100px) {
  #profileTab .profile-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #profileTab .profile-main-grid,
  #profileTab .profile-data-grid,
  #profileTab .profile-bank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  #profileTab .profile-card {
    padding: 10px !important;
  }

  #profileTab .profile-topline {
    grid-template-columns: 1fr !important;
    grid-template-areas: "avatar" "summary" "fields" !important;
    padding: 12px !important;
    gap: 10px !important;
  }

  #profileTab .profile-avatar-panel {
    justify-content: space-between !important;
  }

  #profileTab .profile-avatar {
    width: 76px !important;
    height: 76px !important;
    border-radius: 18px !important;
  }

  #profileTab .profile-avatar-actions {
    grid-template-columns: repeat(3, 34px) !important;
  }

  #profileTab .profile-main-grid,
  #profileTab .profile-dashboard-grid,
  #profileTab .profile-data-grid,
  #profileTab .profile-bank-grid,
  #profileTab .theme-picker-grid {
    grid-template-columns: 1fr !important;
  }

  #profileTab .profile-dashboard-card {
    min-height: 68px !important;
    padding: 10px !important;
  }
}

/* ===== STEP 2.1 · Логото следва избрания облик =====
   Само визуална корекция: PNG логото се използва като mask,
   за да приема цвета на активната тема. Логика не се пипа. */
.brand-logo,
.auth-brand,
#confirmationsTab .confirmation-link-card-brand {
  --brand-logo-color: var(--primary, #079b9a);
}

.brand-logo {
  position: relative;
  overflow: visible;
}

.brand-logo img {
  opacity: 0;
}

.brand-logo::before {
  content: "";
  position: absolute;
  inset: 0;
  display: block;
  background: var(--brand-logo-color);
  -webkit-mask: url("icons/brand-mark.png") center / contain no-repeat;
  mask: url("icons/brand-mark.png") center / contain no-repeat;
}

.auth-brand > img {
  display: none !important;
}

.auth-brand::before {
  content: "";
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  display: block;
  background: var(--brand-logo-color);
  -webkit-mask: url("icons/brand-mark.png") center / contain no-repeat;
  mask: url("icons/brand-mark.png") center / contain no-repeat;
}

#confirmationsTab .confirmation-link-card-brand > img {
  display: none !important;
}

#confirmationsTab .confirmation-link-card-brand::before {
  content: "";
  width: 40px;
  height: 40px;
  display: block;
  align-self: center;
  justify-self: center;
  background: var(--brand-logo-color);
  -webkit-mask: url("icons/brand-mark.png") center / contain no-repeat;
  mask: url("icons/brand-mark.png") center / contain no-repeat;
}

body.theme-dark .brand-logo::before,
body.theme-dark .auth-brand::before,
body.theme-dark #confirmationsTab .confirmation-link-card-brand::before {
  background: var(--primary-dark);
}

/* ===== STEP 3 · Потвърждения: по-чист линк, публична визуализация и компактна карта ===== */
#confirmationsTab .confirmation-link-result {
  max-width: 720px !important;
  margin: 10px auto 4px !important;
}

#confirmationsTab .confirmation-link-card {
  position: relative !important;
  overflow: hidden !important;
  padding: 0 0 14px !important;
  border: 1px solid var(--border) !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-soft) 100%) !important;
  box-shadow: 0 18px 40px rgba(40, 101, 97, .12) !important;
}

#confirmationsTab .confirmation-link-card-titleline {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 14px 22px 8px !important;
}

#confirmationsTab .confirmation-link-card-titleline span {
  display: block !important;
  height: 1px !important;
  background: color-mix(in srgb, var(--primary) 58%, transparent) !important;
}

#confirmationsTab .confirmation-link-card-titleline h3,
#confirmationsTab .confirmation-link-card h3 {
  margin: 0 !important;
  text-align: center !important;
  font-size: 18px !important;
  color: var(--primary-dark) !important;
  letter-spacing: .01em !important;
}

#confirmationsTab .confirmation-link-card-brand {
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) 38px !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 0 18px 10px !important;
  padding: 13px 14px !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  background: linear-gradient(140deg, var(--card) 0%, var(--primary-soft) 100%) !important;
}

#confirmationsTab .confirmation-link-card-brand strong {
  display: block !important;
  color: var(--primary-dark) !important;
  font-size: 17px !important;
  line-height: 1.1 !important;
}

#confirmationsTab .confirmation-link-card-brand span:not(.confirmation-secure-mark) {
  display: block !important;
  color: var(--muted) !important;
  font-size: 11.5px !important;
  margin-top: 2px !important;
}

#confirmationsTab .confirmation-secure-mark {
  width: 34px !important;
  height: 34px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 50% !important;
  font-weight: 900 !important;
}

#confirmationsTab .confirmation-link-summary {
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 12px !important;
  margin: 0 18px 12px !important;
  padding: 13px 14px !important;
  border: 1px solid var(--border) !important;
  border-radius: 15px !important;
  background: var(--card) !important;
}

#confirmationsTab .confirmation-link-summary-icon {
  width: 34px !important;
  height: 34px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 50% !important;
  background: var(--primary-soft) !important;
  color: var(--primary-dark) !important;
  font-size: 18px !important;
}

#confirmationsTab .confirmation-link-summary p,
#confirmationsTab .confirmation-link-card > p {
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  color: var(--text) !important;
}

#confirmationsTab .confirmation-open-link-button {
  width: min(360px, calc(100% - 36px)) !important;
  min-height: 40px !important;
  margin: 0 auto 10px !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--primary) 18%, transparent) !important;
}

#confirmationsTab .confirmation-friendly-link {
  width: min(440px, calc(100% - 36px)) !important;
  margin: 0 auto 10px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 7px 8px 7px 12px !important;
  border-radius: 999px !important;
  border: 1px solid var(--border) !important;
}

#confirmationsTab .confirmation-friendly-link span {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-weight: 700 !important;
  color: var(--primary-dark) !important;
}

#confirmationsTab .confirmation-copy-link-button {
  min-height: 30px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  border: 1px solid var(--border) !important;
  background: var(--card) !important;
  color: var(--primary-dark) !important;
  font-weight: 800 !important;
}

#confirmationsTab .confirmation-share-actions {
  width: min(520px, calc(100% - 36px)) !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

#confirmationsTab .confirmation-share-actions .confirmation-send-channel-button {
  min-height: 36px !important;
  border-radius: 12px !important;
  justify-content: center !important;
  padding: 0 10px !important;
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  color: var(--primary-dark) !important;
}

#confirmationsTab .confirmation-link-meta {
  justify-content: center !important;
  padding: 9px 18px 0 !important;
}

#confirmationsTab .confirmation-text-preview,
#confirmationsTab .confirmation-preview-item {
  border-color: color-mix(in srgb, var(--border) 70%, transparent) !important;
}

@media (max-width: 640px) {
  #confirmationsTab .confirmation-link-card-titleline {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  #confirmationsTab .confirmation-link-card-titleline span {
    display: none !important;
  }
  #confirmationsTab .confirmation-link-card-brand,
  #confirmationsTab .confirmation-link-summary {
    margin-left: 12px !important;
    margin-right: 12px !important;
  }
  #confirmationsTab .confirmation-share-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  #confirmationsTab .confirmation-friendly-link {
    border-radius: 14px !important;
    grid-template-columns: 1fr !important;
  }
}

/* Step 4.1: компактни подмодули и филтри в Искане за плащане */
.payment-mode-tabs {
  margin: 2px 0 12px;
}

.payment-mode-panel {
  display: none;
}

.payment-mode-panel.active {
  display: block;
}

.payment-tracking-filters.compact-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
}

.payment-tracking-filters.compact-filters select {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
}

#paymentTrackingMonthFilter {
  width: 132px;
}

#paymentTrackingDspFilter {
  width: 168px;
}

#paymentTrackingStatusFilter {
  width: 122px;
}

#paymentTrackingYearFilter {
  display: none !important;
}

@media (max-width: 720px) {
  .payment-tracking-filters.compact-filters {
    width: 100%;
  }

  .payment-tracking-filters.compact-filters select {
    flex: 1 1 120px;
  }
}

