@import url("https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap");

* {
  font-family: "Google Sans", sans-serif !important;
}

body {
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--app-text);
  background: var(--app-bg);
}

/* =========================
   VARIABILI
========================= */

:root {
  --app-primary: #20e37f !important;
  --bs-primary: #20e37f !important;
  --bs-btn-primary: #20e37f !important;
  --sidebar-expanded: 240px;
  --sidebar-collapsed: 72px;
  --sidebar-border: rgba(17, 17, 17, 0.08);
  --sidebar-muted: #8c8f94;
  --sidebar-hover: rgba(17, 17, 17, 0.04);
  --sidebar-active: rgba(17, 17, 17, 0.06);
  --sidebar-bg: #f7f8fa;

  --app-bg: #f7f8fa;
  --app-surface: #ffffff;
  --app-text: #111111;
  --app-text-secondary: #5f6368;
  --app-text-muted: #8c8f94;
  --app-border: rgba(17, 17, 17, 0.08);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
}

/* =========================
   TOPBAR
========================= */

.app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--app-border);
  z-index: 1040;
  display: flex;
  align-items: center;
}

.topbar-inner {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 1rem;
  gap: 0.75rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.topbar-hamburger {
  color: var(--app-text);
  font-size: 1.5rem;
  padding: 0.15rem 0.25rem !important;
  text-decoration: none !important;
  min-height: 36px !important;
}

.topbar-hamburger:hover {
  color: var(--app-primary);
}

.topbar-brand {
  text-decoration: none !important;
  color: var(--app-text);
  display: flex;
  align-items: center;
}

.topbar-brand-text {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.topbar-center {
  flex: 1 1 auto;
  max-width: 900px;
  margin: 0 auto;
}

.topbar-search {
  width: 100%;
}

.topbar-search-wrap {
  position: relative;
  width: 100%;
}

.topbar-search-wrap .bi-search {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--app-text-muted);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 5;
}

.topbar-search-wrap .form-control {
  padding-left: 2.25rem;
  font-size: 0.88rem;
  background: var(--sidebar-hover);
  border: 1px solid transparent;
  border-radius: 10px;
  height: 38px;
}

.topbar-search-wrap .form-control:focus {
  background: #fff;
  border-color: var(--app-primary);
  box-shadow: 0 0 0 2px rgba(32, 227, 127, 0.15);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.topbar-notif + .topbar-user {
  margin-left: 0.5rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.topbar-action-btn {
  min-height: 34px;
  padding: 0.25rem 0.55rem;
  border-radius: 8px !important;
  font-size: 0.82rem;
  border: 1px solid var(--app-border);
  background: transparent;
  color: var(--app-text);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none !important;
  white-space: nowrap;
}

.topbar-action-btn:hover {
  background: var(--sidebar-hover);
  border-color: var(--app-primary);
  color: var(--app-text);
}

.topbar-action-label {
  font-weight: 600;
}

.topbar-user-btn {
  text-decoration: none !important;
  color: var(--app-text);
  padding: 0.15rem 0.25rem !important;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 36px !important;
}

.topbar-user-btn:hover {
  color: var(--app-primary);
}

.topbar-user-btn.dropdown-toggle::after {
  display: none;
}

.dropdown-item {
  text-align: left!important;
}

.topbar-user-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.topbar-user-avatar {
  width: 30px;
  height: 30px;
  object-fit: cover;
}

.topbar-notif-btn {
  text-decoration: none !important;
  color: var(--app-text);
  padding: 0.15rem 0.25rem !important;
  display: flex;
  align-items: center;
  min-height: 36px !important;
}
.topbar-notif-btn:hover {
  color: var(--app-primary);
}
.notif-badge {
  font-size: 0.6rem !important;
  min-width: 16px;
  height: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px !important;
  top: 2px !important;
  right: -4px !important;
}
.notif-dropdown {
  width: 360px;
  max-width: calc(100vw - 2rem);
  max-height: 420px;
  overflow-y: auto;
  padding: 0;
}
.notif-item {
  border-bottom: 1px solid var(--app-border);
  padding: 0.6rem 0.85rem;
  white-space: normal;
  word-wrap: break-word;
}
.notif-item:last-child {
  border-bottom: none;
}
.notif-item:hover {
  background-color: var(--sidebar-hover);
}
.notif-icon {
  font-size: 1rem;
  color: var(--app-primary);
  margin-top: 0.15rem;
  flex-shrink: 0;
}
.notif-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-desc {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-search {
  position: relative;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  z-index: 1050;
  max-height: 460px;
  overflow-y: auto;
}

.search-dropdown-category + .search-dropdown-category {
  border-top: 1px solid var(--app-border);
}

.search-dropdown-category-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--app-text-muted);
}

.search-dropdown-category-header i {
  font-size: 0.7rem;
}

.search-dropdown-category-count {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--app-text-muted);
  background: var(--sidebar-hover);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}

.search-dropdown-item:last-child {
  border-bottom: none;
}

.search-dropdown-item-badge {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--app-text-muted);
  background: var(--sidebar-hover);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  flex-shrink: 0;
  line-height: 1.3;
}

.search-dropdown-item:hover {
  background: var(--sidebar-hover);
  text-decoration: none !important;
}

.search-dropdown-item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: 8px;
  flex-shrink: 0;
  color: var(--app-text-muted);
  font-size: 0.85rem;
}

.search-dropdown-item-body {
  flex: 1;
  min-width: 0;
}

.search-dropdown-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--app-text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-dropdown-item-subtitle {
  font-size: 0.72rem;
  color: var(--app-text-muted);
  line-height: 1.2;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-dropdown-empty,
.search-dropdown-loading {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--app-text-muted);
  font-size: 0.85rem;
}

.search-dropdown-loading .spinner-border {
  width: 1rem;
  height: 1rem;
}

.search-dropdown-footer {
  display: block;
  text-align: center;
  padding: 0.55rem 0.85rem;
  border-top: 1px solid var(--app-border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--app-primary);
  text-decoration: none !important;
  transition: background 0.12s ease;
}

.search-dropdown-footer:hover {
  background: var(--sidebar-hover);
  text-decoration: none !important;
}

@media (max-width: 575.98px) {
  .app-topbar {
    height: 56px;
  }

  .topbar-inner {
    padding: 0 0.65rem;
    gap: 0.5rem;
  }

  .topbar-brand-text {
    font-size: 1rem;
  }

  .topbar-center {
    max-width: none;
  }

  .topbar-search-wrap .form-control {
    font-size: 0.82rem;
    height: 34px;
    padding-left: 1.85rem;
  }

  .topbar-action-btn {
    min-height: 32px;
    padding: 0.2rem 0.45rem;
    font-size: 0.78rem;
  }

  .search-dropdown {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    border-radius: 0;
    max-height: calc(100vh - 56px);
    box-shadow: var(--shadow-md);
  }
}

/* =========================
   LAYOUT GENERALE
========================= */

.app-content {
  transition: margin-left 0.2s ease;
  padding: calc(64px + 1.5rem) 80px 80px !important;
}

@media (max-width: 991.98px) {
  .app-content {
    padding: calc(64px + 1rem) 1.25rem 1.25rem !important;
  }
}

@media (max-width: 575.98px) {
  .app-content {
    padding: calc(64px + 0.75rem) 1rem 1.25rem !important;
  }

  .display-6 {
    font-size: 1.35rem;
  }
}

/* =========================
   SIDEBAR DESKTOP
========================= */

@media (min-width: 992px) {
  .app-sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    height: calc(100vh - 64px);
    width: var(--sidebar-expanded);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1030;
    color: var(--app-text) !important;
    border-right: 1px solid var(--app-border);
  }

  .app-content {
    margin-left: var(--sidebar-expanded);
  }

  body.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-collapsed);
  }

  body.sidebar-collapsed .app-content {
    margin-left: var(--sidebar-collapsed);
  }

  body.sidebar-collapsed .nav-label {
    display: none !important;
  }

  body.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 0.5rem 0;
  }
}

/* =========================
   SIDEBAR WORKSPACE
========================= */

.sidebar-workspace {
  padding: 0.85rem 0.85rem 0.65rem;
  border-bottom: 1px solid var(--app-border);
}

.sidebar-workspace-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--app-text);
}

.sidebar-workspace-sub {
  font-size: 0.7rem;
  color: var(--app-text-muted);
  margin-top: 1px;
}

/* =========================
   NAV LINK STYLING
========================= */

.app-sidebar .nav-link,
.app-sidebar-mobile .nav-link {
  color: var(--app-text) !important;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.65rem;
  border-radius: 0;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}

.app-sidebar .nav-link {
  min-height: 32px;
  font-size: 0.85rem;
  padding: 0.3rem 0.65rem;
  position: relative;
}

.app-sidebar-mobile .nav-link {
  min-height: 44px;
  padding: 0.65rem 0.8rem;
  font-size: 0.95rem;
}

.app-sidebar .nav-link:hover,
.app-sidebar-mobile .nav-link:hover {
  background: var(--sidebar-hover) !important;
  color: var(--app-text) !important;
}

.app-sidebar .nav-link.active,
.app-sidebar-mobile .nav-link.active {
  color: var(--app-text) !important;
  font-weight: 600;
  position: relative;
}

.app-sidebar .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--app-primary);
  border-radius: 0 2px 2px 0;
}

.app-sidebar .nav-link i.bi,
.app-sidebar-mobile .nav-link i.bi {
  width: 1rem;
  text-align: center;
  flex: 0 0 1rem;
  font-size: 0.875rem;
}

.app-sidebar-mobile .nav-link i.bi {
  font-size: 1rem;
}

.sidebar-brand-logo {
  width: 100%;
  max-width: 150px;
  height: auto;
}

.sidebar-brand-logo-mobile {
  width: 90px;
}

.sidebar-nav {
  padding: 0.35rem 0.5rem 0.5rem;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

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

.sidebar-nav .nav {
  gap: 0.05rem;
}

/* =========================
   SECTION LABELS & DIVIDERS
========================= */

.nav-section-label {
  display: block;
  list-style: none;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-text-muted);
  padding: 0.55rem 0.65rem 0.15rem;
}

.nav-divider {
  height: 1px;
  background: var(--app-border);
  margin: 0.3rem 0.65rem;
  list-style: none;
}

/* =========================
   SIDEBAR SEARCH
========================= */

.sidebar-search {
  padding: 0 0.75rem 0.5rem;
  flex-shrink: 0;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap .bi-search {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--app-text-muted);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 5;
}

.search-input-wrap .form-control {
  padding-left: 2rem;
  font-size: 0.85rem;
  background: var(--sidebar-hover);
  border: 1px solid transparent;
  border-radius: 8px;
}

.search-input-wrap .form-control:focus {
  background: #fff;
  border-color: var(--app-primary);
  box-shadow: 0 0 0 2px rgba(32, 227, 127, 0.15);
}

/* =========================
   SEARCH RESULTS PAGE
========================= */

.search-page .search-form-wrap {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--app-border);
}

.search-page .search-form-wrap .form-control {
  border-radius: 10px;
  border: 1px solid var(--app-border);
}

.search-page .search-form-wrap .form-control:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(32, 227, 127, 0.12);
}

.search-page .search-header-icon {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-active);
  border-radius: 10px;
  color: var(--app-primary);
}

.search-page .search-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: #f8f9fa;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #495057;
}

.search-page .search-summary strong {
  color: var(--app-text);
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 767.98px) {
  .search-results-grid {
    grid-template-columns: 1fr;
  }
}

.search-card {
  border-radius: 12px;
  overflow: hidden;
}

.search-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--app-border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--app-text);
}

.search-card-header i {
  font-size: 1rem;
  color: var(--app-text-muted);
}

.search-card-count {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15em 0.5em;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--app-border);
  transition: background 0.15s ease;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--sidebar-hover);
}

.search-result-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: 8px;
  flex-shrink: 0;
  color: var(--app-text-muted);
  font-size: 0.9rem;
}

.search-result-body {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--app-text);
  line-height: 1.3;
}

.search-result-subtitle {
  font-size: 0.78rem;
  color: var(--app-text-muted);
  line-height: 1.3;
  margin-top: 1px;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.search-result-arrow {
  color: #ccc;
  font-size: 0.8rem;
  transition: transform 0.15s ease, color 0.15s ease;
}

.search-result-item:hover .search-result-arrow {
  color: var(--app-text-muted);
  transform: translateX(2px);
}

.search-card-empty {
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--app-text-muted);
  font-size: 0.85rem;
}

.search-help {
  text-align: center;
  padding: 2.5rem 1rem;
}

.search-help-icon {
  font-size: 2.5rem;
  color: #dee2e6;
  margin-bottom: 1rem;
}

.search-help h5 {
  font-weight: 600;
  color: var(--app-text);
}

.search-help-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 500px;
  margin: 1rem auto 0;
}

.search-help-categories .badge {
  padding: 0.4rem 0.75rem;
  font-weight: 500;
  font-size: 0.8rem;
  background: #f0f0f0;
  color: #495057;
  border: 1px solid var(--app-border);
}



.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.sidebar-user-meta {
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.sidebar-user-role {
  font-size: 0.74rem;
  color: var(--app-text-muted);
  line-height: 1.1;
}

.sidebar-mobile-header {
  padding: 1rem 1rem 0.9rem 1rem;
  border-bottom: 1px solid var(--app-border);
}

.sidebar-mobile-body {
  padding: 0.9rem;
}

.app-sidebar-mobile {
  width: min(92vw, 320px);
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid var(--app-border);
}

.app-sidebar-mobile .sidebar-brand-logo-mobile {
  width: 84px;
  max-width: 84px;
}

.sidebar-mobile-footer {
  flex-shrink: 0;
  padding: 0.75rem 0.9rem;
  border-top: 1px solid var(--app-border);
}

.sidebar-user-mobile {
  padding: 0.4rem 0.25rem;
}

.app-sidebar-mobile .nav-item + .nav-item .nav-link {
  margin-top: 0.1rem;
}

.app-sidebar-mobile .nav-label {
  font-size: 0.98rem;
}

/* FINE SIDEBAR */

p,
h1,
h2,
h3,
h4,
h5 {
  color: var(--app-text);
}

a {
  text-decoration: none !important;
}

a:hover {
  text-decoration: underline !important;
}

.a-no-color {
  color: unset;
}

body {
  background-color: #f9f9f9;
  opacity: 1;
  transition: opacity 0.1s ease-in;
  padding-bottom: 80px;
}

.shadow-lg {
  box-shadow: none !important;
}

[v-cloak] > *:not(.loader) {
  display: none;
}

[v-cloak] .loader {
  display: block !important;
}

.erp-table {
  width: 100%;
  table-layout: fixed;
  min-width: 600px;
}

.erp-table th,
.erp-table td {
  vertical-align: middle;
  padding: 8px 6px;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--app-border);
}

.erp-table thead th {
  background: #fff;
  border-bottom: 1px solid var(--app-border);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--app-text-muted);
  padding: 8px 6px;
}

.erp-table tbody tr {
  transition: background 0.1s ease;
  border-bottom: none;
}

.erp-table tbody tr:hover {
  background: rgba(32, 227, 127, 0.05);
}

.erp-table tbody tr:hover .erp-actions,
.erp-table tbody tr:hover .invoice-row-azioni,
.erp-table tbody tr:hover .fr-row-azioni {
  opacity: 1;
}

@media (min-width: 768px) {
  .erp-table .erp-actions,
  .erp-table .invoice-row-azioni,
  .erp-table .fr-row-azioni {
    opacity: 0;
    transition: opacity 0.12s ease;
  }
}

/* Invoice list — compact rows, reduced columns */
.invoice-table.erp-table {
  min-width: 500px;
}

.invoice-table .col-fattura {
  width: auto;
}

.invoice-table .col-totale {
  width: 110px;
}

.invoice-table .col-stato {
  width: 120px;
}

.invoice-table .col-scadenza {
  width: 130px;
}

.invoice-table .col-azioni {
  width: 100px;
}

.invoice-row-main {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--app-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-row-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--app-text-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-row-totale {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.invoice-row-azioni {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
}

.invoice-row-azioni .btn {
  min-height: 26px;
  min-width: 26px;
  font-size: 0.72rem;
}

/* Finance list — compact rows, 6 columns */
.finance-list-table.erp-table {
  min-width: 550px;
}

.finance-list-table .col-movimento {
  width: auto;
}

.finance-list-table .col-importo {
  width: 110px;
}

.finance-list-table .col-tipo,
.finance-list-table .col-stato {
  width: 100px;
}

.finance-list-table .col-data {
  width: 130px;
}

.finance-list-table .col-azioni {
  width: 80px;
}

.fr-row-main {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--app-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fr-row-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--app-text-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fr-row-importo {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.fr-row-azioni {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
}

.fr-row-azioni .btn {
  min-height: 26px;
  min-width: 26px;
  font-size: 0.72rem;
}

@media (max-width: 767.98px) {
  .app-content .card-body,
  .app-content .card-header {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .erp-table {
    min-width: 100%;
  }

  .erp-table th,
  .erp-table td {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .mobile-hide,
  .mobile-priority-low {
    display: none !important;
  }
}

@media (max-width: 575.98px) {
  .mobile-hide-sm {
    display: none !important;
  }
}

.mobile-list {
  display: flex;
  flex-direction: column;
}

.mobile-list-item {
  display: block;
  width: 100%;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--app-border);
  color: inherit;
}

.mobile-list-item:last-child {
  border-bottom: none;
}

.mobile-list-item:hover {
  background: var(--sidebar-hover);
  text-decoration: none !important;
}

.mobile-row-link {
  display: block;
  min-width: 0;
  color: inherit;
}

.mobile-row-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.mobile-row-muted {
  color: var(--app-text-muted);
  font-size: 0.82rem;
}

.mobile-row-value {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.cliente-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
}

.erp-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
}

.cliente-action-primary,
.cliente-action-secondary,
.erp-action-primary,
.erp-action-secondary {
  min-height: 40px;
}

.cliente-action-primary {
  min-width: 170px;
}

.cliente-action-secondary,
.erp-action-secondary {
  min-width: 132px;
}

.erp-action-primary {
  min-width: 170px;
}

@media (max-width: 575.98px) {
  .cliente-action-bar > .btn,
  .cliente-action-bar > .dropdown,
  .erp-action-bar > .btn,
  .erp-action-bar > .dropdown {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .cliente-action-bar > .cliente-action-primary,
  .erp-action-bar > .erp-action-primary {
    flex-basis: 100%;
  }

  .cliente-action-bar .dropdown > .btn,
  .erp-action-bar .dropdown > .btn {
    width: 100%;
  }
}

.preventivo-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
}

.preventivo-action-primary,
.preventivo-action-secondary {
  min-height: 40px;
}

.preventivo-action-primary {
  min-width: 170px;
}

.preventivo-action-secondary {
  min-width: 132px;
}

.preventivo-row-card {
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: #fff;
}

.preventivo-lines-mobile {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preventivo-summary-card {
  position: sticky;
  top: 1rem;
}

@media (max-width: 575.98px) {
  .preventivo-action-bar > .btn,
  .preventivo-action-bar > .dropdown {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .preventivo-action-bar > .preventivo-action-primary {
    flex-basis: 100%;
  }

  .preventivo-action-bar .dropdown > .btn {
    width: 100%;
  }

  .preventivo-summary-card {
    position: static;
  }

  .preventivo-summary-card .display-6 {
    font-size: 1.35rem;
  }
}

.erp-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.erp-actions .btn,
.erp-actions button {
  flex-shrink: 0;
}

/* =========================
   ERP ICON BUTTON — compatto icon-only
   ========================= */

.erp-icon-btn {
  min-height: 28px;
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px !important;
}

.erp-icon-btn i.bi {
  font-size: 0.8rem;
}

@media (max-width: 575.98px) {
  .erp-icon-btn {
    min-height: 26px;
    min-width: 26px;
    width: 26px;
    height: 26px;
  }

  .erp-icon-btn i.bi {
    font-size: 0.75rem;
  }
}

.col-id {
  width: 64px !important;
}

.col-date {
  width: 150px !important;
}

.col-datetime {
  width: 180px !important;
}

.col-status{
  width: 120px !important;
}



.col-actions {
  width: 104px !important;
}

.col-money,
.col-prezzo {
  width: 120px !important;
}

.col-note {
  width: 90px !important;
}

.col-payment,
.col-pagamento {
  width: 150px !important;
}

.col-cliente {
  width: 220px !important;
}

.col-nominativo {
  width: 320px !important;
}

.col-email {
  width: 220px !important;
}

.col-descrizione {
  width: auto !important;
}

.col-pdf {
  width: 60px !important;
}

.col-user {
  width: 180px !important;
}

.col-totale {
  width: 120px !important;
}

.col-comunicazione {
  width: auto !important;
}

.col-direzione {
  width: 80px !important;
}

.col-collegamenti {
  width: 130px !important;
}

.tasks-table .col-title {
  width: auto !important;
}

.tasks-table .col-refs {
  width: 130px !important;
}

/* Mobile cards */
.admin-export-table {
  min-width: 0;
  table-layout: fixed;
}

.admin-export-table th,
.admin-export-table td {
  vertical-align: middle !important;
}

.admin-export-resource-col {
  width: 26%;
}

.admin-export-description-col {
  width: 46%;
}

.admin-export-actions-col {
  width: 28%;
  min-width: 150px;
}

.admin-export-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: nowrap;
  max-width: 100%;
}

.admin-export-btn {
  min-height: 30px;
  padding: 0.2rem 0.55rem;
  font-size: 0.82rem;
  gap: 0.25rem;
}

.admin-export-btn i {
  font-size: 0.85rem;
}

.admin-export-mobile-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: #fff;
}

.admin-export-mobile-card + .admin-export-mobile-card {
  margin-top: 0.75rem;
}

.col-desc {
  width: 280px !important;
}

.font-size-md-sm {
  font-size: 0.85rem;
}

i.bi {
  font-size: 1rem;
  line-height: 1;
}

.btn:not(.btn-close) {
  border-radius: 8px;
  font-weight: 500;
  line-height: 1.1;
}

.btn:not(.btn-close) {
  min-height: 32px;
  padding: 0.3rem 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-sm {
  min-height: 28px;
  padding: 0.2rem 0.55rem;
}

.erp-actions .btn,
.erp-actions button {
  min-height: 32px;
  padding: 0.25rem 0.55rem;
}

.erp-actions i.bi,
.btn i.bi {
  font-size: 0.95rem;
}

.desktop-nav-logo,
.mobile-nav-logo {
  padding: 1rem 0rem 0.5rem 0rem !important;
  max-width: 100%;
}

.pointer {
  cursor: pointer !important;
}

.min-w-0 {
  min-width: 0 !important;
}

.container {
  max-width: 1366px !important;
}

body.loaded {
  opacity: 1;
}

/* CSS */

.icon-trash-righe:hover {
  color: #20e37f !important;
}

.bg-primary {
  background-color: #20e37f !important;
  color: var(--app-text) !important;
}

.bg-primary.text-white,
.bg-primary .text-white,
.badge.bg-primary,
.badge.text-bg-primary {
  color: var(--app-text) !important;
}

.border-primary {
  border-color: #20e37f !important;
}

.text-primary {
  color: #20e37f !important;
}

.link-primary {
  color: #20e37f !important;
}

#textarea_descrizione {
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
}

#tr_subtotale {
  border-top-width: medium !important;
}

.descrizione-preventivo {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.form-select-sm {
  padding-top: 0;
  padding-bottom: 0;
}

.data-label {
  color: #20e37f;
  font-weight: 500;
  font-size: 0.8em;
  margin-top: 0.3rem;
}

.status-select {
  font-size: 0.8rem;
  border-radius: 20px !important;
}

.font-size-pill {
  font-size: 0.8rem;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.status-pill {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 10px;
  padding: 2px 10px;
}

.finance-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
}

.finance-status-badge .bi {
  font-size: 0.9rem;
}

.editorial-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.editorial-calendar-header {
  background: #f8f9fa;
  border-bottom: 1px solid var(--bs-border-color);
}

.editorial-day-cell {
  min-height: 185px;
  padding: 0.65rem;
  border-right: 1px solid var(--bs-border-color);
  border-bottom: 1px solid var(--bs-border-color);
}

.editorial-day-today {
  background: rgba(32, 227, 127, 0.06);
  box-shadow: inset 0 0 0 2px rgba(32, 227, 127, 0.25);
}

.editorial-day-today .editorial-day-number {
  color: var(--app-text) !important;
  background: var(--app-primary);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 0.85rem;
}

.editorial-day-add {
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  color: var(--app-primary) !important;
  font-size: 1.1rem;
  line-height: 1;
  transition: opacity 0.15s ease;
}

.editorial-day-add:hover {
  opacity: 0.7;
  background: transparent !important;
  color: var(--app-primary) !important;
}

.editorial-calendar-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  min-width: 0;
  padding: 0.45rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  background: #fff;
  color: inherit;
}

.editorial-calendar-item:hover {
  background: var(--sidebar-hover);
  text-decoration: none !important;
}

.editorial-calendar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.45rem;
  color: var(--app-text-muted);
  font-size: 0.74rem;
  line-height: 1.25;
}

.editorial-client-marker {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  line-height: 1;
  color: var(--app-text-muted);
}

.editorial-client-marker-inline {
  font-size: 0.82rem;
}

.editorial-color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.editorial-color-dot-sm {
  width: 6px;
  height: 6px;
  min-width: 6px;
}

.editorial-platform-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  max-width: 100%;
  min-height: 22px;
  padding: 0.22rem 0.42rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.editorial-platform-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
}

.editorial-platform-pill i {
  font-size: 0.82rem;
  line-height: 1;
}

.editorial-platform-instagram {
  color: #7a123d;
  background: #ffe3ef;
  border-color: #f2a6c5;
}

.editorial-platform-facebook {
  color: #084298;
  background: #dbeafe;
  border-color: #9ec5fe;
}

.editorial-platform-generic {
  color: var(--app-text);
  background: #f8f9fa;
  border-color: rgba(17, 17, 17, 0.12);
}

.editorial-platform-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.editorial-platform-checks-form {
  max-width: 100%;
}

.editorial-platform-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.editorial-platform-check-card {
  min-height: 48px;
  padding: 0.65rem 0.8rem;
}

.editorial-platform-check-card:has(input:checked) {
  border-color: var(--app-primary);
  background: rgba(32, 227, 127, 0.1);
}

.editorial-platform-check span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.editorial-platform-check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.editorial-platform-check-label i {
  flex: 0 0 auto;
  font-size: 1rem;
}

@media (max-width: 575.98px) {
  .editorial-platform-checks {
    grid-template-columns: 1fr;
  }
}

.editorial-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  object-fit: cover;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  background: #f8f9fa;
  color: var(--app-text-muted);
}

.editorial-thumb-sm {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

.editorial-thumb-placeholder i {
  font-size: 1rem;
}

.editorial-mobile-day {
  padding: 0.95rem 1rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: #fff;
}

.editorial-mobile-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
}

.editorial-mobile-tabs .nav-item,
.editorial-mobile-tabs .nav-link {
  width: 100%;
}

.editorial-mobile-tabs .nav-link {
  min-height: 38px;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  color: var(--app-text);
  background: #fff;
  font-weight: 700;
}

.editorial-mobile-tabs .nav-link.active {
  color: var(--app-text);
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.editorial-mobile-month-weekdays,
.editorial-mobile-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
}

.editorial-mobile-month-weekdays {
  margin-bottom: 0.35rem;
  color: var(--app-text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.editorial-mobile-month-grid {
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  background: #fff;
}

.editorial-mobile-month-cell {
  min-width: 0;
  min-height: 78px;
  padding: 0.3rem 0.22rem;
  border-right: 1px solid var(--bs-border-color);
  border-bottom: 1px solid var(--bs-border-color);
  background: #fff;
}

.editorial-mobile-month-cell:nth-child(7n) {
  border-right: 0;
}

.editorial-mobile-month-cell:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.editorial-mobile-month-muted {
  background: #f8f9fa;
  color: var(--app-text-muted);
}

.editorial-mobile-month-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-bottom: 0.2rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
}

.editorial-mobile-month-today {
  background: var(--app-primary);
  color: var(--app-text);
}

.editorial-mobile-month-items {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  overflow: hidden;
}

.editorial-mobile-month-pill {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0.16rem 0.25rem;
  border-radius: 5px;
  border: 1px solid transparent;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none !important;
  overflow: hidden;
}

.editorial-mobile-month-pill-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editorial-mobile-month-pill-instagram {
  color: #7a123d;
  background: #ffe3ef;
  border-color: #f2a6c5;
}

.editorial-mobile-month-pill-facebook {
  color: #084298;
  background: #dbeafe;
  border-color: #9ec5fe;
}

.editorial-mobile-month-pill-multi {
  color: #3d2b00;
  background: #fff0bf;
  border-color: #e6c65c;
}

.editorial-mobile-month-pill-generic {
  color: var(--app-text);
  background: #f1f3f5;
  border-color: rgba(17, 17, 17, 0.12);
}

.editorial-mobile-month-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.12rem 0.2rem;
  border-radius: 5px;
  color: #41464b;
  background: #e9ecef;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.1;
}

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

.editorial-table th,
.editorial-table td {
  vertical-align: middle !important;
}

.editorial-table .editorial-col-publication,
.editorial-table .editorial-publication-cell {
  width: 28% !important;
}

.editorial-table .col-date {
  width: 104px !important;
}

.editorial-table .col-pills {
  width: 110px !important;
}

.editorial-table .col-cliente {
  width: 140px !important;
}

.editorial-table .col-actions {
  width: 72px !important;
}

.editorial-table .editorial-publication-cell > .d-flex {
  max-width: 100%;
}

.editorial-table .editorial-td-date {
  white-space: nowrap;
  font-weight: 700;
  color: var(--app-text);
}

.editorial-table .editorial-td-cliente {
  font-size: 0.88rem;
}

.editorial-title-link {
  font-size: 0.95rem;
}

.editorial-table tbody tr {
  transition: background 0.12s ease;
}

.editorial-table tbody tr:hover {
  background: rgba(32, 227, 127, 0.05) !important;
}

.editorial-table td .editorial-platform-pill {
  font-size: 0.68rem;
  min-height: 22px;
  padding: 0.25rem 0.48rem;
}

.editorial-preview-current,
.editorial-preview-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  border: 1px solid var(--bs-border-color);
  object-fit: cover;
  flex: 0 0 120px;
}

.editorial-preview-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  color: var(--app-text-muted);
}

.editorial-preview-placeholder i {
  font-size: 1.4rem;
}

.editorial-publication-form {
  max-width: 1180px;
  margin-inline: auto;
}

.editorial-form-header {
  max-width: 1180px;
}

.editorial-form-section {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--bs-border-color);
}

.editorial-form-section:first-child {
  padding-top: 0;
}

.editorial-form-section:last-of-type {
  border-bottom: 0;
}

.editorial-form-section-heading {
  margin-bottom: 1rem;
}

.editorial-form-section-heading h5 {
  margin-bottom: 0.2rem;
  font-weight: 800;
}

.editorial-form-section-heading p {
  margin-bottom: 0;
  color: var(--app-text-muted);
  font-size: 0.92rem;
}

.editorial-preview-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.editorial-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bs-border-color);
}

.editorial-form-actions .btn {
  min-width: 160px;
}

.erp-form-danger-action {
  max-width: 1200px;
  margin: 0.85rem auto 0 auto;
}

/* =========================
   CARD/LIST COMUNI
   Pattern condivisi tra card/list di pubblicazioni, task, lavori,
   preventivi, email, eventi e movimenti finanziari.
   Override specifici nelle rispettive sezioni.
========================= */

.pub-list,
.task-list,
.lav-list,
.prev-list,
.mail-list,
.evt-list,
.fin-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pub-card,
.task-card,
.lav-card,
.prev-card,
.mail-card,
.evt-card,
.fin-card {
  display: block;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: #fff;
  padding: 0.85rem 1rem;
  color: inherit;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.pub-card:hover,
.task-card:hover,
.lav-card:hover,
.prev-card:hover,
.mail-card:hover,
.evt-card:hover,
.fin-card:hover {
  background: var(--sidebar-hover);
}

.pub-card-header,
.task-card-header,
.lav-card-header,
.prev-card-header,
.mail-card-header,
.evt-card-header,
.fin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.pub-card-body,
.task-card-body,
.lav-card-body,
.prev-card-body,
.mail-card-body,
.fin-card-body {
  margin-bottom: 0.5rem;
}

.pub-card-footer,
.task-card-footer,
.lav-card-footer,
.prev-card-footer,
.mail-card-footer,
.fin-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

@media (max-width: 575.98px) {
  .pub-card,
  .task-card,
  .lav-card,
  .prev-card,
  .mail-card,
  .evt-card,
  .fin-card {
    padding: 0.75rem 0.85rem;
  }
}

/* =========================
   PUBBLICAZIONI SCHEDA CLIENTE
========================= */

.pub-card-header {
  margin-bottom: 0.5rem;
}

.pub-date {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--app-primary);
  display: inline-flex;
  align-items: center;
}

.pub-date i {
  font-size: 0.82rem;
}

.pub-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.pub-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.pub-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pub-pill i {
  font-size: 0.76rem;
}

.pub-pill-ig {
  color: #7a123d;
  background: #ffe3ef;
  border-color: #f2a6c5;
}

.pub-pill-fb {
  color: #084298;
  background: #dbeafe;
  border-color: #9ec5fe;
}

.pub-pill-generic {
  color: var(--app-text);
  background: #f8f9fa;
  border-color: rgba(17, 17, 17, 0.12);
}

@media (max-width: 575.98px) {
  .pub-title {
    font-size: 0.88rem;
  }

  .pub-pill {
    padding: 0.18rem 0.45rem;
    font-size: 0.64rem;
  }

  .pub-pill i {
    font-size: 0.7rem;
  }

  .pub-date {
    font-size: 0.74rem;
  }
}

/* =========================
   TASK ERP SCHEDA CLIENTE
========================= */

.task-ref {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--app-primary);
  display: inline-flex;
  align-items: center;
}

.task-ref i {
  font-size: 0.8rem;
}

.task-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.task-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.task-meta-item {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--app-text-muted);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.task-meta-item i {
  font-size: 0.8rem;
}

@media (max-width: 575.98px) {
  .task-title {
    font-size: 0.88rem;
  }

  .task-ref {
    font-size: 0.72rem;
  }

  .task-meta-item {
    font-size: 0.72rem;
  }
}

.mt-39 {
  margin-top: 39px;
}

/* =========================
   EVENTI CALENDARIO SCHEDA CLIENTE
========================= */

.evt-datetime {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--app-primary);
  display: inline-flex;
  align-items: center;
}

.evt-datetime i {
  font-size: 0.8rem;
}

.evt-card-body {
  margin-bottom: 0;
}

.evt-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0.2rem;
}

.evt-desc {
  font-size: 0.82rem;
  color: var(--app-text-muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
  .evt-title {
    font-size: 0.88rem;
  }

  .evt-desc {
    font-size: 0.78rem;
  }

  .evt-datetime {
    font-size: 0.72rem;
  }
}

/* =========================
   MOVIMENTI ECONOMICI SCHEDA CLIENTE
========================= */

.fin-ref {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--app-primary);
  display: inline-flex;
  align-items: center;
}

.fin-ref i {
  font-size: 0.8rem;
}

.fin-amount {
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
}

.fin-amount-entrata {
  color: #0f5132;
}

.fin-amount-uscita {
  color: #842029;
}

.fin-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fin-desc {
  font-size: 0.82rem;
  color: var(--app-text-muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.fin-card-footer {
  justify-content: space-between;
}

.fin-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.fin-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.fin-type-badge i {
  font-size: 0.76rem;
}

.fin-type-entrata {
  color: #0f5132;
  background: #d1e7dd;
  border: 1px solid #a3cfbb;
}

.fin-type-uscita {
  color: #842029;
  background: #f8d7da;
  border: 1px solid #f1aeb5;
}

.fin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fin-meta-item {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--app-text-muted);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.fin-meta-item i {
  font-size: 0.8rem;
}

@media (max-width: 575.98px) {
  .fin-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .fin-amount {
    font-size: 1.1rem;
  }

  .fin-title {
    font-size: 0.88rem;
  }

  .fin-desc {
    font-size: 0.78rem;
  }

  .fin-ref {
    font-size: 0.72rem;
  }

  .fin-meta-item {
    font-size: 0.72rem;
  }
}

/* =========================
   LAVORI SCHEDA CLIENTE
========================= */

.lav-ref {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--app-primary);
  display: inline-flex;
  align-items: center;
}

.lav-ref i {
  font-size: 0.8rem;
}

.lav-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.lav-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lav-card-footer {
  justify-content: space-between;
}

.lav-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lav-meta-item {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--app-text-muted);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.lav-meta-item i {
  font-size: 0.8rem;
}

.lav-total {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--app-text);
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .lav-title {
    font-size: 0.88rem;
  }

  .lav-total {
    font-size: 0.88rem;
  }

  .lav-ref {
    font-size: 0.72rem;
  }

  .lav-meta-item {
    font-size: 0.72rem;
  }
}

/* =========================
   PREVENTIVI SCHEDA CLIENTE
========================= */

.prev-ref {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--app-primary);
  display: inline-flex;
  align-items: center;
}

.prev-ref i {
  font-size: 0.8rem;
}

.prev-date {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--app-text-muted);
  display: inline-flex;
  align-items: center;
}

.prev-date i {
  font-size: 0.8rem;
}

.prev-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prev-card-footer {
  justify-content: space-between;
}

.prev-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.prev-total {
  font-size: 1rem;
  font-weight: 800;
  color: var(--app-text);
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .prev-title {
    font-size: 0.88rem;
  }

  .prev-total {
    font-size: 0.92rem;
  }

  .prev-ref,
  .prev-date {
    font-size: 0.72rem;
  }
}

/* =========================
   EMAIL REALI SCHEDA CLIENTE
========================= */

.mail-card-unread {
  border-left: 3px solid var(--app-primary);
  background: rgba(32, 227, 127, 0.04);
}

.mail-card-unread .mail-subject {
  font-weight: 800;
}

.mail-card-contact {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--app-text-muted);
  display: inline-flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-card-contact i {
  font-size: 0.8rem;
  flex-shrink: 0;
}

.mail-contact-label {
  font-weight: 700;
  color: var(--app-primary);
  margin-right: 0.25rem;
}

.mail-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  flex-shrink: 0;
}

.mail-subject {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-date {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--app-text-muted);
  display: inline-flex;
  align-items: center;
}

.mail-date i {
  font-size: 0.8rem;
}

.mail-badge-unread {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  color: #664d03;
  background: #fff3cd;
  border: 1px solid #ffda6a;
}

.mail-badge-manual {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  color: #41464b;
  background: #e2e3e5;
  border: 1px solid #c4c8cb;
}

.mail-card-manual {
  border-style: dashed;
  background: #fafafa;
}

.mail-card-manual .mail-card-contact i {
  color: var(--app-text-muted);
}

@media (max-width: 575.98px) {
  .mail-subject {
    font-size: 0.88rem;
  }

  .mail-card-contact {
    font-size: 0.72rem;
  }

  .mail-date {
    font-size: 0.72rem;
  }

  .mail-badge-unread,
  .mail-badge-manual {
    font-size: 0.64rem;
    padding: 0.18rem 0.45rem;
  }
}

/* =========================
   CTA EDITORIAL - SCHEDA LAVORO
========================= */

.editorial-cta-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.editorial-cta-info {
  min-width: 0;
  flex: 1 1 auto;
}

.editorial-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

@media (max-width: 767.98px) {
  .editorial-cta-box {
    flex-direction: column;
    align-items: stretch;
  }

  .editorial-cta-actions {
    justify-content: stretch;
  }

  .editorial-cta-actions .btn {
    flex: 1 1 calc(50% - 0.25rem);
    text-align: center;
  }
}

@media (max-width: 575.98px) {
  .editorial-preview-box {
    align-items: flex-start;
    flex-direction: column;
  }

  .editorial-preview-current,
  .editorial-preview-placeholder {
    width: 100%;
    max-width: 220px;
    height: 140px;
    flex-basis: auto;
  }

  .editorial-form-actions {
    flex-direction: column-reverse;
  }

  .editorial-form-actions .btn,
  .erp-form-danger-action .btn {
    width: 100%;
    min-width: 0;
  }

  .editorial-images-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .editorial-image-item {
    width: auto;
  }

  .editorial-image-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
}

.erp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.28rem 0.48rem;
  letter-spacing: 0.005em;
  white-space: nowrap;
}

.erp-badge.badge {
  vertical-align: middle;
}

.erp-badge.text-bg-primary,
.erp-badge.primary {
  color: #06357a !important;
  background-color: #dbeafe !important;
  border: 1px solid #9ec5fe !important;
}

.erp-badge.text-bg-success,
.erp-badge.success {
  color: #0f5132 !important;
  background-color: #d1e7dd !important;
  border: 1px solid #a3cfbb !important;
}

.erp-badge.text-bg-warning,
.erp-badge.warning {
  color: #664d03 !important;
  background-color: #fff3cd !important;
  border: 1px solid #ffda6a !important;
}

.erp-badge.text-bg-danger,
.erp-badge.danger {
  color: #842029 !important;
  background-color: #f8d7da !important;
  border: 1px solid #f1aeb5 !important;
}

.erp-badge.text-bg-info,
.erp-badge.info {
  color: #055160 !important;
  background-color: #cff4fc !important;
  border: 1px solid #9eeaf9 !important;
}

.erp-badge.text-bg-secondary,
.erp-badge.secondary {
  color: #41464b !important;
  background-color: #e2e3e5 !important;
  border: 1px solid #c4c8cb !important;
}

.erp-badge.text-bg-light.border,
.erp-badge.badge-light.border {
  color: var(--app-text) !important;
  border-color: rgba(17, 17, 17, 0.12) !important;
  background-color: #f8f9fa !important;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.03);
}

.prio-pill {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 10px;
  padding: 2px 10px;
}

.prio-low {
  /* background: #c0e8c3; */
  color: #33ad62;
}

.prio-med {
  /* background: #fff1c2; */
  color: #ff9f0e;
}

.prio-high {
  /* background: #ffd4d8; */
  color: #dd1021;
}

.btn-primary {
  background-color: var(--app-primary)!important;
  border-color: var(--app-primary)!important;
  color: var(--app-text)!important;
}

.btn-warning:hover {
  transition: 0.3s ease-in-out;
}

.btn-danger:hover {
  transition: 0.3s ease-in-out;
}

.btn-primary:hover {
  background-color: #1acf72 !important;
  border-color: #1acf72 !important;
  color: var(--app-text)!important;
  transition: 0.3s ease-in-out;
}

.table {
  table-layout: fixed;
  width: 100%;
}

.btn {
  border-radius: 12px !important;
  font-weight: bold;
}

.circle-propic {
  display: inline-block;
  width: 80px;
  height: 80px;
  background-color: #ced4da;
  border-radius: 100%;
  margin-bottom: 1rem;
  color: white;
  font-size: 3rem;
  line-height: 80px;
}

.desktop-nav-logo,
.mobile-nav-logo {
  max-width: 160px;
  height: auto;
}

.erp-form-page {
  max-width: 1200px;
  margin-inline: auto;
}

.erp-form-header {
  margin-bottom: 1.5rem;
}

.erp-form-header .erp-form-title {
  margin-bottom: 0.3rem;
  font-weight: 700;
}

.erp-form-header .erp-form-subtitle {
  margin-bottom: 0;
  color: var(--bs-secondary-color);
  font-size: 0.95rem;
}

.erp-form-card {
  border: 1px solid var(--app-border);
  border-radius: 0.75rem;
}

.erp-form-card .card-body {
  padding: 1.5rem;
}

.erp-form-loading {
  min-height: 320px;
}

.erp-form-section {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--bs-border-color);
}

.erp-form-section:first-child {
  padding-top: 0;
}

.erp-form-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.erp-form-section-heading {
  margin-bottom: 1rem;
}

.erp-form-section-heading h5 {
  margin-bottom: 0.2rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.erp-form-section-heading p {
  margin-bottom: 0;
  color: var(--bs-secondary-color);
  font-size: 0.85rem;
}

.erp-boxed-form {
  margin-top: 1.5rem;
}

.erp-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.erp-form-actions .btn {
  min-width: 140px;
}

.erp-form-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-top: 1.25rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--bs-border-color);
}

.erp-form-footer-actions .btn {
  min-width: 150px;
}

.erp-text-capitalize {
  text-transform: capitalize;
}

.erp-text-uppercase {
  text-transform: uppercase;
}

.form-label {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.erp-form-page .form-label {
  font-weight: 600;
}

.form-control,
.form-select {
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
  border-color: var(--app-border);
  border-radius: var(--radius-md);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 2px rgba(32, 227, 127, 0.15);
}

.form-text {
  font-size: 0.75rem;
  color: var(--app-text-muted);
}

@media (max-width: 767.98px) {
  .erp-form-card .card-body {
    padding: 1rem;
  }

  .erp-form-actions {
    flex-direction: column;
  }

  .erp-form-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .erp-form-footer-actions {
    flex-direction: column-reverse;
  }

  .erp-form-footer-actions .btn {
    width: 100%;
    min-width: 0;
  }
}

.erp-toast-container {
  position: fixed;
  top: 76px;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 420px;
  width: calc(100% - 2rem);
  pointer-events: none;
}
.erp-toast-container .toast {
  pointer-events: auto;
  width: 100%;
}
@media (max-width: 575.98px) {
  .erp-toast-container {
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
    width: auto;
    top: 64px;
  }
}

.quote-qty-input {
  width: 100% !important;
  max-width: 150px !important;
  min-width: 0 !important;
  flex: 0 0 150px;
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.preventivo-lines-table .col-qta-cell,
.preventivo-lines-table .col-qta {
  width: 160px;
  min-width: 160px;
  max-width: 160px;
}

.preventivo-lines-table .col-qta-cell .quote-qty-input,
.preventivo-row-card .quote-qty-input {
  width: 100% !important;
  max-width: 150px !important;
}

.quote-price-input {
  width: 100%;
  max-width: 170px;
}

.quote-description-input {
  width: 100%;
  min-width: 0;
}

@media (max-width: 767.98px) {
  .quote-qty-input,
  .quote-price-input {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: 1 1 auto;
  }
}

@media (max-width: 767.98px) {
  .btn {
    min-height: 38px;
  }

  .btn-sm {
    min-height: 30px;
    padding: 0.2rem 0.5rem;
  }

  .erp-actions .btn,
  .erp-actions button {
    min-height: 30px;
    padding: 0.2rem 0.45rem;
  }

  .row.mx-auto.w-100.display-flex.align-items-center.justify-content-space-between > [class*="col-"],
  .row.mx-auto.w-100.align-items-center.g-3 > [class*="col-"],
  .row.mx-auto.w-100.align-items-start.g-3 > [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
  }
}

.p-small {
  padding: 1px 15px 1px 15px !important;
}

.card-body-small {
  flex: 1 1 auto;
  padding: 5px 7px 5px 9px;
  color: var(--bs-card-color);
}

.card-body-small-eq {
  flex: 1 1 auto;
  padding: 5px 9px 2px;
  color: var(--bs-card-color);
}

.font-size-sm {
  font-size: 0.75em;
  letter-spacing: 1px;
  font-weight: bold;
}

.selectDaIniziare {
  border: solid 4px #87b2f2;
}

.selectInCorso {
  border: solid 4px #ffa463;
}

.selectInAttesa {
  border: solid 4px #6b666f;
}

.selectCompletato {
  border: solid 4px #77bd8a;
}

.stato-completato-onlytext {
  color: #77bd8a;
}

.stato-da-iniziare-onlytext {
  color: #87b2f2;
}

.stato-in-attesa-onlytext {
  color: #6b666f;
}

.stato-in-corso-onlytext {
  color: #ffa463;
}

.stato-completato-text {
  background-color: #77bd8a;
  color: #0f3d1f;
  border-radius: 20px;
  padding: 2px 10px;
}

.stato-da-iniziare-text {
  background-color: #87b2f2;
  color: #0a326b;
  border-radius: 20px;
  padding: 2px 10px;
}

.stato-in-corso-text {
  background-color: #ffa463;
  color: #5f3200;
  border-radius: 20px;
  padding: 2px 10px;
}

.stato-in-attesa-text {
  background-color: #6b666f;
  color: #ffffff;
  border-radius: 20px;
  padding: 2px 10px;
}

.cliente-bullet {
  display: inline-block;
  width: 12px;
  margin-right: 7px;
  border-radius: 100%;
  height: 12px;
}

.bi-person-circle {
  color: #adb5bd;
}

/* Esempio: Se il select è in stato "In corso", l'alone diventa giallo invece che azzurro */

.selectInCorso:focus {
  border-color: #ffc107;
  box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25);
}

.selectCompletato:focus {
  border-color: #77bd8a;
  box-shadow: 0 0 0 0.25rem #b7f4c6;
}

.selectInAttesa:focus {
  border-color: #989898;
  box-shadow: 0 0 0 0.25rem #d2d2d2;
}

@media (min-width: 768px) {
  .prio-pill {
    text-align: left !important;
    width: auto;
    display: inline-block;
  }
}

#note_td {
  word-wrap: break-word;
  width: auto;
}

@media (min-width: 768px) {
  .table td {
    vertical-align: middle;
  }

  /* Desktop table default: left-aligned */
  .table th:not(.text-end):not(.text-center),
  .table td:not(.text-end):not(.text-center) {
    text-align: left;
  }
}

.table td {
  font-weight: 500;
}

.loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  position: relative;
  animation: rotate 1s linear infinite;
}

.loader::before,
.loader::after {
  content: "";
  box-sizing: border-box;
  position: absolute;
  inset: 0px;
  border-radius: 50%;
  border: 5px solid #fff;
  animation: prixClipFix 2s linear infinite;
}

.loader::after {
  inset: 8px;
  transform: rotate3d(90, 90, 0, 180deg);
  border-color: #ff3d00;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes prixClipFix {
  0% {
    clip-path: polygon(50% 50%, 0 0, 0 0, 0 0, 0 0, 0 0);
  }

  50% {
    clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 0, 100% 0, 100% 0);
  }

  75%,
  100% {
    clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 100% 100%, 100% 100%);
  }
}

/* =========================
   DASHBOARD
========================= */

.dashboard-loading {
  min-height: 360px;
}

.dashboard-icon-box {
  width: 44px;
  height: 44px;
  color: var(--app-text);
}

.dashboard-list-item {
  display: block;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--bs-border-color);
  color: var(--app-text);
  transition: background 0.12s ease;
  text-decoration: none !important;
}

.dashboard-list-item:first-child {
  padding-top: 0;
}

.dashboard-list-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.dashboard-list-item:hover {
  color: var(--app-text);
  opacity: 0.75;
}

.dashboard-list-item .badge {
  font-size: 0.7rem;
}

.dashboard-kpi-value {
  font-size: 2rem;
}

.dashboard-kpi-danger { color: #dc3545; }
.dashboard-kpi-warning { color: #b8860b; }
.dashboard-kpi-success { color: #198754; }

.dashboard-icon-box-danger { background-color: #f8d7da !important; }
.dashboard-icon-box-warning { background-color: #fff3cd !important; }
.dashboard-icon-box-success { background-color: #d1e7dd !important; }
.dashboard-icon-box-info { background-color: #dbeafe !important; }
.dashboard-icon-box-primary { background-color: var(--sidebar-active) !important; }

.dashboard-list-priority {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.dashboard-list-priority .priority-dot {
  width: 6px;
  height: 6px;
}

.dashboard-empty-icon {
  font-size: 2rem;
  color: #dee2e6;
  margin-bottom: 0.5rem;
}

.dashboard-kpi-card {
  transition: transform 0.15s ease;
}

.dashboard-kpi-card:hover {
  transform: translateY(-1px);
}

.dashboard-kpi-label {
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dashboard-kpi-finance {
  font-size: 1.3rem;
}

.dashboard-today-item {
  display: block;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  background: #fff;
  color: var(--app-text);
  transition: background 0.12s ease, border-color 0.12s ease;
  text-decoration: none !important;
}

.dashboard-today-item:hover {
  background: var(--sidebar-hover);
  border-color: var(--app-primary);
  color: var(--app-text);
}

.dashboard-today-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.9rem;
}

.dashboard-today-task_scaduta {
  background: #f8d7da;
  color: #dc3545;
}

.dashboard-today-task_in_scadenza {
  background: #fff3cd;
  color: #b8860b;
}

.dashboard-today-evento {
  background: #dbeafe;
  color: #0d6efd;
}

/* =========================
   SITUAZIONE OPERATIVA (cliente / lavoro)
   ========================= */

.situ-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.situ-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 90px;
  padding: 0.7rem 0.6rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  background: #fff;
  text-decoration: none !important;
  color: inherit;
  transition: transform 0.12s ease;
}

.situ-item:hover {
  transform: translateY(-1px);
}

.situ-value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.situ-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--app-text-muted);
  text-align: center;
  line-height: 1.2;
}

.situ-item-danger  { border-left: 3px solid #dc3545; }
.situ-item-danger .situ-value { color: #dc3545; }

.situ-item-warning { border-left: 3px solid #ffc107; }
.situ-item-warning .situ-value { color: #b8860b; }

.situ-item-info    { border-left: 3px solid #0d6efd; }
.situ-item-info .situ-value { color: #0d6efd; }

.situ-item-neutral { border-left: 3px solid var(--app-text-muted); }
.situ-item-neutral .situ-value { color: var(--app-text-muted); }

.situ-item-ok      { border-left: 3px solid #198754; }
.situ-item-ok .situ-value { color: #198754; font-size: 1.1rem; }

@media (max-width: 575.98px) {
  .situ-item {
    min-width: 72px;
    padding: 0.5rem 0.4rem;
  }
  .situ-value {
    font-size: 1.1rem;
  }
  .situ-label {
    font-size: 0.62rem;
  }
}

.dashboard-today-da_approvare {
  background: #fff3cd;
  color: #b8860b;
}

.dashboard-today-followup {
  background: #d1e7dd;
  color: #198754;
}

@media (max-width: 575.98px) {
  .dashboard-kpi-value {
    font-size: 1.4rem;
  }

  .dashboard-kpi-label {
    font-size: 0.65rem;
  }

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

  .dashboard-icon-box i {
    font-size: 0.8rem;
  }

  .dashboard-today-item {
    padding: 0.55rem 0.6rem;
  }
}

/* =========================
   CALENDARIO EDITORIALE - HEADER
========================= */

.editorial-page-header {
  padding-right: 1rem;
}

/* =========================
   CALENDARIO EDITORIALE - NESSUN CLIENTE
========================= */

.editorial-no-cliente-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 2px dashed rgba(17, 17, 17, 0.12);
  border-radius: 14px;
  background: #f8f9fa;
}

.editorial-no-cliente-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--app-primary);
  color: var(--app-text);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.editorial-no-cliente-body {
  min-width: 0;
  flex: 1 1 auto;
}

.editorial-no-cliente-body h6 {
  font-size: 1rem;
}

@media (max-width: 575.98px) {
  .editorial-no-cliente-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 1.25rem;
  }

  .editorial-no-cliente-body .d-flex {
    justify-content: center;
  }
}

/* =========================
   CALENDARIO EDITORIALE - LISTA HEADER
========================= */

.editorial-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 767.98px) {
  .editorial-list-header {
    flex-direction: column;
  }
}

/* =========================
   CALENDARIO EDITORIALE - FILTRI
========================= */

.editorial-filter-bar .form-label {
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
}

.editorial-filter-bar .form-control,
.editorial-filter-bar .form-select {
  font-size: 0.88rem;
}

@media (min-width: 768px) {
  .editorial-filter-bar .col-xl-3 {
    border-radius: 8px;
  }

  .editorial-filter-bar .col-xl-3 .form-select {
    border-color: rgba(32, 227, 127, 0.35);
    background-color: #fff;
  }

  .editorial-filter-bar .col-xl-3 .form-label {
    color: var(--app-primary);
  }
}

@media (max-width: 767.98px) {
  .editorial-filter-bar .col-12 > .btn {
    min-height: 42px;
  }
}

/* =========================
   CALENDARIO EDITORIALE - EMPTY STATE
========================= */

.editorial-empty-state {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  text-align: left;
}

.editorial-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #e9ecef;
  color: var(--app-text-muted);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.editorial-empty-body {
  min-width: 0;
  flex: 1 1 auto;
}

.editorial-empty-body h6 {
  font-size: 1rem;
}

@media (max-width: 575.98px) {
  .editorial-empty-state {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem;
  }

  .editorial-empty-body .btn {
    width: 100%;
  }
}

/* =========================
   EDITORIAL CALENDAR - ADJACENT MONTH DAYS
========================= */
.editorial-day-cell-inactive {
  opacity: 0.5;
  pointer-events: none;
}

.editorial-day-cell-inactive .editorial-day-add {
  display: none;
}

.editorial-day-cell-inactive .editorial-calendar-item {
  opacity: 0.7;
}

/* =========================
   EDITORIAL IMAGES GRID (mult immagine)
========================= */
.editorial-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  min-height: 60px;
}

.editorial-image-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
}

.editorial-image-primary {
  position: relative;
}

.editorial-image-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  line-height: 1.2;
  pointer-events: none;
}

.editorial-image-thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--bs-border-color);
  background: #f8f9fa;
}

.editorial-image-thumb:hover {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 2px rgba(32, 227, 127, 0.25);
}

.editorial-image-thumb-wrapper {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.editorial-image-order {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
  pointer-events: none;
}

.editorial-image-remove-btn {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
}

/* =========================
   LIGHTBOX
========================= */
.editorial-lightbox-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* layout frecce esterne: [<] [immagine] [>] */
.lightbox-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  gap: 0.25rem;
}

.lightbox-arrow {
  flex: 0 0 auto;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 5;
  opacity: 0.5;
  transition: opacity 0.15s;
  line-height: 0;
}

.lightbox-arrow:hover {
  opacity: 1;
}

#lightboxCarousel,
#moodboardLightboxCarousel {
  flex: 1 1 auto;
  max-width: 100%;
  min-width: 0;
}

#lightboxCarouselInner,
#moodboardLightboxInner {
  min-height: 40vh;
}

#editorialLightboxModal .carousel-item,
#moodboardLightboxModal .carousel-item {
  text-align: center;
}

.lightbox-img-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
}

@media (max-width: 576px) {
  .lightbox-img-wrapper {
    min-height: 25vh;
  }
  #lightboxCarouselInner,
  #moodboardLightboxInner {
    min-height: 25vh;
  }
  .lightbox-arrow {
    padding: 0.75rem 0.5rem;
  }
  .lightbox-layout {
    gap: 0.125rem;
  }
}

.lightbox-footer {
  flex: 0 0 auto;
  text-align: center;
  padding: 0.5rem 1rem 1rem;
}

/* =========================
   CALENDAR ERP - GRIGLIA MESE
========================= */

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-header-cell {
  padding: 0.65rem 0;
  font-weight: 700;
  font-size: 0.88rem;
  text-align: center;
  border-right: 1px solid var(--bs-border-color);
  background: #f8f9fa;
}

.calendar-header-cell:last-child {
  border-right: 0;
}

.calendar-day-cell {
  min-height: 145px;
  padding: 0.5rem;
  border-right: 1px solid var(--bs-border-color);
  border-bottom: 1px solid var(--bs-border-color);
}

.calendar-day-cell:nth-child(7n) {
  border-right: 0;
}

.calendar-day-cell-inactive {
  background: #f8f9fa;
}

.calendar-day-cell-inactive .calendar-day-number {
  color: var(--app-text-muted);
}

.calendar-day-number {
  font-weight: 700;
  font-size: 0.9rem;
}

.calendar-day-today .calendar-day-number {
  color: var(--app-primary);
}

.calendar-event-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.calendar-event-item {
  display: block;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 6px;
  background: #fff;
  color: inherit;
  font-size: 0.78rem;
  line-height: 1.25;
  text-decoration: none !important;
}

.calendar-event-item:hover {
  background: var(--sidebar-hover);
}

.calendar-event-title {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-time {
  font-size: 0.68rem;
  color: var(--app-text-muted);
}

@media (max-width: 575.98px) {
  .calendar-day-cell {
    min-height: 110px;
    padding: 0.35rem;
  }
}

/* =========================
   CALENDAR ERP - TABELLA
========================= */

.calendar-table {
  min-width: 820px;
  table-layout: fixed;
}

.calendar-table th,
.calendar-table td {
  vertical-align: middle !important;
}

.calendar-table .col-title {
  width: 26%;
}

.calendar-table .col-refs {
  width: 14%;
}

/* =========================
   TASK ERP - TABELLA
========================= */

.priority-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}

.priority-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.priority-urgente .priority-dot,
.priority-alta .priority-dot { background-color: #dc3545; }

.priority-media .priority-dot { background-color: #ffc107; }

.priority-bassa .priority-dot { background-color: #198754; }

.priority-urgente,
.priority-alta { color: #842029; }

.priority-media { color: #664d03; }

.priority-bassa { color: #0f5132; }

.col-prio {
  width: 70px;
}

/* Col-prio for cliente lavori table */
.col-prio-cliente {
  width: 72px;
}

.lavoro-note-icon {
  font-size: 1rem;
  color: #7e508d !important;
  cursor: help;
}

.preventivo-importo {
  font-size: 0.95rem;
  white-space: nowrap;
}

/* =========================
   MAIL - TABELLA
========================= */

.mail-table {
  min-width: 860px;
  table-layout: fixed;
}

.mail-table th,
.mail-table td {
  vertical-align: middle !important;
}

.mail-table .col-data {
  width: 15%;
}

.mail-table .col-stato {
  width: 11%;
}

.mail-table .col-mittente {
  width: 38%;
}

.mail-table .col-account {
  width: 14%;
}

.mail-table .col-collegamenti {
  width: 14%;
}

.mail-table .col-azioni {
  width: 8%;
}

.mail-row-unread {
  background: rgba(32, 227, 127, 0.04) !important;
}

.mail-row-unread .fw-bold {
  color: var(--app-text);
}

/* Mobile card unread usa accento verde invece di bordo warning */
.mobile-list .mail-card-unread {
  border-left: 3px solid var(--app-primary);
  background: rgba(32, 227, 127, 0.04);
}

/* =========================
   MOODBOARD — INDEX (compact grid cards)
   ========================= */

.moodboard-index-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.5rem;
}

.moodboard-index-card {
  border-radius: 8px;
  border: 1px solid var(--bs-border-color);
  background: #fff;
  overflow: hidden;
  text-decoration: none !important;
  color: inherit !important;
  display: block;
}

.moodboard-index-card:hover {
}

.moodboard-index-card-cover {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f8f9fa;
  line-height: 0;
}

.moodboard-index-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.moodboard-index-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--app-text-muted);
  font-size: 1rem;
  background: #f8f9fa;
}

.moodboard-index-card-body {
  padding: 0.5rem 0.55rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.moodboard-index-card-title {
  font-weight: 700;
  margin: 0;
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.moodboard-index-card-body .badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1399.98px) {
  .moodboard-index-grid { grid-template-columns: repeat(8, 1fr); }
}

@media (max-width: 1199.98px) {
  .moodboard-index-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 767.98px) {
  .moodboard-index-grid { grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }
}

@media (max-width: 479.98px) {
  .moodboard-index-grid { grid-template-columns: repeat(2, 1fr); gap: 0.35rem; }
}

/* =========================
   MOODBOARD — DETAIL (compact grid)
   ========================= */

.moodboard-images-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.5rem;
}

.moodboard-images-grid .moodboard-card {
  aspect-ratio: 1 / 1;
  margin-bottom: 0;
  border-radius: 8px;
  position: relative;
  background: #f8f9fa;
  border: 1px solid var(--bs-border-color);
  overflow: hidden;
  transform: none !important;
  box-shadow: none !important;
}

.moodboard-images-grid .moodboard-card:hover {
  transform: none !important;
  box-shadow: none !important;
}

.moodboard-images-grid .moodboard-card-img-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
}

.moodboard-images-grid .moodboard-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.moodboard-images-grid .moodboard-card-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  font-size: 1.25rem;
}

.moodboard-images-grid .moodboard-card-body {
  position: absolute;
  inset: 0;
  padding: 0.4rem;
  background: linear-gradient(transparent 55%, rgba(0, 0, 0, 0.65));
  opacity: 0;
  transition: opacity 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  z-index: 2;
  border-radius: 8px;
}

.moodboard-images-grid .moodboard-card:hover .moodboard-card-body {
  opacity: 1;
}

.moodboard-images-grid .moodboard-card-body h6 {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.2;
}

.moodboard-images-grid .moodboard-card-body p,
.moodboard-images-grid .moodboard-card-body a {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 0.62rem;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  margin: 0;
  text-decoration: none;
}

.moodboard-images-grid .moodboard-card-body a:hover {
  text-decoration: underline;
}

.moodboard-images-grid .moodboard-card-delete {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.15s;
}

.moodboard-images-grid .moodboard-card:hover .moodboard-card-delete,
.moodboard-images-grid .moodboard-card-delete:focus-within {
  opacity: 1;
}

.moodboard-images-grid .moodboard-card-delete .btn {
  width: 26px;
  height: 26px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.7rem;
}

@media (max-width: 1199.98px) {
  .moodboard-images-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 767.98px) {
  .moodboard-images-grid { grid-template-columns: repeat(4, 1fr); gap: 0.35rem; }
}

@media (max-width: 479.98px) {
  .moodboard-images-grid { grid-template-columns: repeat(2, 1fr); gap: 0.35rem; }
}

.loading-container {
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================
   FILE BROWSER
========================= */

.file-browser-table {
  width: 100%;
}

.file-browser-table td:first-child i.bi {
  font-size: 1.1rem;
}

.file-browser-row {
  cursor: default;
}

.file-browser-row:has(td:first-child a.stretched-link-dir) {
  cursor: pointer;
}

.file-browser-row:has(td:first-child a.stretched-link-dir):hover {
  background: rgba(32, 227, 127, 0.05);
}

.file-browser-row td:first-child a.stretched-link-dir {
  display: inline-flex;
  align-items: center;
  width: 100%;
}

/* Column widths */
.file-browser-table .fb-size-col {
  width: 90px;
}

.file-browser-table .fb-date-col {
  width: 140px;
}

.file-browser-table .fb-actions-col {
  width: 132px;
}

/* Name cell — dominant column, truncate long names */
.file-browser-table .fb-name-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: auto;
  max-width: none;
}

.file-browser-table .fb-name-cell a,
.file-browser-table .fb-name-cell > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.file-browser-table .fb-name-cell a.stretched-link-dir span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

@media (max-width: 575.98px) {
  .file-browser-table .fb-size-col,
  .file-browser-table .fb-date-col {
    display: none;
  }

  .file-browser-table .fb-actions-col {
    width: 75px;
  }
}

.folder-path-code {
  word-break: break-all;
}

/* =========================
   CONFIRM MODALE GLOBALE
   ========================= */

.erp-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}
.erp-confirm-modal {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 420px;
  margin: 1rem;
  overflow: hidden;
}
.erp-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0;
}
.erp-confirm-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.erp-confirm-close {
  background: none;
  border: none;
  padding: 0.25rem;
  color: #6c757d;
  cursor: pointer;
  line-height: 1;
}
.erp-confirm-close:hover {
  color: var(--app-text);
}
.erp-confirm-body {
  padding: 1rem 1.5rem 1.25rem;
  color: #495057;
  font-size: 0.95rem;
  line-height: 1.5;
}
.erp-confirm-body p {
  margin: 0;
}
.erp-confirm-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0 1.5rem 1.25rem;
}
@media (max-width: 575.98px) {
  .erp-confirm-footer {
    flex-direction: column-reverse;
  }
  .erp-confirm-footer .btn {
    width: 100%;
  }
}

/* =========================
   APPUNTI OPERATIVI
   ========================= */

.erp-notes-card {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  background: #fafbfc;
}

.erp-notes-content {
  font-size: 0.925rem;
  line-height: 1.65;
  color: #212529;
}

.erp-notes-content p:last-child {
  margin-bottom: 0;
}

.erp-notes-icon {
  font-size: 1.1rem;
  color: #6c757d;
}

.erp-notes-empty {
  color: #adb5bd;
  font-style: italic;
  font-size: 0.9rem;
}

.editoriale-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.editoriale-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}
@media (max-width: 575.98px) {
  .editoriale-header {
    flex-direction: column;
  }
  .editoriale-actions {
    width: 100%;
  }
  .editoriale-actions .btn {
    width: 100%;
  }
}

/* =========================
   PREVENTIVO PDF ESTERNO (Scheda Lavoro)
   Single-row layout: info left, actions right
========================= */
.prev-card-pdf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.prev-card-pdf-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}
.prev-card-pdf-icon {
  font-size: 1.5rem;
  line-height: 1;
  color: #dc3545;
  flex-shrink: 0;
}
.prev-card-pdf-title {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prev-card-pdf-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}
.prev-card-pdf-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
@media (max-width: 575.98px) {
  .prev-card-pdf {
    flex-direction: column;
    align-items: flex-start;
  }
  .prev-card-pdf-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.35rem;
  }
}

/* =========================
   REPORT OPERATIVO
   ========================= */

.report-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.report-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  line-height: 1.3;
}

.report-item + .report-item {
  border-top: 1px solid var(--app-border);
}

.report-icon {
  flex: 0 0 auto;
  font-size: 0.9rem;
  width: 1.25rem;
  text-align: center;
}

.report-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--app-text);
}

.report-link {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--app-primary);
  white-space: nowrap;
  text-decoration: none !important;
}

.report-link:hover {
  text-decoration: underline !important;
}

@media (max-width: 575.98px) {
  .report-item {
    font-size: 0.8rem;
    gap: 0.4rem;
    padding: 0.3rem 0;
  }
  .report-icon {
    font-size: 0.82rem;
    width: 1.1rem;
  }
  .report-link {
    font-size: 0.74rem;
  }
}

/* =========================
   KANBAN BOARD
   ========================= */

.kanban-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.kanban-board {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  min-width: max-content;
  align-items: flex-start;
}

.kanban-column {
  flex: 0 0 300px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kanban-column-header {
  padding: 0.6rem 0.75rem;
  border-radius: 10px 10px 0 0;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.kanban-col-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.1);
  margin-left: auto;
}

.kanban-col-da_fare     { background: #e3f0ff; color: #0d6efd; }
.kanban-col-in_corso    { background: #fff3e0; color: #b85a00; }
.kanban-col-in_revisione { background: #f3e8ff; color: #7b2eda; }
.kanban-col-completata  { background: #e6f9ed; color: #198754; }
.kanban-col-annullata   { background: #f0f0f0; color: #6c757d; }
.kanban-col-altro       { background: #f5f5f5; color: #6c757d; }

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0;
  max-height: clamp(360px, calc(100vh - 260px), 720px);
  overflow-y: auto;
  min-height: 60px;
}

.kanban-card {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.kanban-card:hover {
}

.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 20px;
}

.kanban-card-date {
  font-size: 0.72rem;
  color: var(--app-text-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.kanban-card-date i {
  font-size: 0.7rem;
}

.kanban-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card-title a {
  color: var(--app-text);
  text-decoration: none !important;
}

.kanban-card-title a:hover {
  color: var(--app-primary);
  text-decoration: underline !important;
}

.kanban-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-height: 0;
}

.kanban-card-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: #f0f0f0;
  color: #555;
  line-height: 1.2;
  white-space: nowrap;
}

.kanban-card-footer {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  margin-top: 0.1rem;
}

.kanban-card-ref {
  font-size: 0.72rem;
  color: var(--app-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.kanban-card-ref i {
  font-size: 0.7rem;
  flex-shrink: 0;
}

.kanban-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.5rem;
  font-size: 0.78rem;
  color: var(--app-text-muted);
  font-style: italic;
}

@media (max-width: 575.98px) {
  .kanban-column {
    flex: 0 0 280px;
    max-width: 280px;
  }
  .kanban-cards {
    max-height: clamp(300px, calc(100vh - 280px), 600px);
  }
  .kanban-card-title {
    font-size: 0.84rem;
  }
}

/* Drag handle */
.kanban-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  min-height: 100%;
  padding: 0.65rem 0;
  color: #adb5bd;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transition: color 0.12s ease, background 0.12s ease;
  border-radius: 10px 0 0 10px;
  background: transparent;
}
.kanban-drag-handle:hover {
  color: #6c757d;
  background: rgba(0, 0, 0, 0.03);
}
.kanban-drag-handle:active {
  cursor: grabbing;
  color: var(--app-text);
  background: rgba(0, 0, 0, 0.06);
}
.kanban-drag-handle i {
  font-size: 0.9rem;
  line-height: 1;
}

/* Card body wraps content next to the handle */
.kanban-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem 0.65rem 0;
}

/* SortableJS feedback */
.kanban-chosen {
  opacity: 0.6 !important;
}
.kanban-dragging {
  opacity: 0.4 !important;
}
.kanban-ghost {
  opacity: 0.3 !important;
  background: #f0f0f0 !important;
  border: 2px dashed #adb5bd !important;
  border-radius: 10px;
}
.kanban-ghost * {
  opacity: 0 !important;
}



/* =========================
   TASK LIST REWORK
========================= */

.task-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.task-filter-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  color: var(--app-text);
  text-decoration: none !important;
  background: transparent;
  transition: all 0.15s ease;
}
.task-filter-tab:hover {
  background: var(--app-light-bg);
  border-color: var(--app-primary);
  color: var(--app-primary);
}
.task-filter-tab.active {
  background: var(--app-primary);
  border-color: var(--app-primary);
  color: #fff;
}

.task-group {
  margin-bottom: 1.5rem;
}
.task-group:last-child {
  margin-bottom: 0;
}
.task-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.35rem;
  border-radius: 8px;
  background: var(--app-light-bg);
  border-left: 4px solid var(--app-primary);
}
.task-group-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.task-group-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.task-group-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(0,0,0,0.08);
  color: var(--app-text-muted);
}
.task-group-link {
  color: var(--app-text-muted);
  font-size: 0.8rem;
  text-decoration: none !important;
  flex-shrink: 0;
}
.task-group-link:hover {
  color: var(--app-primary);
}

.task-row td {
  vertical-align: middle;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}
.task-row .task-name {
  color: var(--app-text);
}
.task-row .task-name:hover {
  color: var(--app-primary);
}
.col-check {
  width: 36px;
  padding-right: 0 !important;
}
.col-lavoro {
  width: 130px;
}

.task-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--app-primary);
}

.task-group-mobile {
  margin-bottom: 1rem;
}
.task-group-header-mobile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  background: var(--app-light-bg);
  border-left: 4px solid var(--app-primary);
  border-radius: 0;
}
.task-row-mobile {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--app-border);
}
.task-row-mobile:last-child {
  border-bottom: none;
}

/* =========================
   PAGINATION (ERP)
========================= */

.page-link {
  border-radius: 8px !important;
  margin: 0 2px;
  color: var(--app-text);
  border: 1px solid rgba(17, 17, 17, 0.12);
  padding: 0.375rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.page-link:hover {
  color: var(--app-primary);
  background-color: #f8f9fa;
  border-color: var(--app-primary);
}

.page-item.active .page-link {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
  color: var(--app-text);
}

.page-item.disabled .page-link {
  color: #adb5bd;
  pointer-events: none;
  background-color: #f8f9fa;
  border-color: var(--app-border);
}

