/* ================================================================
   NutriDash — main.css  v6
   Dark Dashboard — fedele a UI8 Core 2.0
   Tutte le variabili vengono sovrascritte da <style id="nd-cfg">
   generato da config.php (nd_output_config_css, priority 5)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── DEFAULT VARIABLES (fallback se nd-cfg non è caricato) ──── */
/* ── CSS CUSTOM PROPERTIES ──────────────────────────────────────
   TUTTE le variabili sono gestite da inc/config.php → nd_output_config_css()
   che viene iniettato via wp_add_inline_style DOPO questo file.
   Le variabili qui sotto sono FALLBACK di emergenza nel caso config.php
   non abbia ancora eseguito (es. primo caricamento senza salvataggio).
   ─────────────────────────────────────────────────────────────── */
:root {
  --nd-bg:#111315;--nd-surface:#1A1D21;--nd-surface-2:#222529;
  --nd-surface-3:#2A2D32;--nd-border:#272B30;--nd-border-light:#33383F;
  --nd-text:#FCFCFC;--nd-text-2:#9A9FA5;--nd-text-3:#6F767E;--nd-text-4:#4A4F56;
  --nd-blue:#77a034;--nd-blue-dim:rgba(119,160,52,.15);
  --nd-green:#83BF6E;--nd-green-dim:rgba(131,191,110,.15);
  --nd-orange:#FF6A55;--nd-orange-dim:rgba(255,106,85,.15);
  --nd-purple:#8E59FF;--nd-purple-dim:rgba(142,89,255,.15);
  --nd-yellow:#FFD166;--nd-yellow-dim:rgba(255,209,102,.15);
  --sidebar-w:260px;--header-h:68px;--content-p:26px;
  --r-sm:8px;--r-md:12px;--r-lg:16px;--r-xl:24px;--r-full:9999px;
  --shadow-sm:0 2px 8px rgba(0,0,0,.32);--shadow-md:0 4px 24px rgba(0,0,0,.4);
  --shadow-lg:0 8px 48px rgba(0,0,0,.52);
  --tr:all .22s cubic-bezier(.4,0,.2,1);--tr-f:all .14s cubic-bezier(.4,0,.2,1);
  --tr-dur:.22s;--tr-fast:.14s;--tr-ease:cubic-bezier(.4,0,.2,1);
  --nd-font:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  --nd-font-size:14px;--nd-h1:22px;--nd-h2:17px;--nd-h3:15px;--nd-h4:14px;
  --nd-font-sm:12px;--nd-nav-font:13.5px;
  --nd-fw-body:400;--nd-fw-heading:700;--nd-fw-ui:500;--nd-lh:1.5;--nd-ls:0;
  --btn-r:8px;--btn-px:16px;--btn-py:8px;--btn-fs:13px;--btn-fw:600;--btn-tt:none;
  --card-r:16px;--card-p:18px;--card-bd-w:1.5px;--card-shadow:none;
  --nav-r:8px;--nav-p:8px 10px;--nav-bar-w:3px;--nav-bar-c:#77a034;
  --nav-ico-size:18px;--bd-w:1.5px;
  --anim-stagger:.06s;
}

/* ── LIGHT MODE ─────────────────────────────────────────────── */
html.nd-light-pending body,
body.nd-light {
  --nd-bg:           #F4F5F6;
  --nd-surface:      #FFFFFF;
  --nd-surface-2:    #F4F5F6;
  --nd-surface-3:    #EAEBEC;
  --nd-border:       #E6E8EC;
  --nd-border-light: #D1D4D9;
  --nd-text:         #1A1D21;
  --nd-text-2:       #464C53;
  --nd-text-3:       #6F767E;
  --nd-text-4:       #9A9FA5;
}

/* ── ANTI-FOUC transition block ─────────────────────────────── */
html.nd-light-pending * { transition: none !important; }

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--nd-font-size); scroll-behavior: smooth; }
body {
  font-family: var(--nd-font);
  background: var(--nd-bg);
  color: var(--nd-text);
  line-height: var(--nd-lh);
  letter-spacing: var(--nd-ls);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; transition: var(--tr-f); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }
input, textarea, select {
  font-family: inherit;
  background: var(--nd-surface-2);
  border: var(--bd-w) solid var(--nd-border);
  color: var(--nd-text);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: var(--nd-font-size);
  transition: var(--tr);
  outline: none;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--nd-blue);
  box-shadow: 0 0 0 3px var(--nd-blue-dim);
}
select option { background: var(--nd-surface-2); }

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--nd-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--nd-border-light); }

/* ================================================================
   LAYOUT WRAPPER
   ================================================================ */
.nd-wrapper { display: flex; min-height: 100vh; }

/* ================================================================
   SIDEBAR
   ================================================================ */
.nd-sidebar {
  width: var(--sidebar-w);
  background: var(--nd-surface);
  border-right: var(--bd-w) solid var(--nd-border);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--nd-border) transparent;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  flex-shrink: 0;
}
.nd-sidebar::-webkit-scrollbar { width: 3px; }
.nd-sidebar::-webkit-scrollbar-thumb { background: var(--nd-border); border-radius: 2px; }

/* Logo */
.nd-sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 18px;
  border-bottom: var(--bd-w) solid var(--nd-border);
  flex-shrink: 0;
}
.nd-sidebar__logo-icon {
  width: 34px; height: 34px;
  background: var(--nd-blue);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
  flex-shrink: 0;
  letter-spacing: -.5px;
}
.nd-sidebar__logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--nd-text);
  letter-spacing: -.3px;
  line-height: 1.2;
}
.nd-sidebar__logo-sub {
  font-size: 11px;
  color: var(--nd-text-3);
  font-weight: 500;
  margin-top: 1px;
}

/* Nav */
.nd-nav {
  flex: 1;
  padding: 10px 12px 8px;
}
.nd-nav > ul,
.nd-nav__sub {
  list-style: none;
  margin: 0; padding: 0;
}
.nd-nav__section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--nd-text-4);
  text-transform: uppercase;
  letter-spacing: .09em;
  padding: 14px 8px 5px;
}

/* Nav Item */
.nd-nav__item { position: relative; margin-bottom: var(--nav-gap, 1px); }
.nd-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--nav-p);
  border-radius: var(--nav-r);
  color: var(--nd-text-2);
  font-size: var(--nd-nav-font);
  font-weight: var(--nd-fw-ui);
  transition: background var(--tr-fast), color var(--tr-fast);
  cursor: pointer;
  position: relative;
  text-decoration: none;
  line-height: 1.4;
}
.nd-nav__link:hover {
  background: var(--nd-surface-2);
  color: var(--nd-text);
}
/* Rimuovi la barra attiva su hover (solo su .active deve apparire) */
.nd-nav__link:hover:not(.active)::before { display: none; }
.nd-nav__link.active {
  background: var(--nd-surface-3);
  color: var(--nd-text);
  font-weight: 600;
}
/* Active bar on left */
.nd-nav__link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: var(--nav-bar-w);
  height: 20px;
  background: var(--nav-bar-c);
  border-radius: 0 3px 3px 0;
}
.nd-nav__icon {
  width: var(--nav-ico-size);
  height: var(--nav-ico-size);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  opacity: .65;
  transition: opacity var(--tr-fast);
}
.nd-nav__link:hover .nd-nav__icon,
.nd-nav__link.active .nd-nav__icon { opacity: 1; }

/* Badge */
.nd-nav__badge {
  margin-left: auto;
  background: var(--nd-orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--r-full);
  min-width: 19px;
  text-align: center;
  flex-shrink: 0;
}
.nd-nav__badge.green  { background: var(--nd-green); }
.nd-nav__badge.blue   { background: var(--nd-blue); }
.nd-nav__badge.purple { background: var(--nd-purple); }

/* Chevron */
.nd-nav__chevron {
  margin-left: auto;
  width: 15px; height: 15px;
  opacity: .4;
  flex-shrink: 0;
  transition: transform .2s ease, opacity .2s;
}
.nd-nav__item.open > .nd-nav__link .nd-nav__chevron {
  transform: rotate(180deg);
  opacity: .7;
}

/* Submenu */
.nd-nav__sub {
  display: none;
  padding: 2px 0 2px 28px;
  margin-top: 1px;
}
.nd-nav__item.open > .nd-nav__sub { display: block; }
.nd-nav__sub .nd-nav__link {
  font-size: 13px;
  padding: 6px 10px;
  color: var(--nd-text-3);
}
.nd-nav__sub .nd-nav__link:hover { color: var(--nd-text); background: var(--nd-surface-2); }
.nd-nav__sub .nd-nav__link.active {
  color: var(--nd-text);
  background: var(--nd-surface-2);
}
.nd-nav__sub .nd-nav__link.active::before { height: 14px; }

/* Sidebar footer */
.nd-sidebar__footer {
  padding: 12px;
  border-top: var(--bd-w) solid var(--nd-border);
  flex-shrink: 0;
}
.nd-sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: var(--tr-f);
}
.nd-sidebar__user:hover { background: var(--nd-surface-2); }
.nd-sidebar__avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--nd-surface-3);
  flex-shrink: 0;
  border: 1.5px solid var(--nd-border-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--nd-blue);
  overflow: hidden;
}
.nd-sidebar__user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--nd-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.nd-sidebar__user-role { font-size: 11px; color: var(--nd-text-3); }

/* ================================================================
   MAIN CONTENT AREA
   ================================================================ */
.nd-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ================================================================
   TOPBAR / HEADER
   ================================================================ */
.nd-header {
  height: var(--header-h);
  background: var(--nd-surface);
  border-bottom: var(--bd-w) solid var(--nd-border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}
.nd-header__title {
  font-size: var(--nd-h2);
  font-weight: var(--nd-fw-heading);
  color: var(--nd-text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.3px;
}

/* Search */
.nd-search { position: relative; flex: 1; max-width: 380px; }
.nd-search__icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--nd-text-3);
  pointer-events: none;
  width: 15px; height: 15px;
}
.nd-search__input {
  background: var(--nd-surface-2);
  border: var(--bd-w) solid var(--nd-border);
  border-radius: var(--r-full);
  padding: 8px 14px 8px 38px;
  font-size: 13px;
  color: var(--nd-text);
  transition: var(--tr);
  width: 100%;
}
.nd-search__input::placeholder { color: var(--nd-text-3); }
.nd-search__input:focus {
  border-color: var(--nd-blue);
  box-shadow: 0 0 0 3px var(--nd-blue-dim);
  background: var(--nd-surface-3);
}

/* Search dropdown */
.nd-search__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--nd-surface);
  border: var(--bd-w) solid var(--nd-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 200;
  overflow: hidden;
  animation: ndFadeDown .18s ease;
}
.nd-search__dropdown.open { display: block; }
.nd-search__section {
  padding: 9px 14px 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--nd-text-4);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.nd-search__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px;
  cursor: pointer;
  transition: var(--tr-f);
}
.nd-search__item:hover { background: var(--nd-surface-2); }
.nd-search__item-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--nd-blue-dim);
  display: flex; align-items: center; justify-content: center;
  color: var(--nd-blue);
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.nd-search__item-name { font-size: 13px; font-weight: 500; color: var(--nd-text); }
.nd-search__item-meta { font-size: 11px; color: var(--nd-text-3); margin-top: 1px; }
.nd-search__item-badge { margin-left: auto; }
.nd-search__empty { padding: 16px 14px; text-align: center; color: var(--nd-text-3); font-size: 13px; }

/* Header action buttons */
.nd-header__actions { display: flex; align-items: center; gap: 4px; }
.nd-header__btn {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--nd-text-2);
  cursor: pointer;
  position: relative;
  transition: var(--tr-f);
  background: transparent;
  flex-shrink: 0;
}
.nd-header__btn:hover { background: var(--nd-surface-2); color: var(--nd-text); }
.nd-header__btn-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--nd-orange);
  border-radius: 50%;
  border: 2px solid var(--nd-surface);
}
.nd-header__btn-dot.blue { background: var(--nd-blue); }
.nd-count-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 16px; height: 16px;
  background: var(--nd-orange);
  color: #fff;
  font-size: 9px; font-weight: 700;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--nd-surface);
  padding: 0 2px;
}
.nd-header__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 1.5px solid var(--nd-border-light);
  transition: var(--tr-f);
  flex-shrink: 0;
  background: var(--nd-surface-3);
  display: flex; align-items: center; justify-content: center;
}
.nd-header__avatar:hover { border-color: var(--nd-blue); }
.nd-header__avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Theme toggle */
.nd-theme-toggle {
  width: 40px; height: 22px;
  background: var(--nd-surface-3);
  border-radius: var(--r-full);
  position: relative;
  cursor: pointer;
  transition: var(--tr);
  border: var(--bd-w) solid var(--nd-border);
  flex-shrink: 0;
}
.nd-theme-toggle.light { background: var(--nd-blue); border-color: var(--nd-blue); }
.nd-theme-toggle__knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: left .2s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.nd-theme-toggle.light .nd-theme-toggle__knob { left: calc(100% - 16px); }

/* ================================================================
   DROPDOWNS
   ================================================================ */
.nd-dropdown-wrap { position: relative; }
.nd-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--nd-surface);
  border: var(--bd-w) solid var(--nd-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  display: none;
  z-index: 300;
  overflow: hidden;
  animation: ndFadeDown .18s ease;
}
.nd-dropdown.open { display: block; }
.nd-dropdown__head {
  padding: 14px 18px 10px;
  border-bottom: var(--bd-w) solid var(--nd-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nd-dropdown__head-title { font-size: 14px; font-weight: 700; color: var(--nd-text); }
.nd-dropdown__head-action {
  font-size: 12px;
  color: var(--nd-blue);
  cursor: pointer;
  font-weight: 500;
}
.nd-dropdown__head-action:hover { text-decoration: underline; }
.nd-dropdown__footer {
  padding: 10px 18px;
  text-align: center;
  border-top: var(--bd-w) solid var(--nd-border);
}
.nd-dropdown__footer a { font-size: 13px; color: var(--nd-blue); font-weight: 500; }
.nd-dropdown__footer a:hover { text-decoration: underline; }

/* Notification items */
.nd-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--nd-border);
  cursor: pointer;
  transition: var(--tr-f);
  position: relative;
}
.nd-notif-item:last-child { border-bottom: none; }
.nd-notif-item:hover { background: var(--nd-surface-2); }
.nd-notif-item.unread::before {
  content: '';
  position: absolute;
  left: 5px; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  background: var(--nd-blue);
  border-radius: 50%;
}
.nd-notif-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--nd-blue-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.nd-notif-text { font-size: 13px; color: var(--nd-text-2); line-height: 1.4; }
.nd-notif-text strong { color: var(--nd-text); font-weight: 600; }
.nd-notif-time { font-size: 11px; color: var(--nd-text-4); margin-top: 3px; }

/* Profile dropdown */
.nd-profile-dd { min-width: 210px; }
.nd-profile-dd__user {
  padding: 14px 18px;
  border-bottom: var(--bd-w) solid var(--nd-border);
  display: flex; align-items: center; gap: 10px;
}
.nd-profile-dd__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--nd-surface-3);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  overflow: hidden;
}
.nd-profile-dd__name { font-size: 13px; font-weight: 600; color: var(--nd-text); }
.nd-profile-dd__email { font-size: 11px; color: var(--nd-text-3); margin-top: 1px; }
.nd-profile-dd__menu { padding: 6px 0; }
.nd-profile-dd__item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  font-size: 13px;
  color: var(--nd-text-2);
  cursor: pointer;
  transition: var(--tr-f);
  text-decoration: none;
}
.nd-profile-dd__item:hover { background: var(--nd-surface-2); color: var(--nd-text); }
.nd-profile-dd__item.danger { color: var(--nd-orange); }
.nd-profile-dd__item.danger:hover { background: var(--nd-orange-dim); }
.nd-profile-dd__sep { height: 1px; background: var(--nd-border); margin: 4px 0; }

/* ================================================================
   CHAT PANEL
   ================================================================ */
.nd-chat {
  position: fixed;
  right: 20px; bottom: 20px;
  width: 340px;
  max-height: 500px;
  background: var(--nd-surface);
  border: var(--bd-w) solid var(--nd-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  z-index: 400;
  animation: ndSlideUp .28s cubic-bezier(.4,0,.2,1);
}
.nd-chat.open { display: flex; }
.nd-chat__head {
  padding: 14px 18px;
  border-bottom: var(--bd-w) solid var(--nd-border);
  display: flex; align-items: center; gap: 9px;
  flex-shrink: 0;
}
.nd-chat__title { font-size: 14px; font-weight: 700; flex: 1; color: var(--nd-text); }
.nd-chat__close {
  width: 26px; height: 26px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--nd-text-3);
  cursor: pointer;
  transition: var(--tr-f);
}
.nd-chat__close:hover { background: var(--nd-surface-2); color: var(--nd-text); }
.nd-chat__list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--nd-border) transparent;
}
.nd-chat-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px;
  cursor: pointer;
  transition: var(--tr-f);
}
.nd-chat-item:hover { background: var(--nd-surface-2); }
.nd-chat-item__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  flex-shrink: 0;
  background: var(--nd-surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  overflow: hidden;
}
.nd-chat-item__online {
  position: absolute;
  bottom: 0; right: 0;
  width: 9px; height: 9px;
  background: var(--nd-green);
  border-radius: 50%;
  border: 2px solid var(--nd-surface);
}
.nd-chat-item__name { font-size: 13px; font-weight: 600; color: var(--nd-text); }
.nd-chat-item__msg {
  font-size: 12px;
  color: var(--nd-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.nd-chat-item__time { margin-left: auto; font-size: 11px; color: var(--nd-text-4); flex-shrink: 0; }
.nd-chat__footer {
  padding: 10px 14px;
  border-top: var(--bd-w) solid var(--nd-border);
  display: flex; gap: 8px;
  flex-shrink: 0;
}
.nd-chat__footer input { flex: 1; padding: 7px 12px; border-radius: var(--r-full); font-size: 13px; }
.nd-chat__send {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--nd-blue);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--tr-f);
}
.nd-chat__send:hover { background: #0070dd; transform: scale(1.06); }

/* ================================================================
   CONTENT AREA
   ================================================================ */
.nd-content {
  flex: 1;
  padding: var(--content-p) calc(var(--content-p) * 0.9);
}

/* Page header */
.nd-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 14px;
}
.nd-page-title {
  font-size: var(--nd-h1);
  font-weight: var(--nd-fw-heading);
  color: var(--nd-text);
  letter-spacing: -.5px;
  line-height: 1.2;
}
.nd-page-sub { font-size: 13px; color: var(--nd-text-3); margin-top: 3px; }
.nd-page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* Breadcrumb */
.nd-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--nd-text-3);
  margin-bottom: 18px;
}
.nd-breadcrumb a { color: var(--nd-text-3); }
.nd-breadcrumb a:hover { color: var(--nd-text); }
.nd-breadcrumb__sep { color: var(--nd-text-4); }
.nd-breadcrumb__cur { color: var(--nd-text); font-weight: 500; }

/* Period selector */
.nd-period {
  display: flex; gap: 2px;
  background: var(--nd-surface-2);
  border: var(--bd-w) solid var(--nd-border);
  border-radius: var(--r-sm);
  padding: 3px;
}
.nd-period__btn {
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--nd-text-3);
  cursor: pointer;
  transition: var(--tr-f);
  background: transparent;
}
.nd-period__btn.active { background: var(--nd-surface-3); color: var(--nd-text); }
.nd-period__btn:hover:not(.active) { color: var(--nd-text-2); }

/* ================================================================
   STAT CARDS
   ================================================================ */
.nd-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.nd-stat-card {
  background: var(--nd-surface);
  border: var(--card-bd-w) solid var(--nd-border);
  border-radius: var(--card-r);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: var(--tr);
  box-shadow: var(--card-shadow);
}
.nd-stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--c-accent, var(--nd-blue));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.nd-stat-card:hover {
  border-color: var(--nd-border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.nd-stat-card:hover::after { transform: scaleX(1); }
.nd-stat-card__ico {
  position: absolute;
  top: 16px; right: 16px;
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--c-dim, var(--nd-blue-dim));
  color: var(--c-accent, var(--nd-blue));
  font-size: 18px;
}
.nd-stat-card__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--nd-text-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 8px;
}
.nd-stat-card__value {
  font-size: 26px;
  font-weight: 800;
  color: var(--nd-text);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 7px;
}
.nd-stat-card__change {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}
.nd-stat-card__change.up   { color: var(--nd-green); }
.nd-stat-card__change.down { color: var(--nd-orange); }
.nd-stat-card__vs { color: var(--nd-text-3); font-weight: 400; margin-left: 2px; }

/* ================================================================
   GRID LAYOUTS
   ================================================================ */
.nd-grid { display: grid; gap: 18px; }
.nd-grid-2   { grid-template-columns: repeat(2, 1fr); }
.nd-grid-3   { grid-template-columns: repeat(3, 1fr); }
.nd-grid-4   { grid-template-columns: repeat(4, 1fr); }
.nd-grid-2-1 { grid-template-columns: 2fr 1fr; }
.nd-grid-3-1 { grid-template-columns: 3fr 1fr; }
.nd-grid-1-2 { grid-template-columns: 1fr 2fr; }

/* ================================================================
   CARD
   ================================================================ */
.nd-card {
  background: var(--nd-surface);
  border: var(--card-bd-w) solid var(--nd-border);
  border-radius: var(--card-r);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: border-color var(--tr-f);
}
.nd-card:hover { border-color: var(--nd-border-light); }
.nd-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 13px;
  border-bottom: var(--bd-w) solid var(--nd-border);
}
.nd-card__title {
  font-size: var(--nd-h3);
  font-weight: 700;
  color: var(--nd-text);
  letter-spacing: -.2px;
}
.nd-card__body { padding: var(--card-p); }
.nd-card__foot {
  padding: 12px 18px;
  border-top: var(--bd-w) solid var(--nd-border);
}

/* Chart wrapper */
.nd-chart { position: relative; height: 220px; width: 100%; }

/* ================================================================
   TABLE
   ================================================================ */
.nd-table-wrap { overflow-x: auto; }
.nd-table { width: 100%; border-collapse: collapse; }
.nd-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--nd-text-4);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 10px 14px;
  border-bottom: var(--bd-w) solid var(--nd-border);
  white-space: nowrap;
}
.nd-table th[data-sort] { cursor: pointer; user-select: none; }
.nd-table th[data-sort]:hover { color: var(--nd-text-2); }
.nd-table td {
  padding: 13px 14px;
  font-size: 13px;
  color: var(--nd-text-2);
  border-bottom: 1px solid var(--nd-border);
  vertical-align: middle;
}
.nd-table tr:last-child td { border-bottom: none; }
.nd-table tbody tr { transition: var(--tr-f); cursor: pointer; }
.nd-table tbody tr:hover { background: var(--nd-surface-2); }
.nd-table__cell-user { display: flex; align-items: center; gap: 9px; }
.nd-table__cell-user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--nd-blue-dim);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: var(--nd-blue);
  overflow: hidden;
}
.nd-table__name { font-size: 13px; font-weight: 600; color: var(--nd-text); }
.nd-table__sub  { font-size: 11px; color: var(--nd-text-3); }

/* ================================================================
   BADGES
   ================================================================ */
.nd-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.nd-badge::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.nd-badge.active   { background: var(--nd-green-dim);  color: var(--nd-green); }
.nd-badge.inactive { background: var(--nd-surface-3);  color: var(--nd-text-3); }
.nd-badge.pending  { background: var(--nd-yellow-dim); color: var(--nd-yellow); }
.nd-badge.urgent   { background: var(--nd-orange-dim); color: var(--nd-orange); }
.nd-badge.new      { background: var(--nd-blue-dim);   color: var(--nd-blue); }

/* ================================================================
   BUTTONS
   ================================================================ */
.nd-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: var(--btn-py) var(--btn-px);
  border-radius: var(--btn-r);
  font-size: var(--btn-fs);
  font-weight: var(--btn-fw);
  text-transform: var(--btn-tt);
  cursor: pointer;
  transition: var(--tr-f);
  border: var(--bd-w) solid transparent;
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
  line-height: 1.4;
}
.nd-btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.nd-btn-primary {
  background: var(--nd-blue);
  color: #fff;
  border-color: var(--nd-blue);
}
.nd-btn-primary:hover {
  background: #0070dd;
  box-shadow: 0 4px 12px rgba(0,132,255,.35);
}
.nd-btn-secondary {
  background: var(--nd-surface-2);
  color: var(--nd-text);
  border-color: var(--nd-border);
}
.nd-btn-secondary:hover { background: var(--nd-surface-3); border-color: var(--nd-border-light); }
.nd-btn-ghost {
  background: transparent;
  color: var(--nd-text-2);
  border-color: transparent;
}
.nd-btn-ghost:hover { background: var(--nd-surface-2); color: var(--nd-text); }
.nd-btn-danger { background: var(--nd-orange-dim); color: var(--nd-orange); }
.nd-btn-danger:hover { background: var(--nd-orange); color: #fff; }
.nd-btn-sm { padding: 5px 11px; font-size: 12px; }
.nd-btn-lg { padding: 11px 22px; font-size: 14px; }

/* ================================================================
   ALERTS
   ================================================================ */
.nd-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  border: var(--bd-w) solid;
  margin-bottom: 18px;
  animation: ndFadeDown .25s ease;
}
.nd-alert__icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.nd-alert__body { flex: 1; }
.nd-alert__title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.nd-alert__text  { font-size: 12px; opacity: .85; color: var(--nd-text-2); }
.nd-alert__close { cursor: pointer; opacity: .5; transition: var(--tr-f); flex-shrink: 0; font-size: 14px; }
.nd-alert__close:hover { opacity: 1; }
.nd-alert.info    { background: var(--nd-blue-dim);   border-color: var(--nd-blue);   color: var(--nd-blue); }
.nd-alert.success { background: var(--nd-green-dim);  border-color: var(--nd-green);  color: var(--nd-green); }
.nd-alert.warning { background: var(--nd-yellow-dim); border-color: var(--nd-yellow); color: var(--nd-yellow); }
.nd-alert.danger  { background: var(--nd-orange-dim); border-color: var(--nd-orange); color: var(--nd-orange); }

/* ================================================================
   PROGRESS
   ================================================================ */
.nd-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--nd-text-3);
  margin-bottom: 5px;
  font-weight: 500;
}
.nd-progress-label strong { color: var(--nd-text); }
.nd-progress {
  height: 5px;
  background: var(--nd-surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 13px;
}
.nd-progress__fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--nd-blue);
  transition: width 1s cubic-bezier(.4,0,.2,1);
  width: 0%;
}
.nd-progress__fill.green  { background: var(--nd-green); }
.nd-progress__fill.orange { background: var(--nd-orange); }
.nd-progress__fill.purple { background: var(--nd-purple); }

/* ================================================================
   CALENDAR WIDGET
   ================================================================ */
.nd-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.nd-cal-month  { font-size: 13px; font-weight: 700; color: var(--nd-text); }
.nd-cal-nav    { display: flex; gap: 3px; }
.nd-cal-nav button {
  width: 26px; height: 26px;
  border-radius: var(--r-sm);
  background: var(--nd-surface-2);
  border: var(--bd-w) solid var(--nd-border);
  color: var(--nd-text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--tr-f);
}
.nd-cal-nav button:hover { background: var(--nd-surface-3); color: var(--nd-text); }
.nd-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.nd-cal-day-lbl {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--nd-text-4);
  text-align: center;
  padding: 2px 0;
  text-transform: uppercase;
}
.nd-cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--nd-text-2);
  cursor: pointer;
  transition: var(--tr-f);
  position: relative;
}
.nd-cal-cell:hover { background: var(--nd-surface-2); color: var(--nd-text); }
.nd-cal-cell.today {
  background: var(--nd-blue);
  color: #fff;
  font-weight: 700;
}
.nd-cal-cell.has-event::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 50%;
  transform: translateX(-50%);
  width: 3px; height: 3px;
  background: var(--nd-green);
  border-radius: 50%;
}
.nd-cal-cell.other-month { opacity: .22; cursor: default; }
.nd-cal-cell.other-month:hover { background: transparent; }

/* ================================================================
   APPOINTMENT
   ================================================================ */
.nd-appt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--nd-border);
  transition: var(--tr-f);
}
.nd-appt:last-child { border-bottom: none; }
.nd-appt:hover { opacity: .78; }
.nd-appt__time { font-size: 11px; font-weight: 700; color: var(--nd-text-3); min-width: 42px; text-align: right; }
.nd-appt__line {
  width: 3px; height: 36px;
  border-radius: 2px;
  background: var(--nd-blue);
  flex-shrink: 0;
}
.nd-appt__line.green  { background: var(--nd-green); }
.nd-appt__line.orange { background: var(--nd-orange); }
.nd-appt__line.purple { background: var(--nd-purple); }
.nd-appt__name { font-size: 13px; font-weight: 600; color: var(--nd-text); }
.nd-appt__type { font-size: 11px; color: var(--nd-text-3); margin-top: 1px; }
.nd-appt__status { margin-left: auto; }

/* ================================================================
   INVOICE ROW
   ================================================================ */
.nd-invoice-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--nd-border);
  transition: var(--tr-f);
}
.nd-invoice-row:last-child { border-bottom: none; }
.nd-invoice-row:hover { opacity: .75; }
.nd-invoice-row__icon {
  width: 34px; height: 34px;
  background: var(--nd-surface-2);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--nd-blue);
  flex-shrink: 0;
}
.nd-invoice-row__desc {
  font-size: 13px; font-weight: 600;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nd-invoice-row__patient { font-size: 11px; color: var(--nd-text-3); }
.nd-invoice-row__amount { font-size: 13px; font-weight: 700; flex-shrink: 0; }
.nd-invoice-row__amount.positive { color: var(--nd-green); }

/* ================================================================
   TOOLTIP (CSS only)
   ================================================================ */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--nd-surface-3);
  color: var(--nd-text);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--nd-border);
  z-index: 1000;
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================================================================
   TOAST NOTIFICATION
   ================================================================ */
.nd-toast-wrap {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  pointer-events: none;
}
.nd-toast {
  background: var(--nd-surface);
  border: var(--bd-w) solid var(--nd-border);
  color: var(--nd-text);
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: ndSlideUp .25s ease;
  max-width: 340px;
}

/* ================================================================
   DASHBOARD WIDGET SYSTEM
   ================================================================ */
.nd-dashboard-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.nd-dashboard-toolbar__editing { display: flex; align-items: center; gap: 8px; }
.nd-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  align-items: start;
}
.nd-dashboard-card-wrap { position: relative; }
/* Default card spans */
[data-card-id="stats"]      { grid-column: span 12; }
[data-card-id="revenue"]    { grid-column: span 8; }
[data-card-id="today"]      { grid-column: span 4; }
[data-card-id="patients"]   { grid-column: span 4; }
[data-card-id="appt_chart"] { grid-column: span 4; }
[data-card-id="donut"]      { grid-column: span 4; }
[data-card-id="weight"]     { grid-column: span 8; }
[data-card-id="calendar"]   { grid-column: span 4; }
[data-card-id="quick"]      { grid-column: span 4; }
[data-card-id="progress"]   { grid-column: span 6; }
[data-card-id="invoices"]   { grid-column: span 6; }
.nd-card-full { grid-column: span 12 !important; }
/* Drag handle */
.nd-card-drag-handle {
  position: absolute;
  top: 13px; right: 13px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
  color: var(--nd-text-4);
  font-size: 14px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
}
.nd-dashboard-editing .nd-card-drag-handle { opacity: 1; }
.nd-dashboard-editing .nd-dashboard-card-wrap {
  outline: 1.5px dashed var(--nd-border-light);
  border-radius: var(--card-r);
}
.nd-dashboard-editing .nd-dashboard-card-wrap:hover { outline-color: var(--nd-blue); }
.nd-dashboard-editing .nd-dashboard-card-wrap.ui-sortable-placeholder {
  outline: 2px dashed var(--nd-blue);
  background: var(--nd-blue-dim);
  border-radius: var(--card-r);
  visibility: visible !important;
}

/* ================================================================
   FOOTER
   ================================================================ */
/* Widget area nel footer */
.nd-footer-widgets {
  padding: 18px calc(var(--content-p) * 0.9);
  border-top: var(--bd-w) solid var(--nd-border);
  background: var(--nd-surface);
}
.nd-footer-widgets .widget {
  margin-bottom: 12px;
}
.nd-footer-widgets .widget:last-child { margin-bottom: 0; }
.nd-footer-widgets .widget-title {
  font-size: var(--nd-h4);
  font-weight: var(--nd-fw-heading);
  color: var(--nd-text);
  margin-bottom: 8px;
}
.nd-footer {
  border-top: var(--bd-w) solid var(--nd-border);
  background: var(--nd-surface);
  padding: 14px calc(var(--content-p) * 0.9);
  flex-shrink: 0;
}
.nd-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.nd-footer__copy { font-size: 12px; color: var(--nd-text-3); }
.nd-footer__links { display: flex; gap: 16px; margin: 0; padding: 0; list-style: none; }
.nd-footer__links a { font-size: 12px; color: var(--nd-text-3); }
.nd-footer__links a:hover { color: var(--nd-text); }
.nd-footer__info { display: flex; align-items: center; gap: 7px; }
.nd-footer__badge {
  font-size: 10px;
  font-weight: 600;
  background: var(--nd-surface-2);
  color: var(--nd-text-4);
  padding: 2px 8px;
  border-radius: var(--r-full);
  border: 1px solid var(--nd-border);
}

/* ================================================================
   MOBILE HAMBURGER + OVERLAY
   ================================================================ */
.nd-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 7px;
  border-radius: var(--r-sm);
  transition: var(--tr-f);
  flex-shrink: 0;
}
.nd-hamburger:hover { background: var(--nd-surface-2); }
.nd-hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--nd-text-2);
  border-radius: 2px;
  transition: var(--tr);
}
.nd-sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.nd-sidebar-overlay.open { display: block; }

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes ndFadeDown  { from { opacity:0; transform:translateY(-7px); } to { opacity:1; transform:translateY(0); } }
@keyframes ndSlideUp   { from { opacity:0; transform:translateY(12px);  } to { opacity:1; transform:translateY(0); } }
@keyframes ndFadeIn    { from { opacity:0; } to { opacity:1; } }
@keyframes ndShimmer   { 0% { background-position:200% 0; } 100% { background-position:-200% 0; } }
@keyframes ndPulse     { 0%,100%{opacity:1;} 50%{opacity:.45;} }

/* Staggered entrance animation */
.nd-animate { animation: ndFadeDown .36s cubic-bezier(.4,0,.2,1) both; }
.nd-animate:nth-child(2)  { animation-delay: var(--anim-stagger, .06s); }
.nd-animate:nth-child(3)  { animation-delay: calc(var(--anim-stagger, .06s) * 2); }
.nd-animate:nth-child(4)  { animation-delay: calc(var(--anim-stagger, .06s) * 3); }
.nd-animate:nth-child(5)  { animation-delay: calc(var(--anim-stagger, .06s) * 4); }
.nd-animate:nth-child(6)  { animation-delay: calc(var(--anim-stagger, .06s) * 5); }
.nd-animate:nth-child(7)  { animation-delay: calc(var(--anim-stagger, .06s) * 6); }
.nd-animate:nth-child(8)  { animation-delay: calc(var(--anim-stagger, .06s) * 7); }
.nd-animate:nth-child(9)  { animation-delay: calc(var(--anim-stagger, .06s) * 8); }
.nd-animate:nth-child(10) { animation-delay: calc(var(--anim-stagger, .06s) * 9); }
.nd-animate:nth-child(11) { animation-delay: calc(var(--anim-stagger, .06s) * 10); }

/* Skeleton loading */
.nd-skeleton {
  background: linear-gradient(90deg, var(--nd-surface-2) 25%, var(--nd-surface-3) 50%, var(--nd-surface-2) 75%);
  background-size: 200% 100%;
  animation: ndShimmer 1.4s infinite;
  border-radius: var(--r-sm);
}

/* ================================================================
   WP ADMIN BAR
   ================================================================ */
/* Quando admin bar è visibile (admin loggato) */
.admin-bar .nd-sidebar { top: 32px; height: calc(100vh - 32px); }
.admin-bar .nd-header  { top: 32px; }
@media (max-width: 782px) {
    .admin-bar .nd-sidebar { top: 46px; height: calc(100vh - 46px); }
    .admin-bar .nd-header  { top: 46px; }
}
/* Quando admin bar è nascosta: azzera qualsiasi spazio residuo */
body:not(.admin-bar) #wpadminbar { display: none !important; height: 0 !important; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1280px) {
  [data-card-id="revenue"] { grid-column: span 12; }
  [data-card-id="today"]   { grid-column: span 12; }
  .nd-grid-3   { grid-template-columns: repeat(2, 1fr); }
  .nd-grid-4   { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .nd-grid-2-1 { grid-template-columns: 1fr; }
  .nd-grid-3-1 { grid-template-columns: 1fr; }
  .nd-grid-1-2 { grid-template-columns: 1fr; }
  .nd-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .nd-sidebar { width: 260px; transform: translateX(-100%); }
  .nd-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .nd-main { margin-left: 0; }
  .nd-hamburger { display: flex; }
  .nd-search { max-width: 200px; }
  .nd-content { padding: 18px 14px; }
  .nd-chat { right:0; bottom:0; width:100%; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .nd-dashboard-grid { grid-template-columns: 1fr !important; }
  [data-card-id] { grid-column: 1 !important; }
}
@media (max-width: 560px) {
  .nd-stats-grid { grid-template-columns: 1fr; }
  .nd-grid-2, .nd-grid-3, .nd-grid-4 { grid-template-columns: 1fr; }
  .nd-header { padding: 0 14px; gap: 8px; }
  .nd-search { max-width: 140px; }
  .nd-header__title { font-size: 15px; }
}


/* ================================================================
   UI8-CORE-2 ENHANCEMENTS — Aggiunti per NutriDash v10
   ================================================================ */

/* ── Micro-animazioni entry ─────────────────────────────────── */
@keyframes nd-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes nd-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes nd-scale-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes nd-slide-right {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.nd-card { animation: nd-fade-up .3s cubic-bezier(.4,0,.2,1) both; }
.nd-card:nth-child(1) { animation-delay: 0s; }
.nd-card:nth-child(2) { animation-delay: .05s; }
.nd-card:nth-child(3) { animation-delay: .1s; }
.nd-card:nth-child(4) { animation-delay: .15s; }

/* ── Header backdrop blur ────────────────────────────────────── */
.nd-header {
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  background: color-mix(in srgb, var(--nd-bg) 85%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--nd-border) 60%, transparent);
}
body.nd-light .nd-header {
  background: color-mix(in srgb, #fff 88%, transparent);
}

/* ── Sidebar nav items con indicatore laterale migliorato ───── */
.nd-nav__link {
  overflow: hidden;
}
.nd-nav__link::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  border-radius: inherit;
  transition: background var(--tr-fast);
}
.nd-nav__link:hover::after {
  background: color-mix(in srgb, var(--nd-text) 4%, transparent);
}
.nd-nav__link.active::after {
  background: color-mix(in srgb, var(--nav-bar-c) 8%, transparent);
}

/* ── Card hover con glow sottile ────────────────────────────── */
.nd-card {
  transition: transform var(--tr-dur) var(--tr-ease),
              border-color var(--tr-dur) var(--tr-ease),
              box-shadow var(--tr-dur) var(--tr-ease);
}
.nd-card:hover {
  border-color: color-mix(in srgb, var(--nd-blue) 30%, var(--nd-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--nd-blue) 15%, transparent),
              var(--shadow-sm);
}

/* ── Focus rings accessibili e moderni ──────────────────────── */
:focus-visible {
  outline: 2px solid var(--nd-blue);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--nd-blue);
  outline-offset: 2px;
}

/* ── Input con transizione border ───────────────────────────── */
input, textarea, select {
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--nd-blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--nd-blue) 15%, transparent);
}

/* ── Skeleton loading ─────────────────────────────────────────  */
@keyframes nd-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.nd-skeleton {
  background: linear-gradient(90deg,
    var(--nd-surface-2) 25%,
    var(--nd-surface-3) 50%,
    var(--nd-surface-2) 75%
  );
  background-size: 800px 100%;
  animation: nd-shimmer 1.4s ease infinite;
  border-radius: var(--r-sm);
}
.nd-skeleton-text  { height: 14px; margin-bottom: 8px; }
.nd-skeleton-title { height: 22px; width: 60%; margin-bottom: 12px; }
.nd-skeleton-avatar{ width: 40px; height: 40px; border-radius: 50%; }

/* ── Bottoni con micro-animazione ────────────────────────────── */
.nd-btn {
  position: relative;
  overflow: hidden;
  transition: background var(--tr-fast), transform .12s, box-shadow var(--tr-fast);
}
.nd-btn:active { transform: scale(.97); }
.nd-btn-primary:hover {
  box-shadow: 0 4px 12px color-mix(in srgb, var(--nd-blue) 35%, transparent);
}

/* ── Scrollbar sottile globale ───────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--nd-border) transparent;
}
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--nd-border);
  border-radius: 4px;
  transition: background .2s;
}
*::-webkit-scrollbar-thumb:hover { background: var(--nd-border-light); }

/* ── Tooltip migliorato ─────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--nd-surface-3);
  color: var(--nd-text);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s, transform .15s;
  z-index: 9999;
  border: 1px solid var(--nd-border);
  box-shadow: var(--shadow-sm);
}
[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Avatar ring on hover ────────────────────────────────────── */
.nd-sidebar__user {
  transition: background var(--tr-fast);
  border-radius: var(--r-md);
  padding: 7px 10px;
  margin: 4px;
}
.nd-sidebar__user:hover { background: var(--nd-surface-2); }
.nd-sidebar__avatar {
  border: 2px solid transparent;
  transition: border-color var(--tr-fast);
}
.nd-sidebar__user:hover .nd-sidebar__avatar {
  border-color: var(--nd-blue);
}

/* ── Logo shine effect ───────────────────────────────────────── */
.nd-sidebar__logo-icon {
  position: relative;
  overflow: hidden;
}
.nd-sidebar__logo-icon::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transform: skewX(-20deg);
  transition: left .4s;
}
.nd-sidebar__logo:hover .nd-sidebar__logo-icon::after {
  left: 120%;
}

/* ── Notification dot pulse ──────────────────────────────────── */
@keyframes nd-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.4); opacity: .6; }
}
.nd-header__btn-dot {
  animation: nd-pulse 2.5s ease infinite;
}

/* ── Page transition ─────────────────────────────────────────── */
.nd-content {
  animation: nd-fade-up .28s cubic-bezier(.4,0,.2,1) both;
}

/* ── Dropdown con scale-in ───────────────────────────────────── */
.nd-dropdown {
  animation: nd-scale-in .18s cubic-bezier(.4,0,.2,1) both;
  transform-origin: top right;
}

/* ── Sidebar nav label slide ─────────────────────────────────── */
.nd-nav__link .nd-nav__label {
  transition: transform var(--tr-fast), opacity var(--tr-fast);
}
.nd-nav__link:hover .nd-nav__label {
  transform: translateX(2px);
}

/* ── KPI card accent top border ─────────────────────────────── */
.nd-kpi-card {
  position: relative;
  overflow: hidden;
}
.nd-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--nd-blue), var(--nd-purple));
  opacity: 0;
  transition: opacity var(--tr-dur);
}
.nd-kpi-card:hover::before { opacity: 1; }

/* ── Table row hover ─────────────────────────────────────────── */
.nd-table tr {
  transition: background var(--tr-fast);
}
.nd-table tbody tr:hover {
  background: color-mix(in srgb, var(--nd-blue) 4%, var(--nd-surface));
}

/* ── Tag / Badge pill ────────────────────────────────────────── */
.nd-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
.nd-tag-blue   { background: var(--nd-blue-dim);   color: var(--nd-blue); }
.nd-tag-green  { background: var(--nd-green-dim);  color: var(--nd-green); }
.nd-tag-orange { background: var(--nd-orange-dim); color: var(--nd-orange); }
.nd-tag-purple { background: var(--nd-purple-dim); color: var(--nd-purple); }

/* ── Sidebar compatta su schermi piccoli ────────────────────── */
@media (max-width: 1024px) {
  .nd-sidebar { transform: translateX(-100%); }
  .nd-sidebar.open { transform: translateX(0); }
  .nd-main { margin-left: 0 !important; }
}

/* ── Gradient text per titoli hero ───────────────────────────── */
.nd-gradient-text {
  background: linear-gradient(135deg, var(--nd-text) 0%, var(--nd-text-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Divider ─────────────────────────────────────────────────── */
.nd-divider {
  height: 1px;
  background: var(--nd-border);
  margin: 16px 0;
}

/* ── Empty state ─────────────────────────────────────────────── */
.nd-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--nd-text-3);
}
.nd-empty__icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.nd-empty__title { font-size: 15px; font-weight: 600; color: var(--nd-text-2); margin-bottom: 6px; }
.nd-empty__sub { font-size: 13px; }
