:root {
  --wertia-bg: #160f0a;
  --wertia-surface: #21160f;
  --wertia-card: #2a1c13;
  --wertia-gold: #c8a45d;
  --wertia-gold-soft: #e0c27a;
  --wertia-cream: #f4e8d0;
  --wertia-muted: #b8a98f;
  --wertia-border: rgba(200, 164, 93, 0.22);
  --wertia-danger: #b85c5c;
  --wertia-success: #70a36b;
  --wertia-warning: #c89b3c;
  --shadow: 0 20px 44px rgba(12, 8, 5, 0.18);
  --sidebar-width: 408px;
  --detail-left: 420px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #2d2923;
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.2px;
  background: #f7f3ec;
}

body.login-active {
  background: #160f0a;
  overflow: hidden;
}

body.is-resizing {
  cursor: col-resize;
  user-select: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid rgba(200, 164, 93, 0.28);
  border-radius: 8px;
  color: inherit;
  background: #fffdf8;
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell:not(.sidebar-collapsed) {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.app-shell.sidebar-collapsed {
  --sidebar-width: 86px;
}

.workspace {
  grid-column: 2;
  min-width: 0;
  padding: 28px;
}

.sidebar {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100vh;
  padding: 0;
  color: var(--wertia-cream);
  background:
    radial-gradient(circle at top, rgba(200, 164, 93, 0.08), transparent 55%),
    linear-gradient(180deg, #1a1310 0%, #14100d 60%, #100d0a 100%);
  border-right: 1px solid rgba(200, 164, 93, 0.14);
  overflow: hidden;
  user-select: none;
}

.app-shell:not(.sidebar-collapsed) .sidebar {
  padding: 0;
}

.brand {
  display: grid;
  justify-items: center;
  gap: 0;
  padding: 14px 20px 16px;
  border-bottom: 1px solid rgba(200, 164, 93, 0.1);
}

.brand-logo {
  width: 90px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 14px rgba(200, 164, 93, 0.18));
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  color: var(--wertia-gold-soft);
  font-size: 15px;
}

.brand span,
.sidebar-footer small {
  color: var(--wertia-muted);
  font-size: 12px;
}

.app-shell:not(.sidebar-collapsed) .brand {
  justify-items: center;
  padding-left: 20px;
}

.app-shell:not(.sidebar-collapsed) .brand-logo {
  width: 90px;
  height: 76px;
  object-position: center;
}

.collapse-btn {
  display: none;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 48px;
  margin: 16px 18px 0;
  padding: 0 14px;
  color: rgba(244, 232, 208, 0.72);
  background: rgba(244, 232, 208, 0.045);
}

.sidebar-footer {
  display: none;
}

.sound-settings {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(200, 164, 93, 0.1);
}

.sound-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(200, 164, 93, 0.2);
  border-radius: 8px;
  background: transparent;
  color: rgba(244, 232, 208, 0.7);
  cursor: pointer;
  transition: background 140ms, color 140ms;
  flex-shrink: 0;
}
.sound-toggle:hover {
  background: rgba(200, 164, 93, 0.12);
  color: #e0c27a;
}
.sound-toggle.muted {
  color: rgba(244, 232, 208, 0.3);
}
.sound-toggle svg {
  width: 16px;
  height: 16px;
}

.sound-select {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(200, 164, 93, 0.2);
  border-radius: 8px;
  background: transparent;
  color: rgba(244, 232, 208, 0.8);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23c8a45d' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}
.sound-select:hover {
  border-color: rgba(200, 164, 93, 0.4);
}
.sound-select:focus {
  outline: none;
  border-color: #c8a45d;
}
.sound-select option {
  background: #1a130c;
  color: #f4e8d0;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 40px;
  padding: 0 16px 0 14px;
  color: rgba(244, 232, 208, 0.5);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-align: left;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.app-shell:not(.sidebar-collapsed) .nav-item {
  grid-template-columns: 22px minmax(0, 1fr) auto;
  place-items: center start;
  justify-items: start;
  gap: 11px;
  padding: 0 16px 0 14px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 12px 12px;
  overflow-y: auto;
}

.nav-group + .nav-group {
  margin-top: 10px;
}

.nav-item:hover {
  color: #fffaf1;
  background: rgba(244, 232, 208, 0.04);
  border-color: rgba(200, 164, 93, 0.12);
}

.nav-item.active {
  color: #fffaf1;
  background: rgba(244, 232, 208, 0.06);
  border-color: rgba(200, 164, 93, 0.16);
  font-weight: 600;
}

.nav-icon,
.collapse-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: currentColor;
}

.nav-icon svg {
  stroke-width: 1.6;
}

.nav-item.active .nav-icon {
  color: #fffaf1;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--wertia-gold-soft), var(--wertia-gold));
  box-shadow: 0 0 12px rgba(200, 164, 93, 0.45);
}

.nav-section {
  margin: 0 0 8px 20px;
  color: rgba(244, 232, 208, 0.34);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.8px;
  text-transform: uppercase;
}

.nav-label {
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  justify-self: end;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--wertia-gold-soft), var(--wertia-gold));
  color: #1a1208;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(255, 246, 210, 0.3), 0 0 14px rgba(200, 164, 93, 0.5);
}

.sidebar-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  z-index: 3;
  background: linear-gradient(90deg, transparent, rgba(200, 164, 93, 0.1));
}

.sidebar-resizer::after {
  content: "";
  position: absolute;
  top: 28%;
  right: 2px;
  width: 4px;
  height: 44%;
  border-radius: 999px;
  background:
    linear-gradient(180deg, var(--wertia-gold-soft), var(--wertia-gold), var(--wertia-gold-soft));
  box-shadow:
    0 0 0 1px rgba(255, 246, 210, 0.35),
    0 0 14px rgba(200, 164, 93, 0.5);
}

.sidebar-resizer::before {
  content: "";
  position: absolute;
  top: 43%;
  right: 3px;
  width: 1px;
  height: 14%;
  border-radius: 999px;
  background: rgba(26, 18, 8, 0.6);
  box-shadow:
    -2px 0 0 rgba(26, 18, 8, 0.4),
    2px 0 0 rgba(26, 18, 8, 0.4);
}

.sidebar-resizer:hover::after {
  background:
    linear-gradient(180deg, #fff4c9, var(--wertia-gold-soft), #fff4c9);
  box-shadow:
    0 0 0 1px rgba(255, 246, 210, 0.6),
    0 0 20px rgba(200, 164, 93, 0.65);
}

.app-shell.sidebar-icon-only .brand {
  padding: 18px 10px;
}

.app-shell.sidebar-icon-only .brand-logo {
  width: 54px;
  height: 54px;
}

.app-shell.sidebar-icon-only .brand div,
.app-shell.sidebar-icon-only .nav-section,
.app-shell.sidebar-icon-only .nav-label,
.app-shell.sidebar-icon-only .collapse-label,
.app-shell.sidebar-icon-only .sidebar-footer div {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.app-shell.sidebar-icon-only .nav-list {
  gap: 8px;
  padding: 22px 10px 18px;
}

.app-shell.sidebar-icon-only .nav-item,
.app-shell.sidebar-icon-only .collapse-btn {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 52px;
  padding: 0;
}

.app-shell.sidebar-icon-only .nav-item.active::before {
  left: 0;
  top: 10px;
  bottom: 10px;
  height: auto;
}

.app-shell.sidebar-icon-only .sidebar-footer {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 12px 0;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--wertia-success);
  box-shadow: 0 0 0 4px rgba(112, 163, 107, 0.18);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding: 10px 18px;
  border: 1px solid rgba(200, 164, 93, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf8, #f7f1e6);
  box-shadow: 0 12px 30px rgba(60, 42, 20, 0.08);
  position: relative;
  z-index: 100;
}

.topbar-title {
  min-width: 0;
}

.topbar-utils {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-clock {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(200, 164, 93, 0.22);
  border-radius: 10px;
  background: #1a1310;
  color: var(--wertia-gold-soft);
}

.clock-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--wertia-gold-soft);
}

.topbar-date {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #6b5d48;
  font-size: 13px;
}

.date-day {
  font-weight: 800;
  font-size: 16px;
  color: #2a2118;
}

.date-month {
  font-weight: 600;
  text-transform: capitalize;
}

.date-year {
  font-weight: 600;
  color: #8a7d63;
}

.topbar-bell {
  position: relative;
  width: 42px;
  height: 42px;
  min-height: 42px;
  border: 1px solid rgba(200, 164, 93, 0.24);
  border-radius: 11px;
  background: #fffdf8;
  color: var(--wertia-gold);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.topbar-bell svg {
  width: 19px;
  height: 19px;
}

.topbar-bell:hover {
  background: #fbf3e2;
  border-color: var(--wertia-gold);
}

.bell-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--wertia-gold-soft), var(--wertia-gold));
  color: #1a1208;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 0 0 2px #fffdf8, 0 0 12px rgba(200, 164, 93, 0.5);
}

.topbar-profile {
  position: relative;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 4px 12px 4px 4px;
  border: 1px solid rgba(200, 164, 93, 0.22);
  border-radius: 999px;
  background: #fffdf8;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.profile-trigger:hover {
  background: #fbf3e2;
  border-color: var(--wertia-gold);
}

.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--wertia-gold-soft), var(--wertia-gold));
  color: #1a1208;
  font-weight: 800;
  font-size: 13px;
}

.profile-greet {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}

.profile-greet small {
  color: #8a7d63;
  font-size: 11px;
}

.profile-greet strong {
  color: #2a2118;
  font-size: 13px;
  font-weight: 700;
}

.profile-chevron {
  width: 16px;
  height: 16px;
  color: var(--wertia-gold);
  transition: transform 180ms ease;
}

.profile-trigger[aria-expanded="true"] .profile-chevron {
  transform: rotate(180deg);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  padding: 8px;
  border: 1px solid rgba(200, 164, 93, 0.22);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 18px 40px rgba(60, 42, 20, 0.18);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-menu[hidden] {
  display: none;
}

.profile-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #2a2118;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease;
}

.profile-menu button:hover {
  background: #fbf3e2;
}

.profile-menu button svg {
  width: 18px;
  height: 18px;
  color: var(--wertia-gold);
}

.profile-menu-sep {
  height: 1px;
  margin: 4px 8px;
  background: rgba(200, 164, 93, 0.18);
}

.profile-logout {
  color: var(--wertia-danger) !important;
}

.profile-logout svg {
  color: var(--wertia-danger) !important;
}

.eyebrow,
.kicker {
  margin: 0 0 8px;
  color: var(--wertia-gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 0;
  font-size: 28px;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.search {
  display: grid;
  grid-template-columns: 28px minmax(220px, 380px);
  align-items: center;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #e2d8c8;
  border-radius: 10px;
  background: #fffdf8;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  padding: 0;
  font-weight: 800;
}

.primary-btn,
.gold-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 16px;
  border-color: var(--wertia-gold);
  color: var(--wertia-bg);
  background: linear-gradient(135deg, var(--wertia-gold-soft), var(--wertia-gold));
  font-weight: 800;
}

.ghost-btn,
.outline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: #6c5732;
  background: #fffdf8;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.main-panel,
.panel-card,
.metric-card,
.client-card,
.identity-card {
  border: 1px solid #e6dccb;
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 10px 30px rgba(54, 38, 23, 0.08);
}

.main-panel {
  min-height: calc(100vh - 132px);
  padding: 14px;
}

.panel-section {
  display: grid;
  gap: 12px;
}

.section-heading,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-head.compact {
  margin-bottom: 14px;
}

.page-stack {
  display: grid;
  gap: 12px;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  color: var(--wertia-cream);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(224, 194, 122, 0.18), rgba(22, 15, 10, 0)),
    var(--wertia-bg);
}

.hero-card h2 {
  color: #fff7e6;
  font-size: 34px;
}

.hero-card span {
  color: var(--wertia-muted);
}

.clock-card {
  display: grid;
  align-content: center;
  min-width: 240px;
  padding: 18px;
  border: 1px solid var(--wertia-border);
  border-radius: 12px;
  background: rgba(244, 232, 208, 0.06);
}

.clock-card span {
  color: var(--wertia-gold-soft);
  font-size: 30px;
  font-weight: 800;
}

.metrics-grid {
  display: flex;
  gap: 10px;
}

.metric-card {
  padding: 18px;
}

.metric-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  flex: 1;
}
.metric-inline .metric-ico {
  display: flex;
  align-items: center;
  color: #c89b3c;
}
.metric-inline .metric-ico svg {
  width: 20px;
  height: 20px;
}
.metric-inline .metric-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.metric-inline .metric-text span {
  color: #76664d;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.metric-inline .metric-text strong {
  color: #2a2117;
  font-size: 20px;
  margin-top: 0;
}

.metric-card span {
  color: #76664d;
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  color: #2a2117;
  font-size: 25px;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dashboard-three-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 12px;
}

.dash-cal-panel {
  display: flex;
  flex-direction: column;
  max-height: 500px;
  overflow: hidden;
}
.dash-cal-head h3 {
  font-size: 16px;
}
.dash-cal-day {
  overflow-y: auto;
  flex: 1;
}
.dash-cal-hours {
  display: flex;
  flex-direction: column;
}
.dash-cal-hour {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 32px;
}
.dash-cal-hour-label {
  font-size: 11px;
  color: #a0917a;
  width: 36px;
  flex-shrink: 0;
  padding-top: 2px;
}
.dash-cal-hour-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px 0;
  border-top: 1px solid #f0e9db;
}
.dash-cal-event {
  padding: 4px 8px;
  border-left: 3px solid #c89b3c;
  border-radius: 4px;
}
.dash-cal-event strong {
  font-size: 12px;
  color: #2f2623;
  display: block;
}
.dash-cal-event span {
  font-size: 10px;
  color: #8a7d63;
}
.dash-cal-event em {
  font-size: 10px;
  color: #a0917a;
  font-style: normal;
  margin-left: 4px;
}

.panel-card {
  padding: 14px;
}

.clean-list,
.side-card,
.side-line {
  display: grid;
  gap: 8px;
}

.clean-list div,
.side-line {
  padding: 12px;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fbf6ed;
}

.clean-list span,
.side-line span,
.side-card span {
  color: #806f58;
}

.side-line.danger {
  border-color: rgba(184, 92, 92, 0.34);
  background: #fff3ef;
}

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

.kunden-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.kunden-search-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e6dccb;
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 10px 30px rgba(54, 38, 23, 0.08);
}

.kunden-toolbar > div:first-child span,
.results-head span,
.form-hint {
  color: #806f58;
}

.kunden-actions,
.contact-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-plus-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 16px;
  border-color: rgba(200, 164, 93, 0.42);
  color: var(--wertia-cream);
  background:
    linear-gradient(135deg, rgba(200, 164, 93, 0.28), rgba(42, 28, 19, 0.9)),
    var(--wertia-card);
  font-weight: 800;
}

.kunden-search {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid #e6dccb;
  border-radius: 14px;
  color: var(--wertia-gold);
  background: #fffdf8;
  box-shadow: 0 10px 30px rgba(54, 38, 23, 0.06);
}

.kunden-search.main-search {
  min-height: 48px;
  box-shadow: none;
}

.kunden-search input {
  border: 0;
  outline: 0;
  font-size: 16px;
}

.kunden-results {
  display: grid;
  gap: 14px;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.empty-results {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px dashed #d8c8ad;
  border-radius: 14px;
  color: #806f58;
  background: #fffdf8;
}

.recent-client-list {
  display: grid;
  overflow: hidden;
  border: 1px solid #e6dccb;
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 10px 30px rgba(54, 38, 23, 0.06);
}

.recent-client-row {
  display: grid;
  grid-template-columns: 48px minmax(220px, 1.4fr) minmax(150px, 0.8fr) minmax(220px, 1fr) 48px;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 0 14px;
  border-bottom: 1px solid #eadfce;
}

.recent-client-row:last-child {
  border-bottom: 0;
}

.recent-client-row a {
  color: #6c5732;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-name {
  display: grid;
  gap: 3px;
}

.recent-name span {
  color: #8a7b66;
  font-size: 12px;
}

.customer-code {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  color: #a88945;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.detail-code {
  margin-left: 2px;
  padding-top: 2px;
}

.eye-btn {
  display: grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  color: var(--wertia-gold);
  background: #fbf6ed;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.danger-icon,
.danger-action {
  color: #9b3c3c;
  border-color: rgba(184, 92, 92, 0.28);
  background: #fff6f1;
}

.client-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  overflow: hidden;
}

.id-thumb,
.id-one {
  color: #23332f;
  background:
    radial-gradient(circle at 72% 28%, rgba(184, 92, 92, 0.22), transparent 16%),
    linear-gradient(135deg, #a9d6cc, #eee0c6 48%, #c5dedf);
}

.id-thumb {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 164px;
  padding: 14px;
}

.id-thumb span,
.id-one span {
  color: #0e9b72;
  font-weight: 900;
}

.id-thumb strong,
.id-one strong {
  font-size: 28px;
}

.id-thumb em {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-top: 12px;
  border-radius: 999px;
  color: #fbf6ed;
  background: rgba(31, 28, 24, 0.58);
  font-style: normal;
  font-weight: 800;
}

.client-card-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.client-card-body h3 {
  margin-bottom: 4px;
}

.client-card-body span,
.client-meta span {
  color: #7a6a55;
}

.client-meta {
  display: grid;
  gap: 5px;
  font-size: 13px;
}

.detail-main {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.client-detail-page {
  display: grid;
  gap: 24px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #8a806f;
  font-size: 17px;
}

.breadcrumb button {
  min-height: auto;
  padding: 0;
  border: 0;
  color: #7d725f;
  background: transparent;
  font-size: 17px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.customer-form-grid {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  align-items: start;
}

.identity-card {
  padding: 18px;
  width: 100%;
  max-width: 340px;
}

.detail-column-resizer {
  display: none;
}

.insurance-column,
.detail-content {
  grid-column: 3;
}

.sticky-id {
  align-self: start;
}

.id-one {
  min-height: 0;
  padding: 18px;
  border: 1px solid #d9d0c0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.32);
  aspect-ratio: 85.6 / 53.98;
  width: 100%;
  height: auto;
}

.id-one img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.id-one.has-preview {
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  background: #fffdf8;
}

.customer-id-placeholder {
  display: grid;
  align-content: space-between;
}

.id-upload-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.id-upload-panel .outline-btn {
  width: 100%;
}

.id-upload-status {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(112, 163, 107, 0.28);
  border-radius: 8px;
  color: #2d602a;
  background: rgba(112, 163, 107, 0.12);
}

.id-upload-status.hidden {
  display: none;
}

.id-upload-status strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.id-upload-status svg {
  width: 16px;
  height: 16px;
}

.id-upload-status span {
  color: #52704d;
  font-size: 12px;
  font-weight: 800;
}

.client-action-bar {
  display: flex;
  flex-direction: row;
  gap: 6px;
  margin-top: 8px;
}

.client-action-bar .gold-btn,
.client-action-bar .outline-btn {
  min-height: 40px;
  padding: 0 10px;
  font-size: 12px;
}

.icon-only-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #d8c8a8;
  border-radius: 8px;
  background: #fbf6ed;
  color: #806f58;
  cursor: pointer;
  position: relative;
}
.icon-only-btn:hover {
  background: #f0e6d0;
  color: #5a4a36;
}
.icon-only-btn.danger-action:hover {
  border-color: #c84a4a;
  color: #c84a4a;
}
.icon-only-btn[title] {
  position: relative;
}
.icon-only-btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 4px;
  background: #2c2823;
  color: #fffdf8;
  font-size: 11px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}

.id-one > div {
  display: flex;
  align-items: center;
  gap: 18px;
}

.id-one p {
  margin: 10px 0 48px;
  color: #5d594f;
  font-size: 12px;
  font-weight: 800;
}

.id-one h3 {
  color: #1f1e1a;
  font-size: 22px;
}

.gold {
  margin-top: 24px;
}

.completion,
.barometer {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadfce;
}

.completion span,
.barometer span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--wertia-danger), var(--wertia-warning), var(--wertia-success));
}

.right {
  display: block;
  margin-top: 6px;
  color: #76664d;
  text-align: right;
}

.contact-box {
  display: grid;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid #e8ddcd;
  border-radius: 10px;
}

.contact-box div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 13px;
  border-bottom: 1px solid #e8ddcd;
}

.contact-box div:last-child {
  border-bottom: 0;
}

.contact-box svg {
  color: var(--wertia-gold);
}

.creation-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #eadfce;
  color: #8a7b66;
  font-size: 11px;
}

.identity-card .collapse-card {
  margin-top: 16px;
  box-shadow: none;
}

.identity-card .form-section-grid {
  grid-template-columns: 1fr;
}

.insurance-column {
  min-width: 0;
}

.insurance-status-card {
  padding: 28px;
  border: 1px solid #e6dccb;
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 10px 30px rgba(54, 38, 23, 0.08);
}

.insurance-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.insurance-head h2 {
  color: #25211c;
  font-size: 28px;
}

.insurance-icons {
  display: grid;
  grid-template-columns: repeat(10, minmax(34px, 1fr));
  gap: 12px;
  margin: 14px 0 0;
  padding-bottom: 0;
}

.insurance-icon {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #88817a;
  background: transparent;
  cursor: default;
  position: relative;
}

.insurance-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 5px 9px;
  border-radius: 6px;
  background: #3a2c1c;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}

.insurance-icon:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.insurance-icon svg {
  width: 31px;
  height: 31px;
  stroke-width: 1.3;
}

.insurance-icon.covered {
  color: #2f7a44;
  background: rgba(112, 163, 107, 0.13);
  border-color: rgba(112, 163, 107, 0.28);
}

.barometer-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.insurance-barometer-inline {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ebe4d8;
}

.barometer-title strong {
  color: #d82424;
  font-size: 16px;
}

.barometer-title span {
  color: #8d8374;
  font-size: 11px;
}

.protection-line {
  position: relative;
  height: 7px;
  margin: 5px 0 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f2a1a1 0%, #f0b46f 42%, #f1df8c 62%, #93d39b 100%);
  box-shadow: inset 0 1px 2px rgba(80, 57, 34, 0.15);
}

.protection-pin {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border: 1.5px solid #2c2823;
  border-radius: 999px;
  background: #fffdf8;
  transform: translate(-1px, -50%);
}

.protection-labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  color: #8f8578;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.protection-labels strong {
  color: #d82424;
}

.protection-labels span:nth-child(2) {
  text-align: center;
}

.protection-labels span:nth-child(3) {
  text-align: right;
}

.coverage-note {
  margin: 4px 0 0;
  color: #d82424;
  font-weight: 700;
  font-size: 11px;
}

.customer-work-card {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #e6dccb;
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 10px 30px rgba(54, 38, 23, 0.08);
}

.customer-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid #eadfce;
  background: #fbf6ed;
}

.customer-tab {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 78px;
  padding: 10px 8px;
  border: 0;
  border-right: 1px solid #eadfce;
  border-radius: 0;
  color: #7b7167;
  background: transparent;
}

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

.customer-tab svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.9;
}

.customer-tab strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-tab:hover,
.customer-tab.active {
  color: #2f251c;
  background: #fffdf8;
}

.customer-tab.active {
  box-shadow: inset 0 -3px 0 var(--wertia-gold);
}

.customer-tab.active svg {
  color: var(--wertia-gold);
}

.customer-tab-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.tab-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tab-panel-head h3 {
  margin-bottom: 0;
  color: #25211c;
  font-size: 20px;
}

.tab-row-list {
  display: grid;
  gap: 8px;
}

.tab-data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: #fbf6ed;
}

.tab-data-row span {
  color: #806f58;
}

.tab-data-row strong {
  color: #3a2e22;
  text-align: right;
}

.application-list {
  display: grid;
  gap: 10px;
}

.application-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 40px minmax(170px, auto);
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fbf6ed;
}

.application-row.application-status-pending {
  border-left: 4px solid #d2a23a;
  background: #fff8e8;
}

.application-row.application-status-accepted {
  border-left: 4px solid var(--wertia-success);
  background: #f3fbf0;
}

.application-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.application-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #806f58;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.application-row span svg {
  width: 14px;
  height: 14px;
  color: var(--wertia-gold);
}

.application-row.application-status-pending .application-status-icon svg,
.application-row.application-status-pending .application-status-label {
  color: #c68b18;
}

.application-row.application-status-accepted .application-status-icon svg,
.application-row.application-status-accepted .application-status-label {
  color: var(--wertia-success);
}

.application-row small {
  display: block;
  margin-top: 3px;
  color: #9a6b20;
  font-size: 11px;
  font-weight: 800;
}

.policy-row {
  border-left: 4px solid var(--wertia-success);
}

.policy-row.application-status-pending {
  border-left-color: #d2a23a;
}

.policy-row.application-status-accepted {
  border-left-color: var(--wertia-success);
}

.application-row em {
  color: var(--wertia-gold);
  font-style: normal;
  font-weight: 900;
}

.application-eye {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  color: var(--wertia-gold);
  background: #fffdf8;
  text-decoration: none;
}

.application-eye.disabled {
  color: #c7bba8;
  background: #f2ede5;
}

.application-accept-btn,
.application-accept-badge,
.application-medical-btn,
.application-medical-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #d8b15d;
  border-radius: 8px;
  background: #dfbd68;
  color: #23170b;
  font-weight: 900;
  white-space: nowrap;
}

.application-accept-btn {
  cursor: pointer;
}

.application-admin-actions {
  display: grid;
  gap: 6px;
  justify-items: stretch;
}

.appt-table-wrap {
  overflow-x: auto;
}
.appt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.appt-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #a0917a;
  border-bottom: 2px solid #e6dccb;
  white-space: nowrap;
}
.appt-table th:last-child,
.appt-table td:last-child {
  width: 36px;
  text-align: right;
}
.appt-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #f0e9db;
  color: #4a3c2e;
  white-space: nowrap;
}
.appt-table tr:hover td {
  background: #fbf6ed;
}
.appt-status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.appt-status-pill.appt-status-accepted {
  background: #e3f5e8;
  color: #2a8a4a;
}
.appt-status-pill.appt-status-pending {
  background: #fff4d8;
  color: #9a7a20;
}
.appt-medical svg {
  color: #c84a4a;
}
.appt-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #806f58;
  cursor: pointer;
}
.appt-eye:hover {
  background: #f0e6d0;
  color: #5a4a36;
}
.appt-eye.disabled {
  opacity: 0.3;
  cursor: default;
}

.application-accept-btn:hover {
  background: #d4a94d;
}

.application-edit-btn,
.application-delete-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #d8c8a8;
  border-radius: 8px;
  background: #fbf6ed;
  color: #806f58;
  cursor: pointer;
}

.application-edit-btn:hover {
  background: #f0e6d0;
  color: #5a4a36;
}

.application-delete-btn:hover {
  background: #fce8e6;
  border-color: #e0a8a0;
  color: #c44a3a;
}

.application-edit-btn svg,
.application-delete-btn svg {
  width: 15px;
  height: 15px;
}

.application-accept-badge {
  border-color: #8dbb75;
  background: #e4f4dc;
  color: #2f6b24;
}

.application-accept-btn svg,
.application-accept-badge svg,
.application-medical-btn svg,
.application-medical-badge svg {
  width: 15px;
  height: 15px;
}

.application-medical-btn {
  border-color: #e4a0a0;
  background: #fff4f4;
  color: #a82727;
  cursor: pointer;
}

.application-medical-btn:hover {
  background: #ffe4e4;
}

.application-medical-badge {
  border-color: #d64a4a;
  background: #cf2d2d;
  color: #fff;
}

.application-link-badge {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: -6px;
  margin-top: 8px;
  border-radius: 50%;
  background: #2f7a44;
  color: #fff;
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(47, 122, 68, 0.4);
}

.application-link-badge svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.application-medical-badge svg,
.application-medical-note.active svg {
  fill: currentColor;
  stroke: currentColor;
}

.application-medical-note {
  color: #8b735a;
}

.application-medical-note.active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c22d2d;
  font-weight: 900;
}

.application-medical-note svg {
  width: 13px;
  height: 13px;
}

.client-doc-grid {
  display: grid;
  gap: 10px;
}

.client-doc-slot {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fbf6ed;
}

.client-doc-slot > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #e4d8c7;
  border-radius: 8px;
  color: #7b7167;
  background: #fffdf8;
}

.client-doc-slot div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.client-doc-slot small {
  color: #806f58;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-doc-slot.required {
  border-color: rgba(200, 164, 93, 0.5);
  background: #fff8e8;
}

.client-doc-slot.complete {
  border-color: rgba(112, 163, 107, 0.28);
  background: rgba(112, 163, 107, 0.1);
}

.application-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #e4d8c7;
  border-radius: 8px;
  color: #7b7167;
  background: #fffdf8;
}

.readonly-field {
  min-height: 60px;
  padding: 10px;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fbf6ed;
}

.readonly-field span {
  display: block;
  color: #7f705d;
  font-size: 12px;
  font-weight: 800;
}

.readonly-field strong {
  display: block;
  margin-top: 5px;
}

.creation-context span {
  display: inline-flex;
  align-items: center;
}

.creation-context span:not(:last-child)::after {
  content: "·";
  margin-left: 10px;
  color: #c4ab78;
}

.detail-content {
  display: grid;
  gap: 18px;
}

.collapse-card {
  overflow: hidden;
  border: 1px solid #e6dccb;
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 10px 30px rgba(54, 38, 23, 0.08);
}

.collapse-card summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 18px;
  color: #3a2e22;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.collapse-card summary::-webkit-details-marker {
  display: none;
}

.collapse-card[open] summary {
  border-bottom: 1px solid #eadfce;
}

.collapse-card summary svg {
  color: var(--wertia-gold);
}

.collapse-card summary.summary-actions {
  grid-template-columns: minmax(0, 1fr) auto;
}

.summary-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.summary-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.summary-icon-btn {
  display: grid;
  place-items: center;
  min-width: 34px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #eadfce;
  border-radius: 8px;
  color: var(--wertia-gold);
  background: #fffdf8;
}

.summary-icon-btn svg {
  width: 16px;
  height: 16px;
}

.form-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.field-control {
  min-width: 0;
}

.field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.field-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  min-height: 40px;
  border: 1px solid #e4d8c7;
  border-radius: 8px;
  background: #fffdf8;
  overflow: hidden;
}

.field-row.has-suffix {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-icon {
  display: grid;
  place-items: center;
  align-self: stretch;
}

.field-icon svg {
  width: 16px;
  height: 16px;
  color: var(--wertia-gold);
  stroke-width: 2.2;
}

.field-control input,
.field-control select {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-left: 1px solid #eee3d2;
  border-radius: 0;
  background: transparent;
}

.personal-data-table {
  gap: 0;
  padding: 8px 14px 10px;
}

.identity-card .personal-data-table {
  grid-template-columns: 1fr;
}

.personal-data-table .field-pair {
  gap: 0;
}

.personal-data-table .field-control {
  border-bottom: 1px solid #eadfce;
}

.personal-data-table .field-row {
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.personal-data-table .field-icon {
  width: 26px;
}

.personal-data-table .field-icon svg {
  width: 15px;
  height: 15px;
}

.personal-data-table .field-control input,
.personal-data-table .field-control select {
  min-height: 34px;
  border-left: 0;
  padding: 3px 6px;
  color: #2d2923;
  font-size: 13px;
  font-weight: 400;
}

.personal-data-table .field-suffix {
  border-left: 0;
  font-size: 15px;
  font-weight: 400;
}

.contact-data-table {
  gap: 0;
  padding: 10px 16px 14px;
}

.identity-card .contact-data-table {
  grid-template-columns: 1fr;
}

.contact-data-table .field-control {
  border-bottom: 1px solid #eadfce;
}

.contact-data-table .field-row {
  min-height: 46px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.contact-data-table .field-icon {
  width: 30px;
}

.contact-data-table .field-icon svg {
  width: 18px;
  height: 18px;
}

.contact-data-table .field-control input,
.contact-data-table .field-control select {
  min-height: 46px;
  border-left: 0;
  padding: 6px 8px;
  color: #2d2923;
  font-size: 17px;
  font-weight: 400;
}

.field-suffix {
  display: flex;
  align-items: center;
  align-self: stretch;
  padding: 0 10px;
  border-left: 1px solid #eee3d2;
  color: var(--wertia-gold);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.readonly-row strong {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-left: 1px solid #eee3d2;
}

.contact-shortcuts {
  padding: 0 18px 18px;
}

.contact-shortcuts a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #e4d8c7;
  border-radius: 8px;
  color: #6c5732;
  background: #fbf6ed;
  text-decoration: none;
  font-weight: 800;
}

.form-hint {
  margin: -4px 18px 18px;
  font-size: 13px;
}

.client-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid #e6dccb;
  border-radius: 14px;
  background: #fffdf8;
}

.client-header-card span {
  color: #7d6b55;
}

.compliance-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 800;
}

.compliance-badge.ok {
  color: #2d602a;
  background: rgba(112, 163, 107, 0.18);
}

.compliance-badge.blocked {
  color: #8c3030;
  background: rgba(184, 92, 92, 0.18);
}

.compliance-panel.warning {
  border-color: rgba(184, 92, 92, 0.36);
  background: #fff6f1;
}

.compliance-panel .section-head > span {
  color: #8c3030;
  font-weight: 900;
}

.percent {
  color: var(--wertia-gold);
  font-size: 30px;
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.coverage-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fbf6ed;
}

.ok-text {
  color: #497a45;
}

.warn-text {
  color: #9a6b20;
}

.danger-text {
  color: #9b3c3c;
}

.muted-text {
  color: #918572;
}

.data-groups {
  display: grid;
  gap: 18px;
}

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

.data-group h3 {
  grid-column: 1 / -1;
  margin-bottom: 0;
  color: #3a2e22;
}

.data-group div {
  min-height: 62px;
  padding: 10px;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fbf6ed;
}

.data-group span {
  display: block;
  color: #7f705d;
  font-size: 12px;
}

.data-group strong {
  display: block;
  margin-top: 5px;
}

.document-grid,
.company-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.document-folder {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid #eadfce;
  border-radius: 12px;
  background: #fbf6ed;
}

.document-folder span,
.document-folder small {
  color: #7d705f;
}

.document-folder em {
  color: var(--wertia-gold);
  font-style: normal;
  font-weight: 800;
}

.company-card {
  min-height: 130px;
}

dialog {
  width: min(720px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  background: transparent;
}

#applicationDialog {
  width: min(980px, calc(100vw - 28px));
}

#idCropDialog {
  width: min(980px, calc(100vw - 28px));
}

#userDialog {
  width: min(440px, calc(100vw - 28px));
}

dialog::backdrop {
  background: rgba(22, 15, 10, 0.55);
}

.modal {
  padding: 20px;
  border: 1px solid #e6dccb;
  border-radius: 14px;
  background: #fffdf8;
}

.wide-modal {
  width: min(980px, calc(100vw - 28px));
}

.id-crop-modal {
  width: min(940px, calc(100vw - 28px));
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}

.form-wide {
  grid-column: 1 / -1;
}

.ia-fill-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(112, 163, 107, 0.28);
  border-radius: 8px;
  color: #2d602a;
  background: rgba(112, 163, 107, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.ia-fill-status.hidden {
  display: none;
}

.start-choice-field {
  display: grid;
  gap: 8px;
}

.start-choice-field > strong {
  color: #74644f;
  font-size: 13px;
}

.start-choice-grid {
  display: grid;
  gap: 8px;
}

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

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

.start-choice-btn {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #e4d8c7;
  border-radius: 8px;
  color: #4d4134;
  background: #fffdf8;
  text-align: left;
}

.start-choice-btn span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: var(--wertia-gold);
  background: #fbf6ed;
}

.start-choice-btn svg {
  width: 15px;
  height: 15px;
}

.start-choice-btn strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.start-choice-btn.active {
  border-color: var(--wertia-gold);
  color: var(--wertia-bg);
  background: linear-gradient(135deg, #fff8e8, #f2dfaa);
}

.start-choice-btn.active span {
  color: #fffdf8;
  background: var(--wertia-gold);
}

.application-form-grid {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.application-form-grid label {
  min-width: 0;
}

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

.application-stepper button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  color: #6f604e;
  background: #fffdf8;
  text-align: left;
}

.application-stepper button span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #8b6423;
  background: #f3e5c8;
  font-weight: 900;
}

.application-stepper button.active {
  border-color: var(--wertia-gold);
  color: #2d2923;
  background: #fff8e8;
}

.application-stepper button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.coach-field.hidden,
.ai-check-panel.hidden,
.hidden {
  display: none !important;
}

.commission-box,
.application-block {
  grid-column: 1 / -1;
}

.application-block {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #eadfce;
  border-radius: 12px;
  background: #fbf6ed;
}

.application-block.hidden,
.ai-check-panel.hidden,
.coach-field.hidden,
.application-rest.hidden {
  display: none !important;
}

.application-rest {
  display: grid;
  gap: 14px;
  grid-column: 1 / -1;
}

.application-gate-message {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(200, 164, 93, 0.28);
  border-radius: 8px;
  color: #806f58;
  background: #fffdf8;
  font-size: 13px;
  font-weight: 800;
}

.application-gate-message svg {
  width: 16px;
  height: 16px;
  color: var(--wertia-gold);
}

.application-gate-message.ready {
  color: #2d602a;
  border-color: rgba(112, 163, 107, 0.28);
  background: rgba(112, 163, 107, 0.12);
}

.application-step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.application-step-actions.split {
  justify-content: space-between;
  align-items: center;
}

.application-final-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #2d602a;
  font-weight: 800;
}

.application-block-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.application-block-head > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(200, 164, 93, 0.34);
  border-radius: 10px;
  color: var(--wertia-gold);
  background: #fffdf8;
}

.application-block-head h3 {
  margin: 0;
  color: #2d2923;
  font-size: 18px;
}

.application-block-head .kicker {
  margin-bottom: 2px;
}

.application-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.compact-field-grid {
  grid-template-columns: minmax(240px, 360px);
}

.method-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.method-choice-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 64px;
  padding: 0 16px;
  border: 1px solid #e4d8c7;
  border-radius: 8px;
  color: #4d4134;
  background: #fffdf8;
  text-align: left;
}

.method-choice-btn span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--wertia-gold);
  background: #fbf6ed;
}

.method-choice-btn.active {
  border-color: var(--wertia-gold);
  color: var(--wertia-bg);
  background: linear-gradient(135deg, #fff8e8, #f2dfaa);
  box-shadow: inset 0 0 0 1px rgba(200, 164, 93, 0.2);
}

.method-choice-btn.active span {
  color: #fffdf8;
  background: var(--wertia-gold);
}

.hidden-file-input {
  display: none;
}

.document-import {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.document-import-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6f604e;
  font-size: 12px;
  font-weight: 900;
}

.document-import-head svg {
  width: 16px;
  height: 16px;
  color: var(--wertia-gold);
}

.document-import-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fffdf8;
}

.document-import-panel.hidden {
  display: none;
}

.document-import-panel.error {
  border-color: #c44a3a;
  background: #fdf3f1;
}

.document-import-panel.error .qr-box {
  border-color: #c44a3a;
  color: #c44a3a;
  background: #fbe7e3;
}

.document-import-panel.error strong {
  color: #c44a3a;
}

.document-import-panel.ok {
  border-color: #3a8a5c;
  background: #f1faf4;
}

.document-import-panel.ok .qr-box {
  border-color: #3a8a5c;
  color: #3a8a5c;
  background: #e6f5ec;
}

.document-import-panel.ok strong {
  color: #3a8a5c;
}

.document-import-retry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #c8a45d;
  border-radius: 8px;
  background: #fbf6ed;
  color: #806f58;
  font-size: 13px;
  cursor: pointer;
  justify-self: start;
}

.document-import-retry:hover {
  background: #f5edd8;
  color: #5a4a36;
}

.document-import-retry svg {
  width: 14px;
  height: 14px;
}

.document-import-retry.hidden {
  display: none;
}

.document-import-panel.loading .qr-box {
  border-color: var(--wertia-gold);
  color: var(--wertia-gold);
  background: transparent;
  animation: ia-pulse 1.4s ease-in-out infinite;
}

.document-import-panel.loading .qr-box svg {
  animation: ia-spin 1.1s linear infinite;
}

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

@keyframes ia-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 164, 93, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(200, 164, 93, 0); }
}

.document-import-panel.loading strong::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--wertia-gold);
  animation: ia-dot 1s ease-in-out infinite alternate;
}

@keyframes ia-dot {
  from { opacity: 0.25; }
  to { opacity: 1; }
}

.id-crop-body {
  display: grid;
  gap: 12px;
}

.id-crop-guide {
  position: relative;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid rgba(200, 164, 93, 0.36);
  border-radius: 0;
  background:
    linear-gradient(45deg, rgba(200, 164, 93, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(200, 164, 93, 0.08) 25%, transparent 25%),
    #fbf6ed;
  background-size: 22px 22px;
}

.id-crop-guide::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 3px solid rgba(200, 164, 93, 0.78);
  border-radius: 0;
  pointer-events: none;
}

#idCropCanvas {
  width: min(100%, 856px);
  aspect-ratio: 85.6 / 53.98;
  border: 1px solid rgba(42, 28, 19, 0.18);
  border-radius: 0;
  background: #fffdf8;
  box-shadow: 0 14px 28px rgba(54, 38, 23, 0.16);
}

.id-crop-corner {
  position: absolute;
  width: 58px;
  height: 58px;
  border-color: var(--wertia-gold);
  border-style: solid;
  pointer-events: none;
  z-index: 1;
}

.id-crop-corner.top-left {
  top: 18px;
  left: 18px;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 0;
}

.id-crop-corner.top-right {
  top: 18px;
  right: 18px;
  border-width: 3px 3px 0 0;
  border-top-right-radius: 0;
}

.id-crop-corner.bottom-left {
  bottom: 18px;
  left: 18px;
  border-width: 0 0 3px 3px;
  border-bottom-left-radius: 0;
}

.id-crop-corner.bottom-right {
  right: 18px;
  bottom: 18px;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 0;
}

#idCropHint {
  margin: 0;
  color: #756550;
  font-size: 13px;
}

.id-crop-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fffdf8;
}

.id-crop-controls label,
.id-crop-rotate-actions {
  display: grid;
  gap: 8px;
  color: #6f604e;
  font-size: 12px;
  font-weight: 500;
}

.id-crop-controls input[type="range"] {
  width: 100%;
  min-height: 28px;
  padding: 0;
  accent-color: var(--wertia-gold);
}

.id-crop-rotate-actions {
  grid-template-columns: repeat(2, minmax(74px, 1fr));
}

.id-crop-nudge-actions {
  display: grid;
  grid-template-rows: repeat(3, 40px);
  gap: 6px;
  min-width: 96px;
}

.id-crop-nudge-actions div {
  display: grid;
  grid-template-columns: repeat(2, minmax(42px, 1fr));
  gap: 6px;
}

.id-crop-nudge-actions .outline-btn {
  min-height: 40px;
  padding: 0;
  font-size: 20px;
}

.id-crop-controls .outline-btn {
  min-height: 40px;
}

.start-id-upload-field {
  display: grid;
  gap: 8px;
}

.id-source-main-btn {
  justify-content: center;
  min-height: 52px;
  gap: 10px;
  border-style: dashed;
}

.id-source-main-btn svg {
  width: 22px;
  height: 22px;
}

.start-id-upload-field small {
  color: #806f58;
  font-size: 12px;
}

.skip-id-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #8a7d63;
  cursor: pointer;
  padding: 8px 0;
}
.skip-id-checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #c89b3c;
}
.skip-id-checkbox span {
  user-select: none;
}

.id-source-modal {
  width: min(680px, calc(100vw - 32px));
}

.id-source-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.id-source-option {
  display: grid;
  justify-items: start;
  gap: 8px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid #eadfce;
  border-radius: 12px;
  background: #fffaf0;
  color: var(--wertia-ink);
  text-align: left;
  cursor: pointer;
}

.id-source-option span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f2e2c1;
  color: #8b6423;
}

.id-source-option svg {
  width: 22px;
  height: 22px;
}

.id-source-option strong {
  font-size: 16px;
}

.id-source-option em {
  color: #756550;
  font-style: normal;
  font-size: 13px;
}

.id-source-option:hover {
  border-color: var(--wertia-gold);
  box-shadow: 0 10px 24px rgba(97, 69, 26, 0.12);
}

.id-source-qr {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #eadfce;
  border-radius: 12px;
  background: #fffdf8;
}

.id-source-qr-code {
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
  border: 1px solid #eadfce;
  border-radius: 12px;
  background: white;
}

.id-source-qr-code img {
  width: 180px;
  height: 180px;
}

.id-source-qr span,
.id-source-qr a {
  display: block;
  margin-top: 8px;
  color: #756550;
  overflow-wrap: anywhere;
}

#qrUploadPanel {
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
}

.qr-box {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px dashed var(--wertia-gold);
  border-radius: 8px;
  color: var(--wertia-gold);
  background: #fbf6ed;
}

.document-import-panel span {
  display: block;
  margin-top: 4px;
  color: #806f58;
  font-size: 12px;
}

.termination-upload {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fffdf8;
}

.termination-flag {
  display: grid;
  gap: 4px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(112, 163, 107, 0.28);
  border-radius: 8px;
  color: #2d602a;
  background: rgba(112, 163, 107, 0.12);
}

.termination-flag.hidden {
  display: none;
}

.termination-flag strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.termination-flag svg {
  width: 16px;
  height: 16px;
}

.termination-flag span {
  color: #52704d;
  font-size: 12px;
  font-weight: 800;
}

.application-field {
  display: grid;
  gap: 12px;
}

.application-field > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6f604e;
  font-size: 12px;
  font-weight: 900;
}

.application-field svg {
  width: 16px;
  height: 16px;
  color: var(--wertia-gold);
}

.application-field input,
.application-field select {
  background: #fffdf8;
}

.application-model-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(200, 164, 93, 0.28);
  border-radius: 8px;
  color: #655743;
  background: #fffdf8;
  font-size: 13px;
  font-weight: 400;
}

.application-requirements {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(112, 163, 107, 0.24);
  border-radius: 8px;
  color: #3f5f3f;
  background: rgba(112, 163, 107, 0.09);
}

.application-requirements strong {
  font-size: 13px;
}

.application-requirements span {
  color: #526d50;
  font-size: 13px;
}

.product-components-preview {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(200, 164, 93, 0.3);
  border-radius: 8px;
  background: #fffdf8;
}

.components-preview-head,
.component-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 120px 100px 82px 82px 120px;
  gap: 10px;
  align-items: center;
}

.components-preview-head {
  color: #6f604e;
  font-size: 13px;
}

.component-preview-row {
  min-height: 38px;
  padding-top: 8px;
  border-top: 1px solid #eee5d8;
}

.component-preview-row span {
  font-weight: 800;
}

.component-preview-row input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: #fffdf8;
  font: inherit;
  font-weight: 800;
}

.component-without-premium {
  opacity: 0.78;
}

.component-preview-row em {
  color: #806f58;
  font-style: normal;
}

.component-preview-row strong {
  text-align: right;
}

.application-model-summary svg {
  width: 16px;
  height: 16px;
  color: var(--wertia-gold);
}

.vorsorge-three-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.vorsorge-three-cols div {
  min-height: 78px;
  padding: 12px;
  border: 1px solid rgba(200, 164, 93, 0.34);
  border-radius: 8px;
  background: #fffdf8;
}

.vorsorge-three-cols span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #806f58;
  font-size: 12px;
  font-weight: 900;
}

.vorsorge-three-cols svg {
  width: 16px;
  height: 16px;
  color: var(--wertia-gold);
}

.vorsorge-three-cols strong {
  display: block;
  margin-top: 8px;
  color: #3a2e22;
  font-size: 18px;
}

.ai-check-panel {
  background: #fffdf8;
}

.ai-check-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px auto;
  align-items: end;
  gap: 12px;
}

.name-match-result {
  display: grid;
  align-content: center;
  min-height: 64px;
  padding: 10px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  color: #8c3030;
  background: rgba(184, 92, 92, 0.13);
}

.name-match-result.ok {
  color: #2d602a;
  background: rgba(112, 163, 107, 0.16);
}

.name-match-result strong {
  font-size: 24px;
}

.name-match-result span {
  font-size: 12px;
  font-weight: 800;
}

.ia-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(200, 164, 93, 0.45);
  border-radius: 8px;
  color: #4a3426;
  background: #fffdf8;
  font-weight: 900;
  cursor: pointer;
}

.ia-refresh-btn svg {
  width: 17px;
  height: 17px;
  color: var(--wertia-gold);
}

.ia-refresh-btn:hover {
  border-color: var(--wertia-gold);
  background: #fbf6ed;
}

.application-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #eadfce;
  color: #3a2e22;
}

.application-divider svg {
  color: var(--wertia-gold);
}

.commission-calculator {
  display: grid;
  gap: 14px;
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px solid rgba(200, 164, 93, 0.38);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(200, 164, 93, 0.14), rgba(255, 253, 248, 0.92)),
    #fffdf8;
}

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

.commission-formula-grid div {
  min-height: 92px;
  padding: 12px;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fffdf8;
}

.commission-formula-grid span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #806f58;
  font-size: 12px;
  font-weight: 900;
}

.commission-formula-grid svg {
  width: 16px;
  height: 16px;
  color: var(--wertia-gold);
}

.commission-formula-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--wertia-gold);
  font-size: 24px;
}

.commission-formula-grid small {
  display: block;
  margin-top: 5px;
  color: #8a7b66;
  font-size: 11px;
  font-weight: 700;
}

.commission-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(200, 164, 93, 0.34);
  border-radius: 12px;
  background: linear-gradient(135deg, #fffdf8, #fbf2df);
}

.commission-box div {
  min-height: 76px;
  padding: 12px;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fffdf8;
}

.commission-box span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #806f58;
  font-size: 12px;
  font-weight: 800;
}

.commission-box svg {
  width: 16px;
  height: 16px;
  color: var(--wertia-gold);
}

.commission-box strong {
  display: block;
  margin-top: 8px;
  color: var(--wertia-gold);
  font-size: 22px;
}

.provider-admin-page {
  display: grid;
  gap: 24px;
}

.provider-admin-head,
.provider-products-head,
.provider-section-head,
.provider-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.provider-admin-head h2 {
  margin: 0 0 4px;
  font-size: 32px;
}

.provider-admin-head span,
.provider-card span,
.provider-product p,
.provider-list-item small,
.provider-empty {
  color: #8a806f;
}

.provider-admin-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.provider-list {
  padding: 0;
  overflow: hidden;
}

.provider-search {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 12px;
  padding: 0 12px;
  border: 1px solid #e6ded2;
  border-radius: 8px;
  background: #fffdf8;
}

.provider-search input {
  border: 0;
  background: transparent;
}

.provider-list-items {
  display: grid;
}

.provider-list-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid #eee7dc;
  border-radius: 0;
  background: #fffdf8;
  text-align: left;
}

.provider-list-item.active {
  background: #fbf4e7;
  box-shadow: inset 4px 0 0 var(--provider-accent);
}

.provider-list-item strong {
  display: block;
  font-size: 16px;
}

.provider-logo-mark,
.provider-logo-img {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--provider-accent);
}

.provider-logo-img {
  object-fit: contain;
}

.provider-admin-content {
  display: grid;
  gap: 16px;
}

.provider-card {
  border-top: 3px solid var(--provider-accent);
}

.provider-card-main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.provider-card-main .provider-logo-mark,
.provider-card-main .provider-logo-img {
  width: 38px;
  height: 38px;
}

.provider-card h3 {
  margin: 2px 0 6px;
  font-size: 28px;
}

.provider-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: #817560;
}

.provider-meta-line a,
.provider-meta-line span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.provider-meta-line svg {
  width: 16px;
  height: 16px;
  color: var(--wertia-gold);
}

.provider-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.provider-logo-upload {
  position: relative;
  overflow: hidden;
}

.provider-logo-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.provider-section {
  padding: 0;
  overflow: hidden;
}

.provider-section-head {
  padding: 14px 16px;
  border-bottom: 1px solid #eee7dc;
}

.provider-section-head h3,
.provider-products-head h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #7c7468;
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.provider-empty {
  padding: 22px;
  text-align: center;
}

.provider-contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.provider-contact-card {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid #eee7dc;
  border-radius: 8px;
  background: #fffdf8;
}

.provider-contact-card a {
  color: #7d6742;
  text-decoration: none;
}

.mini-edit {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 30px;
  padding: 4px;
  border: 0;
  background: transparent;
}

.provider-products {
  display: grid;
  gap: 14px;
}

.provider-product-list {
  display: grid;
  gap: 12px;
}

.provider-product {
  padding: 0;
  overflow: hidden;
}

.provider-product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

.provider-product h4 {
  margin: 0 0 4px;
  font-size: 18px;
}

.provider-product h4 span {
  color: #8a806f;
  font-size: 14px;
}

.provider-row-actions {
  display: flex;
  gap: 8px;
}

.provider-components {
  border-top: 1px solid #eee7dc;
  background: #fffaf2;
}

.provider-components-title,
.provider-rule-total {
  padding: 12px 16px;
  color: #7d7569;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.provider-rule-table {
  display: grid;
}

.provider-rule-header,
.provider-rule-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) 110px 110px minmax(260px, 1.7fr) 44px;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid #eee7dc;
}

.provider-rule-header {
  color: #80776a;
  background: #f6f1e8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.provider-rule-row input {
  min-height: 34px;
}

.provider-rule-row input:nth-child(3) {
  color: var(--wertia-gold);
  font-weight: 900;
}

.provider-rule-total {
  border-top: 1px solid #eee7dc;
  color: #8a806f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-transform: none;
}

.add-component-btn {
  margin: 12px 16px 16px;
}

label {
  display: grid;
  gap: 6px;
  color: #74644f;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  min-height: 40px;
  border: 1px solid #e4d8c7;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fffdf8;
}

body {
  font-weight: 400;
}

strong,
b {
  font-weight: 600;
}

button,
label,
.nav-item,
.nav-item.active,
.kicker,
.document-import-head,
.application-field > span,
.vorsorge-three-cols span,
.commission-formula-grid span,
.commission-formula-grid small,
.commission-box span,
.customer-tab strong,
.tab-data-row strong,
.application-row small,
.application-row em,
.readonly-field span,
.termination-flag span,
.ia-refresh-btn,
.provider-rule-header,
.provider-rule-total,
.provider-rule-row input:nth-child(3) {
  font-weight: 500;
}

h1,
h2,
h3,
h4,
.metric-card strong,
.name-match-result strong,
.commission-formula-grid strong,
.commission-box strong,
.vorsorge-three-cols strong,
.provider-card h3,
.provider-product h4 {
  font-weight: 600;
}

@media (max-width: 1180px) {
  .content-grid,
  .detail-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .detail-column-resizer {
    display: none;
  }

  .insurance-column,
  .detail-content {
    grid-column: auto;
  }

  .client-grid,
  .document-grid,
  .company-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  dialog,
  #applicationDialog,
  #idCropDialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .modal,
  .wide-modal,
  .id-crop-modal {
    width: 100%;
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    padding: 14px;
  }

  .modal-head,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-actions button {
    width: 100%;
  }

  .id-crop-guide {
    padding: 10px;
  }

  #idCropCanvas {
    width: 100%;
    max-height: 42dvh;
    object-fit: contain;
  }

  .id-crop-controls {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .id-crop-rotate-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .id-crop-nudge-actions {
    grid-template-rows: repeat(3, 44px);
    min-width: 0;
  }

  .id-source-actions,
  .id-source-qr {
    grid-template-columns: 1fr;
  }

  .application-stepper {
    grid-template-columns: 1fr;
  }

  .id-source-option {
    min-height: 96px;
  }

  .id-source-qr-code {
    justify-self: center;
  }

  .id-crop-controls input[type="range"] {
    min-height: 34px;
  }

  .app-shell,
  .app-shell:not(.sidebar-collapsed) {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .hero-card,
  .section-head,
  .client-header-card,
  .kunden-search-card {
    align-items: stretch;
    flex-direction: column;
  }

  .kunden-search-card {
    grid-template-columns: 1fr;
  }

  .recent-client-row {
    grid-template-columns: 1fr 82px;
    gap: 4px 12px;
    padding: 12px;
  }

  .recent-client-row a {
    grid-column: 1;
  }

  .row-actions {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .search {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .metrics-grid,
  .client-grid,
  .coverage-grid,
  .customer-tabs,
  .application-form-grid,
  .ai-check-panel,
  .commission-box,
  .commission-formula-grid,
  .vorsorge-three-cols,
  .method-choice,
  .data-group,
  .document-grid,
  .company-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.customer-acquired-banner {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(112, 163, 107, 0.36);
  border-radius: 10px;
  color: #214f23;
  background: #eaf6e8;
  box-shadow: 0 12px 28px rgba(31, 78, 35, 0.12);
}

.customer-acquired-banner > svg {
  width: 28px;
  height: 28px;
  padding: 10px;
  border-radius: 10px;
  color: #1f6b31;
  background: white;
}

.customer-acquired-banner strong {
  display: block;
  font-size: 20px;
}

.customer-acquired-banner span {
  display: block;
  margin-top: 3px;
  color: #3b6b3b;
}

.client-doc-stack {
  display: grid;
  gap: 12px;
}

.client-id-document-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(112, 163, 107, 0.34);
  border-radius: 10px;
  background: #edf8eb;
}

.client-id-document-card > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  color: #1f6b31;
  background: white;
}

.client-id-document-card small {
  display: block;
  margin-top: 4px;
  color: #4f744c;
  overflow-wrap: anywhere;
}

/* User preference: keep interface copy light, avoid heavy bold text. */
strong,
b,
.application-row small,
.application-row em,
.tab-data-row strong,
.metric-card strong,
.coverage-row strong,
.data-group strong,
.document-folder strong,
.field-suffix,
[data-readonly],
.application-stepper strong,
.method-choice-btn strong,
.document-import-panel strong,
.commission-formula-grid strong,
.vorsorge-three-cols strong,
.component-preview-row span,
.component-preview-row strong,
.customer-acquired-banner strong,
.client-id-document-card strong,
.client-doc-slot strong,
.provider-list-item strong,
.provider-card strong {
  font-weight: 500;
}

.application-field > span,
.field-label,
.kicker,
.eyebrow,
.application-status-label,
.application-medical-note.active,
.application-accept-btn,
.application-accept-badge,
.application-medical-btn,
.application-medical-badge,
.component-preview-row input {
  font-weight: 500;
}

h1,
h2,
h3,
.page-title,
.detail-header h2 {
  font-weight: 650;
}

body,
button,
input,
select,
textarea {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
}

strong,
b,
small,
em,
label,
span,
p,
button,
input,
select,
textarea,
.field-label,
.kicker,
.eyebrow {
  font-weight: 300;
}

h1,
h2,
h3 {
  font-weight: 400;
}

.contracts-page {
  display: grid;
  gap: 18px;
}

.mandate-page {
  display: grid;
  gap: 14px;
}
.mandate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mandate-head h2 {
  font-size: 24px;
  font-weight: 700;
  color: #3a2c1c;
}
.mandate-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #d8c8a8;
  border-radius: 10px;
  background: #fbf6ed;
  min-width: 260px;
}
.mandate-search-box svg {
  width: 18px;
  height: 18px;
  color: #a0917a;
}
.mandate-search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: #3a2c1c;
  width: 100%;
}
.mandate-client-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f5ede0;
  border-radius: 8px;
  font-size: 14px;
}
.mandate-client-info svg {
  width: 18px;
  height: 18px;
  color: #c89b3c;
}
.mandate-client-info .customer-code {
  font-size: 12px;
  color: #a0917a;
}
.mandate-table th,
.mandate-table td {
  white-space: nowrap;
}
.mandate-doc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #d8c8a8;
  background: #fbf6ed;
  color: #806f58;
  cursor: pointer;
}
.mandate-doc-btn:hover {
  background: #f0e6d0;
  color: #5a4a36;
}

.contracts-head h2 {
  font-size: 24px;
  font-weight: 700;
  color: #3a2c1c;
}

.contracts-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #eadfce;
}

.contracts-tab {
  padding: 10px 20px;
  border: 0;
  background: transparent;
  color: #806f58;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.contracts-tab.active {
  color: #3a2c1c;
  border-bottom-color: var(--wertia-gold);
}

.contracts-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  background: #fffdf8;
  border: 1px solid #eadfce;
  border-radius: 10px;
}

.contracts-filters .field-control {
  flex: 1;
  min-width: 140px;
}

.contracts-filters select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d8c8a8;
  border-radius: 6px;
  font-size: 13px;
}

.contracts-table-wrap {
  overflow-x: auto;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fffdf8;
}

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

.contracts-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: #5a4a36;
  background: #fbf6ed;
  border-bottom: 2px solid #eadfce;
  white-space: nowrap;
}

.contracts-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0e8d8;
  vertical-align: middle;
}

.contracts-table tbody tr:hover {
  background: #fbf6ed;
}

.contracts-table svg {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 4px;
}

.contracts-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.contracts-status-pending {
  background: #fef3cd;
  color: #8a6d1b;
}

.contracts-status-accepted {
  background: #e4f4dc;
  color: #2f6b24;
}

.contracts-status-contracts-status-medicalReview,
.contracts-status-pending[class*="med"] {
  background: #fce4e4;
  color: #a82727;
}

.contracts-status-rejected {
  background: #fce4e4;
  color: #a82727;
}

/* Righe colorate Anträge: accettata = verde, rifiutata = rossa */
.contracts-status-row-accepted {
  background: linear-gradient(90deg, rgba(47, 107, 36, 0.16), rgba(47, 107, 36, 0.02));
  border-left: 3px solid #2f6b24;
}

.contracts-status-row-rejected {
  background: linear-gradient(90deg, rgba(168, 39, 39, 0.16), rgba(168, 39, 39, 0.02));
  border-left: 3px solid #a82727;
}

.contracts-status-row-pending {
  border-left: 3px solid transparent;
}

.contracts-status-row-medical {
  background: linear-gradient(90deg, rgba(168, 39, 39, 0.1), rgba(168, 39, 39, 0.02));
  border-left: 3px solid #c97a1b;
}

/* Dialog Azioni Anträge / Policen */
.action-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border, #e3d9c9);
  border-bottom: 1px solid var(--border, #e3d9c9);
  margin-bottom: 18px;
}

.action-summary-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.action-summary-grid .field-label {
  color: #8a7d63;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.action-summary-grid strong {
  color: #2a2118;
  font-size: 15px;
}

.medical-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e3d9c9;
  border-radius: 10px;
  background: #fbf6ec;
  cursor: pointer;
  margin-bottom: 18px;
  color: #2a2118;
  font-size: 14px;
}

.medical-toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: #2f6b24;
}

.medical-toggle-icon {
  display: inline-flex;
  color: #c97a1b;
}

.medical-toggle-icon svg {
  width: 18px;
  height: 18px;
}

.action-decision-title {
  margin: 0 0 10px;
  font-weight: 700;
  color: #2a2118;
  font-size: 14px;
}

.action-decision-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.action-decision-row button {
  flex: 1;
  height: 50px;
  border-radius: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.action-decision-row button svg {
  width: 18px;
  height: 18px;
}

.decision-accept {
  background: #e4f4dc;
  border: 1px solid #2f6b24;
  color: #2f6b24;
}

.decision-accept:hover {
  background: #d4eacb;
}

.decision-reject {
  background: #fce4e4;
  border: 1px solid #a82727;
  color: #a82727;
}

.decision-reject:hover {
  background: #f7d4d4;
}

.action-decision-hint {
  margin: 8px 0 0;
  color: #8a7d63;
  font-size: 13px;
  line-height: 1.5;
  min-height: 20px;
}

.action-decision-hint svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
  color: #c97a1b;
}

.action-decision-hint strong {
  color: #2f6b24;
}

.contracts-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.contracts-actions .eye-btn {
  width: 30px;
  height: 30px;
}

/* PROVVIGIONI PAGE */

.provvigioni-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.provvigioni-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.provvigioni-sub {
  margin: 6px 0 0;
  color: #8a7d63;
  font-size: 13px;
}

.provvigioni-sub strong {
  color: var(--wertia-gold);
}

.provvigioni-actions {
  display: flex;
  gap: 10px;
}

.provvigioni-actions .outline-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(200, 164, 93, 0.4);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--wertia-gold);
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.provvigioni-actions .outline-btn:hover {
  background: #fbf3e2;
  border-color: var(--wertia-gold);
}

.provvigioni-actions .outline-btn svg {
  width: 17px;
  height: 17px;
}

.prov-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.prov-kpi-card {
  padding: 18px;
  border: 1px solid rgba(200, 164, 93, 0.2);
  border-radius: 12px;
  background: #fffdf8;
}

.prov-kpi-card span {
  display: block;
  color: #8a7d63;
  font-size: 12px;
  margin-bottom: 6px;
}

.prov-kpi-card strong {
  font-size: 22px;
  color: #2a2118;
  letter-spacing: -0.4px;
}

.prov-kpi-card.prov-kpi-paid strong { color: #2f6b24; }
.prov-kpi-card.prov-kpi-remaining strong { color: #a82727; }
.prov-kpi-card.prov-kpi-next {
  background: linear-gradient(135deg, #fbf3e2, #fffdf8);
  border-color: var(--wertia-gold);
}
.prov-kpi-card.prov-kpi-next strong { color: var(--wertia-gold); }

.provvigioni-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(200, 164, 93, 0.18);
  border-radius: 12px;
  background: #fffdf8;
}

.provvigioni-filters .field-control {
  flex: 1;
  min-width: 140px;
}

.provvigioni-table {
  width: 100%;
  border-collapse: collapse;
}

.provvigioni-table th,
.provvigioni-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(200, 164, 93, 0.18);
  text-align: left;
  font-size: 13px;
}

.provvigioni-table th {
  color: var(--wertia-gold);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #fbf3e2;
}

.provvigioni-table td {
  color: #2a2118;
}

.provvigioni-table tfoot td {
  font-weight: 800;
  background: #fbf3e2;
  color: #2a2118;
  border-top: 2px solid rgba(200, 164, 93, 0.4);
}

.prov-row {
  transition: background 150ms ease;
}

.prov-row:hover {
  background: #fbf6ec;
}

.prov-row.prov-paid { border-left: 3px solid #2f6b24; }
.prov-row.prov-pending { border-left: 3px solid #c89b3c; }
.prov-row.prov-partial { border-left: 3px solid #b85c5c; }
.prov-row.prov-outstanding { border-left: 3px solid #a82727; }

@media (max-width: 900px) {
  .prov-kpi-row { grid-template-columns: repeat(2, 1fr); }
}

/* CHAT WIDGET */
.chat-widget {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 400;
  font-family: inherit;
  display: none;
}

body.crm-active .chat-widget {
  display: block;
}

.chat-fab {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--wertia-gold-soft), var(--wertia-gold));
  color: #1a1208;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(60, 42, 20, 0.28), 0 0 0 1px rgba(255, 246, 210, 0.3);
  transition: transform 180ms ease;
  position: relative;
}

.chat-fab:hover { transform: translateY(-2px) scale(1.04); }

.chat-fab svg { width: 26px; height: 26px; stroke-width: 1.8; }

.chat-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #a82727;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 0 0 2px #fffdf8;
}

.chat-panel {
  position: absolute;
  bottom: 74px;
  right: 0;
  width: 380px;
  height: 540px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(200, 164, 93, 0.28);
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: 0 24px 60px rgba(40, 28, 14, 0.32);
  overflow: hidden;
}

.chat-panel[hidden] { display: none; }

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #1a1310, #2a1c13);
  color: #f4e8d0;
  border-bottom: 1px solid rgba(200, 164, 93, 0.2);
}

.chat-head-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-head-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--wertia-gold-soft), var(--wertia-gold));
  color: #1a1208;
  font-weight: 800;
}

.chat-head-info strong { display: block; font-size: 14px; }
.chat-head-info small { display: block; color: var(--wertia-gold-soft); font-size: 11px; }

.chat-head-actions { display: flex; gap: 6px; }

.chat-head-btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(244, 232, 208, 0.08);
  color: var(--wertia-gold-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-head-btn:hover { background: rgba(244, 232, 208, 0.16); }
.chat-head-btn svg { width: 16px; height: 16px; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #faf4e8;
}

.chat-empty {
  margin: auto;
  color: #8a7d63;
  font-size: 13px;
  text-align: center;
}

.chat-day-sep {
  text-align: center;
  margin: 8px 0 6px;
}

.chat-day-sep span {
  font-size: 11px;
  color: #8a7d63;
  background: #f0e6d0;
  padding: 3px 12px;
  border-radius: 999px;
}

.chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 85%;
}

.chat-msg.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #c8a45d, #8a6a32);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.chat-msg-bubble {
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.chat-msg.mine .chat-msg-bubble {
  background: linear-gradient(135deg, var(--wertia-gold-soft), var(--wertia-gold));
  color: #1a1208;
  border-bottom-right-radius: 4px;
}

.chat-msg.their .chat-msg-bubble {
  background: #fffdf8;
  border: 1px solid rgba(200, 164, 93, 0.2);
  color: #2a2118;
  border-bottom-left-radius: 4px;
}

.chat-msg-bubble strong {
  display: block;
  font-size: 12px;
  margin-bottom: 2px;
  color: var(--wertia-gold);
}

.chat-msg-bubble p { margin: 0; }

.chat-msg-bubble small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.7;
  text-align: right;
}

.chat-attach-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.chat-attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(26, 18, 8, 0.06);
  border: 1px solid rgba(200, 164, 93, 0.18);
  text-decoration: none;
  color: #2a2118;
  font-size: 12px;
  cursor: pointer;
}

.chat-attach-item:hover { background: rgba(26, 18, 8, 0.1); }
.chat-attach-item svg { width: 16px; height: 16px; color: var(--wertia-gold); flex-shrink: 0; }
.chat-attach-item small { margin-left: auto; color: #8a7d63; }

.chat-attach-preview {
  padding: 8px 12px;
  border-top: 1px solid rgba(200, 164, 93, 0.18);
  background: #fbf3e2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-attach-preview[hidden] { display: none; }

.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fffdf8;
  border: 1px solid rgba(200, 164, 93, 0.3);
  font-size: 12px;
  color: #2a2118;
}

.attach-chip small { color: #8a7d63; }

.attach-remove {
  width: 18px;
  height: 18px;
  min-height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(168, 39, 39, 0.15);
  color: #a82727;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(200, 164, 93, 0.18);
  background: #fffdf8;
}

.chat-attach-btn,
.chat-send-btn {
  width: 38px;
  height: 38px;
  min-height: 38px;
  border: 1px solid rgba(200, 164, 93, 0.28);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--wertia-gold);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-attach-btn:hover, .chat-send-btn:hover {
  background: #fbf3e2;
  border-color: var(--wertia-gold);
}

.chat-attach-btn svg, .chat-send-btn svg { width: 18px; height: 18px; }

.chat-send-btn {
  background: linear-gradient(135deg, var(--wertia-gold-soft), var(--wertia-gold));
  border-color: var(--wertia-gold);
  color: #1a1208;
}

#chatTextInput {
  flex: 1;
  min-height: 40px;
  border: 1px solid rgba(200, 164, 93, 0.28);
  border-radius: 10px;
  padding: 0 14px;
  background: #fffdf8;
  color: #2a2118;
  font-size: 14px;
  outline: none;
}

#chatTextInput:focus { border-color: var(--wertia-gold); }

@media (max-width: 480px) {
  .chat-panel { width: calc(100vw - 44px); height: 70vh; }
}

/* AUFGABEN DASHBOARD */
.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.aufgaben-panel {
  padding: 18px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.aufgaben-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 0;
}

.aufgaben-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.aufgaben-head h3 {
  margin: 0;
  font-size: 20px;
}

.aufgaben-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.aufg-stat {
  padding: 5px 12px;
  border-radius: 999px;
  background: #f0e6d0;
  color: #6b5d48;
  font-size: 12px;
  font-weight: 700;
}

.aufg-stat-overdue {
  background: #fce4e4;
  color: #a82727;
}

.aufg-stat-today {
  background: #fbf3e2;
  color: #c89b3c;
}

.aufgaben-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aufg-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid rgba(200, 164, 93, 0.2);
  border-radius: 12px;
  background: #fffdf8;
  transition: background 150ms ease;
}

.aufg-row:hover { background: #fbf6ec; }

.aufg-row.aufg-done {
  opacity: 0.55;
  background: #f7f1e6;
}

.aufg-row.aufg-done .aufg-main strong {
  text-decoration: line-through;
}

.aufg-row.aufg-overdue {
  border-left: 3px solid #a82727;
}

.aufg-check {
  width: 26px;
  height: 26px;
  min-height: 26px;
  border: 2px solid rgba(200, 164, 93, 0.4);
  border-radius: 8px;
  background: #fffdf8;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #2f6b24;
  transition: background 150ms ease, border-color 150ms ease;
}

.aufg-check:hover { border-color: #2f6b24; }
.aufg-check svg { width: 16px; height: 16px; stroke-width: 2.5; }

.aufg-main strong {
  display: block;
  font-size: 15px;
  color: #2a2118;
}

.aufg-main p {
  margin: 4px 0 0;
  color: #6b5d48;
  font-size: 13px;
}

.aufg-top {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.aufg-prio {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.aufg-prio-hoch { background: #fce4e4; color: #a82727; }
.aufg-prio-mittel { background: #fbf3e2; color: #c89b3c; }
.aufg-prio-niedrig { background: #eaf3e2; color: #2f6b24; }

.aufg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  color: #8a7d63;
  font-size: 12px;
}

.aufg-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.aufg-meta svg {
  width: 14px;
  height: 14px;
  color: var(--wertia-gold);
}

.aufg-notes {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fbf3e2;
  border: 1px solid rgba(200, 164, 93, 0.18);
  color: #6b5d48;
  font-size: 12px;
  white-space: pre-wrap;
}

.aufg-actions {
  display: flex;
  gap: 6px;
}

.aufg-actions .summary-icon-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
}

/* Dialog Aufgabe: invite chips */
.aufg-invite-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.invite-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(200, 164, 93, 0.3);
  border-radius: 999px;
  background: #fffdf8;
  font-size: 13px;
  cursor: pointer;
}

.invite-chip input {
  width: 16px;
  height: 16px;
  accent-color: var(--wertia-gold);
}

.invite-chip:has(input:checked) {
  background: #fbf3e2;
  border-color: var(--wertia-gold);
  color: var(--wertia-gold);
}

/* USER ADMIN */
.user-admin-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.user-table th, .user-table td {
  font-size: 13px;
  padding: 9px 10px;
}

.user-table {
  border: none;
}

.user-table th {
  background: transparent;
  border-bottom: 1px solid rgba(200, 164, 93, 0.3);
  color: var(--wertia-gold);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.user-table td {
  border-bottom: 1px solid rgba(200, 164, 93, 0.12);
  border-top: none;
  border-left: none;
  border-right: none;
}

.user-table tr:last-child td {
  border-bottom: none;
}

.contracts-table-wrap:has(.user-table) {
  border: none;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.user-row small.user-me {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--wertia-gold);
  color: #1a1208;
  font-size: 10px;
  font-weight: 800;
}

.user-inactive { opacity: 0.5; }

.role-pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.role-pill.role-admin { background: #fce4e4; color: #a82727; }
.role-pill.role-cons { background: #eaf3e2; color: #2f6b24; }
.role-pill.role-collab { background: #fbf3e2; color: #c89b3c; }

.roles-info { padding: 18px; }

.roles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 10px;
}

.role-card {
  padding: 16px;
  border: 1px solid rgba(200, 164, 93, 0.2);
  border-radius: 12px;
  background: #fffdf8;
}

.role-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid;
}

.role-card.role-admin h3 { color: #a82727; border-color: #a82727; }
.role-card.role-cons h3 { color: #2f6b24; border-color: #2f6b24; }
.role-card.role-collab h3 { color: #c89b3c; border-color: #c89b3c; }

.role-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.role-card li {
  font-size: 13px;
  color: #2a2118;
}

.role-card li.role-note {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fbf3e2;
  color: #6b5d48;
  font-style: italic;
  font-size: 12px;
}

.prov-level-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  width: 100%;
  box-sizing: border-box;
}

.prov-level-grid .prov-level-chip {
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(20% - 5px);
}

.prov-level-chip {
  min-height: 32px;
  padding: 0 4px;
  border: 1px solid rgba(200, 164, 93, 0.3);
  border-radius: 7px;
  background: #fffdf8;
  color: #8a7d63;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.prov-level-chip:hover { border-color: var(--wertia-gold); }

.prov-level-chip.active {
  background: linear-gradient(135deg, var(--wertia-gold-soft), var(--wertia-gold));
  border-color: var(--wertia-gold);
  color: #1a1208;
}

#userDialog {
  width: min(440px, calc(100vw - 28px));
  max-width: 440px;
  overflow: hidden;
}

#userDialog .modal {
  padding: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

#userDialog #userDialogBody {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

#userDialog .modal-head {
  margin-bottom: 10px;
}

#userDialog .modal-head h2 {
  font-size: 18px;
}

.prov-storno-hint {
  margin: 8px 0;
  padding: 8px 12px;
  font-size: 12px;
}

#userDialog .modal-actions {
  margin-top: 12px;
}

#userDialog .modal-actions button {
  min-height: 38px;
  font-size: 13px;
}

.prov-storno-hint {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid rgba(200, 164, 93, 0.22);
  border-radius: 10px;
  background: #fbf6ec;
  color: #6b5d48;
  font-size: 13px;
}

.prov-storno-hint strong { color: var(--wertia-gold); }

.profile-menu-user {
  padding: 4px 8px 6px;
}

.profile-switch-label {
  margin: 0 4px 6px;
  color: #8a7d63;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-switch-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-switch-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #2a2118;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease;
}

.profile-switch-btn:hover { background: #fbf3e2; }
.profile-switch-btn.active {
  background: #fbf3e2;
  border-color: var(--wertia-gold);
}

.profile-switch-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--wertia-gold-soft), var(--wertia-gold));
  color: #1a1208;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.profile-switch-name { flex: 1; font-weight: 600; }
.profile-switch-btn small {
  color: #8a7d63;
  font-size: 11px;
}

#coachLabel.hidden { display: none; }

/* USER FORM COMPACT */
.user-form-compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.uf-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.uf-field {
  display: flex;
  align-items: center;
  gap: 0;
  border: none;
  border-bottom: 1px solid rgba(200, 164, 93, 0.28);
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  transition: border-color 150ms ease;
}

.uf-field:focus-within {
  border-bottom-color: var(--wertia-gold);
}

.uf-ico {
  width: 34px;
  min-width: 34px;
  height: 38px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--wertia-gold);
  border-right: none;
  flex-shrink: 0;
}

.uf-ico svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.6;
}

.uf-field input,
.uf-field select {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 0 10px;
  height: 38px;
  color: #2a2118;
  font-size: 13.5px;
}

.uf-field input::placeholder { color: #b8a98f; }

.uf-section {
  margin-top: 2px;
}

.uf-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 6px;
  color: var(--wertia-gold);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.uf-section-title svg {
  width: 14px;
  height: 14px;
}

.uf-signature-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(200, 164, 93, 0.18);
}

.uf-sign-row {
  display: flex;
  gap: 6px;
}

.uf-sign-btn {
  flex: 1;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(200, 164, 93, 0.3);
  border-radius: 7px;
  background: #fffdf8;
  color: var(--wertia-gold);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 150ms ease, border-color 150ms ease;
}

.uf-sign-btn:hover {
  background: #fbf3e2;
  border-color: var(--wertia-gold);
}

.uf-sign-btn svg {
  width: 15px;
  height: 15px;
}

.uf-sign-preview {
  position: relative;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(200, 164, 93, 0.3);
  border-radius: 8px;
  background: #fbf6ec;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
}

.uf-sign-preview img {
  max-height: 60px;
  max-width: 100%;
  object-fit: contain;
}

.uf-sign-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  min-height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(168, 39, 39, 0.15);
  color: #a82727;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.uf-sign-hint {
  display: block;
  margin-top: 6px;
  color: #8a7d63;
  font-size: 11px;
}

@media (max-width: 900px) {
  .roles-grid { grid-template-columns: 1fr; }
  .prov-level-grid { grid-template-columns: repeat(3, 1fr); }
}

/* FINANZANALYSE */
.fa-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fa-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.fa-sub {
  margin: 6px 0 0;
  color: #8a7d63;
  font-size: 13px;
}

.fa-section h3 {
  margin: 0 0 12px;
  font-size: 17px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(200, 164, 93, 0.2);
}

.fa-lcharts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.l-chart {
  width: 100%;
  height: auto;
  background: #fffdf8;
  border: 1px solid rgba(200, 164, 93, 0.2);
  border-radius: 10px;
  padding: 6px;
  box-sizing: border-box;
}

.fa-scenario-detail {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.fa-scenario-card {
  padding: 14px;
  border: 1px solid rgba(200, 164, 93, 0.2);
  border-radius: 10px;
  background: #fffdf8;
}

.fa-scenario-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--wertia-gold);
}

.fa-scenario-card p {
  margin: 3px 0;
  font-size: 13px;
  color: #2a2118;
}

.fa-scenario-card p.fa-luecke {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 7px;
  background: #fce4e4;
  color: #a82727;
  font-weight: 700;
}

.fa-scenario-card small {
  display: block;
  margin-top: 6px;
  color: #8a7d63;
  font-size: 11px;
}

.fa-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.fa-prov-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(200, 164, 93, 0.12);
  font-size: 13px;
}

.fa-prov-row span { color: #8a7d63; }
.fa-prov-row strong { color: #2a2118; }
.fa-prov-row.fa-gap strong { color: #a82727; }
.fa-gap { color: #a82727; }
.fa-ok { color: #2f6b24; }

.fa-proj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.fa-proj-card {
  padding: 14px;
  border: 1px solid rgba(200, 164, 93, 0.2);
  border-radius: 10px;
  background: #fffdf8;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fa-proj-card .kicker {
  margin: 0 0 4px;
}

.fa-proj-card div {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.fa-proj-card div span { color: #8a7d63; }
.fa-proj-card div strong { color: #2a2118; }

@media (max-width: 900px) {
  .fa-lcharts, .fa-scenario-detail, .fa-two-col, .fa-proj-grid { grid-template-columns: 1fr; }
}

/* FINANZANALYSE WIZARD */
.fa-wizard-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: calc(100vh - 120px);
  max-width: 720px;
  margin: 0 auto;
}

.fa-wizard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.fa-wizard-head h2 { font-size: 20px; margin: 2px 0 0; }
.fa-wizard-head .kicker { margin: 0; }

.fa-steps-bar {
  display: flex;
  gap: 2px;
  padding: 6px;
  border: 1px solid rgba(200, 164, 93, 0.2);
  border-radius: 10px;
  background: #fffdf8;
  overflow-x: auto;
}

.fa-step-dot {
  flex: 1;
  min-width: 90px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #8a7d63;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: background 150ms ease, color 150ms ease;
}

.fa-step-dot:disabled { cursor: not-allowed; opacity: 0.4; }

.fa-step-dot.active {
  background: linear-gradient(135deg, var(--wertia-gold-soft), var(--wertia-gold));
  color: #1a1208;
}

.fa-step-dot.done { color: #2f6b24; }

.fa-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f0e6d0;
  color: #6b5d48;
  font-weight: 800;
  font-size: 11px;
  flex-shrink: 0;
}

.fa-step-dot.active .fa-step-num { background: #1a1208; color: var(--wertia-gold-soft); }
.fa-step-dot.done .fa-step-num { background: #eaf3e2; color: #2f6b24; }

.fa-step-lbl { white-space: nowrap; }

.fa-step-body { flex: 1; min-height: 200px; }

.fa-step-content h3 { margin: 0 0 6px; font-size: 16px; }

.fa-step-hint {
  margin: 0 0 10px;
  color: #8a7d63;
  font-size: 12px;
}

.fa-client-pick { margin-bottom: 8px; }

.fa-pick-btn {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(200, 164, 93, 0.3);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--wertia-gold);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.fa-pick-btn.active, .fa-pick-btn:hover {
  background: #fbf3e2;
  border-color: var(--wertia-gold);
}

.fa-client-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.fa-client-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(200, 164, 93, 0.2);
  border-radius: 8px;
  background: #fffdf8;
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease;
}

.fa-client-row:hover { background: #fbf6ec; }
.fa-client-row.active { border-color: var(--wertia-gold); background: #fbf3e2; }

.fa-client-row .profile-avatar { width: 30px; height: 30px; font-size: 11px; }
.fa-client-row strong { display: block; font-size: 13px; color: #2a2118; }
.fa-client-row small { color: #8a7d63; font-size: 10px; }

.fa-calc-box {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(200, 164, 93, 0.2);
  border-radius: 8px;
  background: #fffdf8;
}

.fa-calc-sub {
  color: var(--wertia-gold);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 6px 0 4px;
}

.fa-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 12.5px;
}

.fa-calc-row span { color: #8a7d63; }
.fa-calc-row strong { color: #2a2118; }
.fa-calc-row.sub span { color: #a99b85; font-size: 11px; }
.fa-calc-row.sub { font-size: 11px; }

.fa-calc-row.total {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1.5px solid rgba(200, 164, 93, 0.3);
}

.fa-calc-row.total strong { color: var(--wertia-gold); font-size: 15px; }

.fa-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.fa-sum-card {
  padding: 10px;
  border: 1px solid rgba(200, 164, 93, 0.2);
  border-radius: 8px;
  background: #fffdf8;
}

.fa-sum-card h4 { margin: 0 0 6px; color: var(--wertia-gold); font-size: 13px; }
.fa-sum-card p { margin: 2px 0; font-size: 12px; }

.fa-wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  margin-bottom: 90px;
  border-top: 1px solid rgba(200, 164, 93, 0.2);
  position: relative;
  z-index: 950;
}

.fa-wizard-nav .primary-btn, .fa-wizard-nav .outline-btn {
  min-height: 38px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
}

@media (max-width: 700px) {
  .fa-client-list, .fa-summary-grid { grid-template-columns: 1fr; }
  .fa-wizard-page { max-width: 100%; }
}

/* Dialog gestione pagamento provvigione */
.prov-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 10px;
}

.prov-status-row > strong {
  font-size: 13px;
  color: #2a2118;
}

.prov-status-choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.prov-status-chip {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(200, 164, 93, 0.3);
  border-radius: 999px;
  background: #fffdf8;
  color: #8a7d63;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.prov-status-chip:hover {
  border-color: var(--wertia-gold);
}

.prov-status-chip.active.prov-paid {
  background: #eaf3e2;
  border-color: #2f6b24;
  color: #2f6b24;
}

.prov-status-chip.active.prov-partial {
  background: #fce8d8;
  border-color: #b85c5c;
  color: #b85c5c;
}

.prov-status-chip.active.prov-pending {
  background: #fbf3e2;
  border-color: #c89b3c;
  color: #c89b3c;
}

.prov-status-chip.active.prov-outstanding {
  background: #fce4e4;
  border-color: #a82727;
  color: #a82727;
}

.prov-carry-hint {
  margin: 8px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(200, 164, 93, 0.22);
  border-radius: 10px;
  background: #fbf6ec;
  color: #6b5d48;
  font-size: 13px;
  line-height: 1.5;
}

.prov-carry-hint svg {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  margin-right: 6px;
  color: var(--wertia-gold);
}

.prov-carry-hint strong { color: #2a2118; }

.prov-carry-hint.prov-carry-closed {
  background: #eaf3e2;
  border-color: #2f6b24;
  color: #2f6b24;
}

.prov-carry-hint.prov-carry-open {
  background: #fce4e4;
  border-color: #a82727;
  color: #a82727;
}

.prov-carry-flag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #fbf3e2;
  border: 1px solid #c89b3c;
  color: #c89b3c;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.prov-row.prov-carried {
  background: repeating-linear-gradient(45deg, rgba(200,164,93,0.04) 0 8px, transparent 8px 16px);
}

.provvigioni-table td input[type="number"],
.provvigioni-table td textarea,
.provvigioni-table td input[type="date"] {
  width: 100%;
}

/* ===== Animazioni generali ===== */

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

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

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.8); }
  60%  { opacity: 1; transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

@keyframes pulseSoft {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

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

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

@keyframes barGrow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

/* Vista principale: ingresso ad ogni render */
.main-panel {
  animation: viewIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Carte client / metriche: ingresso scalonato */
.client-card,
.metric-card,
.panel-card,
.identity-card,
.action-card,
.stat-card {
  animation: slideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.client-card:nth-child(1)  { animation-delay: 0.02s; }
.client-card:nth-child(2)  { animation-delay: 0.06s; }
.client-card:nth-child(3) { animation-delay: 0.10s; }
.client-card:nth-child(4) { animation-delay: 0.14s; }
.client-card:nth-child(5) { animation-delay: 0.18s; }
.client-card:nth-child(6) { animation-delay: 0.22s; }
.client-card:nth-child(7) { animation-delay: 0.26s; }
.client-card:nth-child(8) { animation-delay: 0.30s; }

/* Dialoghi: scale-in fluido */
dialog {
  animation: scaleIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

dialog::backdrop {
  animation: fadeIn 0.2s ease;
}

/* Hero card: ingresso morbido */
.hero-card {
  animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Sidebar nav items */
.nav-item {
  animation: slideInLeft 0.3s ease both;
}
.nav-item:nth-child(1)  { animation-delay: 0.02s; }
.nav-item:nth-child(2)  { animation-delay: 0.05s; }
.nav-item:nth-child(3)  { animation-delay: 0.08s; }
.nav-item:nth-child(4)  { animation-delay: 0.11s; }
.nav-item:nth-child(5)  { animation-delay: 0.14s; }
.nav-item:nth-child(6)  { animation-delay: 0.17s; }
.nav-item:nth-child(7)  { animation-delay: 0.20s; }
.nav-item:nth-child(8)  { animation-delay: 0.23s; }

/* Topbar */
.topbar {
  animation: fadeIn 0.4s ease both;
}

/* Pulsanti: press feedback */
button:not(:disabled):active {
  transform: scale(0.97);
}

/* Outline / primary btn hover lift */
.outline-btn,
.primary-btn,
.ghost-btn {
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.outline-btn:hover,
.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(54, 38, 23, 0.12);
}

/* Skeleton shimmer per loading */
.skeleton {
  background: linear-gradient(90deg, #f3ece0 25%, #faf4e8 50%, #f3ece0 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}

/* Toast / notifiche */
.toast,
.notification {
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Barre nei grafici */
.bar-fill,
.barometer-fill,
.progress-fill {
  transform-origin: bottom;
  animation: barGrow 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Badge / pill pulse */
.badge-new,
.pulse-soft {
  animation: pulseSoft 2s ease-in-out infinite;
}

/* Riduci animazioni per chi preferisce meno movimento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Budget dinamico (Step 3) ===== */
.budget-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 14px;
}

.budget-row {
  display: grid;
  grid-template-columns: 26px 160px 1fr 28px;
  gap: 8px;
  align-items: center;
  padding: 7px 6px;
  border: none;
  border-bottom: 1px solid #efe8da;
  background: transparent;
  animation: slideUp 0.25s ease both;
  transition: background 140ms ease;
}

.budget-row:hover {
  background: #faf6ee;
}

.budget-row:last-child {
  border-bottom: none;
}

.budget-row-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  color: #b8a48a;
}

.budget-row-ico svg { width: 16px; height: 16px; }

.budget-type-select {
  padding: 6px 4px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #2a2118;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: color 140ms ease;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  max-width: 160px;
}

.budget-type-select:hover {
  color: var(--wertia-gold);
}

.budget-type-select:focus {
  outline: none;
  color: var(--wertia-gold);
}

.budget-amount {
  padding: 6px 8px;
  border: none;
  border-radius: 0;
  font-size: 13px;
  font-family: inherit;
  text-align: right;
  width: 100%;
  background: transparent;
  color: #2a2118;
  font-weight: 600;
  transition: color 140ms ease;
}

.budget-amount::placeholder {
  color: #d9cdb3;
  font-weight: 400;
}

.budget-amount:focus {
  outline: none;
  color: var(--wertia-gold);
}

.budget-del-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #c9b89a;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.budget-del-btn:hover {
  background: #fef0f0;
  color: #b85c5c;
  transform: scale(1.08);
}

.budget-del-btn:active {
  transform: scale(0.92);
}

.budget-del-btn svg { width: 15px; height: 15px; }
.budget-add-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding-top: 10px;
  border-top: 1px solid #efe8da;
}

.budget-add-bar select {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #e6dccb;
  border-radius: 8px;
  background: #fffdf8;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.budget-add-bar select:focus {
  outline: none;
  border-color: var(--wertia-gold);
}

@media (max-width: 720px) {
  .budget-row {
    grid-template-columns: 24px 120px 1fr 24px;
    row-gap: 2px;
  }
}

/* ===== Courtage ===== */
.courtage-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cn-btn {
  padding: 8px 16px;
  border: 1px solid #e6dccb;
  border-radius: 8px;
  background: #fffdf8;
  color: #6b5d48;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 140ms, color 140ms, border-color 140ms;
}
.cn-btn:hover { border-color: #c8a45d; color: #c89b3c; }
.cn-btn.active { background: var(--wertia-bg); color: #fff7e6; border-color: var(--wertia-bg); }

.courtage-dashboard { display: flex; flex-direction: column; gap: 16px; }
.courtage-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .courtage-two-col { grid-template-columns: 1fr; } }

.courtage-storno-banner {
  padding: 10px 14px;
  background: #fef0f0;
  border: 1px solid #b85c5c;
  border-radius: 8px;
  color: #b85c5c;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.courtage-add-bar { margin-bottom: 14px; }

.mandate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.mandate-card {
  border: 1px solid #e6dccb;
  border-radius: 12px;
  background: #fffdf8;
  padding: 14px;
  animation: slideUp 0.3s ease both;
}
.mandate-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mandate-card-head strong { font-size: 15px; }
.mandate-card-head span { font-size: 12px; color: #8a7d63; }
.mandate-card-body { display: flex; flex-direction: column; gap: 4px; }
.mandate-card-body > div { display: flex; justify-content: space-between; font-size: 12px; }
.mandate-card-body > div span { color: #8a7d63; }
.mandate-scale { flex-direction: column !important; align-items: flex-start !important; }
.scale-bars { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.scale-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 6px;
  border-radius: 4px;
  background: #f4e8d0;
  font-size: 10px;
}
.scale-bar small { color: #8a7d63; }
.scale-bar span { color: #c89b3c; font-weight: 700; }
.mandate-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #efe8da;
}

.courtage-export-bar {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.scale-edit-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}
.birthday-panel h3 { margin: 2px 0 10px; font-size: 15px; }
.birthday-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}
.birthday-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fffdf8;
  border: 1px solid #efe8da;
  transition: border-color 150ms ease, background 150ms ease;
  animation: slideUp 0.25s ease both;
}
.birthday-row:hover { border-color: #c8a45d; background: #faf6ee; }
.birthday-row.bd-today {
  border-color: #c89b3c;
  background: linear-gradient(90deg, rgba(200,164,93,0.08), transparent);
}
.birthday-row.bd-tomorrow {
  border-color: #e0c27a;
}
.bd-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #f4e8d0;
  color: #8a6d3b;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.birthday-row.bd-today .bd-avatar {
  background: #c89b3c; color: #fff;
}
.bd-info { flex: 1; min-width: 0; }
.bd-info strong { display: block; font-size: 13px; color: #2a2118; }
.bd-info span { font-size: 11px; color: #8a7d63; }
.birthday-row.bd-today .bd-info span { color: #c89b3c; font-weight: 600; }
.bd-actions { display: flex; gap: 4px; flex-shrink: 0; }
.bd-btn {
  width: 30px; height: 30px;
  border: 1px solid #e6dccb;
  border-radius: 7px;
  background: #fffdf8;
  color: #8a7d63;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 140ms, color 140ms, transform 140ms;
}
.bd-btn:hover { background: #f4e8d0; color: #c89b3c; transform: scale(1.08); }
.bd-btn:active { transform: scale(0.92); }
.bd-btn svg { width: 15px; height: 15px; }
.bd-btn.bd-card:hover { background: #c89b3c; color: #fff; border-color: #c89b3c; }

/* ===== Bell dropdown (topbar) ===== */
.bell-dropdown {
  position: fixed;
  z-index: 9999;
  width: 340px;
  max-height: 400px;
  overflow-y: auto;
  background: #fffdf8;
  border: 1px solid #e6dccb;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(22,15,10,0.18);
  display: none;
  padding: 8px;
}
.bell-dropdown.open {
  display: block;
  animation: slideUp 0.2s ease;
}
.bell-empty {
  padding: 20px; text-align: center; color: #8a7d63; font-size: 13px;
}
.bell-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  transition: background 140ms;
}
.bell-item:hover { background: #faf6ee; }
.bell-item.bell-today {
  background: linear-gradient(90deg, rgba(200,164,93,0.1), transparent);
  border-color: #e0c27a;
}
.bell-item.bell-tomorrow {
  border-color: #efe8da;
}
.bell-item-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bell-item-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f4e8d0; color: #8a6d3b;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bell-item.bell-today .bell-item-avatar { background: #c89b3c; color: #fff; }
.bell-item-info strong { display: block; font-size: 13px; color: #2a2118; }
.bell-item-info small { font-size: 11px; color: #c89b3c; font-weight: 600; }
.bell-item-actions { display: flex; gap: 3px; flex-shrink: 0; }
.bell-action {
  width: 28px; height: 28px;
  border: none; border-radius: 6px;
  background: transparent; color: #8a7d63;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 140ms, color 140ms;
}
.bell-action:hover { background: #f4e8d0; color: #c89b3c; }
.bell-action svg { width: 14px; height: 14px; }

/* ===== Step Unfall / Krankheit ===== */
.unfall-chart-wrap {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 8px 0 24px;
  box-sizing: border-box;
}
.unfall-l-chart {
  display: block;
  width: 100%;
  height: auto;
}

.fa-phase3-detail {
  margin-top: 8px;
  padding: 16px 18px;
  background: #faf6ee;
  border: 1px solid #e6dccb;
  border-radius: 10px;
}
.fa-phase3-title {
  font-size: 14px;
  color: #8a6d3b;
  margin-bottom: 10px;
}
.fa-phase3-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fa-phase3-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #4a4034;
  padding: 4px 0;
}
.fa-phase3-row strong {
  margin-left: auto;
  color: #2a2118;
}
.fa-phase3-row .dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.dot-ahv { background: #3b6b8a; }
.dot-uvg { background: #8a6d3b; }
.fa-phase3-row.total {
  border-top: 1px solid #e6dccb;
  padding-top: 8px;
  margin-top: 2px;
  color: #8a6d3b;
}
.fa-phase3-row.total strong { color: #8a6d3b; }
.fa-phase3-row.luecke { color: #a82727; }
.fa-phase3-row.luecke strong { color: #a82727; }

.fa-section-block {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid #efe8da;
}
.fa-section-block:last-child { border-bottom: none; }
.fa-section-block h4 {
  font-size: 15px;
  margin: 0 0 12px;
  color: var(--wertia-bg);
}

/* Phase bar charts (Invalidität Unfall 3 Phasen) */
.phase-charts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.phase-bar-wrap {
  display: grid;
  grid-template-columns: 180px 1fr 160px;
  gap: 12px;
  align-items: center;
}
.phase-bar-label {
  font-size: 12px;
  font-weight: 600;
  color: #2a2118;
}
.phase-bar-track {
  position: relative;
  height: 24px;
  background: #f3ece0;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
}
.phase-bar-fill {
  height: 100%;
  border-radius: 6px 0 0 6px;
  transform-origin: left;
  transition: width 0.4s ease;
}
.phase-bar-gap {
  height: 100%;
  background: repeating-linear-gradient(45deg, rgba(184,92,92,0.18) 0 6px, rgba(184,92,92,0.08) 6px 12px);
  border-radius: 0 6px 6px 0;
}
.phase-bar-vals {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
}
.phase-amt { font-weight: 700; }
.phase-gap { color: #b85c5c; font-weight: 600; }
.phase-ok { color: #5a8a4f; }

.phase-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.phase-detail-card {
  padding: 14px;
  border: 1px solid #e6dccb;
  border-radius: 10px;
  background: #fffdf8;
  animation: slideUp 0.3s ease both;
}
.phase-detail-card h5 {
  font-size: 12px;
  margin: 0 0 6px;
  color: var(--wertia-gold);
  font-weight: 800;
}
.phase-source { font-size: 11px; color: #8a7d63; margin: 0 0 4px; }
.phase-pct, .phase-days { font-size: 11px; color: #6b5d48; margin: 0 0 6px; }
.phase-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
}
.phase-row span { color: #8a7d63; }
.phase-row strong { color: #2a2118; }
.phase-row.gap strong { color: #b85c5c; }
.phase-row.ok strong { color: #5a8a4f; }

/* Tod Unfall row */
.fa-death-row, .fa-two-chart-row {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.fa-death-chart, .fa-chart-card {
  flex-shrink: 0;
}
.fa-death-detail, .fa-chart-detail {
  flex: 1;
  min-width: 200px;
}
.fa-death-detail p, .fa-chart-detail p {
  margin: 4px 0;
  font-size: 13px;
}

@media (max-width: 600px) {
  .phase-bar-wrap {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ===== User Detail (Consulente Anagrafica) ===== */
.detail-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid #efe8da;
  padding-bottom: 0;
  overflow-x: auto;
}
.detail-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #8a7d63;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: color 140ms, border-color 140ms;
  white-space: nowrap;
  margin-bottom: -2px;
}
.detail-tab svg { width: 16px; height: 16px; }
.detail-tab:hover { color: #c89b3c; }
.detail-tab.active {
  color: var(--wertia-bg);
  border-bottom-color: var(--wertia-gold);
  font-weight: 600;
}

.user-detail-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .user-detail-grid { grid-template-columns: 1fr; }
}

.form-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #efe8da;
  font-size: 13px;
}
.form-field-row:last-child { border-bottom: none; }
.form-field-row .field-label { color: #8a7d63; }
.form-field-row strong { color: #2a2118; }

.user-row { cursor: pointer; transition: background 140ms; }
.user-row:hover { background: #faf6ee; }

/* ===== KALENDER ===== */

.cal-page { display: flex; flex-direction: column; gap: 14px; }

.cal-breadcrumb {
  font-size: 13px;
  color: var(--wertia-gold);
  font-weight: 600;
}

.cal-h1 {
  font-family: "Manrope", "Helvetica Neue", sans-serif;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 0;
  color: #2f2623;
  line-height: 1.05;
}
.cal-h1 .cal-year {
  font-weight: 600;
  color: #6b5d4f;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b5d4f;
  font-weight: 600;
}
.cal-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}
.cal-legend-dot.rounded { border-radius: 50%; }
.cal-legend-dot.small { width: 7px; height: 7px; }

.cal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cal-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: var(--wertia-gold);
  color: #1d130b;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(200,164,93,0.3);
  transition: background 140ms;
}
.cal-btn-primary:hover { background: var(--wertia-gold-soft); }
.cal-btn-primary svg { width: 16px; height: 16px; }

.cal-nav-group { display: flex; gap: 4px; }
.cal-btn-outline {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #d4c9b3;
  border-radius: 0;
  background: transparent;
  color: #2f2623;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 140ms;
}
.cal-btn-outline:hover { background: #f0e8d6; }

.cal-view-tabs {
  display: inline-flex;
  border: 1px solid #d4c9b3;
  border-radius: 8px;
  overflow: hidden;
  margin-left: auto;
}
.cal-view-tab {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #6b5d4f;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 140ms, color 140ms;
}
.cal-view-tab:hover { background: #f0e8d6; }
.cal-view-tab.active {
  background: var(--wertia-gold);
  color: #1d130b;
}

.cal-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.cal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: flex-start;
}

.cal-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 10px;
}

.cal-filter-card,
.cal-upcoming-card {
  border: 1px solid var(--wertia-border);
  border-radius: 12px;
  background: #fffdf8;
  padding: 16px;
}
.cal-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-filter-head strong { font-size: 15px; color: #2f2623; }
.cal-filter-clear {
  border: none;
  background: none;
  color: var(--wertia-gold);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  min-height: auto;
}
.cal-filter-group { margin-top: 14px; }
.cal-filter-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wertia-gold);
  margin-bottom: 8px;
}
.cal-filter-list { display: flex; flex-direction: column; gap: 4px; }
.cal-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 13px;
  color: #2f2623;
}
.cal-check-row input { width: 16px; height: 16px; accent-color: var(--wertia-gold); }
.cal-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e6dccb;
  border-radius: 8px;
  background: #faf6ee;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #2f2623;
}
.cal-toggle-row input { width: 18px; height: 18px; accent-color: var(--wertia-gold); }
.cal-berater-badge {
  width: 24px; height: 24px; min-width: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wertia-gold-soft), #8a6d3b);
  color: #1d130b;
  font-size: 10px;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.cal-upcoming-card strong { font-size: 15px; color: #2f2623; display: block; margin-bottom: 10px; }
.cal-upcoming-list { display: flex; flex-direction: column; gap: 6px; }
.cal-upcoming-item {
  display: flex;
  gap: 8px;
  text-align: left;
  border: 1px solid #e6dccb;
  border-radius: 8px;
  background: #faf6ee;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 140ms;
  min-height: auto;
}
.cal-upcoming-item:hover { background: #f0e8d6; }
.cal-upcoming-bar { width: 3px; border-radius: 99px; flex-shrink: 0; }
.cal-upcoming-item > div { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-upcoming-item strong { font-size: 12px; color: #2f2623; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-upcoming-item span { font-size: 11px; color: #8a7d63; display: flex; align-items: center; gap: 4px; }

.cal-main { min-width: 0; }

/* MONTH GRID */
.cal-month-grid {
  border: 1px solid #e6dccb;
  border-radius: 12px;
  background: #fffdf8;
  overflow: hidden;
}
.cal-weekday-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid #e6dccb;
  background: #faf6ee;
}
.cal-weekday-cell {
  padding: 8px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wertia-gold);
}
.cal-weekday-cell.is-weekend { color: #b85c5c; }
.cal-cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell {
  min-height: 112px;
  padding: 6px;
  border-right: 1px solid #f0e8d6;
  border-bottom: 1px solid #f0e8d6;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: background 140ms;
  overflow: hidden;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: #faf6ee; }
.cal-cell.is-weekend { background: #f5f0e6; }
.cal-cell.is-weekend:hover { background: #efe8d8; }
.cal-cell.out-of-month { opacity: 0.4; }
.cal-cell.out-of-month.is-weekend { background: #f0ebe0; }
.cal-cell.is-today { background: rgba(37, 99, 235, 0.04); }
.cal-cell.is-today.is-weekend { background: rgba(37, 99, 235, 0.06); }
.cal-cell-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cal-cell-day span { font-size: 13px; font-weight: 700; color: #6b5d4f; }
.cal-cell-day .day-today {
  color: #fff;
  background: var(--wertia-gold);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 12px;
}
.cal-day-count {
  font-size: 10px;
  color: var(--wertia-gold);
  background: rgba(200,164,93,0.14);
  border-radius: 99px;
  padding: 1px 5px;
  font-weight: 700;
}
.cal-cell-events { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }

.cal-event-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 3px;
  border-left: 3px solid var(--wertia-gold);
  font-size: 11px;
  color: #2f2623;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 100ms;
}
.cal-event-chip:hover { filter: brightness(0.95); }
.cal-prio-dot { width: 6px; height: 6px; min-width: 6px; border-radius: 50%; }
.cal-event-time { font-weight: 700; color: #6b5d4f; font-size: 10px; font-variant-numeric: tabular-nums; }
.cal-event-title { overflow: hidden; text-overflow: ellipsis; }
.cal-share-icon svg { width: 10px; height: 10px; color: #8a7d63; }
.cal-more { font-size: 10px; color: #8a7d63; padding: 1px 6px; }

/* WEEK GRID */
.cal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid #e6dccb;
  border-radius: 12px;
  background: #fffdf8;
  overflow: hidden;
}
.cal-week-day {
  min-height: 280px;
  border-right: 1px solid #f0e8d6;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background 140ms;
}
.cal-week-day:last-child { border-right: none; }
.cal-week-day:hover { background: #faf6ee; }
.cal-week-day.is-today { background: rgba(37,99,235,0.03); }
.cal-week-day.is-weekend { background: #f5f0e6; }
.cal-week-day.is-weekend:hover { background: #efe8d8; }
.cal-week-day.is-weekend.is-today { background: rgba(37,99,235,0.06); }
.cal-week-day-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0e8d6;
  margin-bottom: 4px;
}
.cal-week-day-name { font-size: 11px; text-transform: uppercase; color: var(--wertia-gold); font-weight: 700; }
.cal-week-day-num { font-size: 18px; font-weight: 800; color: #2f2623; }
.cal-week-day-num.today {
  color: #fff; background: var(--wertia-gold);
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
}
.cal-week-day-events { display: flex; flex-direction: column; gap: 4px; }
.cal-week-empty { text-align: center; color: #d4c9b3; font-size: 12px; padding: 8px 0; }
.week-chip { flex-direction: column; align-items: flex-start; gap: 2px; padding: 4px 8px; }

/* DAY GRID */
.cal-day-grid {
  border: 1px solid #e6dccb;
  border-radius: 12px;
  background: #fffdf8;
  overflow: hidden;
}
.cal-day-hour {
  display: grid;
  grid-template-columns: 70px 1fr;
  border-bottom: 1px solid #f0e8d6;
  min-height: 52px;
}
.cal-day-hour:last-child { border-bottom: none; }
.cal-day-hour-label {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #8a7d63;
  border-right: 1px solid #f0e8d6;
  font-variant-numeric: tabular-nums;
}
.cal-day-hour-events { padding: 4px 12px; display: flex; flex-direction: column; gap: 4px; }
.cal-day-hour-empty { min-height: 40px; }
.cal-day-event {
  border-left: 3px solid var(--wertia-gold);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 140ms;
}
.cal-day-event:hover { background: rgba(200,164,93,0.08) !important; }
.cal-day-event-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cal-day-event-head strong { font-size: 14px; color: #2f2623; }
.cal-day-event-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #8a7d63; }
.cal-day-event-meta span { display: flex; align-items: center; gap: 4px; }
.cal-day-event-meta svg { width: 12px; height: 12px; }
.cal-day-event p { margin: 4px 0 0; font-size: 13px; color: #8a7d63; line-height: 1.4; }

/* MODAL → ora wizard, vedi sezione WIZARD sotto */

/* RESPONSIVE */
@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-sidebar { position: static; }
  .cal-stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .cal-h1 { font-size: 32px; }
  .cal-modal-grid { grid-template-columns: 1fr; }
  .cal-cells { grid-template-columns: repeat(7, minmax(0, 1fr)); overflow-x: auto; }
  .cal-week-grid { grid-template-columns: 1fr; }
  .cal-week-day { min-height: auto; border-right: none; border-bottom: 1px solid #f0e8d6; }
}

/* ===== KALENDER WIZARD ===== */

.cal-wizard-steps {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  position: relative;
}
.cal-wizard-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  position: relative;
  z-index: 2;
}
.cal-wizard-step-num {
  width: 28px; height: 28px; min-width: 28px;
  border-radius: 50%;
  border: 2px solid #d4c9b3;
  background: #fffdf8;
  color: #8a7d63;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  transition: all 160ms;
}
.cal-wizard-step.active .cal-wizard-step-num {
  border-color: var(--wertia-gold);
  background: var(--wertia-gold);
  color: #1d130b;
}
.cal-wizard-step.done .cal-wizard-step-num {
  border-color: var(--wertia-success);
  background: var(--wertia-success);
  color: #fff;
}
.cal-wizard-step-text { display: flex; flex-direction: column; gap: 1px; }
.cal-wizard-step-text strong { font-size: 13px; color: #2f2623; }
.cal-wizard-step-text span { font-size: 11px; color: #8a7d63; }
.cal-wizard-step:not(.active) .cal-wizard-step-text { opacity: 0.5; }
.cal-wizard-step-line {
  position: absolute;
  bottom: 14px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: #e6dccb;
  z-index: 1;
}

.cal-wizard-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
  min-height: 180px;
}
.cal-wizard-body > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #2f2623;
}
.cal-wizard-full { grid-column: 1 / -1; }
.cal-wizard-body input,
.cal-wizard-body select,
.cal-wizard-body textarea {
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d4c9b3;
  border-radius: 8px;
  background: #fffdf8;
  color: #2f2623;
  font-size: 14px;
  outline: none;
  transition: border-color 140ms;
}
.cal-wizard-body textarea { height: auto; padding: 10px 12px; resize: vertical; font-family: inherit; }
.cal-wizard-body input:focus,
.cal-wizard-body select:focus,
.cal-wizard-body textarea:focus { border-color: var(--wertia-gold); }

.cal-type-selector,
.cal-priority-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cal-type-btn,
.cal-prio-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #d4c9b3;
  border-radius: 8px;
  background: #fffdf8;
  color: #8a7d63;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms;
  min-height: auto;
}
.cal-type-btn:hover,
.cal-prio-btn:hover { border-color: var(--wertia-gold); color: #2f2623; }
.cal-type-btn.active,
.cal-prio-btn.active { color: #2f2623; font-weight: 700; }

.cal-wizard-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #e6dccb;
  padding-top: 16px;
}
.cal-wizard-nav .cal-delete-btn { margin-right: auto; }

.cal-wizard-summary {
  border: 1px solid #e6dccb;
  border-radius: 10px;
  padding: 14px 16px;
  background: #faf6ee;
}
.cal-wizard-summary h3 { margin: 0 0 12px; font-size: 15px; color: #2f2623; }
.cal-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f0e8d6;
  font-size: 13px;
}
.cal-summary-row:last-child { border-bottom: none; }
.cal-summary-row span { color: #8a7d63; }
.cal-summary-row strong { color: #2f2623; display: flex; align-items: center; gap: 6px; }

@media (max-width: 760px) {
  .cal-wizard-body { grid-template-columns: 1fr; }
  .cal-wizard-step-text { display: none; }
  .cal-wizard-step { justify-content: center; }
}

/* KALENDER SHARED COMPONENTS (color picker, share, delete) */

.cal-color-picker { display: flex; gap: 8px; }
.cal-color-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 100ms;
  min-height: auto;
  padding: 0;
}
.cal-color-btn:hover { transform: scale(1.1); }
.cal-color-btn.selected { box-shadow: 0 0 0 3px #fffdf8, 0 0 0 5px #2f2623; }

.cal-share-label { display: block; font-size: 13px; font-weight: 700; color: #2f2623; margin-bottom: 8px; }
.cal-share-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d4c9b3;
  border-radius: 8px;
  background: #fffdf8;
  color: #8a7d63;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms, border-color 140ms;
  min-height: auto;
}
.cal-share-btn:hover { border-color: var(--wertia-gold); }
.cal-share-btn.active {
  border-color: var(--wertia-gold);
  background: rgba(200,164,93,0.14);
  color: #2f2623;
}

.cal-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(184,92,92,0.4);
  background: rgba(184,92,92,0.1);
  color: var(--wertia-danger);
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  min-height: auto;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}
.cal-delete-btn:hover { background: rgba(184,92,92,0.2); }
.cal-delete-btn svg { width: 14px; height: 14px; }

.cal-berater-badge {
  width: 24px; height: 24px; min-width: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wertia-gold-soft), #8a6d3b);
  color: #1d130b;
  font-size: 10px;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.cal-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e6dccb;
  border-radius: 8px;
  background: #faf6ee;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #2f2623;
}
.cal-toggle-row input { width: 18px; height: 18px; accent-color: var(--wertia-gold); }

/* ===== CHAT PAGE ===== */

.chat-page { padding: 0; }
.chat-page .chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  height: calc(100vh - 120px);
  border: 1px solid var(--wertia-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fffdf8;
}
.chat-sidebar-col {
  border-right: 1px solid #e6dccb;
  display: flex;
  flex-direction: column;
  background: #faf6ee;
}
.chat-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px;
  border-bottom: 1px solid #e6dccb;
}
.chat-sidebar-head h2 { margin: 2px 0 0; font-size: 22px; color: #2f2623; }
.chat-online-badge {
  font-size: 11px; font-weight: 700; color: var(--wertia-success);
  background: rgba(112,163,107,0.14); padding: 3px 10px; border-radius: 99px;
  border: 1px solid rgba(112,163,107,0.3);
}
.chat-search-row { padding: 10px 14px; }
.chat-search-row input {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid #d4c9b3; border-radius: 8px;
  background: #fffdf8; color: #2f2623; font-size: 13px; outline: none;
}
.chat-search-row input:focus { border-color: var(--wertia-gold); }
.chat-conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.chat-conv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: none; border-bottom: 1px solid #f0e8d6;
  background: transparent; cursor: pointer; text-align: left;
  transition: background 120ms; min-height: auto; width: 100%;
}
.chat-conv-item:hover { background: #f0e8d6; }
.chat-conv-item.active { background: rgba(200,164,93,0.14); border-left: 3px solid var(--wertia-gold); }
.chat-conv-avatar {
  width: 40px; height: 40px; min-width: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--wertia-gold-soft), #8a6d3b);
  color: #1d130b; font-weight: 800; font-size: 14px;
  display: grid; place-items: center; position: relative;
}
.chat-conv-online {
  position: absolute; bottom: 0; right: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--wertia-success); border: 2px solid #faf6ee;
}
.chat-conv-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-conv-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chat-conv-top strong { font-size: 14px; color: #2f2623; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-conv-top small { font-size: 11px; color: #8a7d63; flex-shrink: 0; }
.chat-conv-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chat-conv-preview { font-size: 12px; color: #8a7d63; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.chat-conv-unread {
  min-width: 18px; height: 18px; border-radius: 99px;
  background: var(--wertia-gold); color: #1d130b; font-size: 10px; font-weight: 800;
  display: grid; place-items: center; padding: 0 5px; flex-shrink: 0;
}
.chat-main-col { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.chat-main-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-bottom: 1px solid #e6dccb; background: #fffdf8;
}
.chat-main-head-info { display: flex; align-items: center; gap: 12px; }
.chat-main-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--wertia-gold), #8a6d3b);
  color: #1d130b; font-weight: 800; display: grid; place-items: center;
}
.chat-main-head-info strong { font-size: 16px; color: #2f2623; display: block; }
.chat-main-status { font-size: 12px; color: #8a7d63; }
.chat-main-status.online { color: var(--wertia-success); }
.chat-main-status.online::before { content: "\25CF "; }
.chat-main-actions { display: flex; gap: 6px; }
.chat-main-btn {
  width: 36px; height: 36px; border: 1px solid #d4c9b3; border-radius: 8px;
  background: #fffdf8; color: #8a7d63; cursor: pointer;
  display: grid; place-items: center; min-height: auto;
}
.chat-main-btn:hover { background: #f0e8d6; color: var(--wertia-danger); }
.chat-main-btn svg { width: 16px; height: 16px; }
.chat-main-body {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px; background: #f7f3ec;
}
.chat-empty-full { text-align: center; color: #8a7d63; padding: 40px 0; font-size: 14px; }
.chat-main-input {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-top: 1px solid #e6dccb; background: #fffdf8;
}
.chat-main-input input[type="text"] {
  flex: 1; height: 40px; padding: 0 14px;
  border: 1px solid #d4c9b3; border-radius: 99px;
  background: #faf6ee; color: #2f2623; font-size: 14px; outline: none;
}
.chat-main-input input[type="text"]:focus { border-color: var(--wertia-gold); }
.chat-main-attach {
  width: 40px; height: 40px; border: 1px solid #d4c9b3; border-radius: 50%;
  background: #fffdf8; color: var(--wertia-gold); cursor: pointer;
  display: grid; place-items: center; min-height: auto;
}
.chat-main-attach svg { width: 18px; height: 18px; }
.chat-main-send {
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: var(--wertia-gold); color: #1d130b; cursor: pointer;
  display: grid; place-items: center; min-height: auto;
}
.chat-main-send svg { width: 18px; height: 18px; }
.chat-main-attach-preview {
  padding: 8px 14px; border-top: 1px solid #f0e8d6;
  background: #fffdf8; display: flex; flex-wrap: wrap; gap: 6px;
}
.chat-main-body .chat-msg { font-size: 14px; }
.chat-main-body .chat-msg-bubble { max-width: 420px; }
.chat-main-body .chat-msg-bubble p { margin: 0 0 4px; }
.chat-main-body .chat-msg-bubble small { font-size: 11px; color: #8a7d63; }
@media (max-width: 900px) {
  .chat-page .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 120px); }
  .chat-sidebar-col { max-height: 220px; border-right: none; border-bottom: 1px solid #e6dccb; }
}

/* ===== MAIL CENTER ===== */

.mail-center { padding: 0; }
.mail-layout {
  display: grid;
  grid-template-columns: var(--mail-sidebar-w, 260px) 5px var(--mail-list-w, 380px) 5px 1fr;
  height: calc(100vh - 120px);
  border: 1px solid var(--wertia-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fffdf8;
}

/* SIDEBAR */
.mail-sidebar {
  border-right: 1px solid #e6dccb;
  display: flex;
  flex-direction: column;
  background: #faf6ee;
  overflow-y: auto;
}
.mail-sidebar-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #e6dccb;
}
.mail-sidebar-logo {
  height: 36px;
  width: auto;
  display: block;
}
.mail-new-btn {
  margin: 12px 14px;
  height: 38px;
  border: none;
  border-radius: 8px;
  background: var(--wertia-gold);
  color: #1d130b;
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  min-height: auto;
  transition: background 140ms;
}
.mail-new-btn:hover { background: var(--wertia-gold-soft); }
.mail-new-btn svg { width: 16px; height: 16px; }

.mail-sidebar-section { padding: 4px 10px 12px; }
.mail-sidebar-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wertia-gold);
  padding: 8px 8px 4px;
  margin: 0;
}
.mail-folder {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #2f2623;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 120ms;
  min-height: auto;
}
.mail-folder:hover { background: rgba(200,164,93,0.12); }
.mail-folder.active { background: rgba(200,164,93,0.2); color: var(--wertia-gold); font-weight: 800; }
.mail-folder-icon { width: 18px; height: 18px; display: grid; place-items: center; flex-shrink: 0; }
.mail-folder-icon svg { width: 16px; height: 16px; }
.mail-folder-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-folder-badge {
  min-width: 18px; height: 18px; border-radius: 99px;
  background: var(--wertia-gold); color: #1d130b;
  font-size: 10px; font-weight: 800;
  display: grid; place-items: center; padding: 0 5px;
}
.mail-folder-count { font-size: 11px; color: #8a7d63; font-weight: 600; }

.mail-sidebar-account {
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid #e6dccb;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mail-account-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.mail-account-icon { width: 32px; height: 32px; border-radius: 8px; background: rgba(200,164,93,0.14); color: var(--wertia-gold); display: grid; place-items: center; flex-shrink: 0; }
.mail-account-icon svg { width: 16px; height: 16px; }
.mail-account-info > div { min-width: 0; }
.mail-account-email { display: block; font-size: 12px; color: #2f2623; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-account-status { font-size: 11px; }
.mail-account-status.ok { color: var(--wertia-success); }
.mail-account-status.err { color: var(--wertia-danger); }
.mail-sync-btn {
  width: 32px; height: 32px;
  border: 1px solid #d4c9b3;
  border-radius: 8px;
  background: #fffdf8;
  color: var(--wertia-gold);
  cursor: pointer;
  display: grid;
  place-items: center;
  min-height: auto;
}
.mail-sync-btn svg { width: 16px; height: 16px; }
.mail-sync-btn:hover { background: rgba(200,164,93,0.12); }

/* LIST */
.mail-list-col {
  border-right: 1px solid #e6dccb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mail-list-toolbar {
  padding: 10px 14px;
  border-bottom: 1px solid #e6dccb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mail-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d4c9b3;
  border-radius: 8px;
  background: #fffdf8;
}
.mail-search-wrap svg { width: 16px; height: 16px; color: #8a7d63; flex-shrink: 0; }
.mail-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: #2f2623;
  font-size: 13px;
}
.mail-filter-pills { display: flex; gap: 6px; }
.mail-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #d4c9b3;
  border-radius: 99px;
  background: #fffdf8;
  color: #8a7d63;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: auto;
  transition: all 120ms;
}
.mail-pill svg { width: 13px; height: 13px; }
.mail-pill.active { border-color: var(--wertia-gold); background: rgba(200,164,93,0.16); color: var(--wertia-gold); font-weight: 800; }
.mail-pill:hover { border-color: var(--wertia-gold); }

.mail-list {
  flex: 1;
  overflow-y: auto;
}
.mail-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0e8d6;
  cursor: pointer;
  transition: background 100ms;
}
.mail-row:hover { background: #faf6ee; }
.mail-row.selected { background: rgba(200,164,93,0.14); border-left: 3px solid var(--wertia-gold); }
.mail-row.unread .mail-row-from { font-weight: 800; }
.mail-row.unread .mail-row-subject { font-weight: 700; }
.mail-row-star {
  width: 18px; height: 18px; flex-shrink: 0;
  display: grid; place-items: center;
  color: #d4c9b3; cursor: pointer;
}
.mail-row-star svg { width: 16px; height: 16px; }
.mail-row-star:hover { color: var(--wertia-gold); }
.mail-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mail-row-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mail-row-from { font-size: 13px; color: #2f2623; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-row-date { font-size: 11px; color: #8a7d63; flex-shrink: 0; }
.mail-row-subject { font-size: 13px; color: #2f2623; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-row-snippet { font-size: 12px; color: #8a7d63; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-row-tags { display: flex; gap: 4px; margin-top: 2px; flex-wrap: wrap; }
.mail-tag {
  font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 99px;
  background: rgba(200,164,93,0.12); color: var(--wertia-gold);
  display: inline-flex; align-items: center; gap: 3px;
}
.mail-tag svg { width: 10px; height: 10px; }
.mail-tag.crm { background: rgba(112,163,107,0.14); color: var(--wertia-success); }
.mail-tag.unknown { background: rgba(184,89,89,0.1); color: var(--wertia-danger); }
.mail-tag.attach { background: rgba(37,99,235,0.1); color: #2563EB; }
.mail-empty { text-align: center; padding: 40px; color: #8a7d63; font-size: 14px; }

/* READER */
.mail-reader-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mail-reader {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}
.mail-reader-empty {
  flex: 1;
  display: grid;
  place-items: center;
  color: #8a7d63;
}
.mail-reader-empty-icon svg { width: 48px; height: 48px; opacity: 0.3; }
.mail-reader-empty p { margin-top: 12px; font-size: 14px; }

.mail-reader-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e6dccb;
}
.mail-reader-subject { margin: 0; font-size: 22px; font-weight: 800; color: #2f2623; line-height: 1.3; }
.mail-reader-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.mail-action-btn {
  width: 34px; height: 34px;
  border: 1px solid #d4c9b3;
  border-radius: 7px;
  background: #fffdf8;
  color: #8a7d63;
  cursor: pointer;
  display: grid;
  place-items: center;
  min-height: auto;
  transition: all 120ms;
}
.mail-action-btn svg { width: 16px; height: 16px; }
.mail-action-btn:hover { border-color: var(--wertia-gold); color: var(--wertia-gold); }
.mail-action-btn.active { color: var(--wertia-gold); border-color: var(--wertia-gold); }
.mail-action-sep { width: 1px; height: 24px; background: #e6dccb; margin: 0 2px; }

.mail-reader-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #f0e8d6;
}
.mail-reader-from-info { display: flex; align-items: center; gap: 10px; }
.mail-reader-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--wertia-gold-soft), #8a6d3b);
  color: #1d130b; font-weight: 800; font-size: 14px;
  display: grid; place-items: center;
}
.mail-reader-from-info strong { font-size: 14px; color: #2f2623; display: block; }
.mail-reader-email { font-size: 12px; color: #8a7d63; }
.mail-reader-meta-right { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.mail-reader-date { font-size: 12px; color: #2f2623; font-weight: 600; }
.mail-reader-to { font-size: 11px; color: #8a7d63; }

.mail-recognized { padding: 8px 20px; }
.mail-recognized-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(112,163,107,0.14);
  border: 1px solid rgba(112,163,107,0.3);
  color: var(--wertia-success);
  font-size: 12px;
  font-weight: 700;
}
.mail-recognized-badge svg { width: 13px; height: 13px; }
.mail-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--wertia-gold);
  background: rgba(200,164,93,0.1);
  color: var(--wertia-gold);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-height: auto;
}
.mail-link-btn svg { width: 13px; height: 13px; }

.mail-reader-body {
  padding: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #2f2623;
  flex: 1;
}

.mail-reader-attachments {
  padding: 0 20px 16px;
}
.mail-attachments-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--wertia-gold);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.mail-attachments-label svg { width: 14px; height: 14px; }
.mail-attach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.mail-attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e6dccb;
  border-radius: 8px;
  background: #fffdf8;
}
.mail-attach-icon { color: var(--wertia-gold); flex-shrink: 0; }
.mail-attach-icon svg { width: 20px; height: 20px; }
.mail-attach-info { flex: 1; min-width: 0; }
.mail-attach-info strong { display: block; font-size: 12px; color: #2f2623; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-attach-info small { font-size: 11px; color: #8a7d63; }
.mail-attach-actions { display: flex; gap: 4px; }
.mail-attach-btn {
  width: 28px; height: 28px;
  border: 1px solid #d4c9b3;
  border-radius: 6px;
  background: #fffdf8;
  color: #8a7d63;
  cursor: pointer;
  display: grid;
  place-items: center;
  min-height: auto;
}
.mail-attach-btn:hover { border-color: var(--wertia-gold); color: var(--wertia-gold); }
.mail-attach-btn svg { width: 14px; height: 14px; }

.mail-audit-trail {
  margin: 0 20px 16px;
  padding: 10px 14px;
  border: 1px solid #f0e8d6;
  border-radius: 8px;
  background: #faf6ee;
}
.mail-audit-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wertia-muted);
  margin: 0 0 6px;
}
.mail-audit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
  font-size: 11px;
  color: #8a7d63;
}
.mail-audit-row span { font-weight: 600; color: #2f2623; }
.mail-audit-row small { margin-left: auto; }

/* COMPOSE MODAL */
.mail-compose-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}
.mail-comp-field { display: flex; flex-direction: column; gap: 4px; }
.mail-comp-field.full { grid-column: 1 / -1; }
.mail-comp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; grid-column: 1 / -1; }
.mail-comp-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wertia-gold);
}
.mail-comp-field input,
.mail-comp-field select,
.mail-comp-field textarea {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d4c9b3;
  border-radius: 8px;
  background: #fffdf8;
  color: #2f2623;
  font-size: 14px;
  outline: none;
}
.mail-comp-field textarea { height: auto; max-height: 160px; padding: 10px 12px; resize: none; font-family: inherit; }
.mail-comp-field input:focus,
.mail-comp-field select:focus,
.mail-comp-field textarea:focus { border-color: var(--wertia-gold); }

.mail-comp-att-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.mail-comp-att-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid #d4c9b3;
  border-radius: 99px;
  background: #fffdf8;
  font-size: 12px;
  color: #2f2623;
}
.mail-comp-att-chip svg { width: 13px; height: 13px; color: var(--wertia-gold); }
.mail-comp-att-chip button {
  border: none;
  background: none;
  color: var(--wertia-danger);
  font-size: 14px;
  cursor: pointer;
  min-height: auto;
  padding: 0;
}
.mail-comp-att-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border: 1px dashed #d4c9b3;
  border-radius: 8px;
  background: transparent;
  color: #8a7d63;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: auto;
}
.mail-comp-att-add:hover { border-color: var(--wertia-gold); color: var(--wertia-gold); }
.mail-comp-att-add svg { width: 14px; height: 14px; }

@media (max-width: 1100px) {
  .mail-layout { grid-template-columns: 200px 320px 1fr; }
}
@media (max-width: 900px) {
  .mail-layout { grid-template-columns: 1fr; height: auto; }
  .mail-sidebar { max-height: 200px; }
  .mail-list-col { max-height: 300px; }
  .mail-compose-grid { grid-template-columns: 1fr; }
}

/* ===== MAIL CENTER FIXES ===== */

/* 1. Popup compose senza scrollbar interna */
#mailComposeDialog .modal {
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
}
#mailComposeDialog .mail-compose-grid {
  margin: 8px 0;
  overflow-y: auto;
  flex: 1;
}
#mailComposeDialog .mail-comp-field textarea {
  rows: 8;
  max-height: 200px;
}

/* 2. Icone azione con etichette */
.mail-action-btn {
  position: relative;
  width: auto;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
}
.mail-action-btn .mail-action-label {
  display: inline;
}
.mail-action-btn.with-label {
  width: auto;
}
.mail-reader-actions {
  flex-wrap: wrap;
  gap: 3px;
}

/* 3. Resizer colonne */
.mail-col-resizer {
  width: 5px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}
.mail-col-resizer:hover,
.mail-col-resizer.dragging {
  background: var(--wertia-gold);
}
.mail-col-resizer::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -2px; right: -2px;
}
.mail-action-btn.danger:hover { color: var(--wertia-danger); border-color: var(--wertia-danger); }
.mail-action-btn { width: 34px; height: 34px; }

/* Stella attiva = riempita */
.mail-action-btn.active svg { fill: var(--wertia-gold); stroke: var(--wertia-gold); }
.mail-row-star svg[fill="currentColor"], .mail-row-star[style*="gold"] svg { fill: var(--wertia-gold); }

/* Neue E-Mail solo icona */
.mail-new-btn {
  width: 38px; height: 38px;
  margin: 10px 14px 6px;
  padding: 0;
  display: grid;
  place-items: center;
  gap: 0;
}
.mail-new-btn svg { width: 18px; height: 18px; }

/* Stella nella lista - attiva */
.mail-row-star[data-starred="true"] svg { fill: var(--wertia-gold); stroke: var(--wertia-gold); }

/* ===== MAIL 2FA DIALOG ===== */

.mail-2fa-container {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 120px);
  padding: 20px;
}
.mail-2fa-card {
  width: 100%;
  max-width: 460px;
  border: 1px solid var(--wertia-border);
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf8, #faf6ee);
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(12,8,5,0.15);
}
.mail-2fa-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(200,164,93,0.14);
  border: 2px solid var(--wertia-gold);
  color: var(--wertia-gold);
  display: grid;
  place-items: center;
}
.mail-2fa-icon svg { width: 28px; height: 28px; }
.mail-2fa-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
  color: #2f2623;
}
.mail-2fa-subtitle {
  margin: 0 0 20px;
  font-size: 14px;
  color: #8a7d63;
  line-height: 1.5;
}
.mail-2fa-account {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 12px 16px;
  border: 1px solid #e6dccb;
  border-radius: 10px;
  background: #fffdf8;
  margin-bottom: 20px;
}
.mail-2fa-account-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(200,164,93,0.14);
  color: var(--wertia-gold);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.mail-2fa-account-icon svg { width: 18px; height: 18px; }
.mail-2fa-account strong { display: block; font-size: 14px; color: #2f2623; }
.mail-2fa-account span { font-size: 12px; color: #8a7d63; }

.mail-2fa-code-display {
  padding: 16px;
  border: 1px solid #e6dccb;
  border-radius: 10px;
  background: #f7f3ec;
  margin-bottom: 20px;
}
.mail-2fa-code-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--wertia-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
}
.mail-2fa-code-numbers {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}
.mail-2fa-code-numbers span {
  width: 38px; height: 48px;
  border: 1px solid #d4c9b3;
  border-radius: 8px;
  background: #fffdf8;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--wertia-gold);
  font-variant-numeric: tabular-nums;
}
.mail-2fa-code-display small {
  font-size: 11px;
  color: #8a7d63;
}

.mail-2fa-input-section { margin-bottom: 20px; }
.mail-2fa-input-section label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #2f2623;
  margin-bottom: 8px;
}
.mail-2fa-input-section input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #d4c9b3;
  border-radius: 10px;
  background: #fffdf8;
  color: #2f2623;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 8px;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.mail-2fa-input-section input:focus { border-color: var(--wertia-gold); }
.mail-2fa-error {
  color: var(--wertia-danger);
  font-size: 13px;
  font-weight: 600;
  margin: 8px 0 0;
  min-height: 18px;
}

.mail-2fa-actions { display: flex; gap: 10px; margin-bottom: 20px; }
.mail-2fa-cancel {
  flex: 1;
  height: 44px;
  border: 1px solid #d4c9b3;
  border-radius: 10px;
  background: #fffdf8;
  color: #8a7d63;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  min-height: auto;
}
.mail-2fa-cancel:hover { background: #f0e8d6; }
.mail-2fa-verify-btn {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--wertia-gold);
  color: #1d130b;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  min-height: auto;
}
.mail-2fa-verify-btn:hover { background: var(--wertia-gold-soft); }

.mail-2fa-info {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #e6dccb;
  border-radius: 8px;
  background: rgba(200,164,93,0.06);
}
.mail-2fa-info svg { width: 16px; height: 16px; color: var(--wertia-gold); flex-shrink: 0; margin-top: 2px; }
.mail-2fa-info p { margin: 0; font-size: 12px; color: #8a7d63; line-height: 1.5; text-align: left; }

/* ===== LOGIN PAGE ===== */

.login-intro-video {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  object-fit: cover;
  z-index: 9999;
  background: #160f0a;
}
.login-intro-video.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  width: 100vw;
  background:
    radial-gradient(circle at 30% 20%, rgba(200,164,93,0.08), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(200,164,93,0.05), transparent 50%),
    linear-gradient(135deg, #1a1208 0%, #160f0a 30%, #0d0805 70%, #050302 100%);
  padding: 20px;
  overflow: hidden;
}
.login-card {
  width: 100%;
  max-width: 420px;
  border: 1px solid rgba(200, 164, 93, 0.28);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(42,28,19,0.92), rgba(26,18,8,0.88));
  backdrop-filter: blur(10px);
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(200,164,93,0.08);
}
.login-logo {
  margin: 0 auto 20px;
  width: 120px;
}
.login-logo img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4)) drop-shadow(0 0 10px rgba(200,164,93,0.2));
}
.login-card h1 {
  margin: 0 0 6px;
  font-size: 26px;
  color: var(--wertia-gold-soft);
  font-weight: 800;
  letter-spacing: -0.5px;
}
.login-subtitle {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--wertia-muted);
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.login-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--wertia-gold-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.login-field input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(200, 164, 93, 0.3);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.06);
  color: var(--wertia-cream);
  font-size: 15px;
  outline: none;
}
.login-field input::placeholder { color: rgba(244, 232, 208, 0.3); }
.login-field input:focus { border-color: var(--wertia-gold); box-shadow: 0 0 0 3px rgba(200,164,93,0.14); background: rgba(255, 253, 248, 0.1); }
.login-error {
  color: var(--wertia-danger);
  font-size: 13px;
  font-weight: 600;
  min-height: 18px;
  margin: 0;
}
.login-submit {
  height: 46px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--wertia-gold-soft), var(--wertia-gold));
  color: #1d130b;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  min-height: auto;
  transition: background 140ms;
}
.login-submit:hover { background: var(--wertia-gold-soft); box-shadow: 0 4px 20px rgba(200,164,93,0.3); }
.login-hint {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 12px;
  border: 1px solid #e6dccb;
  border-radius: 8px;
  background: rgba(200,164,93,0.06);
  text-align: left;
}
.login-hint svg { width: 16px; height: 16px; color: var(--wertia-gold); flex-shrink: 0; margin-top: 2px; }
.login-hint p { margin: 0; font-size: 12px; color: #8a7d63; line-height: 1.6; }
.login-footer {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(200, 164, 93, 0.2);
  text-align: left;
}
.login-footer svg { width: 14px; height: 14px; color: var(--wertia-success); flex-shrink: 0; margin-top: 2px; }
.login-footer p { margin: 0; font-size: 11px; color: var(--wertia-muted); line-height: 1.5; }

/* ===== MAIL SETTINGS ===== */

.mail-settings-page { display: flex; flex-direction: column; gap: 16px; }
.mail-set-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }

.mail-set-accounts { display: flex; flex-direction: column; gap: 12px; }
.mail-set-account-card {
  border: 1px solid var(--wertia-border);
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdf8, #faf6ee);
  overflow: hidden;
}
.mail-set-account-card.default { border-color: var(--wertia-gold); box-shadow: 0 0 0 1px rgba(200,164,93,0.2); }
.mail-set-acc-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #f0e8d6;
}
.mail-set-acc-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(200,164,93,0.14);
  color: var(--wertia-gold);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.mail-set-acc-icon.ok { background: rgba(112,163,107,0.14); color: var(--wertia-success); }
.mail-set-acc-icon.err { background: rgba(184,92,92,0.14); color: var(--wertia-danger); }
.mail-set-acc-icon svg { width: 20px; height: 20px; }
.mail-set-acc-info { flex: 1; min-width: 0; }
.mail-set-acc-info strong { font-size: 15px; color: #2f2623; display: block; }
.mail-set-acc-provider { font-size: 12px; color: #8a7d63; }
.mail-set-acc-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.mail-set-status {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(200,164,93,0.12); color: #8a7d63;
}
.mail-set-status.ok { background: rgba(112,163,107,0.14); color: var(--wertia-success); }
.mail-set-status.err { background: rgba(184,92,92,0.14); color: var(--wertia-danger); }
.mail-set-status.syncing { background: rgba(200,164,93,0.14); color: var(--wertia-gold); }
.mail-set-status.syncing svg { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.mail-set-status svg { width: 12px; height: 12px; }
.mail-set-btn {
  height: 30px; padding: 0 10px;
  border: 1px solid #d4c9b3; border-radius: 6px;
  background: #fffdf8; color: #8a7d63;
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  min-height: auto;
}
.mail-set-btn svg { width: 14px; height: 14px; }
.mail-set-btn:hover { border-color: var(--wertia-gold); color: var(--wertia-gold); }
.mail-set-btn.danger:hover { border-color: var(--wertia-danger); color: var(--wertia-danger); }

.mail-set-acc-details { padding: 10px 18px; }
.mail-set-detail-row {
  display: flex; justify-content: space-between;
  padding: 5px 0; border-bottom: 1px solid #f7f0e4;
  font-size: 13px;
}
.mail-set-detail-row:last-child { border-bottom: none; }
.mail-set-detail-row span { color: #8a7d63; }
.mail-set-detail-row strong { color: #2f2623; }

.mail-set-acc-footer { padding: 10px 18px; border-top: 1px solid #f0e8d6; }
.mail-set-sync-btn {
  height: 32px; padding: 0 14px;
  border: 1px solid #d4c9b3; border-radius: 8px;
  background: #fffdf8; color: var(--wertia-gold);
  font-size: 12px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  min-height: auto;
}
.mail-set-sync-btn svg { width: 14px; height: 14px; }
.mail-set-sync-btn:hover { background: rgba(200,164,93,0.1); }

.mail-set-security-note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px 18px;
  border: 1px solid var(--wertia-border); border-radius: 10px;
  background: rgba(112,163,107,0.06);
}
.mail-set-security-note > span { width: 32px; height: 32px; border-radius: 8px; background: rgba(112,163,107,0.14); color: var(--wertia-success); display: grid; place-items: center; flex-shrink: 0; }
.mail-set-security-note > span svg { width: 16px; height: 16px; }
.mail-set-security-note strong { font-size: 13px; color: #2f2623; display: block; margin-bottom: 4px; }
.mail-set-security-note p { margin: 0; font-size: 12px; color: #8a7d63; line-height: 1.5; }

/* MODAL FORM */
.mail-set-modal-form { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.mail-set-modal-form > label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: #2f2623; }
.ms-full { grid-column: 1 / -1; }
.mail-set-modal-form input,
.mail-set-modal-form select {
  height: 40px; padding: 0 12px;
  border: 1px solid #d4c9b3; border-radius: 8px;
  background: #fffdf8; color: #2f2623; font-size: 14px; outline: none;
}
.mail-set-modal-form input:focus,
.mail-set-modal-form select:focus { border-color: var(--wertia-gold); }

.ms-provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ms-provider-btn {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px;
  border: 1px solid #d4c9b3; border-radius: 10px;
  background: #fffdf8; color: #8a7d63;
  cursor: pointer; text-align: left;
  min-height: auto; transition: all 120ms;
}
.ms-provider-btn strong { font-size: 13px; }
.ms-provider-btn small { font-size: 11px; color: #8a7d63; }
.ms-provider-btn:hover { border-color: var(--wertia-gold); color: #2f2623; }
.ms-provider-btn.active { border-color: var(--wertia-gold); background: rgba(200,164,93,0.14); }

.mail-set-modal-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  border-top: 1px solid #f0e8d6; padding-top: 12px;
}
.mail-set-modal-grid > label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: #2f2623; }
.mail-set-modal-grid input,
.mail-set-modal-grid select {
  height: 38px; padding: 0 10px;
  border: 1px solid #d4c9b3; border-radius: 6px;
  background: #fffdf8; color: #2f2623; font-size: 13px; outline: none;
}
.mail-set-modal-grid input:focus,
.mail-set-modal-grid select:focus { border-color: var(--wertia-gold); }

.ms-toggle-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid #e6dccb; border-radius: 8px;
  background: #faf6ee; cursor: pointer;
  font-size: 13px; font-weight: 600; color: #2f2623;
}
.ms-toggle-row input { width: 18px; height: 18px; accent-color: var(--wertia-gold); }

.mail-set-modal-info {
  padding: 14px; border: 1px solid #e6dccb; border-radius: 10px;
  background: #faf6ee; display: flex; flex-direction: column; gap: 12px;
  border-top: 1px solid #f0e8d6; padding-top: 12px;
}
.mail-set-modal-info p { margin: 0; font-size: 13px; color: #8a7d63; display: flex; align-items: center; gap: 6px; }
.mail-set-modal-info p svg { width: 16px; height: 16px; color: var(--wertia-gold); }
.mail-set-oauth-btn {
  height: 40px; padding: 0 18px;
  border: 1px solid var(--wertia-gold); border-radius: 10px;
  background: rgba(200,164,93,0.12); color: var(--wertia-gold);
  font-weight: 700; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: auto;
}
.mail-set-oauth-btn:hover { background: rgba(200,164,93,0.2); }
.mail-set-oauth-btn svg { width: 16px; height: 16px; }

@media (max-width: 760px) {
  .mail-set-stats { grid-template-columns: repeat(2,1fr); }
  .mail-set-modal-grid { grid-template-columns: 1fr; }
  .ms-provider-grid { grid-template-columns: 1fr; }
}

/* ===== PROFILO & IMPOSTAZIONI ===== */

.profile-page { display: flex; flex-direction: column; gap: 16px; }
.profile-header-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border: 1px solid var(--wertia-border); border-radius: 14px;
  background: linear-gradient(135deg, #1a1310, #2a1c13);
}
.profile-header-left { display: flex; align-items: center; gap: 16px; }
.profile-header-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--wertia-gold-soft), var(--wertia-gold));
  color: #1d130b; font-size: 24px; font-weight: 900;
  display: grid; place-items: center;
}
.profile-header-left h1 { margin: 4px 0 2px; font-size: 24px; color: var(--wertia-cream); }
.profile-header-left p { margin: 0; color: var(--wertia-muted); font-size: 14px; }
.profile-header-left .module-kicker { color: var(--wertia-gold); }
.profile-header-right { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.profile-role-badge {
  padding: 4px 14px; border-radius: 99px; font-size: 12px; font-weight: 800;
  background: rgba(200,164,93,0.2); color: var(--wertia-gold-soft); border: 1px solid var(--wertia-gold);
}
.profile-active-badge { padding: 4px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; background: rgba(112,163,107,0.2); color: var(--wertia-success); }
.profile-inactive-badge { padding: 4px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; background: rgba(184,92,92,0.2); color: var(--wertia-danger); }

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-detail-list { display: flex; flex-direction: column; gap: 0; margin-top: 12px; }
.profile-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid #f0e8d6; font-size: 13px;
}
.profile-detail-row:last-child { border-bottom: none; }
.profile-detail-row span { color: #8a7d63; }
.profile-detail-row strong { color: #2f2623; }
.text-success { color: var(--wertia-success); }
.text-danger { color: var(--wertia-danger); }

.settings-page { display: flex; flex-direction: column; gap: 16px; }
.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: flex-start; }
.settings-sidebar { display: flex; flex-direction: column; gap: 4px; }
.settings-nav-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: none; border-radius: 8px;
  background: transparent; color: #8a7d63;
  font-size: 14px; font-weight: 600; cursor: pointer;
  text-align: left; min-height: auto; transition: all 120ms;
}
.settings-nav-btn:hover { background: #faf6ee; color: #2f2623; }
.settings-nav-btn.active { background: rgba(200,164,93,0.14); color: var(--wertia-gold); font-weight: 800; }
.settings-nav-icon { width: 18px; height: 18px; display: grid; place-items: center; }
.settings-nav-icon svg { width: 16px; height: 16px; }

.settings-content {
  border: 1px solid var(--wertia-border); border-radius: 12px;
  background: #fffdf8; padding: 20px 24px; min-height: 400px;
}
.settings-section h3 { margin: 0 0 16px; font-size: 18px; color: #2f2623; }
.settings-desc { font-size: 13px; color: #8a7d63; margin: 0 0 16px; }
.settings-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid #f0e8d6; gap: 16px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row > div { display: flex; flex-direction: column; gap: 2px; }
.settings-row strong { font-size: 14px; color: #2f2623; }
.settings-row span { font-size: 12px; color: #8a7d63; }
.settings-row select { height: 36px; padding: 0 12px; border: 1px solid #d4c9b3; border-radius: 8px; background: #fffdf8; color: #2f2623; font-size: 13px; outline: none; min-width: 180px; }
.settings-row select:focus { border-color: var(--wertia-gold); }

.settings-toggle { position: relative; width: 44px; height: 24px; cursor: pointer; }
.settings-toggle input { opacity: 0; width: 0; height: 0; }
.settings-toggle span {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: #d4c9b3; border-radius: 99px; transition: 200ms;
}
.settings-toggle span::before {
  content: ""; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 200ms;
}
.settings-toggle input:checked + span { background: var(--wertia-gold); }
.settings-toggle input:checked + span::before { transform: translateX(20px); }

.settings-role-card {
  border: 1px solid #e6dccb; border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
}
.settings-role-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.settings-role-icon { color: var(--wertia-gold); display: grid; place-items: center; }
.settings-role-icon svg { width: 18px; height: 18px; }
.settings-role-perms { display: flex; flex-wrap: wrap; gap: 6px; }
.settings-perm {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 99px;
  background: rgba(200,164,93,0.1); color: var(--wertia-gold);
}

@media (max-width: 760px) {
  .profile-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-sidebar { flex-direction: row; flex-wrap: wrap; }
}

/* Sound selector nel menu profilo */
.profile-menu-sound {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  min-height: 40px;
}
.profile-menu-sound svg { width: 18px; height: 18px; color: #8a7d63; flex-shrink: 0; }
.profile-menu-sound select {
  flex: 1;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #d4c9b3;
  border-radius: 6px;
  background: #fffdf8;
  color: #2a2118;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  outline: none;
}
.profile-menu-sound select:focus { border-color: var(--wertia-gold); }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 500;
    transform: translateX(-100%);
    transition: transform 250ms ease;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .workspace {
    grid-column: 1;
    padding: 12px;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 12px;
  }

  .topbar-title h2 {
    font-size: 18px;
  }

  .topbar-clock {
    display: none;
  }

  .metrics-grid {
    flex-wrap: wrap;
  }

  .metric-inline {
    flex: 1 1 calc(50% - 10px);
    min-width: 140px;
  }

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

  .dash-cal-panel {
    max-height: 300px;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .client-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid,
  .customer-form-grid {
    grid-template-columns: 1fr;
  }

  .identity-card {
    max-width: 100%;
  }

  .customer-tabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .customer-tab strong {
    font-size: 10px;
  }

  .appt-table {
    font-size: 12px;
  }

  .appt-table th,
  .appt-table td {
    padding: 6px 6px;
  }

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

  .mail-layout {
    grid-template-columns: 1fr !important;
  }

  .mail-sidebar,
  .mail-list-col {
    display: none;
  }

  .mail-reader-col {
    grid-column: 1;
  }

  .chat-panel {
    width: calc(100vw - 32px);
    right: 0;
  }

  .login-card {
    max-width: calc(100vw - 32px);
    padding: 24px 20px;
  }

  .login-page {
    padding: 12px;
  }

  .kunden-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-card {
    padding: 10px;
  }

  .main-panel {
    padding: 8px;
    min-height: auto;
  }

  .mobile-menu-toggle {
    display: flex !important;
  }
}

.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 600;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(200, 164, 93, 0.3);
  background: #1a1208;
  color: var(--wertia-gold);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 768px) {
  .workspace { padding-top: 56px; }
}
