:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #18202a;
  --muted: #667085;
  --line: #d9e0e8;
  --brand: #176b87;
  --brand-2: #2f8f6f;
}

body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { background: #10232d; color: white; padding: 24px 18px; }
.brand { font-size: 1.35rem; font-weight: 800; margin-bottom: 28px; }
.sidebar .nav { align-items: stretch; }
.sidebar .nav-link { width: 100%; color: #d8e6ea; border-radius: 8px; padding: 10px 12px; text-align: left; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: white; }
.sidebar .nav-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 1fr auto;
  justify-content: start;
  align-items: center;
  text-align: left;
}
.sidebar .nav-toggle span:first-child { justify-self: start; }
.sidebar .nav-toggle-icon {
  flex: 0 0 auto;
  font-size: 1.15rem;
  line-height: 1;
  opacity: .78;
  transition: transform .18s ease;
}
.sidebar .nav-toggle[aria-expanded="true"] .nav-toggle-icon { transform: rotate(90deg); }
.sidebar .nav-submenu {
  position: relative;
  margin: 2px 0 6px 10px;
  padding: 4px 0 4px 14px;
  border-left: 1px solid rgba(255,255,255,.22);
}
.sidebar .nav-submenu .nav-link {
  position: relative;
  padding: 8px 10px;
  font-size: .94rem;
}
.sidebar .nav-submenu .nav-link::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 10px;
  border-top: 1px solid rgba(255,255,255,.22);
}
.main { padding: 26px; }
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: 1.8rem; font-weight: 800; letter-spacing: 0; }
.topbar-actions, .button-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.language-form { margin: 0; }
.language-menu-toggle {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  min-height: 40px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}
.language-menu-toggle:hover, .language-menu-toggle[aria-expanded="true"] {
  border-color: rgba(23,107,135,.34);
  box-shadow: 0 0 0 3px rgba(23,107,135,.08);
}
.language-flag { font-size: 1.15rem; line-height: 1; }
.language-code { font-size: .82rem; font-weight: 800; }
.language-dropdown {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(16,35,45,.14);
  min-width: 170px;
  padding: 8px;
}
.language-dropdown .dropdown-item {
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}
.language-dropdown .dropdown-item.active {
  background: #eef7f8;
  color: var(--brand);
  font-weight: 800;
}
.eyebrow { color: var(--muted); font-size: .82rem; text-transform: uppercase; font-weight: 700; }
.user-pill { background: white; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; color: var(--ink); text-decoration: none; }
.user-pill:hover { border-color: var(--brand); color: var(--brand); }
.profile-menu { position: relative; }
.profile-menu-toggle {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 7px 10px 7px 7px;
  display: grid;
  grid-template-columns: 46px minmax(140px, auto) 18px;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  min-height: 60px;
}
.profile-menu-toggle:hover, .profile-menu-toggle[aria-expanded="true"] {
  border-color: rgba(23,107,135,.34);
  box-shadow: 0 0 0 3px rgba(23,107,135,.08);
}
.topbar-avatar {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
  align-self: center;
  justify-self: center;
}
.topbar-avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef7f8;
  color: var(--brand);
  font-weight: 800;
}
.profile-menu-text { display: grid; text-align: left; line-height: 1.1; }
.profile-menu-name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .98rem; font-weight: 800; }
.profile-menu-role { color: var(--muted); font-size: .78rem; margin-top: 3px; }
.profile-menu-chevron { color: var(--muted); font-size: .78rem; }
.profile-dropdown {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(16,35,45,.14);
  min-width: 240px;
  padding: 8px;
}
.profile-dropdown .dropdown-header {
  display: grid;
  gap: 3px;
  padding: 8px 10px 10px;
  color: var(--ink);
}
.profile-dropdown .dropdown-header span {
  color: var(--muted);
  font-size: .8rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-dropdown .dropdown-item {
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-avatar-preview { width: 96px; height: 96px; border-radius: 999px; object-fit: cover; border: 1px solid var(--line); }
.profile-avatar-placeholder { width: 96px; height: 96px; border-radius: 999px; background: #eef3f5; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 2rem; font-weight: 800; border: 1px solid var(--line); }
.panel, .metric { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(16,35,45,.06); }
.panel { padding: 20px; margin-bottom: 18px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.metric { padding: 18px; display: flex; justify-content: space-between; align-items: center; }
.metric span, .meta-row, .panel p { color: var(--muted); }
.metric strong { font-size: 2rem; }
.section-heading, .detail-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 14px; }
.section-heading h2, .detail-header h2, .properties-panel h2 { font-size: 1.15rem; margin: 0; font-weight: 800; }
.meta-row { display: flex; gap: 22px; flex-wrap: wrap; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.mini-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; justify-content: space-between; background: #fbfcfd; }
.workflow-link { display: inline-block; margin-right: 10px; }
.action-cell { width: 92px; white-space: nowrap; text-align: right; }
.action-buttons { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.action-buttons .btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 8px;
  border-color: #d7e0e8;
  background: #ffffff;
  color: #52616f;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.action-buttons .btn i { font-size: .96rem; line-height: 1; }
.action-buttons .btn:hover { transform: translateY(-1px); }
.action-buttons .btn-outline-secondary:hover {
  background: #eef7f8;
  border-color: rgba(23,107,135,.32);
  color: var(--brand);
}
.action-buttons .btn-outline-danger {
  color: #b42318;
}
.action-buttons .btn-outline-danger:hover {
  background: #fff1f0;
  border-color: #f1a7a2;
  color: #8f1d14;
}
.form-panel { max-width: 860px; }
.team-type-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.team-type-button { margin-bottom: 1rem; white-space: nowrap; }
.quick-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #f7faf9, #e7eef0); }
.login-panel { width: min(420px, calc(100% - 32px)); background: white; border: 1px solid var(--line); border-radius: 8px; padding: 30px; box-shadow: 0 20px 60px rgba(16,35,45,.12); }

.panel form label, .smart-field label { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.panel form .form-control, .panel form .form-select, .smart-field .form-control, .smart-field .form-select {
  border-color: #cfd8e3;
  border-radius: 8px;
  min-height: 42px;
}
.panel form .form-control:focus, .panel form .form-select:focus, .smart-field .form-control:focus, .smart-field .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23,107,135,.14);
}
div.radio-choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
div.radio-choice-group > div,
div.radio-choice-group label {
  display: flex;
  align-items: center;
}
div.radio-choice-group label {
  gap: 8px;
  margin: 0;
  cursor: pointer;
  font-weight: 700;
}
input[type="radio"].radio-choice-group {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.panel fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  background: #fbfcfd;
}
.panel legend {
  float: none;
  width: auto;
  padding: 0 8px;
  margin-bottom: 10px;
  font-size: .86rem;
  font-weight: 800;
  color: var(--brand);
}

.workflow-wizard-shell { display: grid; gap: 18px; }
.wizard-hero {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 18px;
  align-items: stretch;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(16,35,45,.06);
}
.wizard-kicker {
  display: inline-block;
  color: var(--brand);
  text-transform: uppercase;
  font-weight: 800;
  font-size: .78rem;
  margin-bottom: 8px;
}
.wizard-hero h2 { margin: 0 0 8px; font-size: 1.45rem; font-weight: 800; }
.wizard-hero p { margin: 0; color: var(--muted); max-width: 760px; }
.wizard-summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #f8fbfc;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.wizard-summary-card span { color: var(--muted); font-weight: 700; font-size: .8rem; }
.wizard-summary-card strong { color: var(--ink); font-size: 1.15rem; }
.workflow-wizard {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.wizard-steps, .wizard-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16,35,45,.06);
}
.wizard-steps { padding: 12px; display: grid; gap: 8px; }
.wizard-step {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  text-align: left;
  color: var(--muted);
}
.wizard-step:hover { background: #f8fbfc; border-color: var(--line); }
.wizard-step.is-active { background: #eef7f8; border-color: rgba(23,107,135,.28); color: var(--ink); }
.wizard-step-index {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8edf2;
  color: var(--muted);
  font-weight: 800;
  font-size: .8rem;
}
.wizard-step.is-active .wizard-step-index { background: var(--brand); color: #fff; }
.wizard-step strong { display: block; font-size: .94rem; }
.wizard-step small { display: block; margin-top: 2px; font-size: .78rem; }
.wizard-card { padding: 22px; }
.wizard-pane { display: none; }
.wizard-pane.is-active { display: block; }
.wizard-pane-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.wizard-pane-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #10232d;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.wizard-pane-heading h3 { margin: 0 0 4px; font-size: 1.18rem; font-weight: 800; }
.wizard-pane-heading p { margin: 0; color: var(--muted); }
.smart-field { margin-bottom: 16px; }
.smart-field.is-muted { opacity: .55; }
.wizard-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wizard-choice {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfd;
  cursor: pointer;
  min-height: 128px;
}
.wizard-choice input { position: absolute; opacity: 0; pointer-events: none; }
.wizard-choice .choice-mark {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid #a9b6c3;
  display: inline-block;
  margin-bottom: 16px;
}
.wizard-choice:has(input:checked) {
  border-color: var(--brand);
  background: #eef7f8;
  box-shadow: 0 0 0 3px rgba(23,107,135,.1);
}
.wizard-choice:has(input:checked) .choice-mark { border: 7px solid var(--brand); }
.wizard-choice strong { display: block; font-size: 1rem; margin-bottom: 4px; }
.wizard-choice small { color: var(--muted); }
.wizard-switch {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
  background: #fbfcfd;
}
.wizard-switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cfd8e3;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,.24);
  transition: transform .16s ease;
}
.wizard-switch input:checked + .switch-track { background: var(--brand-2); }
.wizard-switch input:checked + .switch-track::after { transform: translateX(20px); }
.wizard-switch strong, .wizard-switch small { display: block; }
.wizard-switch small { color: var(--muted); margin-top: 2px; }
.wizard-next-preview {
  margin-top: 18px;
  padding: 16px;
  border: 1px dashed #b8c5d1;
  border-radius: 8px;
  background: #f8fbfc;
}
.wizard-next-preview h4 { font-size: .95rem; font-weight: 800; margin-bottom: 10px; }
.wizard-next-preview ul { margin: 0; padding-left: 18px; color: var(--muted); }
.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .metric-grid, .builder-layout { grid-template-columns: 1fr; }
  .team-type-row, .quick-options { grid-template-columns: 1fr; }
  .team-type-button { margin-bottom: 0; }
  .topbar, .section-heading, .detail-header { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .profile-menu-toggle { grid-template-columns: 42px 1fr 16px; min-height: 56px; }
  .topbar-avatar { width: 42px; height: 42px; }
  .profile-menu-name { max-width: 140px; }
  .workflow-wizard, .wizard-hero, .wizard-choice-grid { grid-template-columns: 1fr; }
}

/* Dashboard operativa */
.dashboard-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  margin-bottom: 18px;
  border-radius: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 0, rgba(94, 234, 212, .22), transparent 38%),
    linear-gradient(135deg, #10232d 0%, #176b87 72%, #217a8e 100%);
  box-shadow: 0 18px 48px rgba(16, 35, 45, .18);
}
.dashboard-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -95px;
  bottom: -150px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
}
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero h2 { margin: 4px 0 7px; font-size: clamp(1.45rem, 2.4vw, 2rem); font-weight: 850; }
.dashboard-hero p { max-width: 760px; margin: 0; color: rgba(255,255,255,.76); }
.dashboard-kicker { color: #5eead4; text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 850; }
.dashboard-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; flex: 0 0 auto; }
.dashboard-hero-actions .btn { border-radius: 9px; font-weight: 750; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.dashboard-metric {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 13px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16,35,45,.05);
}
.dashboard-metric.metric-primary { border-color: rgba(23,107,135,.27); background: linear-gradient(145deg, #fff, #eef8f8); }
.metric-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: #eef7f8;
  color: var(--brand);
  font-size: 1.2rem;
}
.dashboard-metric small, .dashboard-metric strong, .dashboard-metric span { display: block; }
.dashboard-metric small { color: var(--muted); font-weight: 700; }
.dashboard-metric strong { margin: 2px 0; overflow: hidden; text-overflow: ellipsis; font-size: 1.55rem; line-height: 1.15; }
.dashboard-metric div > span { color: #84909c; font-size: .76rem; }
.dashboard-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.dashboard-mini-stats span { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: .8rem; }
.dashboard-mini-stats b { color: var(--ink); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 16px; margin-bottom: 16px; }
.dashboard-grid-wide { grid-template-columns: minmax(0, 1.4fr) minmax(300px, .7fr) minmax(340px, .9fr); }
.dashboard-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16,35,45,.05);
  margin-bottom: 16px;
}
.dashboard-grid > .dashboard-card { margin-bottom: 0; }
.dashboard-card-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.dashboard-card-heading span { display: block; margin-bottom: 2px; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; font-size: .7rem; font-weight: 850; }
.dashboard-card-heading h3 { margin: 0; font-size: 1.04rem; font-weight: 850; }
.dashboard-card-heading small { color: var(--muted); font-size: .76rem; }
.dashboard-card-heading a, .link-button { border: 0; padding: 0; background: transparent; color: var(--brand); text-decoration: none; font-size: .78rem; font-weight: 750; white-space: nowrap; }
.chart-frame { position: relative; height: 265px; }
.chart-frame-donut { height: 265px; }
.dashboard-list { display: grid; }
.dashboard-list-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #edf0f3;
  color: inherit;
  text-decoration: none;
}
.dashboard-list-item:last-child { border-bottom: 0; }
.dashboard-list-item:hover .list-main strong { color: var(--brand); }
.list-avatar {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #eef7f8;
  color: var(--brand);
  font-size: .86rem;
  font-weight: 850;
}
.task-avatar { background: #f3f0ff; color: #6941c6; }
.earning-avatar { background: #ecfdf3; color: #067647; }
.list-main { min-width: 0; }
.list-main strong, .list-main small, .list-main em { display: block; overflow: hidden; text-overflow: ellipsis; }
.list-main strong { white-space: nowrap; font-size: .88rem; transition: color .15s ease; }
.list-main small { color: var(--muted); white-space: nowrap; font-size: .75rem; }
.list-main em { margin-top: 3px; color: #98a2b3; font-size: .69rem; font-style: normal; }
.list-time { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.list-time.is-overdue { color: #b42318; font-weight: 750; }
.earning-amount { color: #067647; font-size: .82rem; font-weight: 850; white-space: nowrap; }
.dashboard-empty { min-height: 145px; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.dashboard-empty i { color: #98a2b3; font-size: 1.6rem; }
.dashboard-table { margin-bottom: 0; }
.dashboard-table th { border-bottom-color: var(--line); color: var(--muted); text-transform: uppercase; font-size: .68rem; letter-spacing: .04em; }
.conversion-pill { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #ecfdf3; color: #067647; font-size: .75rem; font-weight: 800; }
.unread-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #d92d20; color: #fff; font-size: .68rem; vertical-align: middle; }
.notification-item { border-bottom: 1px solid #edf0f3; }
.notification-item:last-child { border-bottom: 0; }
.notification-item button {
  width: 100%;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.notification-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 999px; background: #d0d5dd; }
.notification-item.is-unread .notification-dot { background: var(--brand); box-shadow: 0 0 0 4px rgba(23,107,135,.1); }
.notification-item.is-unread strong { color: var(--brand); }
.dashboard-modal { border: 0; border-radius: 14px; box-shadow: 0 30px 80px rgba(16,35,45,.25); }
.notification-menu-toggle {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}
.notification-menu-toggle > span {
  position: absolute;
  right: -3px;
  top: -4px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  font-size: .62rem;
  font-weight: 850;
}
.notification-dropdown { width: min(360px, calc(100vw - 24px)); padding: 8px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(16,35,45,.16); }
.notification-dropdown-heading { display: flex; justify-content: space-between; gap: 12px; padding: 8px 8px 10px; }
.notification-dropdown-heading a { color: var(--brand); font-size: .72rem; font-weight: 750; }
.notification-dropdown form { margin: 0; }
.notification-dropdown-item { width: 100%; display: grid; gap: 2px; padding: 10px; border: 0; border-radius: 8px; background: #f8fbfc; text-align: left; }
.notification-dropdown-item:hover { background: #eef7f8; }
.notification-dropdown-item strong { font-size: .8rem; }
.notification-dropdown-item small { color: var(--muted); font-size: .72rem; }
.notification-dropdown-empty { padding: 24px 10px; color: var(--muted); text-align: center; font-size: .8rem; }

/* Wizard e organigramma commerciale */
.team-wizard-shell { display: grid; gap: 18px; }
.team-wizard-hero { margin-bottom: 0; }
.team-wizard-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.team-wizard-layout .wizard-steps { position: sticky; top: 18px; }
.role-editor, .network-editor { display: grid; gap: 10px; }
.role-editor-row {
  display: grid;
  grid-template-columns: 24px minmax(220px, 1fr) minmax(150px, .35fr) 40px;
  gap: 12px;
  align-items: end;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}
.role-editor-row label, .network-editor-row label { display: block; margin-bottom: 5px; color: var(--muted); font-size: .72rem; font-weight: 750; }
.role-drag { align-self: center; color: #98a2b3; }
.role-remove, .member-remove { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 9px; }
.network-editor-row {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(180px, 1fr) minmax(160px, .8fr) minmax(170px, .8fr) 40px;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}
.network-node-icon { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: #10232d; color: #fff; }
.empty-network { display: flex; min-height: 160px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; padding: 22px; border: 1px dashed #b8c5d1; border-radius: 10px; color: var(--muted); text-align: center; background: #fbfcfd; }
.empty-network i { margin-bottom: 4px; color: var(--brand); font-size: 1.6rem; }
.empty-network strong { color: var(--ink); }
.network-summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.network-summary-strip span { display: grid; gap: 2px; padding: 12px 14px; background: #f8fbfc; }
.network-summary-strip small { color: var(--muted); font-size: .7rem; }
.commercial-tree { display: grid; gap: 10px; padding: 6px 0; }
.commercial-tree-branch { position: relative; }
.commercial-tree-node {
  position: relative;
  z-index: 1;
  width: min(500px, 100%);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 32px;
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(16,35,45,.05);
}
.tree-avatar { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: #10232d; color: #fff; font-weight: 850; }
.tree-person { min-width: 0; }
.tree-person strong, .tree-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-person small { color: var(--muted); font-size: .74rem; }
.tree-percentage { padding: 5px 9px; border-radius: 999px; background: #ecfdf3; color: #067647; font-size: .76rem; font-weight: 850; }
.tree-edit { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--muted); }
.tree-edit:hover { background: #eef7f8; color: var(--brand); }
.commercial-tree-children {
  position: relative;
  display: grid;
  gap: 10px;
  margin: 10px 0 0 34px;
  padding-left: 34px;
  border-left: 2px solid #d7e5e9;
}
.commercial-tree-children > .commercial-tree-branch::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 32px;
  width: 34px;
  border-top: 2px solid #d7e5e9;
}
.commission-role-card { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 24px; gap: 10px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.commission-role-order { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: #eef7f8; color: var(--brand); font-size: .75rem; font-weight: 850; }
.commission-role-card strong, .commission-role-card small { display: block; }
.commission-role-card small { color: var(--muted); font-size: .7rem; }
.commission-role-card b { color: #067647; }
.commission-role-card a { color: var(--muted); }

@media (max-width: 1250px) {
  .dashboard-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid-wide .priority-card { grid-column: 1 / -1; }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .dashboard-hero { align-items: flex-start; flex-direction: column; padding: 22px; }
  .dashboard-grid, .dashboard-grid-wide, .team-wizard-layout { grid-template-columns: 1fr; }
  .dashboard-grid-wide .priority-card { grid-column: auto; }
  .team-wizard-layout .wizard-steps { position: static; grid-template-columns: repeat(3, 1fr); }
  .role-editor-row { grid-template-columns: 20px minmax(0, 1fr) 130px 40px; }
  .network-editor-row { grid-template-columns: 42px minmax(0, 1fr) 40px; }
  .network-editor-row > div { grid-column: 2 / 3; }
  .network-editor-row .member-remove { grid-column: 3; grid-row: 1; }
}
@media (max-width: 620px) {
  .main { padding: 16px; }
  .dashboard-metrics { grid-template-columns: 1fr; }
  .dashboard-hero-actions, .dashboard-hero-actions .btn { width: 100%; }
  .dashboard-hero-actions .btn { justify-content: center; }
  .dashboard-card { padding: 16px; }
  .team-wizard-layout .wizard-steps { grid-template-columns: 1fr; }
  .role-editor-row { grid-template-columns: 20px minmax(0, 1fr) 40px; }
  .role-editor-row > div:nth-child(3) { grid-column: 2; }
  .network-summary-strip { grid-template-columns: 1fr; }
  .commercial-tree-children { margin-left: 16px; padding-left: 18px; }
  .commercial-tree-children > .commercial-tree-branch::before { left: -18px; width: 18px; }
}
