/*
Theme Name: Galileo Dashboard
Theme URI: https://example.local/galileo-dashboard
Author: Ufficio Tecnico
Author URI: https://example.local
Description: Tema applicativo WordPress per la dashboard dell'Ufficio Tecnico scolastico.
Version: 0.1.11
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: galileo-dashboard
*/

:root {
  --fd-bg: #f4f7f4;
  --fd-surface: #ffffff;
  --fd-surface-soft: #f4f2ff;
  --fd-text: #111428;
  --fd-muted: #68708c;
  --fd-border: #e4e8f2;
  --fd-primary: #5b4cf0;
  --fd-primary-strong: #4637d9;
  --fd-blue: #2563eb;
  --fd-red: #ef4444;
  --fd-orange: #f59e0b;
  --fd-green: #16a34a;
  --fd-cyan: #0891b2;
  --fd-shadow: 0 18px 45px rgba(36, 42, 74, 0.08);
  --fd-sidebar: 320px;
  --fd-radius: 8px;
  --fd-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--fd-bg);
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--fd-bg);
  color: var(--fd-text);
  font-family: var(--fd-font);
  line-height: 1.45;
}

body.admin-bar .fd-sidebar,
body.admin-bar .fd-topbar {
  top: 32px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

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

.fd-sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  height: 100vh;
  flex-direction: column;
  background: transparent;
}

.fd-brand {
  display: grid;
  min-height: 92px;
  grid-template-columns: 44px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 14px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--fd-border);
}

.fd-brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 0;
  background: transparent;
  color: #102817;
  box-shadow: none;
}

.fd-brand-mark svg,
.fd-icon svg {
  width: 32px;
  height: 32px;
}

.fd-brand-title {
  overflow: hidden;
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-brand-subtitle {
  margin-top: 2px;
  color: var(--fd-muted);
  font-size: 13px;
}

.fd-icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #59617d;
  cursor: pointer;
}

.fd-icon-button:hover,
.fd-icon-button:focus-visible {
  border-color: var(--fd-border);
  background: #f7f8ff;
  color: var(--fd-primary);
  outline: none;
}

.fd-nav {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
}

.fd-nav-section + .fd-nav-section {
  margin-top: 24px;
}

.fd-nav-heading {
  margin: 0 0 8px 8px;
  color: #7a819b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.fd-nav-link {
  display: grid;
  min-height: 42px;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #303750;
  font-size: 14px;
  font-weight: 600;
}

.fd-nav-link:hover,
.fd-nav-link:focus-visible,
.fd-nav-link.is-active {
  background: var(--fd-surface-soft);
  color: var(--fd-primary-strong);
  outline: none;
}

.fd-nav-link .fd-icon {
  color: #68708c;
}

.fd-nav-link.is-active .fd-icon,
.fd-nav-link:hover .fd-icon {
  color: var(--fd-primary);
}

.fd-sidebar-footer {
  padding: 16px;
}

.fd-help {
  display: grid;
  min-height: 48px;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--fd-border);
  border-radius: 8px;
  background: var(--fd-surface);
  color: #434a65;
  font-size: 14px;
  font-weight: 650;
}

.fd-main {
  min-width: 0;
  background: #ffffff;
  border-top-left-radius: 24px;
  border-left: 1px solid var(--fd-border);
  border-top: 1px solid var(--fd-border);
  min-height: 100vh;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.02);
}

.fd-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  min-height: 92px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--fd-border);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  border-top-left-radius: 24px;
}

.fd-page-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.08;
}

.fd-page-subtitle {
  margin: 6px 0 0;
  color: var(--fd-muted);
  font-size: 14px;
}

.fd-topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fd-search {
  display: grid;
  width: min(360px, 28vw);
  min-height: 46px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--fd-border);
  border-radius: 8px;
  background: var(--fd-surface);
  box-shadow: 0 8px 22px rgba(36, 42, 74, 0.04);
}

.fd-search input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--fd-text);
  outline: none;
}

.fd-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 42px;
  padding: 4px 7px;
  border-radius: 6px;
  background: #f3f5fb;
  color: #7a819b;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.fd-notification {
  position: relative;
  border-color: var(--fd-border);
  background: var(--fd-surface);
}

.fd-notification-count {
  position: absolute;
  top: -5px;
  right: -4px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--fd-red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.fd-user {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.fd-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(135deg, #d6f1ff, #ffd9c7);
  color: #222743;
  font-weight: 900;
}

.fd-user-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-user-role {
  overflow: hidden;
  color: var(--fd-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-mobile-toggle {
  display: none;
}

.fd-brand .fd-sidebar-close {
  display: none;
}

.fd-content {
  display: grid;
  gap: 22px;
  padding: 30px 32px 40px;
}

.fd-date-pill {
  justify-self: end;
  display: inline-grid;
  min-height: 36px;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--fd-border);
  border-radius: 8px;
  background: var(--fd-surface);
  color: #303750;
  font-size: 13px;
  font-weight: 800;
}

.fd-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  gap: 18px;
}

.fd-card {
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 36px rgba(36, 42, 74, 0.05);
}

.fd-kpi {
  display: grid;
  min-height: 166px;
  align-content: space-between;
  gap: 14px;
  padding: 18px;
}

.fd-kpi-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.fd-kpi-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, currentColor 13%, #fff);
}

.fd-kpi-title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-kpi-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 30px;
  font-weight: 850;
  line-height: 1;
}

.fd-kpi-value span {
  color: var(--fd-muted);
  font-size: 16px;
  font-weight: 700;
}

.fd-kpi-note {
  min-height: 20px;
  color: currentColor;
  font-size: 12px;
  font-weight: 750;
}

.fd-sparkline {
  width: 92px;
  height: 28px;
  justify-self: end;
}

.fd-sparkline polyline {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.fd-purple {
  color: var(--fd-primary);
}

.fd-red {
  color: var(--fd-red);
}

.fd-orange {
  color: var(--fd-orange);
}

.fd-blue {
  color: var(--fd-blue);
}

.fd-green {
  color: var(--fd-green);
}

.fd-cyan {
  color: var(--fd-cyan);
}

.fd-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr) minmax(320px, 0.92fr);
  gap: 18px;
}

.fd-dashboard-grid-secondary {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(250px, 0.8fr) minmax(310px, 1fr) minmax(270px, 0.9fr);
  gap: 18px;
}

.fd-panel {
  min-width: 0;
  overflow: hidden;
}

.fd-panel-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
}

.fd-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 15px;
  font-weight: 850;
}

.fd-panel-title .fd-kpi-icon {
  width: 32px;
  height: 32px;
}

.fd-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #dedcff;
  border-radius: 8px;
  background: #fff;
  color: var(--fd-primary-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.fd-button:hover,
.fd-button:focus-visible {
  border-color: #c8c3ff;
  background: #f8f7ff;
  outline: none;
}

.fd-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 10px 12px;
  border: 1px solid #eceef6;
  border-radius: 7px;
  background: #fbfcff;
}

.fd-tab {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5d6681;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.fd-tab.is-active {
  background: var(--fd-surface-soft);
  color: var(--fd-primary-strong);
}

.fd-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--fd-border);
}

.fd-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

.fd-table th,
.fd-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #edf0f6;
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

.fd-table th {
  color: #717990;
  font-weight: 800;
}

.fd-table td {
  color: #1e243b;
  font-weight: 650;
}

.fd-status,
.fd-priority {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.fd-status {
  background: #fff2db;
  color: #d47d00;
}

.fd-status.is-blue {
  background: #eef3ff;
  color: #4b5fd6;
}

.fd-priority.high {
  background: #ffe7e8;
  color: #d92331;
}

.fd-priority.medium {
  background: #fff2db;
  color: #c97500;
}

.fd-priority.low {
  background: #e6f8ed;
  color: #15803d;
}

.fd-list {
  display: grid;
}

.fd-list-item {
  display: grid;
  min-height: 60px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid #edf0f6;
}

.fd-list-main {
  min-width: 0;
}

.fd-list-title {
  overflow: hidden;
  color: #1f243b;
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-list-meta {
  overflow: hidden;
  margin-top: 2px;
  color: #69728d;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-deadline {
  color: var(--fd-red);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.fd-panel-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 16px 16px;
  color: var(--fd-primary-strong);
  font-size: 13px;
  font-weight: 850;
}

.fd-booking-list {
  display: grid;
  border-top: 1px solid var(--fd-border);
}

.fd-booking-row {
  display: grid;
  min-height: 56px;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid #edf0f6;
}

.fd-booking-time {
  color: #111428;
  font-size: 13px;
  font-weight: 850;
}

.fd-donut-wrap {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 12px 18px 20px;
}

.fd-donut {
  width: 148px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 0 42%, transparent 43%),
    conic-gradient(var(--fd-green) 0 70%, #f7b733 70% 79%, #f95f62 79% 85%, #65b5f6 85% 92%, #b6becd 92% 100%);
}

.fd-number-block {
  text-align: center;
}

.fd-number {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
}

.fd-number-caption {
  margin: 3px 0 12px;
  color: var(--fd-muted);
  font-size: 12px;
}

.fd-legend {
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.fd-legend li {
  display: grid;
  grid-template-columns: 10px auto 1fr;
  align-items: center;
  gap: 8px;
  color: #59617d;
  font-size: 12px;
  font-weight: 750;
}

.fd-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.fd-badge-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 16px;
  padding: 0 16px 16px;
}

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

.fd-action {
  display: grid;
  min-height: 44px;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--fd-border);
  border-radius: 8px;
  background: #fff;
  color: #4b536e;
  font-size: 13px;
  font-weight: 750;
}

.fd-id-preview {
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--fd-border);
  border-radius: 8px;
  background: linear-gradient(180deg, #f5f7ff, #fff);
  text-align: center;
  box-shadow: 0 12px 26px rgba(36, 42, 74, 0.08);
}

.fd-id-head {
  padding: 8px;
  background: var(--fd-primary);
  color: #fff;
  font-size: 9px;
  font-weight: 850;
}

.fd-id-face {
  width: 70px;
  height: 70px;
  margin: 18px auto 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fed7aa, #bfdbfe);
}

.fd-id-name {
  font-size: 13px;
  font-weight: 900;
}

.fd-id-meta {
  color: #5b647e;
  font-size: 10px;
  font-weight: 700;
}

.fd-barcode {
  width: 72px;
  height: 26px;
  margin: 14px auto 4px;
  background: repeating-linear-gradient(90deg, #111 0 2px, transparent 2px 4px, #111 4px 5px, transparent 5px 8px);
}

.fd-event-date {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  background: #f4f3ff;
  color: var(--fd-primary-strong);
  font-weight: 900;
  line-height: 1;
}

.fd-event-date span {
  color: #6e7790;
  font-size: 10px;
  text-transform: uppercase;
}

.fd-stats {
  padding: 0 14px 14px;
}

.fd-stats-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px;
}

.fd-stats-title {
  margin: 0;
  font-size: 15px;
  font-weight: 850;
}

.fd-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.fd-stat {
  display: grid;
  min-height: 96px;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--fd-border);
  border-radius: 8px;
  background: #fff;
}

.fd-stat .fd-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.fd-stat-label {
  color: #59617d;
  font-size: 12px;
  font-weight: 750;
}

.fd-stat-value {
  margin-top: 3px;
  font-size: 22px;
  font-weight: 900;
}

.fd-stat-note {
  color: #7a819b;
  font-size: 11px;
  font-weight: 650;
}

.fd-screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

@media (max-width: 1500px) {
  .fd-kpi-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

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

  .fd-stat-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 980px) {
  :root {
    --fd-sidebar: 288px;
  }

  .fd-app {
    display: block;
  }

  .fd-sidebar {
    position: fixed;
    transform: translateX(-102%);
    transition: transform 180ms ease;
    box-shadow: var(--fd-shadow);
  }

  body.fd-sidebar-open .fd-sidebar {
    transform: translateX(0);
  }

  .fd-mobile-toggle {
    display: inline-grid;
  }

  .fd-topbar {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 18px;
  }

  .fd-topbar-actions {
    justify-content: space-between;
  }

  .fd-search {
    width: min(100%, 420px);
  }

  .fd-user {
    min-width: auto;
    grid-template-columns: 44px 18px;
  }

  .fd-user-text {
    display: none;
  }

  .fd-content {
    padding: 20px 18px 32px;
  }

  .fd-date-pill {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  body.admin-bar .fd-sidebar,
  body.admin-bar .fd-topbar {
    top: 46px;
  }

  .fd-kpi-grid,
  .fd-dashboard-grid,
  .fd-dashboard-grid-secondary,
  .fd-stat-grid {
    grid-template-columns: 1fr;
  }

  .fd-topbar-actions {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 10px;
  }

  .fd-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .fd-donut-wrap,
  .fd-badge-panel {
    grid-template-columns: 1fr;
  }

  .fd-id-preview {
    max-width: 150px;
  }
}

/* Minimal product refresh */
:root {
  --fd-bg: #f5f6f3;
  --fd-surface: #ffffff;
  --fd-surface-soft: #eef3ec;
  --fd-text: #14231d;
  --fd-muted: #778178;
  --fd-border: #e1e6df;
  --fd-primary: #143f2e;
  --fd-primary-strong: #0d2f22;
  --fd-blue: #466b8f;
  --fd-red: #c94d4d;
  --fd-orange: #c17d24;
  --fd-green: #1f8d59;
  --fd-cyan: #4c8a98;
  --fd-shadow: 0 12px 28px rgba(20, 35, 29, 0.06);
  --fd-sidebar: 300px;
  --fd-radius: 10px;
  --fd-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: var(--fd-bg);
  color: var(--fd-text);
  letter-spacing: 0;
}

.fd-sidebar {
  border-right-color: #dde3db;
  background: #eef1ec;
  backdrop-filter: none;
}

.fd-brand {
  min-height: 84px;
  padding: 20px 22px 16px;
  border-bottom-color: #dde3db;
}

.fd-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 0;
  background: transparent;
  color: #102817;
  box-shadow: none;
}

.fd-brand-title {
  color: #163426;
  font-size: 18px;
  font-weight: 800;
}

.fd-brand-subtitle,
.fd-page-subtitle,
.fd-user-role {
  color: var(--fd-muted);
}

.fd-nav {
  padding: 18px 20px;
}

.fd-nav-heading {
  margin: 0 0 10px 12px;
  color: #9aa49a;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
}

.fd-nav-link {
  min-height: 44px;
  padding: 10px 12px;
  color: #566157;
  font-size: 14px;
  font-weight: 700;
}

.fd-nav-link:hover,
.fd-nav-link:focus-visible,
.fd-nav-link.is-active {
  background: #ffffff;
  color: #133d2c;
  box-shadow: inset 0 0 0 1px #e2e7df;
}

.fd-nav-link .fd-icon,
.fd-nav-link.is-active .fd-icon,
.fd-nav-link:hover .fd-icon {
  color: currentColor;
}

.fd-help {
  border-color: #dde3db;
  background: #fff;
  color: #566157;
  box-shadow: none;
}

.fd-topbar {
  min-height: 84px;
  padding: 18px 34px;
  border-bottom-color: #e1e6df;
  background: rgba(245, 246, 243, 0.9);
  backdrop-filter: blur(12px);
}

.fd-page-title {
  color: #14231d;
  font-size: 25px;
  font-weight: 850;
  letter-spacing: 0;
}

.fd-search {
  min-height: 44px;
  border-color: #e1e6df;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.fd-key {
  border-radius: 7px;
  background: #f1f3f0;
  color: #7a837a;
}

.fd-icon-button,
.fd-notification {
  border-color: #e1e6df;
  border-radius: 10px;
  background: #fff;
  color: #59655c;
}

.fd-icon-button:hover,
.fd-icon-button:focus-visible {
  border-color: #cdd7cc;
  background: #f8faf6;
  color: #143f2e;
}

.fd-avatar {
  background: #dce7df;
  color: #143f2e;
}

.fd-card,
.fd-stat,
.fd-action,
.fd-id-preview {
  border-color: #e1e6df;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

.fd-button {
  min-height: 38px;
  border-color: #dfe5dd;
  border-radius: 10px;
  background: #fff;
  color: #143f2e;
  font-weight: 800;
  box-shadow: none;
}

.fd-button:hover,
.fd-button:focus-visible {
  border-color: #cad6c8;
  background: #f7faf5;
}

.fd-tabs,
.fd-tab {
  border-radius: 10px;
}

.fd-tab.is-active {
  background: #eaf4e5;
  color: #143f2e;
}

.fd-kpi {
  min-height: 150px;
}

.fd-kpi-icon {
  border-radius: 12px;
  background: color-mix(in srgb, currentColor 12%, #fff);
}

.fd-kpi-title,
.fd-panel-title,
.fd-stats-title {
  color: #24362d;
}

/* Rounded workspace refresh */
@font-face {
  font-display: swap;
  font-family: "Balgin Light";
  font-style: normal;
  font-weight: 300;
  src: url("assets/fonts/balgin-light.otf") format("opentype");
}

:root {
  --fd-bg: #eef3ef;
  --fd-app-bg: #fdfdfd;
  --fd-surface: #fdfdfd;
  --fd-surface-soft: #e6ebe5;
  --fd-text: #102417;
  --fd-muted: #687267;
  --fd-border: #dedfdb;
  --fd-primary: #0f2a12;
  --fd-primary-strong: #081b0b;
  --fd-shadow: none;
  --fd-sidebar: 318px;
  --fd-radius: 22px;
}

html,
body {
  background: #0f2a12;
}

body {
  color: var(--fd-text);
  font-weight: 500;
}

.fd-app {
  min-height: 100vh;
  background: var(--fd-bg);
  border-top: 18px solid #0f2a12;
}

.fd-sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 18px);
  border-right: 0;
  background: var(--fd-bg);
}

body.admin-bar .fd-sidebar {
  top: 50px;
  height: calc(100vh - 50px);
}

.fd-main {
  min-height: calc(100vh - 18px);
  margin: 22px 22px 0 -8px;
  overflow: clip;
  border: 1px solid var(--fd-border);
  border-bottom: 0;
  border-radius: 34px 0 0 0;
  background: var(--fd-app-bg);
}

.fd-brand {
  min-height: 112px;
  grid-template-columns: 46px minmax(0, 1fr);
  padding: 26px 26px 22px;
  border-bottom: 0;
}

.fd-sidebar-close {
  display: none;
}

.fd-brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 0;
  background: transparent;
  color: #102817;
}

.fd-brand-title {
  color: #102817;
  font-size: 21px;
  font-weight: 850;
}

.fd-brand-subtitle {
  color: #717b70;
  font-size: 13px;
}

.fd-nav {
  padding: 16px 28px 20px;
}

.fd-nav-section + .fd-nav-section {
  margin-top: 26px;
}

.fd-nav-heading {
  margin: 0 0 10px 8px;
  color: #9ba39a;
  font-size: 11px;
  font-weight: 800;
}

.fd-nav-link {
  min-height: 52px;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: #626b61;
  font-size: 16px;
  font-weight: 700;
}

.fd-nav-link.has-count {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}

.fd-nav-link:hover,
.fd-nav-link:focus-visible,
.fd-nav-link.is-active {
  border-color: transparent;
  background: #dde3dc;
  color: #102817;
  box-shadow: none;
}

.fd-nav-link.is-active {
  font-weight: 850;
}

.fd-nav-count {
  min-width: 22px;
  color: #626b61;
  font-size: 16px;
  font-weight: 750;
  text-align: right;
}

.fd-sidebar-footer {
  padding: 18px 28px 26px;
}

.fd-help {
  min-height: 54px;
  border-color: #e3e5e1;
  border-radius: 16px;
  background: #fdfdfd;
}

.fd-topbar {
  position: sticky;
  top: 18px;
  min-height: 132px;
  padding: 28px 30px;
  border-bottom: 1px solid var(--fd-border);
  background: rgba(253, 253, 253, 0.94);
}

body.admin-bar .fd-topbar {
  top: 50px;
}

.fd-page-title {
  max-width: 720px;
  color: #102817;
  font-family: "Balgin Light", var(--fd-font);
  font-size: clamp(34px, 3.2vw, 50px);
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1.06;
}

.fd-page-subtitle,
.ut-breadcrumbs {
  color: #687267;
  font-size: 14px;
}

.fd-topbar-actions {
  gap: 12px;
}

.fd-search {
  min-height: 54px;
  width: clamp(260px, 24vw, 420px);
  border-color: #e0e1dc;
  border-radius: 16px;
  background: #fdfdfd;
}

.fd-key {
  border: 1px solid #e5e6e2;
  border-radius: 9px;
  background: #f4f5f2;
}

.fd-icon-button,
.fd-notification,
.fd-account-pill,
.fd-avatar-button {
  display: inline-grid;
  min-width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid #e0e1dc;
  border-radius: 16px;
  background: #fdfdfd;
  color: #102817;
  cursor: pointer;
}

.fd-notification-wrap,
.fd-user-menu-wrap {
  position: relative;
}

.fd-notification {
  width: 48px;
  min-width: 48px;
  height: 48px;
  border-radius: 14px;
}

.fd-notification svg {
  width: 22px;
  height: 22px;
}

.fd-notification-count {
  position: absolute;
  top: -7px;
  right: -6px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border: 2px solid #fdfdfd;
  border-radius: 999px;
  background: #bd4242;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.fd-notification-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 90;
  display: none;
  width: min(340px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid #dedfdb;
  border-radius: 18px;
  background: #fdfdfd;
  box-shadow: 0 20px 50px rgba(16, 40, 23, 0.14);
}

.fd-notification-wrap.is-open .fd-notification-menu {
  display: block;
}

.fd-notification-menu header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid #e6e7e3;
}

.fd-notification-menu header strong {
  color: #102817;
  font-size: 15px;
  font-weight: 900;
}

.fd-notification-menu header span,
.fd-notification-empty,
.fd-notification-list small {
  color: #687267;
  font-size: 12px;
  font-weight: 750;
}

.fd-notification-empty {
  margin: 0;
  padding: 16px;
}

.fd-notification-list {
  display: grid;
  padding: 8px;
}

.fd-notification-list a {
  display: grid;
  min-height: 58px;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 13px;
}

.fd-notification-list a:hover,
.fd-notification-list a:focus-visible {
  background: #eef3ef;
  outline: none;
}

.fd-notification-list strong {
  display: block;
  color: #102817;
  font-size: 14px;
  font-weight: 850;
}

.fd-notification-list small {
  display: block;
  margin-top: 2px;
}

.fd-notification-list em {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #e4f4e8;
  color: #0f5b2d;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.fd-notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #0f5b2d;
}

.fd-account-pill {
  display: inline-flex;
  min-width: 176px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  text-transform: uppercase;
  font-size: 16px;
  font-weight: 850;
}

.fd-account-pill svg {
  width: 20px;
  height: 20px;
}

.fd-avatar-button {
  overflow: hidden;
  padding: 0;
}

.fd-avatar {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #dce7df;
  color: #102817;
  font-size: 17px;
  font-weight: 850;
}

.fd-user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 90;
  display: none;
  width: min(290px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid #dedfdb;
  border-radius: 18px;
  background: #fdfdfd;
  box-shadow: 0 20px 50px rgba(16, 40, 23, 0.14);
}

.fd-user-menu-wrap.is-open .fd-user-menu {
  display: block;
}

.fd-user-menu header {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #e6e7e3;
}

.fd-user-menu header .fd-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 15px;
}

.fd-user-menu strong,
.fd-user-menu small {
  display: block;
}

.fd-user-menu strong {
  color: #102817;
  font-size: 15px;
  font-weight: 900;
}

.fd-user-menu small {
  margin-top: 3px;
  color: #687267;
  font-size: 12px;
  font-weight: 750;
}

.fd-user-menu nav {
  display: grid;
  padding: 8px;
}

.fd-user-menu a {
  min-height: 44px;
  padding: 12px 10px;
  border-radius: 13px;
  color: #102817;
  font-size: 14px;
  font-weight: 850;
}

.fd-user-menu a:hover,
.fd-user-menu a:focus-visible {
  background: #eef3ef;
  outline: none;
}

.fd-user-menu a.is-danger {
  color: #8f2f2f;
}

.fd-mobile-toggle {
  display: none;
}

.fd-content {
  padding: 30px;
}

.fd-card,
.fd-stat,
.fd-action,
.fd-id-preview,
.ut-inventory-panel,
.ut-equipment-form,
.ut-empty-view,
.ut-category-grid article {
  border: 1px solid var(--fd-border);
  border-radius: 22px;
  background: #fdfdfd;
  box-shadow: none;
}

.fd-panel-header,
.ut-inventory-panel-head {
  border-bottom: 1px solid var(--fd-border);
}

.fd-button {
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid #bfc2bb;
  border-radius: 15px;
  background: #fdfdfd;
  color: #102817;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0;
}

.fd-button:hover,
.fd-button:focus-visible {
  border-color: #92998e;
  background: #fdfdfd;
  color: #102817;
}

.fd-button.fd-button-primary,
.ut-primary-button {
  border-color: #0f2a12;
  background: #0f2a12;
  color: #fff;
}

.ut-primary-button:hover,
.ut-primary-button:focus-visible {
  border-color: #0a1d0c;
  background: #0a1d0c;
  color: #fff;
}

.fd-tabs {
  border-color: #e0e1dc;
  border-radius: 16px;
  background: #fdfdfd;
}

.fd-tab {
  min-height: 44px;
  border-radius: 14px;
}

.fd-tab.is-active,
.ut-view-tab.is-active {
  background: #e7eee5;
  color: #102817;
}

@media (max-width: 980px) {
  .fd-app {
    border-top-width: 0;
  }

  .fd-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    height: 100vh;
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  body.fd-sidebar-open .fd-sidebar {
    transform: translateX(0);
  }

  .fd-brand {
    grid-template-columns: 46px minmax(0, 1fr) 42px;
  }

  .fd-brand .fd-sidebar-close {
    display: inline-grid;
  }

  .fd-main {
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .fd-topbar {
    top: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .fd-mobile-toggle {
    display: inline-grid;
  }

  .fd-page-title {
    font-size: 34px;
  }

  .fd-account-pill {
    min-width: 138px;
    padding: 0 16px;
  }
}

@media (max-width: 1080px) {
  .fd-topbar {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .fd-topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .fd-search {
    width: min(100%, 420px);
  }
}

@media (max-width: 720px) {
  .fd-topbar-actions {
    grid-template-columns: auto 1fr auto auto auto;
  }

  .fd-account-pill {
    min-width: 54px;
    padding: 0;
    font-size: 0;
  }
}

html {
  margin-top: 0 !important;
}

#wpadminbar {
  display: none !important;
}

.fd-topbar,
body.admin-bar .fd-topbar {
  position: relative !important;
  top: auto !important;
  z-index: 20;
  background: #fdfdfd;
  backdrop-filter: none;
}

body.admin-bar .fd-sidebar {
  top: 18px !important;
  height: calc(100vh - 18px) !important;
}

@media (max-width: 980px) {
  body.admin-bar .fd-sidebar {
    top: 0 !important;
    height: 100vh !important;
  }
}

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #eef3ef !important;
}

.fd-app {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  border-top: 0;
  background: #eef3ef;
}

.fd-sidebar,
body.admin-bar .fd-sidebar {
  top: 0 !important;
  height: 100dvh !important;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.fd-main {
  height: calc(100dvh - 22px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 980px) {
  .fd-main {
    height: 100dvh;
  }
}

.fd-login-screen {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  background: #fdfdfd;
  color: #08090c;
}

.fd-login-panel {
  display: grid;
  width: min(1720px, calc(100vw - 96px));
  min-height: min(820px, calc(100dvh - 96px));
  grid-template-columns: minmax(360px, 0.84fr) minmax(520px, 1.16fr);
  align-items: stretch;
  gap: clamp(48px, 7vw, 120px);
}

.fd-login-content {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 8px 0;
}

.fd-login-brand {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 14px;
  color: #08090c;
  font-size: clamp(26px, 2.1vw, 38px);
  font-weight: 400;
  letter-spacing: 0;
}

.fd-login-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #102817;
}

.fd-login-mark svg {
  width: 42px;
  height: 42px;
}

.fd-login-copy {
  display: grid;
  max-width: 590px;
  align-content: center;
  padding-bottom: 28px;
}

.fd-login-copy h1 {
  max-width: 720px;
  margin: 0 0 36px;
  color: #08090c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 4.2vw, 68px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.02;
}

.fd-login-form {
  display: grid;
  gap: 24px;
}

.fd-login-form label {
  display: grid;
  gap: 12px;
  color: #08090c;
  font-size: 16px;
  font-weight: 800;
}

.fd-login-form input {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid #dedfe4;
  border-radius: 14px;
  background: #fff;
  color: #08090c;
  box-shadow: 0 3px 9px rgba(8, 9, 12, 0.07);
  font-size: 18px;
  font-weight: 600;
  outline: none;
}

.fd-login-form input:focus {
  border-color: #08090c;
  box-shadow: 0 0 0 4px rgba(8, 9, 12, 0.08);
}

.fd-login-form input[name="fd_login_code"] {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.fd-login-button {
  width: max-content;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: #050509;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
}

.fd-login-button:hover,
.fd-login-button:focus-visible {
  background: #1d1d24;
  outline: none;
}

.fd-login-resend {
  margin-top: 18px;
}

.fd-login-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #102817;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.fd-login-hint,
.fd-login-message {
  margin: -8px 0 0;
  color: #5f626a;
  font-size: 15px;
  font-weight: 650;
}

.fd-login-message {
  margin: 0 0 22px;
  padding: 12px 14px;
  border-radius: 12px;
}

.fd-login-message.is-success {
  background: #edf7ef;
  color: #176036;
}

.fd-login-message.is-error {
  background: #fff0f0;
  color: #9f2626;
}

.fd-login-art {
  display: grid;
  min-height: 100%;
  padding: 0;
}

.fd-login-art > div {
  min-height: 100%;
  overflow: hidden;
  border-radius: 42px;
  background:
    radial-gradient(ellipse at 58% 6%, rgba(50, 120, 255, 0.9) 0 9%, rgba(50, 120, 255, 0) 23%),
    radial-gradient(ellipse at 82% 35%, rgba(45, 110, 255, 0.85) 0 8%, rgba(45, 110, 255, 0) 22%),
    radial-gradient(ellipse at 70% 74%, rgba(42, 112, 255, 0.82) 0 8%, rgba(42, 112, 255, 0) 22%),
    radial-gradient(ellipse at 20% 18%, rgba(228, 169, 61, 0.86) 0 17%, rgba(228, 169, 61, 0) 35%),
    radial-gradient(ellipse at 52% 48%, rgba(231, 166, 55, 0.8) 0 18%, rgba(231, 166, 55, 0) 35%),
    radial-gradient(ellipse at 82% 70%, rgba(222, 153, 49, 0.82) 0 16%, rgba(222, 153, 49, 0) 34%),
    #fbf6d6;
  filter: saturate(1.12);
}

.fd-login-art > div::after {
  display: block;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
    repeating-radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.16) 0 1px, rgba(255, 255, 255, 0) 1px 3px);
  content: "";
  mix-blend-mode: soft-light;
}

body:not(.logged-in) .fd-screen-reader-text {
  display: none;
}

@media (max-width: 1080px) {
  .fd-login-panel {
    width: min(760px, calc(100vw - 40px));
    min-height: calc(100dvh - 40px);
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .fd-login-content {
    min-height: 560px;
  }

  .fd-login-art {
    display: none;
  }
}

@media (max-width: 640px) {
  .fd-login-screen {
    place-items: stretch;
  }

  .fd-login-panel {
    width: 100%;
    min-height: 100dvh;
    padding: 28px;
  }

  .fd-login-copy h1 {
    font-size: 42px;
  }
}

/* Desktop/tablet density: closer to a native productivity app at 100% zoom. */
@media (min-width: 981px) {
  :root {
    --fd-sidebar: 264px;
    --fd-radius: 18px;
  }

  .fd-app {
    grid-template-columns: var(--fd-sidebar) minmax(0, 1fr);
  }

  .fd-main {
    height: calc(100dvh - 16px);
    margin: 16px 16px 0 -4px;
    border-radius: 26px 0 0 0;
  }

  .fd-brand {
    min-height: 82px;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 11px;
    padding: 18px 20px 14px;
  }

  .fd-brand-mark {
    width: 34px;
    height: 34px;
  }

  .fd-brand-mark svg {
    width: 30px;
    height: 30px;
  }

  .fd-brand-title {
    font-size: 18px;
  }

  .fd-brand-subtitle {
    font-size: 12px;
  }

  .fd-nav {
    padding: 12px 20px 16px;
  }

  .fd-nav-section + .fd-nav-section {
    margin-top: 18px;
  }

  .fd-nav-heading {
    margin: 0 0 8px 6px;
    font-size: 10px;
  }

  .fd-nav-link {
    min-height: 40px;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 14px;
  }

  .fd-nav-link.has-count {
    grid-template-columns: 22px minmax(0, 1fr) auto;
  }

  .fd-nav-count {
    min-width: 18px;
    font-size: 14px;
  }

  .fd-icon svg,
  .fd-nav-link .fd-icon svg {
    width: 20px;
    height: 20px;
  }

  .fd-sidebar-footer {
    padding: 14px 20px 20px;
  }

  .fd-help {
    min-height: 44px;
    border-radius: 13px;
    font-size: 13px;
  }

  .fd-topbar {
    min-height: 96px;
    padding: 22px 24px;
  }

  .fd-page-title {
    font-size: clamp(28px, 2.6vw, 40px);
  }

  .fd-page-subtitle,
  .ut-breadcrumbs {
    font-size: 13px;
  }

  .fd-search {
    min-height: 46px;
    width: clamp(260px, 29vw, 420px);
    border-radius: 14px;
  }

  .fd-search svg {
    width: 20px;
    height: 20px;
  }

  .fd-search input {
    font-size: 14px;
  }

  .fd-icon-button,
  .fd-notification,
  .fd-avatar-button {
    min-width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .fd-notification {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .fd-notification svg {
    width: 20px;
    height: 20px;
  }

  .fd-avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 15px;
  }

  .fd-content {
    padding: 22px;
  }

  .fd-button {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 13px;
    font-size: 13px;
  }
}

/* Panoramica: compact control-room layout from the approved mockup. */
/* Hide only the role subtitle in the Panoramica topbar; plugin pages keep their own .fd-page-subtitle visible. */
.fd-overview-topbar .fd-page-subtitle {
  display: none;
}

.fd-content.fd-overview {
  display: grid;
  gap: 18px;
  padding: 22px 24px 28px;
  background: #fdfdfd;
}

.fd-overview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.fd-role-pill,
.fd-overview .fd-date-pill {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #dedfdb;
  border-radius: 8px;
  background: #fdfdfd;
  color: #5f695f;
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
}

.fd-overview .fd-date-pill {
  color: #2e3a32;
  font-weight: 900;
}

.fd-overview-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.fd-overview .fd-kpi {
  min-height: 82px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  align-content: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 22px;
  background: #fdfdfd;
}

.fd-overview .fd-kpi.fd-green {
  border-color: #1f7d5a;
  color: #1d9460;
}

.fd-overview .fd-kpi.fd-red {
  border-color: #c94d4d;
  color: #c94d4d;
}

.fd-overview .fd-kpi.fd-orange {
  border-color: #c7882d;
  color: #c17d24;
}

.fd-overview .fd-kpi.fd-blue {
  border-color: #466b8f;
  color: #466b8f;
}

.fd-overview .fd-kpi-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: color-mix(in srgb, currentColor 13%, #eef3ef);
}

.fd-overview .fd-kpi-icon svg {
  width: 18px;
  height: 18px;
}

.fd-overview .fd-kpi-copy {
  min-width: 0;
}

.fd-overview .fd-kpi-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: #102817;
  font-size: 28px;
  font-weight: 950;
  line-height: 0.9;
}

.fd-overview .fd-kpi-value span {
  color: #5f695f;
  font-size: 14px;
  font-weight: 900;
}

.fd-overview .fd-kpi-title {
  margin: 3px 0 0;
  overflow: hidden;
  color: #102817;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-overview .fd-kpi-note {
  min-height: 0;
  margin-top: 2px;
  overflow: hidden;
  color: currentColor;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-overview .fd-card,
.fd-overview .fd-stat {
  border-color: #dedfdb;
  border-radius: 22px;
  background: #fdfdfd;
  box-shadow: none;
}

.fd-overview-primary,
.fd-overview-secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.fd-overview .fd-panel {
  min-height: 0;
  overflow: hidden;
}

.fd-overview .fd-panel-header {
  min-height: 66px;
  padding: 16px 18px;
  border-bottom: 1px solid #dedfdb;
}

.fd-overview .fd-panel-title {
  gap: 10px;
  color: #102817;
  font-size: 16px;
  font-weight: 950;
}

.fd-overview .fd-panel-title .fd-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: #102817;
  background: #e9eee7;
}

.fd-overview .fd-button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #cfd3cb;
  border-radius: 14px;
  background: #fdfdfd;
  color: #102817;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 950;
}

.fd-overview .fd-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-width: 0 0 1px;
  border-color: #dedfdb;
  border-radius: 0;
  background: #fdfdfd;
}

.fd-overview .fd-tabs.fd-tabs-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fd-overview .fd-tab {
  min-height: 44px;
  border-radius: 0 0 16px 16px;
  color: #59635c;
  font-size: 12px;
  font-weight: 900;
}

.fd-overview .fd-tab.is-active {
  background: #e7eee5;
  color: #102817;
}

.fd-overview .fd-table-wrap {
  overflow: hidden;
  border-top: 0;
}

.fd-overview .fd-table {
  min-width: 0;
  table-layout: fixed;
}

.fd-overview .fd-table th,
.fd-overview .fd-table td {
  padding: 15px 16px;
  border-bottom: 1px solid #e5e6e2;
  color: #1d2921;
  font-size: 12px;
  font-weight: 850;
}

.fd-overview .fd-table th {
  color: #6f7a70;
  font-size: 11px;
  font-weight: 950;
  text-transform: none;
}

.fd-overview .fd-overview-table th:nth-child(1),
.fd-overview .fd-overview-table td:nth-child(1) {
  width: 54%;
}

.fd-overview .fd-overview-table th:nth-child(2),
.fd-overview .fd-overview-table td:nth-child(2) {
  width: 22%;
}

.fd-overview .fd-overview-table th:nth-child(3),
.fd-overview .fd-overview-table td:nth-child(3) {
  width: 24%;
  text-align: right;
}

.fd-overview .fd-status,
.fd-overview .fd-priority {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 950;
}

.fd-overview .fd-list-item {
  min-height: 62px;
  padding: 12px 16px;
  border-top: 1px solid #e5e6e2;
}

.fd-overview .fd-list-title {
  color: #111c15;
  font-size: 13px;
  font-weight: 950;
}

.fd-overview .fd-list-meta {
  color: #667069;
  font-size: 11px;
  font-weight: 800;
}

.fd-overview .fd-deadline {
  color: #c94d4d;
  font-size: 11px;
  font-weight: 950;
}

.fd-overview .fd-panel-link {
  min-height: 42px;
  padding: 0 16px 14px;
  color: #102817;
  font-size: 13px;
  font-weight: 950;
}

.fd-overview .fd-booking-list {
  border-top: 0;
}

.fd-overview .fd-booking-row {
  min-height: 52px;
  grid-template-columns: 112px minmax(0, 1fr);
  padding: 10px 16px;
  border-bottom: 1px solid #e5e6e2;
}

.fd-overview .fd-booking-time {
  color: #111c15;
  font-size: 12px;
  font-weight: 950;
}

.fd-overview .fd-event-date {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: #f3f4f1;
  color: #102817;
  font-size: 16px;
}

.fd-overview .fd-event-date span {
  color: #687267;
  font-size: 8px;
  font-weight: 950;
}

.fd-overview .fd-number {
  margin-top: 2px;
  color: #050807;
  font-size: 30px;
  line-height: 1;
}

.fd-overview .fd-number-caption {
  margin: 8px 0 8px;
  color: #687267;
  font-size: 14px;
  font-weight: 700;
}

.fd-overview .fd-donut-wrap {
  grid-template-columns: minmax(110px, 0.85fr) minmax(0, 1fr);
  gap: 20px;
  padding: 6px 22px 14px;
}

.fd-overview .fd-donut {
  width: min(130px, 100%);
  justify-self: center;
  background:
    radial-gradient(circle, #fdfdfd 0 42%, transparent 43%),
    conic-gradient(#21945e 0 70%, #c17d24 70% 79%, #c94d4d 79% 85%, #5f98b0 85% 92%, #9da69c 92% 100%);
}

.fd-overview .fd-legend {
  gap: 10px;
}

.fd-overview .fd-legend li {
  color: #566156;
  font-size: 12px;
  font-weight: 800;
}

.fd-overview .fd-stats {
  padding: 0 18px 18px;
}

.fd-overview .fd-stats-head {
  min-height: 58px;
  padding: 0 6px;
}

.fd-overview .fd-stats-title {
  color: #102817;
  font-size: 15px;
  font-weight: 950;
}

.fd-overview .fd-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.fd-overview .fd-stat {
  min-height: 72px;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 16px;
  border-radius: 18px;
}

.fd-overview .fd-stat .fd-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.fd-overview .fd-stat-label {
  color: #667069;
  font-size: 11px;
  font-weight: 850;
}

.fd-overview .fd-stat-value {
  color: #102817;
  font-size: 22px;
  font-weight: 950;
  line-height: 1.05;
}

.fd-overview .fd-stat-note {
  color: #667069;
  font-size: 11px;
  font-weight: 750;
}

.fd-teacher-overview {
  display: grid;
  gap: 18px;
  padding: 22px 24px 28px;
  background: #fdfdfd;
}

.fd-teacher-overview .fd-date-pill {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #dedfdb;
  border-radius: 8px;
  background: #fdfdfd;
  color: #2e3a32;
  font-size: 12px;
  font-weight: 900;
}

.fd-teacher-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.fd-teacher-kpi {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid #dedfdb;
  border-radius: 22px;
  background: #fdfdfd;
  box-shadow: none;
}

.fd-teacher-kpi strong {
  color: #102817;
  font-size: 32px;
  font-weight: 950;
  line-height: 1;
}

.fd-teacher-kpi span {
  color: #667069;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.fd-teacher-panel {
  overflow: hidden;
  border: 1px solid #dedfdb;
  border-radius: 22px;
  background: #fdfdfd;
  box-shadow: none;
}

.fd-teacher-panel .fd-panel-header {
  min-height: 70px;
  padding: 16px 18px;
  border-bottom: 1px solid #dedfdb;
}

.fd-teacher-panel .fd-panel-title {
  gap: 10px;
  color: #102817;
  font-size: 17px;
  font-weight: 950;
}

.fd-teacher-primary {
  min-height: 42px;
  gap: 8px;
  border-color: #0f2a12;
  border-radius: 14px;
  background: #0f2a12;
  color: #fff;
}

.fd-teacher-request-list {
  display: grid;
}

.fd-teacher-request {
  display: grid;
  min-height: 74px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e6e2;
}

.fd-teacher-request strong {
  display: block;
  overflow: hidden;
  color: #162033;
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-teacher-request span:not(.fd-teacher-status) {
  display: block;
  margin-top: 4px;
  color: #66708a;
  font-size: 13px;
  font-weight: 760;
}

.fd-teacher-status {
  display: inline-flex;
  min-width: 98px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff1d7;
  color: #b9781d;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.fd-teacher-status.in-stampa {
  background: #e4effd;
  color: #356fb4;
}

.fd-teacher-status.completata {
  background: #e4f4e8;
  color: #1f8d59;
}

.fd-teacher-empty {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 34px 18px 38px;
}

.fd-teacher-empty h3 {
  margin: 0;
  color: #102817;
  font-size: 22px;
}

.fd-teacher-empty p {
  max-width: 520px;
  margin: 0 0 8px;
  color: #667069;
  font-size: 14px;
  font-weight: 750;
}

@media (min-width: 981px) {
  .fd-overview-page .fd-topbar {
    min-height: 118px;
  }

  .fd-overview-page .fd-page-title {
    font-size: clamp(34px, 3.15vw, 48px);
  }
}

@media (max-width: 1450px) {
  .fd-overview-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .fd-overview-primary,
  .fd-overview-secondary,
  .fd-overview .fd-stat-grid,
  .fd-teacher-kpis {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .fd-overview-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .fd-overview-kpis {
    grid-template-columns: 1fr;
  }

  .fd-overview .fd-donut-wrap {
    grid-template-columns: 1fr;
  }
}

/* Final docente shell: compact app layout for narrow content columns. */
.fd-role-docente .ut-print-topbar {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 26px 26px 22px;
}

.fd-role-docente .ut-print-topbar .fd-page-title {
  max-width: none;
  font-size: clamp(36px, 4.2vw, 52px);
  line-height: 0.98;
}

.fd-role-docente .ut-print-topbar .fd-topbar-actions {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 54px 54px;
  gap: 10px;
}

.fd-role-docente .ut-print-topbar .fd-mobile-toggle {
  display: none;
}

.fd-role-docente .ut-print-topbar .fd-search {
  width: 100%;
  min-width: 0;
}

.fd-role-docente .ut-print-topbar .fd-notification,
.fd-role-docente .ut-print-topbar .fd-avatar-button,
.fd-role-docente .ut-print-topbar .fd-avatar {
  min-width: 54px;
  width: 54px;
  height: 54px;
}

@media (min-width: 981px) and (max-width: 1180px) {
  .fd-role-docente .fd-app {
    grid-template-columns: 290px minmax(0, 1fr);
  }

  .fd-role-docente .fd-sidebar {
    width: 290px;
  }

  .fd-role-docente .fd-nav {
    padding-inline: 22px;
  }

  .fd-role-docente .fd-nav-link {
    min-height: 48px;
    padding-inline: 14px;
    font-size: 15px;
  }
}

/* Ticket Assistenza visual system: final global layer. */
:root {
  --fd-bg: #eef3ef;
  --fd-app-bg: #fdfdfd;
  --fd-surface: #fdfdfd;
  --fd-surface-soft: #eef3ec;
  --fd-text: #102417;
  --fd-muted: #687267;
  --fd-border: #dedfdb;
  --fd-primary: #0f2a12;
  --fd-primary-strong: #081b0b;
  --fd-blue: #2563eb;
  --fd-red: #d92331;
  --fd-orange: #b45309;
  --fd-green: #16a34a;
  --fd-cyan: #0891b2;
  --fd-radius: 20px;
}

body {
  background: #eef3ef !important;
  color: var(--fd-text);
}

.fd-main {
  background: var(--fd-app-bg);
}

.fd-topbar {
  min-height: 118px;
  padding: 26px 30px;
  border-bottom: 1px solid var(--fd-border);
  background: #fdfdfd;
}

.fd-page-title {
  color: #102817;
  font-family: "Balgin Light", var(--fd-font);
  font-size: clamp(40px, 3.35vw, 56px);
  font-weight: 300;
  line-height: 1.04;
}

.fd-page-subtitle {
  max-width: 620px;
  color: #687267;
  font-size: 14px;
  font-weight: 600;
}

.fd-search,
.fd-icon-button,
.fd-notification,
.fd-avatar-button {
  border-color: var(--fd-border);
  background: #fdfdfd;
  box-shadow: none;
}

.fd-search {
  min-height: 52px;
  border-radius: 16px;
}

.fd-key {
  border-color: #e3e5e1;
  background: #f4f5f2;
}

.fd-content {
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
  background: #fdfdfd;
}

.fd-card,
.fd-panel,
.fd-stat,
.fd-action,
.fd-id-preview,
.fd-teacher-panel {
  border-color: var(--fd-border);
  border-radius: 20px;
  background: #fdfdfd;
  box-shadow: none;
}

.fd-button {
  min-height: 42px;
  padding: 0 18px;
  border-color: #cfd5cc;
  border-radius: 13px;
  background: #fdfdfd;
  color: #102817;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.fd-button:hover,
.fd-button:focus-visible {
  border-color: #0f2a12;
  background: #fdfdfd;
  color: #0f2a12;
}

.fd-button.fd-button-primary,
.fd-teacher-primary {
  border-color: #0f2a12;
  background: #0f2a12;
  color: #fff;
}

.fd-tabs {
  border: 0;
  border-bottom: 1px solid var(--fd-border);
  border-radius: 0;
  background: transparent;
}

.fd-tab {
  min-height: 44px;
  border-radius: 0;
  color: #626b61;
}

.fd-tab.is-active {
  background: transparent;
  color: #102817;
  box-shadow: inset 0 -2px 0 #102817;
}

.fd-table th,
.fd-table td {
  border-bottom-color: #e5e6e2;
}

.fd-table th {
  color: #687267;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fd-status,
.fd-priority {
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  text-transform: none;
}

.fd-status {
  background: #fef3c7;
  color: #b45309;
}

.fd-status.is-blue {
  background: #dbeafe;
  color: #2563eb;
}

.fd-priority.high {
  background: #ffe7e8;
  color: #d92331;
}

.fd-priority.medium {
  background: #fff2db;
  color: #d47d00;
}

.fd-priority.low {
  background: #dcfce7;
  color: #15803d;
}

.fd-panel-link {
  color: #102817;
}

.fd-overview-page .fd-topbar {
  min-height: 118px;
}

.fd-content.fd-overview,
.fd-teacher-overview {
  padding: 24px 30px 34px;
}

.fd-overview-kpis,
.fd-teacher-kpis {
  gap: 16px;
}

.fd-overview .fd-kpi,
.fd-teacher-kpi {
  min-height: 112px;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  background: #fdfdfd;
}

.fd-overview .fd-kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.fd-overview .fd-kpi-icon svg {
  width: 24px;
  height: 24px;
}

.fd-overview .fd-kpi-value {
  font-size: 32px;
  font-weight: 850;
}

.fd-overview .fd-kpi-title {
  font-size: 14px;
  font-weight: 800;
  white-space: normal;
}

.fd-overview .fd-kpi-note {
  color: currentColor;
  font-size: 13px;
  font-weight: 750;
  white-space: normal;
}

.fd-overview .fd-panel-header,
.fd-teacher-panel .fd-panel-header {
  min-height: 66px;
  padding: 16px 18px;
}

@media (min-width: 981px) {
  .fd-page-title {
    font-size: clamp(40px, 3.35vw, 56px);
  }

  .fd-content {
    padding: 24px 30px 34px;
  }
}

@media (max-width: 980px) {
  .fd-topbar {
    min-height: 0;
    padding: 24px 30px;
  }

  .fd-page-title {
    font-size: 42px;
  }
}

@media (max-width: 720px) {
  .fd-topbar {
    padding: 24px 30px 26px;
  }

  .fd-page-title {
    font-size: 42px;
    line-height: 0.98;
  }

  .fd-content,
  .fd-content.fd-overview,
  .fd-teacher-overview {
    padding: 30px;
  }
}

/* ===== Assistente Panoramica (chatbot) ===== */
.fd-assistant { background: #fff; color: var(--fd-text); border: 1.5px solid color-mix(in srgb, var(--fd-primary) 45%, #ffffff); border-radius: 18px; padding: 20px 22px; margin-bottom: 22px; box-shadow: 0 4px 14px rgba(15,42,18,.05); }
.fd-assistant-head { display: flex; align-items: center; gap: 13px; }
.fd-assistant-avatar { width: 42px; height: 42px; border-radius: 12px; background: color-mix(in srgb, var(--fd-primary) 12%, #ffffff); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fd-assistant-avatar svg { width: 26px; height: 26px; color: var(--fd-primary); }
.fd-assistant-title { margin: 0; font-size: 22px; font-weight: 300; font-family: "Balgin Light", var(--fd-font); color: #102817; line-height: 1.1; letter-spacing: 0; }
.fd-assistant-sub { margin: 3px 0 0; font-size: 13px; color: var(--fd-muted); font-weight: 500; }
.fd-assistant-thread { margin-top: 16px; max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.fd-assistant-thread[hidden] { display: none; }
.fd-assistant-msg { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.fd-assistant-msg.is-user { align-self: flex-end; background: var(--fd-primary); color: #fff; border-bottom-right-radius: 4px; font-weight: 600; }
.fd-assistant-msg.is-bot { align-self: flex-start; background: var(--fd-surface-soft); color: var(--fd-text); border: 1px solid var(--fd-border); border-bottom-left-radius: 4px; }
.fd-assistant-reply { white-space: normal; }
.fd-assistant-action { display: inline-flex; margin-top: 10px; padding: 7px 14px; border-radius: 999px; background: var(--fd-primary); color: #fff; font-size: 13px; font-weight: 800; text-decoration: none; }
.fd-assistant-action:hover { background: var(--fd-primary-strong, #081b0b); }
.fd-assistant-form { display: flex; gap: 10px; margin-top: 16px; }
.fd-assistant-form input { flex: 1; height: 46px; border: 1px solid var(--fd-border); border-radius: 14px; padding: 0 16px; font-size: 14px; background: #fff; color: var(--fd-text); outline: none; transition: border-color .15s; }
.fd-assistant-form input:focus { border-color: var(--fd-primary); }
.fd-assistant-send { width: 46px; height: 46px; border: 0; border-radius: 14px; background: var(--fd-primary); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s; }
.fd-assistant-send:hover { background: var(--fd-primary-strong, #081b0b); }
.fd-assistant-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fd-assistant-chip { border: 1px solid var(--fd-border); background: #fff; color: var(--fd-text); border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .15s; }
.fd-assistant-chip:hover { border-color: var(--fd-primary); color: var(--fd-primary); background: color-mix(in srgb, var(--fd-primary) 7%, #ffffff); }
.fd-assistant-typing { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.fd-assistant-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--fd-muted); animation: fd-typing 1s infinite ease-in-out; }
.fd-assistant-typing i:nth-child(2) { animation-delay: .15s; }
.fd-assistant-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes fd-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (max-width: 640px) { .fd-assistant-msg { max-width: 92%; } .fd-assistant-title { font-size: 20px; } }

/* Fix dimensione emoji (img.emoji di WordPress) — evita emoji giganti. */
img.emoji { display: inline-block; height: 1em; width: 1em; margin: 0 .07em; vertical-align: -0.1em; border: 0; box-shadow: none; background: none; padding: 0; }

/* ════════════════════════════════════════════════════════════
   SHELL 2.0 — Floating gradient sidebar + theme skins
   (final layer, keep at EOF)
   ════════════════════════════════════════════════════════════ */

/* ── Skin variables (default = Verde bosco) ── */
:root {
  --fds-g1: #0c2410;
  --fds-g2: #14532d;
  --fds-g3: #059669;
  --fds-glow: rgba(5, 150, 105, 0.35);
  --fds-mark-ink: #0c2410;
}

html[data-fd-skin="blu"] {
  --fds-g1: #0a3060;
  --fds-g2: #185fa5;
  --fds-g3: #378add;
  --fds-glow: rgba(55, 138, 221, 0.35);
  --fds-mark-ink: #0c447c;
  --fd-primary: #185fa5;
  --fd-primary-strong: #0c447c;
  --fd-surface-soft: #ecf3fa;
}

html[data-fd-skin="navy"] {
  --fds-g1: #0b1220;
  --fds-g2: #1e293b;
  --fds-g3: #134e4a;
  --fds-glow: rgba(52, 211, 153, 0.3);
  --fds-mark-ink: #0b1220;
  --fd-primary: #115e59;
  --fd-primary-strong: #134e4a;
  --fd-surface-soft: #e9f6f1;
}

html[data-fd-skin="navy"] .fd-brand-mark {
  background: #34d399;
}

/* ── Sidebar: gradient surface (all viewports) ── */
.fd-sidebar {
  background: linear-gradient(168deg, var(--fds-g1) 0%, var(--fds-g2) 52%, var(--fds-g3) 135%);
  border-right: 0;
  color: #fff;
}

.fd-brand {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.fd-brand-title {
  color: #fff;
}

.fd-brand-subtitle {
  color: rgba(255, 255, 255, 0.55);
}

.fd-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ffffff;
  color: var(--fds-mark-ink);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.fd-brand-mark svg {
  width: 24px;
  height: 24px;
}

.fd-brand .fd-sidebar-close {
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.85);
}

.fd-brand .fd-sidebar-close:hover,
.fd-brand .fd-sidebar-close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.fd-nav-heading {
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 0.08em;
}

.fd-nav-link {
  color: rgba(255, 255, 255, 0.74);
  border-radius: 12px;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.fd-nav-link.has-count {
  grid-template-columns: 24px minmax(0, 1fr) auto;
}

.fd-nav-link .fd-icon {
  color: rgba(255, 255, 255, 0.52);
  transition: color 0.16s ease;
}

.fd-nav-link:hover,
.fd-nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.fd-nav-link.is-active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.fd-nav-link:hover .fd-icon,
.fd-nav-link:focus-visible .fd-icon,
.fd-nav-link.is-active .fd-icon {
  color: #fff;
}

.fd-nav-count {
  display: inline-grid;
  min-width: 22px;
  height: 20px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--fds-g1);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.fd-nav::-webkit-scrollbar {
  width: 6px;
}

.fd-nav::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
}

.fd-nav::-webkit-scrollbar-track {
  background: transparent;
}

.fd-help {
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}

.fd-help:hover,
.fd-help:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  outline: none;
}

.fd-help .fd-icon {
  color: rgba(255, 255, 255, 0.7);
}

/* ── Footer tools: theme picker + collapse toggle ── */
.fd-shell-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.fd-skin-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fd-skin-dot {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.fd-skin-dot:hover {
  transform: scale(1.12);
  border-color: rgba(255, 255, 255, 0.7);
}

.fd-skin-dot.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.fd-skin-dot.is-verde {
  background: linear-gradient(135deg, #0c2410, #059669);
}

.fd-skin-dot.is-blu {
  background: linear-gradient(135deg, #0a3060, #378add);
}

.fd-skin-dot.is-navy {
  background: linear-gradient(135deg, #0b1220, #34d399);
}

.fd-rail-toggle {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.fd-rail-toggle:hover,
.fd-rail-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.fd-rail-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s ease;
}

/* ── Desktop: floating card + collapsible rail ── */
@media (min-width: 981px) {
  .fd-app {
    transition: grid-template-columns 0.26s ease;
  }

  .fd-sidebar {
    position: sticky;
    top: 14px;
    height: calc(100vh - 28px);
    margin: 14px 0 14px 14px;
    border-radius: 22px;
    box-shadow: 0 18px 44px rgba(8, 20, 14, 0.25), 0 2px 10px var(--fds-glow);
    overflow: hidden;
  }

  body.admin-bar .fd-sidebar {
    top: 46px;
    height: calc(100vh - 60px);
  }

  .fd-main {
    border-left: 0;
  }

  .fd-rail-toggle svg {
    transform: rotate(0deg);
  }

  /* Collapsed rail */
  html.fd-rail {
    --fd-sidebar: 104px;
  }

  html.fd-rail .fd-sidebar {
    overflow: visible;
  }

  html.fd-rail .fd-brand {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 0;
    padding: 18px 10px 14px;
    gap: 0;
  }

  html.fd-rail .fd-brand-text,
  html.fd-rail .fd-brand .fd-sidebar-close {
    display: none;
  }

  html.fd-rail .fd-nav {
    padding: 14px 12px;
    overflow: visible;
  }

  html.fd-rail .fd-nav-heading {
    display: none;
  }

  html.fd-rail .fd-nav-section + .fd-nav-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  html.fd-rail .fd-nav-link {
    position: relative;
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 44px;
    padding: 10px 8px;
  }

  html.fd-rail .fd-nav-link .fd-nav-label {
    display: none;
  }

  html.fd-rail .fd-nav-link.has-count {
    grid-template-columns: 1fr;
  }

  html.fd-rail .fd-nav-count {
    position: absolute;
    top: 3px;
    right: 5px;
    min-width: 17px;
    height: 17px;
    font-size: 10px;
    padding: 0 4px;
  }

  html.fd-rail .fd-nav-link::after {
    content: attr(data-tip);
    position: absolute;
    top: 50%;
    left: calc(100% + 16px);
    z-index: 80;
    padding: 8px 13px;
    border-radius: 10px;
    background: #0b1411;
    color: #fff;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-50%) translateX(-4px);
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
  }

  html.fd-rail .fd-nav-link:hover::after,
  html.fd-rail .fd-nav-link:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }

  html.fd-rail .fd-help {
    display: none;
  }

  html.fd-rail .fd-sidebar-footer {
    padding: 12px 10px;
  }

  html.fd-rail .fd-shell-tools {
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
  }

  html.fd-rail .fd-skin-picker {
    flex-direction: column;
  }

  html.fd-rail .fd-rail-toggle svg {
    transform: rotate(180deg);
  }
}

/* Shell 2.0 — mobile refinements */
.fd-brand .fd-sidebar-close {
  background: rgba(255, 255, 255, 0.1);
}

.fd-brand .fd-sidebar-close svg {
  color: #fff;
}

@media (max-width: 980px) {
  .fd-rail-toggle {
    display: none;
  }

  .fd-shell-tools {
    justify-content: center;
  }
}

/* ── Shell 2.0: unified toasts + branded confirm dialog ── */
.fd-toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

body.admin-bar .fd-toast-stack {
  top: 50px;
}

.fd-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  max-width: 380px;
  padding: 13px 16px;
  border: 1px solid var(--fd-border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(8, 20, 14, 0.16);
  color: var(--fd-text);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(14px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.fd-toast.is-in {
  opacity: 1;
  transform: translateX(0);
}

.fd-toast-ico {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
}

.fd-toast-ico svg {
  width: 16px;
  height: 16px;
}

.fd-toast.is-success .fd-toast-ico {
  background: #dcfce7;
  color: #16a34a;
}

.fd-toast.is-error .fd-toast-ico {
  background: #ffe7e8;
  color: #d92331;
}

.fd-toast.is-info .fd-toast-ico {
  background: var(--fd-surface-soft);
  color: var(--fd-primary);
}

.fd-dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 24, 16, 0.32);
  backdrop-filter: blur(6px);
}

.fd-dialog-layer[hidden] {
  display: none;
}

.fd-dialog {
  width: min(440px, 100%);
  padding: 26px 26px 22px;
  border: 1px solid var(--fd-border);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(8, 20, 14, 0.28);
  animation: fd-dialog-pop 0.18s ease;
}

@keyframes fd-dialog-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fd-dialog-title {
  margin: 0;
  color: var(--fd-text);
  font-size: 19px;
  font-weight: 850;
}

.fd-dialog-msg {
  margin: 8px 0 0;
  color: var(--fd-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.fd-dialog-msg[hidden] {
  display: none;
}

.fd-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.fd-dialog-btn {
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid var(--fd-border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--fd-text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.fd-dialog-btn.is-cancel:hover,
.fd-dialog-btn.is-cancel:focus-visible {
  background: var(--fd-surface-soft);
  outline: none;
}

.fd-dialog-btn.is-confirm {
  border-color: var(--fd-primary);
  background: var(--fd-primary);
  color: #ffffff;
}

.fd-dialog-btn.is-confirm:hover,
.fd-dialog-btn.is-confirm:focus-visible {
  background: var(--fd-primary-strong);
  border-color: var(--fd-primary-strong);
  outline: none;
}

.fd-dialog-btn.is-confirm.is-danger {
  border-color: #d92331;
  background: #d92331;
}

.fd-dialog-btn.is-confirm.is-danger:hover,
.fd-dialog-btn.is-confirm.is-danger:focus-visible {
  background: #b51c28;
  border-color: #b51c28;
}

/* ── Shell 2.0: curated empty states ── */
.fd-empty-row td {
  padding: 26px 16px;
  color: var(--fd-muted);
  font-size: 14px;
  font-weight: 650;
  text-align: center;
}

.fd-empty-row[hidden] {
  display: none;
}

.fd-empty-row.is-rich td {
  padding: 52px 16px 56px;
}

.fd-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.fd-empty-ico {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 18px;
  background: var(--fd-surface-soft);
  color: var(--fd-primary);
}

.fd-empty-ico svg {
  width: 27px;
  height: 27px;
}

.fd-empty-state strong {
  color: var(--fd-text);
  font-size: 16px;
  font-weight: 850;
}

.fd-empty-state p {
  max-width: 440px;
  margin: 0 0 14px;
  color: var(--fd-muted);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
}

/* ── Shell 2.0: command palette (⇧R) ── */
.fd-palette-layer {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 24px 24px;
  background: rgba(12, 24, 16, 0.32);
  backdrop-filter: blur(6px);
}

.fd-palette-layer[hidden] {
  display: none;
}

.fd-palette {
  width: min(640px, 100%);
  overflow: hidden;
  border: 1px solid var(--fd-border);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(8, 20, 14, 0.3);
  animation: fd-dialog-pop 0.16s ease;
}

.fd-palette-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--fd-border);
  color: var(--fd-muted);
}

.fd-palette-head > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.fd-palette-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--fd-text);
  font-size: 16px;
  font-weight: 600;
  outline: none;
}

.fd-palette-input::placeholder {
  color: var(--fd-muted);
  font-weight: 500;
}

.fd-palette-kbd {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid var(--fd-border);
  border-radius: 7px;
  background: var(--fd-bg);
  color: var(--fd-muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.fd-palette-list {
  max-height: 380px;
  padding: 8px;
  overflow-y: auto;
}

.fd-palette-group {
  margin: 10px 10px 4px;
  color: var(--fd-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.fd-palette-group:first-child {
  margin-top: 4px;
}

.fd-palette-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--fd-text);
  cursor: pointer;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 650;
  text-align: left;
}

.fd-palette-item.is-active {
  background: var(--fd-surface-soft);
  color: var(--fd-primary-strong);
}

.fd-palette-ico {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--fd-bg);
  color: var(--fd-muted);
}

.fd-palette-item.is-active .fd-palette-ico {
  background: #ffffff;
  color: var(--fd-primary);
}

.fd-palette-ico svg {
  width: 16px;
  height: 16px;
}

.fd-palette-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-palette-meta {
  flex: 0 0 auto;
  display: inline-grid;
  min-width: 22px;
  height: 20px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--fd-surface-soft);
  color: var(--fd-primary);
  font-size: 11px;
  font-weight: 800;
}

.fd-palette-empty {
  padding: 28px 16px;
  color: var(--fd-muted);
  font-size: 14px;
  font-weight: 650;
  text-align: center;
}

.fd-palette-foot {
  display: flex;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--fd-border);
  background: var(--fd-bg);
  color: var(--fd-muted);
  font-size: 12px;
  font-weight: 650;
}

/* ── Shell 2.0: Spotlight-style topbar search button ── */
.fd-topbar .fd-search {
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 14px !important;
  border: 1px solid var(--fd-border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fd-topbar .fd-search:hover,
.fd-topbar .fd-search:focus-visible {
  border-color: var(--fd-primary);
  box-shadow: 0 6px 18px rgba(16, 40, 23, 0.1);
  outline: none;
}

.fd-topbar .fd-search input[type="search"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  margin: -1px !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.fd-topbar .fd-search .fd-icon {
  color: var(--fd-muted);
}

.fd-topbar .fd-search:hover .fd-icon {
  color: var(--fd-primary);
}

.fd-topbar .fd-search .fd-key {
  display: inline-flex;
}

/* ── Shell 2.0: Panoramica mini-map ── */
.fd-minimap-section {
  margin: 24px 0;
}

.fd-minimap-card {
  overflow: hidden;
  border: 1px solid var(--fd-border);
  border-radius: 22px;
  background: #fdfdfd;
}

.fd-minimap-card .fd-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--fd-border);
}

.fd-minimap-open {
  color: var(--fd-primary);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fd-minimap-open:hover {
  color: var(--fd-primary-strong);
}

.fd-minimap-stage {
  position: relative;
  display: block;
  max-height: 420px;
  overflow: hidden;
  background: #f2f4f0;
}

.fd-minimap-stage img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.fd-minimap-zone {
  position: absolute;
  display: block;
  border: 2px solid var(--fd-zone);
  border-radius: 6px;
  background: color-mix(in srgb, var(--fd-zone) 28%, transparent);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.fd-minimap-stage:hover .fd-minimap-zone {
  background: color-mix(in srgb, var(--fd-zone) 42%, transparent);
}

.fd-minimap-floor {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(12, 24, 16, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
}

.fd-minimap-mosaic {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 22px;
}

.fd-minimap-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1.5px solid var(--fd-zone);
  border-radius: 10px;
  background: color-mix(in srgb, var(--fd-zone) 12%, #ffffff);
  color: var(--fd-text);
  font-size: 13px;
  font-weight: 700;
}

.fd-minimap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 22px;
  border-top: 1px solid var(--fd-border);
  color: var(--fd-muted);
  font-size: 12.5px;
  font-weight: 650;
}

.fd-minimap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fd-minimap-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ════════════════════════════════════════════════════════════
   UI 2.0 — New skins, sidebar fixes, Impostazioni, Surface 2.0
   (final layer, keep at EOF)
   ════════════════════════════════════════════════════════════ */

/* ── 3 nuovi skin ── */
html[data-fd-skin="viola"] {
  --fds-g1: #2e1065;
  --fds-g2: #6d28d9;
  --fds-g3: #8b5cf6;
  --fds-glow: rgba(139, 92, 246, 0.35);
  --fds-mark-ink: #2e1065;
  --fd-primary: #6d28d9;
  --fd-primary-strong: #5b21b6;
  --fd-surface-soft: #f1edfb;
}

html[data-fd-skin="bordeaux"] {
  --fds-g1: #4c0519;
  --fds-g2: #9f1239;
  --fds-g3: #e11d48;
  --fds-glow: rgba(225, 29, 72, 0.32);
  --fds-mark-ink: #4c0519;
  --fd-primary: #9f1239;
  --fd-primary-strong: #881337;
  --fd-surface-soft: #fdecf0;
}

html[data-fd-skin="oceano"] {
  --fds-g1: #042f2e;
  --fds-g2: #0f766e;
  --fds-g3: #14b8a6;
  --fds-glow: rgba(20, 184, 166, 0.32);
  --fds-mark-ink: #042f2e;
  --fd-primary: #0f766e;
  --fd-primary-strong: #115e59;
  --fd-surface-soft: #e7f6f4;
}

/* ── Sidebar: float completo + toggle sempre raggiungibile ── */
@media (min-width: 981px) {
  .fd-sidebar {
    top: 16px;
    height: calc(100vh - 32px);
    margin: 16px 0 16px 16px;
  }

  body.admin-bar .fd-sidebar {
    top: 48px;
    height: calc(100vh - 64px);
  }

  .fd-rail-edge {
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: background-color 0.16s ease, transform 0.2s ease;
  }

  .fd-rail-edge:hover,
  .fd-rail-edge:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    outline: none;
  }

  .fd-rail-edge svg {
    width: 15px;
    height: 15px;
    transition: transform 0.25s ease;
  }

  html.fd-rail .fd-rail-edge {
    margin-top: 10px;
  }

  html.fd-rail .fd-rail-edge svg {
    transform: rotate(180deg);
  }

  /* Rail: la nav torna scrollabile (il toggle ora sta in alto, sempre visibile) */
  html.fd-rail .fd-sidebar {
    overflow: hidden;
  }

  html.fd-rail .fd-nav {
    overflow-y: auto;
    overflow-x: hidden;
  }

  html.fd-rail .fd-nav-link::after {
    display: none !important;
  }

  html.fd-rail .fd-sidebar-footer {
    display: none;
  }
}

@media (max-width: 980px) {
  .fd-rail-edge {
    display: none;
  }
}

/* Tooltip flottante (JS, niente clipping) */
.fd-tipfloat {
  position: fixed;
  z-index: 2400;
  padding: 8px 13px;
  border-radius: 10px;
  background: #0b1411;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  transform: translateY(-50%);
  pointer-events: none;
}

.fd-tipfloat[hidden] {
  display: none;
}

/* ── Impostazioni ── */
.fd-imp-content {
  display: grid;
  gap: 20px;
  max-width: 980px;
}

.fd-imp-card {
  padding: 24px 26px;
  border-radius: 20px;
}

.fd-imp-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 850;
  color: var(--fd-text);
}

.fd-imp-head p {
  margin: 4px 0 18px;
  color: var(--fd-muted);
  font-size: 13.5px;
  font-weight: 600;
}

.fd-skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.fd-skin-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px;
  border: 1.5px solid var(--fd-border);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.fd-skin-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(15, 30, 20, 0.1);
}

.fd-skin-card.is-active {
  border-color: var(--fd-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fd-primary) 18%, transparent);
}

.fd-skin-card-prev {
  display: grid;
  width: 100%;
  height: 64px;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 11px;
}

.fd-skin-card-prev svg {
  width: 22px;
  height: 22px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.fd-skin-card.is-active .fd-skin-card-prev svg {
  opacity: 1;
}

.fd-skin-card strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--fd-text);
}

.fd-skin-card small {
  font-size: 12px;
  color: var(--fd-muted);
  font-weight: 600;
}

.fd-imp-toggle {
  padding: 11px 20px;
  border: 1px solid var(--fd-border);
  border-radius: 12px;
  background: #fff;
  color: var(--fd-text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
}

.fd-imp-toggle:hover {
  border-color: var(--fd-primary);
  color: var(--fd-primary);
}

.fd-imp-toggle .fd-imp-toggle-off { display: none; }
html.fd-rail .fd-imp-toggle .fd-imp-toggle-on { display: none; }
html.fd-rail .fd-imp-toggle .fd-imp-toggle-off { display: inline; }

.fd-imp-sys {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fd-imp-sys li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #edefe9;
  border-radius: 12px;
  font-size: 13.5px;
}

.fd-imp-sys span { color: var(--fd-muted); font-weight: 650; }
.fd-imp-sys strong { color: var(--fd-text); font-weight: 800; }

/* ── SURFACE 2.0 — un solo pianeta ──
   Canvas unico morbido: il main diventa trasparente, le card flottano,
   la topbar si fonde nel canvas, i bottoni parlano la lingua del tema. */
@media (min-width: 981px) {
  .fd-main {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

.fd-topbar {
  min-height: 84px;
  border-bottom: 0 !important;
  border-radius: 0 !important;
  background: color-mix(in srgb, var(--fd-bg) 88%, transparent) !important;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: none !important;
}

.fd-page-title {
  font-size: clamp(28px, 2.5vw, 38px) !important;
}

.fd-card:not([class*="-kpi"]) {
  border-color: #e8eae4 !important;
  box-shadow: 0 1px 2px rgba(15, 30, 20, 0.04), 0 18px 44px -26px rgba(15, 30, 20, 0.28) !important;
}

.fd-button,
[class*="primary-button"],
[class*="secondary-button"],
.ut-pren-new-btn,
.ut-ticket-new-btn {
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  border-radius: 12px !important;
  font-weight: 750 !important;
}

.ut-primary-button,
.ut-ticket-new-btn,
.ut-pren-new-btn:not(.is-event),
.ut-pren-submit-btn,
.ut-pren-approve-btn {
  border-color: var(--fd-primary) !important;
  background: var(--fd-primary) !important;
  color: #ffffff !important;
}

.ut-primary-button:hover,
.ut-primary-button:focus-visible,
.ut-ticket-new-btn:hover,
.ut-pren-new-btn:not(.is-event):hover,
.ut-pren-submit-btn:hover,
.ut-pren-approve-btn:hover {
  border-color: var(--fd-primary-strong) !important;
  background: var(--fd-primary-strong) !important;
  color: #ffffff !important;
}

.ut-secondary-button {
  background: #ffffff !important;
  color: var(--fd-text) !important;
}

.ut-secondary-button:hover,
.ut-secondary-button:focus-visible {
  background: var(--fd-surface-soft) !important;
  border-color: var(--fd-primary) !important;
  color: var(--fd-primary-strong) !important;
}

/* UI 2.0 — sidebar float geometry: nuclear override (legacy layers set top:0/height:100vh with higher specificity) */
@media (min-width: 981px) {
  html body .fd-app .fd-sidebar {
    position: sticky !important;
    top: 16px !important;
    height: calc(100vh - 32px) !important;
    margin: 16px 0 16px 16px !important;
  }

  html body.admin-bar .fd-app .fd-sidebar {
    top: 48px !important;
    height: calc(100vh - 64px) !important;
  }
}

/* ════════════════════════════════════════════════════════════
   UI 3.0 — Accordion nav, smooth rail, Qonto round, drag widgets
   ════════════════════════════════════════════════════════════ */

/* ── Accordion nav ── */
.fd-nav-section + .fd-nav-section {
  margin-top: 10px;
}

button.fd-nav-heading {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  transition: color 0.15s ease, background-color 0.15s ease;
}

button.fd-nav-heading:hover,
button.fd-nav-heading:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.85);
  outline: none;
}

.fd-nav-heading-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-nav-heading-count {
  display: inline-grid;
  min-width: 20px;
  height: 18px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 1;
  transition: opacity 0.15s ease;
}

.fd-nav-section.is-open .fd-nav-heading-count {
  opacity: 0;
}

.fd-nav-heading-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}

.fd-nav-section.is-open .fd-nav-heading-chevron {
  transform: rotate(180deg);
}

.fd-nav-section.has-acc .fd-nav-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.24s ease;
}

.fd-nav-section.has-acc.is-open .fd-nav-items {
  max-height: 640px;
}

/* ── Rail transition glitch fix: niente wrap, fade ritardato ── */
.fd-nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.14s ease 0.12s;
}

.fd-brand-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.14s ease 0.12s;
}

.fd-brand-title,
.fd-brand-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 981px) {
  html.fd-rail .fd-nav-label,
  html.fd-rail .fd-brand-text {
    opacity: 0;
    transition: opacity 0.08s ease;
  }

  html.fd-rail .fd-brand-text {
    position: absolute;
    pointer-events: none;
  }

  html.fd-rail .fd-nav-heading {
    display: none;
  }

  html.fd-rail .fd-nav-section.has-acc .fd-nav-items {
    max-height: none;
    overflow: visible;
  }

  html.fd-rail .fd-nav-section + .fd-nav-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
}

/* ── Round Qonto: card senza bordo, pillole ovunque ── */
.fd-card:not([class*="-kpi"]) {
  border-color: transparent !important;
  box-shadow: 0 1px 2px rgba(18, 28, 22, 0.05), 0 12px 34px -20px rgba(18, 28, 22, 0.25) !important;
}

.fd-button,
[class*="primary-button"],
[class*="secondary-button"],
.ut-ticket-new-btn,
.ut-pren-new-btn,
.ut-pren-cancel-btn,
.ut-pren-submit-btn {
  border-radius: 999px !important;
}

[class*="-toolbar"] select,
[class*="-filters"] select,
.ut-filter-dropdown-toggle,
[class*="-page-size"] select {
  border-radius: 999px !important;
}

[class*="-search-control"],
[class*="-search-control"] input,
[class*="-search-wrap"] input {
  border-radius: 999px !important;
}

.fd-topbar .fd-search {
  border-radius: 999px !important;
}

.fd-dialog-btn {
  border-radius: 999px !important;
}

/* ── Widget trascinabili (Panoramica) ── */
.fd-widget > header,
.fd-widget > h2,
.fd-widget .fd-panel-header {
  cursor: grab;
}

.fd-widget.is-dragging {
  opacity: 0.55;
  transform: scale(0.985);
  box-shadow: 0 24px 60px -20px rgba(18, 28, 22, 0.4) !important;
}

.fd-widget > header::after,
.fd-widget .fd-panel-header::after {
  content: '⠿';
  margin-left: auto;
  padding-left: 10px;
  color: var(--fd-muted);
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.fd-widget:hover > header::after,
.fd-widget:hover .fd-panel-header::after {
  opacity: 0.7;
}
