/* ============================================================
   AZIENDE CON DURC — App CSS v4
   Professional · Mobile-first · No-emoji
   ============================================================ */

:root {
  --blu:      #1a3a5c;
  --blu-md:   #2563a8;
  --blu-lt:   #eff6ff;
  --verde:    #1d6a3e;
  --verde-md: #40916c;
  --verde-lt: #f0fdf4;
  --rosso:    #dc2626;
  --rosso-lt: #fef2f2;
  --amber:    #d97706;
  --amber-lt: #fffbeb;
  --slate:    #1e293b;
  --muted:    #64748b;
  --muted-lt: #94a3b8;
  --border:   #e2e8f0;
  --bg:       #f4f6f9;
  --white:    #ffffff;
  --r:        10px;
  --shadow:   0 2px 12px rgba(0,0,0,.07);
  --shadow-md:0 4px 24px rgba(0,0,0,.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Inter, 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--slate);
  line-height: 1.6;
  font-size: 15px;
}
a { color: var(--blu-md); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

/* ── FORM ── */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, .field-a label {
  font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .02em;
  text-transform: uppercase;
}
.field input, .field select, .field textarea,
.field-a input, .field-a select, .field-a textarea {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: .6rem .85rem;
  font-size: .92rem;
  color: var(--slate);
  background: var(--white);
  font-family: inherit;
  width: 100%;
  transition: border-color .18s, box-shadow .18s;
}
.field input:focus, .field select:focus, .field textarea:focus,
.field-a input:focus, .field-a select:focus, .field-a textarea:focus {
  outline: none;
  border-color: var(--blu);
  box-shadow: 0 0 0 3px rgba(26,58,92,.1);
}
.field__wrap { position: relative; display: flex; align-items: center; }
.field__wrap input { padding-left: 2.5rem; }
.field__icon { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.field__eye { position: absolute; right: 10px; background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; display: flex; }
.field__eye svg { width: 16px; height: 16px; }
.field__hint { font-size: .75rem; color: var(--muted-lt); margin-top: 2px; }
.field-a { margin-bottom: .85rem; }

.field-grid { display: grid; gap: .85rem; }
.field-grid--2 { grid-template-columns: 1fr 1fr; }
.field-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.fg2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.fg3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .75rem; }

@media(max-width:560px) {
  .field-grid--2, .field-grid--3, .fg2, .fg3 { grid-template-columns: 1fr; }
}

.form-section-title, .st {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 1.1rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: .62rem 1.35rem;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  text-decoration: none;
  transition: background .18s, opacity .18s, transform .12s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn--primary   { background: var(--blu);      color: #fff; }
.btn--primary:hover { background: #122c47; color: #fff; text-decoration: none; }
.btn--green     { background: var(--verde-md); color: #fff; }
.btn--green:hover { background: var(--verde); color: #fff; text-decoration: none; }
.btn--outline   { background: transparent; border: 1.5px solid var(--border); color: var(--muted); }
.btn--outline:hover { border-color: var(--blu); color: var(--blu); text-decoration: none; }
.btn--danger    { background: var(--rosso); color: #fff; }
.btn--danger:hover { background: #b91c1c; color: #fff; text-decoration: none; }
.btn--ghost     { background: var(--bg); border: 1.5px solid var(--border); color: var(--muted); }
.btn--ghost:hover { border-color: var(--muted); color: var(--slate); text-decoration: none; }
.btn--sm  { padding: .38rem .85rem; font-size: .8rem; }
.btn--xs  { padding: .28rem .65rem; font-size: .75rem; }
.btn--full { width: 100%; justify-content: center; }

/* Legacy admin button aliases */
.btn-p { background: var(--blu); color: #fff; display: inline-flex; align-items: center; gap: 6px; padding: .5rem 1rem; border-radius: 8px; font-size: .84rem; font-weight: 600; cursor: pointer; border: none; font-family: inherit; text-decoration: none; transition: background .18s; }
.btn-p:hover { background: #122c47; color: #fff; text-decoration: none; }
.btn-g { background: var(--verde-md); color: #fff; display: inline-flex; align-items: center; gap: 6px; padding: .5rem 1rem; border-radius: 8px; font-size: .84rem; font-weight: 600; cursor: pointer; border: none; font-family: inherit; transition: background .18s; }
.btn-g:hover { background: var(--verde); color: #fff; }
.btn-o { background: transparent; border: 1.5px solid var(--border); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: .5rem 1rem; border-radius: 8px; font-size: .84rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .18s; }
.btn-o:hover { border-color: var(--blu); color: var(--blu); }
.btn-sm { padding: .35rem .8rem; font-size: .78rem; }

/* ── ALERTS ── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: var(--r); padding: .85rem 1.1rem;
  font-size: .88rem; line-height: 1.55;
  border-left: 4px solid transparent;
}
.alert--ok   { background: var(--verde-lt); border-color: var(--verde-md); color: #14532d; }
.alert--err  { background: var(--rosso-lt); border-color: var(--rosso);    color: #7f1d1d; }
.alert--warn { background: var(--amber-lt); border-color: var(--amber);     color: #78350f; }
.alert--info { background: var(--blu-lt);   border-color: var(--blu-md);    color: #1e3a5f; }

/* Legacy admin alert aliases */
.alert-a { display: flex; align-items: flex-start; gap: 8px; border-radius: var(--r); padding: .75rem 1rem; font-size: .88rem; margin-bottom: 1rem; border-left: 4px solid transparent; }
.alert-ok  { background: var(--verde-lt); border-color: var(--verde-md); color: #14532d; }
.alert-err { background: var(--rosso-lt); border-color: var(--rosso);    color: #7f1d1d; }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.badge--green  { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge--blue   { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge--amber  { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.badge--gray   { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge--red    { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
/* Legacy */
.bg  { background: #dcfce7; color: #15803d; }
.bb  { background: #dbeafe; color: #1d4ed8; }
.bo  { background: #ffedd5; color: #c2410c; }
.bgr { background: #f1f5f9; color: #475569; }
.br  { background: #fee2e2; color: #b91c1c; }

/* ── SPINNER ── */
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── AUTH ── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background: var(--blu);
}
.auth-card {
  background: var(--white); border-radius: 16px; padding: 2.5rem 2rem;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-md);
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo__icon { font-size: 2rem; display: block; margin-bottom: .5rem; }
.auth-logo__name { font-size: 1.25rem; font-weight: 800; color: var(--slate); margin-bottom: .2rem; }
.auth-logo__sub  { font-size: .82rem; color: var(--muted); }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .84rem; color: var(--muted); }
.auth-footer a { color: var(--blu-md); font-weight: 600; }

/* ── TOPBAR (dashboard aziende) ── */
.topbar {
  background: linear-gradient(135deg, var(--blu) 0%, var(--verde) 100%);
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.22);
}
.topbar__brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: .97rem; text-decoration: none; }
.topbar__brand:hover { text-decoration: none; color: #fff; }
.topbar__right { display: flex; align-items: center; gap: .65rem; }
.topbar__cred {
  background: rgba(255,255,255,.14); color: #fff;
  border-radius: 6px; padding: 4px 12px; font-size: .82rem; font-weight: 700;
  border: 1px solid rgba(255,255,255,.18);
}
.topbar__cred--zero { background: rgba(220,38,38,.35); }
.topbar__btn {
  background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.18); border-radius: 7px;
  padding: 5px 12px; font-size: .82rem; font-weight: 600;
  cursor: pointer; font-family: inherit; text-decoration: none; transition: background .18s;
}
.topbar__btn:hover { background: rgba(255,255,255,.2); color: #fff; text-decoration: none; }

/* Hamburger */
.topbar__ham {
  display: none; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px; padding: 7px 9px; cursor: pointer; flex-direction: column; gap: 4px;
}
.topbar__ham span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; }
@media(max-width:768px) { .topbar__ham { display: flex; } }
@media(max-width:900px) { .topbar__ham { display: flex; } }

/* ── DASHBOARD LAYOUT ── */
.dash-layout {
  display: grid; grid-template-columns: 230px 1fr;
  min-height: calc(100vh - 58px);
}
@media(max-width:768px) { .dash-layout { grid-template-columns: 1fr; } }

/* ── SIDEBAR ── */
.dash-sidebar {
  background: var(--white); border-right: 1px solid var(--border);
  min-height: calc(100vh - 58px);
  display: flex; flex-direction: column;
  position: sticky; top: 58px; height: calc(100vh - 58px); overflow-y: auto;
}
@media(max-width:768px) {
  .dash-sidebar {
    position: fixed; top: 58px; left: 0; width: 260px; z-index: 90;
    transform: translateX(-100%); transition: transform .28s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.14); height: 100vh;
  }
  .dash-sidebar.open { transform: translateX(0); }
}

.dash-sidebar__profile {
  padding: 1.35rem 1.25rem; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(26,58,92,.04) 0%, rgba(29,106,62,.04) 100%);
}
.dash-avatar {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, var(--blu) 0%, var(--verde) 100%); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; margin-bottom: .65rem;
  box-shadow: 0 2px 8px rgba(26,58,92,.25);
}
.dash-sidebar__nome { font-weight: 700; font-size: .92rem; margin-bottom: 2px; }
.dash-sidebar__citta { font-size: .77rem; color: var(--muted); }

.dash-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: .7rem 1.25rem; color: var(--muted); font-size: .88rem; font-weight: 500;
  text-decoration: none; transition: all .15s; position: relative; border-left: 3px solid transparent;
}
.dash-nav a svg { width: 17px; height: 17px; flex-shrink: 0; }
.dash-nav a:hover { background: var(--bg); color: var(--slate); text-decoration: none; }
.dash-nav a.active {
  background: var(--blu); color: #fff; font-weight: 700;
  border-left-color: var(--blu);
}
.dash-nav a.active svg { color: #fff; }
.dash-nav .badge-msg {
  background: var(--rosso); color: #fff; border-radius: 20px;
  padding: 1px 7px; font-size: 11px; font-weight: 700; margin-left: auto;
}

.dash-main { padding: 1.75rem; }
@media(max-width:768px) { .dash-main { padding: 1rem .85rem; } }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 80; }
.sidebar-overlay.show { display: block; }

/* ── STATS ── */
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media(max-width:560px) { .stats-grid { grid-template-columns: 1fr 1fr; } }
.stat-card {
  background: var(--white); border-radius: var(--r); padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow); text-align: left; border: 1px solid var(--border);
  border-left: 4px solid var(--blu); display: flex; align-items: center; gap: 1rem;
  transition: box-shadow .18s, transform .18s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card__icon {
  width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--blu-lt);
}
.stat-card__icon svg { width: 22px; height: 22px; color: var(--blu); }
.stat-card__body { flex: 1; min-width: 0; }
.stat-card strong { display: block; font-size: 2rem; font-weight: 800; color: var(--blu); line-height: 1; margin-bottom: 4px; }
.stat-card span { font-size: .74rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-card--warn { border-left-color: var(--rosso); }
.stat-card--warn .stat-card__icon { background: var(--rosso-lt); }
.stat-card--warn .stat-card__icon svg { color: var(--rosso); }
.stat-card--warn strong { color: var(--rosso); }
.stat-card--green { border-left-color: var(--verde-md); }
.stat-card--green .stat-card__icon { background: var(--verde-lt); }
.stat-card--green .stat-card__icon svg { color: var(--verde-md); }
.stat-card--green strong { color: var(--verde); }
.stat-card--amber { border-left-color: var(--amber); }
.stat-card--amber .stat-card__icon { background: var(--amber-lt); }
.stat-card--amber .stat-card__icon svg { color: var(--amber); }
.stat-card--amber strong { color: var(--amber); }

/* ── ADMIN TOPBAR ── */
.admin-top {
  background: linear-gradient(135deg, var(--blu) 0%, var(--verde) 100%);
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.22);
}
.admin-top__brand { color: #fff; font-size: .95rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.admin-top__actions { display: flex; gap: .5rem; }

/* ── ADMIN LAYOUT ── */
.admin-layout { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 58px); }
@media(max-width:900px) { .admin-layout { grid-template-columns: 1fr; } }

.admin-side {
  background: var(--white); border-right: 1px solid var(--border);
  position: sticky; top: 58px; height: calc(100vh - 58px); overflow-y: auto;
}
@media(max-width:900px) {
  .admin-side {
    position: fixed; top: 58px; left: 0; width: 260px; z-index: 90;
    transform: translateX(-100%); transition: transform .28s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.14); height: 100vh;
  }
  .admin-side.open { transform: translateX(0); }
}

.admin-nav a {
  display: flex; align-items: center; gap: 9px;
  padding: .65rem 1.2rem; color: var(--muted); font-size: .86rem; font-weight: 500;
  text-decoration: none; transition: all .15s; border-left: 3px solid transparent;
}
.admin-nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
.admin-nav a:hover { background: var(--bg); color: var(--slate); text-decoration: none; }
.admin-nav a.act { background: var(--blu); color: #fff; font-weight: 700; border-left-color: var(--blu); }
.admin-nav a.act svg { color: #fff; }
.admin-nav .n {
  margin-left: auto; background: var(--rosso); color: #fff;
  border-radius: 20px; padding: 1px 7px; font-size: 11px; font-weight: 700;
}
.admin-nav-sep { height: 1px; background: var(--border); margin: .4rem 0; }

.admin-main { padding: 1.75rem; }
@media(max-width:768px) { .admin-main { padding: 1rem .85rem; } }

/* (mobile-admin-nav rimossa — sostituita da hamburger + sidebar slide-in) */

/* ── PAGE HEADER ── */
.page-hd {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem;
}
.page-hd h2 { font-size: 1.15rem; font-weight: 700; color: var(--slate); }
.page-hd .back-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .82rem; color: var(--muted); font-weight: 500; text-decoration: none;
}
.page-hd .back-link:hover { color: var(--blu); text-decoration: none; }
.admin-main h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 1.25rem; }

/* ── CARD ── */
.card {
  background: var(--white); border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,.06); border: 1px solid var(--border); padding: 1.5rem;
  transition: box-shadow .18s;
}
.card:hover { box-shadow: 0 4px 24px rgba(0,0,0,.09); }
.card--section { margin-bottom: 1.25rem; }
.card__title {
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-bottom: 1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--border);
}

/* ── REQUEST COMPACT LIST ── */
.req-list { display: flex; flex-direction: column; gap: .5rem; }
.req-row {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r);
  padding: .9rem 1.25rem;
  display: grid;
  grid-template-columns: 120px 1fr auto auto;
  align-items: center; gap: .75rem 1rem;
  transition: border-color .15s, box-shadow .15s;
}
.req-row:hover { border-color: var(--blu-md); box-shadow: 0 2px 12px rgba(26,58,92,.08); }
.req-row__cat .badge { font-size: .72rem; white-space: nowrap; }
.req-row__body { min-width: 0; }
.req-row__service { font-size: .9rem; font-weight: 600; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-row__meta { font-size: .77rem; color: var(--muted); margin-top: 1px; }
.req-row__status { flex-shrink: 0; }
.req-row__actions { display: flex; gap: .4rem; align-items: center; flex-shrink: 0; }

@media(max-width:700px) {
  .req-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: .4rem .75rem;
  }
  .req-row__cat { grid-column: 1; grid-row: 1; }
  .req-row__status { grid-column: 2; grid-row: 1; }
  .req-row__body { grid-column: 1; grid-row: 2; }
  .req-row__actions { grid-column: 2; grid-row: 2; }
}

/* ── COMPANY LIST (assignment) ── */
.az-list {
  border: 1.5px solid var(--border); border-radius: var(--r);
  max-height: 320px; overflow-y: auto;
  background: var(--white);
}
.az-row {
  display: flex; align-items: center; gap: 10px;
  padding: .65rem 1rem; border-bottom: 1px solid #f1f5f9;
  cursor: pointer; transition: background .12s; font-size: .84rem;
}
.az-row:last-child { border-bottom: none; }
.az-row:hover { background: var(--bg); }
.az-row input[type=checkbox] { flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--blu); cursor: pointer; }
.az-row__name { font-weight: 600; flex: 1; min-width: 0; }
.az-row__meta { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.az-row--same { background: #f8fff9; }
.az-row--same:hover { background: #f0fdf4; }
.az-row__tag { font-size: .7rem; background: #dcfce7; color: #15803d; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }

/* ── TABLE ── */
.tw { background: var(--white); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--border); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 580px; }
th { background: var(--bg); padding: 10px 14px; text-align: left; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:last-child td { border: none; }
tr:hover td { background: #fafbfd; }

/* Mobile table → card reflow */
@media(max-width:640px) {
  .tw { overflow: visible; border: none; box-shadow: none; background: transparent; }
  table, thead, tbody, th, td, tr { display: block; min-width: unset; }
  thead tr { display: none; }
  tr { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: .65rem; padding: .75rem 1rem; box-shadow: var(--shadow); }
  tr:hover td { background: transparent; }
  td { padding: 5px 0; border: none; font-size: .85rem; }
  td::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
}

/* ── MESSAGES ── */
.msg-thread { display: flex; flex-direction: column; gap: .75rem; max-height: 440px; overflow-y: auto; padding: .5rem; background: var(--bg); border-radius: var(--r); margin-bottom: 1rem; }
.msg-bubble { max-width: 80%; padding: .75rem 1rem; border-radius: 12px; font-size: .87rem; line-height: 1.55; word-break: break-word; }
.msg-bubble--admin   { background: var(--blu); color: #fff; border-radius: 4px 12px 12px 12px; }
.msg-bubble--azienda { background: var(--white); border: 1px solid var(--border); color: var(--slate); border-radius: 12px 4px 12px 12px; }
.msg-bubble time { display: block; font-size: .7rem; opacity: .65; margin-top: 4px; }
.msg-empty { text-align: center; padding: 2.5rem; color: var(--muted); font-size: .88rem; }

/* ── SETTINGS GRID ── */
.sg { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 880px; }
@media(max-width:700px) { .sg { grid-template-columns: 1fr; } }
.sb { background: var(--white); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 1.5rem; }
.sb h3 { font-size: .9rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--border); color: var(--slate); }

/* ── CATEGORY PICKER ── */
.cat-picker { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.cat-opt { cursor: pointer; }
.cat-opt input { display: none; }
.cat-opt span { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border); border-radius: 8px; padding: .48rem .9rem; font-size: .84rem; font-weight: 600; transition: all .15s; white-space: nowrap; }
.cat-opt input:checked + span { border-color: var(--blu); background: var(--blu-lt); color: var(--blu); }

/* ── SERVIZI GRID ── */
.servizi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
@media(max-width:480px) { .servizi-grid { grid-template-columns: 1fr; } }
.servizio-opt { cursor: pointer; }
.servizio-opt input { display: none; }
.servizio-opt span { display: flex; align-items: center; gap: 6px; border: 1.5px solid var(--border); border-radius: 8px; padding: .48rem .75rem; font-size: .82rem; font-weight: 500; transition: all .15s; }
.servizio-opt input:checked + span { border-color: var(--blu); background: var(--blu-lt); color: var(--blu); font-weight: 700; }

/* ── MODALS ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9000; overflow-y: auto; padding: 2rem 1rem; align-items: flex-start; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: 14px; width: 100%; max-width: 560px; padding: 2rem; position: relative; margin: auto; }
.modal__close { position: absolute; top: 12px; right: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 5px 10px; cursor: pointer; font-size: .8rem; color: var(--muted); }
.modal h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1.25rem; }

/* ── DETAIL SECTIONS ── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1.25rem; font-size: .88rem; }
@media(max-width:540px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-grid dt { font-size: .73rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.detail-grid dd { font-weight: 500; color: var(--slate); }

/* ── FILTER BAR ── */
.filter-bar {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r);
  padding: 1rem 1.1rem; margin-bottom: 1.1rem;
  display: flex; gap: .65rem; flex-wrap: wrap; align-items: flex-end;
}
.filter-bar__item { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 120px; }
@media(max-width:768px) {
  .filter-bar__item { min-width: calc(50% - .65rem); flex: 1 1 calc(50% - .65rem); }
  .admin-main { overflow-x: hidden; }
}
@media(max-width:480px) {
  .filter-bar__item { min-width: 100%; flex: 1 1 100%; }
}
.filter-bar__item label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.filter-bar__item select,
.filter-bar__item input {
  border: 1.5px solid var(--border); border-radius: 7px; padding: .45rem .75rem;
  font-size: .84rem; font-family: inherit; background: var(--white); color: var(--slate);
  transition: border-color .18s;
}
.filter-bar__item select:focus,
.filter-bar__item input:focus { outline: none; border-color: var(--blu); }
.filter-count { font-size: .8rem; color: var(--muted); margin-bottom: .65rem; }

/* ── SECTION TAGS (category badges color variants) ── */
.cat-badge { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }

/* ── UNLOCK BLOCK ── */
.unlock-block {
  background: var(--blu-lt); border: 1.5px solid #bfdbfe; border-radius: var(--r);
  padding: 1.1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.unlock-block__text { font-size: .88rem; color: var(--slate); }
.unlock-block__text strong { color: var(--blu); }

.contact-block {
  background: var(--verde-lt); border: 1.5px solid #bbf7d0; border-radius: var(--r);
  padding: 1.1rem 1.25rem;
}
.contact-block__title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--verde); margin-bottom: .6rem; }
.contact-block__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .85rem; font-size: .88rem; }
@media(max-width:480px) { .contact-block__grid { grid-template-columns: 1fr; } }

/* ── DURC BADGE ── */
.durc-verified {
  display: inline-flex; align-items: center; gap: 5px;
  background: #dcfce7; color: #15803d;
  border-radius: 6px; padding: 3px 10px; font-size: .78rem; font-weight: 700;
}

/* ── MISC ── */
.section-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: .75rem; display: block;
}
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }
.text-muted { color: var(--muted); font-size: .85rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 1.5rem; }

.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty-state__icon { width: 48px; height: 48px; margin: 0 auto .75rem; opacity: .35; }
.empty-state p { font-size: .9rem; margin-top: .35rem; }

/* Azienda profile page */
.az-profile-hd {
  display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.az-avatar-lg {
  width: 64px; height: 64px; border-radius: 12px;
  background: var(--blu); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.4rem; flex-shrink: 0;
}
.az-profile-hd__name { font-size: 1.25rem; font-weight: 700; }
.az-profile-hd__sub  { font-size: .84rem; color: var(--muted); margin-top: 2px; }

/* Crediti block */
.crediti-highlight { text-align: center; padding: 1.5rem 1rem; }
.crediti-highlight__num { font-size: 3rem; font-weight: 900; color: var(--blu); line-height: 1; }
.crediti-highlight__num--zero { color: var(--rosso); }
.crediti-highlight__sub { font-size: .82rem; color: var(--muted); margin-top: 4px; }

/* ── Responsive grid fixes ── */
@media(max-width:700px) {
  .req-detail-grid { grid-template-columns: 1fr !important; }
  .admin-msg-grid  { grid-template-columns: 1fr !important; }
  .profilo-grid    { grid-template-columns: 1fr !important; }
  .az-detail-grid  { grid-template-columns: 1fr !important; }
}

/* ── SVG icon sizing ── */
.back-link svg       { width: 16px; height: 16px; flex-shrink: 0; }
.admin-nav a svg     { width: 16px; height: 16px; }
.dash-nav a svg      { width: 17px; height: 17px; }
.page-hd svg         { width: 15px; height: 15px; }
.durc-verified svg   { width: 13px; height: 13px; }

/* ── PAGINATION ── */
.pagination { display:flex; gap:.4rem; flex-wrap:wrap; margin-top:1.25rem; align-items:center; }
.pagination__info { font-size:.8rem; color:var(--muted); }
.pagination a, .pagination span {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:34px; height:34px; padding:0 .6rem;
  border-radius:7px; font-size:.82rem; font-weight:600; text-decoration:none;
  border:1.5px solid var(--border); color:var(--muted); transition:all .15s;
}
.pagination a:hover { border-color:var(--blu); color:var(--blu); }
.pagination .pg-active { background:var(--blu); color:#fff; border-color:var(--blu); }
.pagination .pg-dots  { border:none; color:var(--muted-lt); }

/* ── STEP FORM ── */
.step-wrap { display:flex; align-items:center; margin-bottom:2rem; }
.step-item { display:flex; flex-direction:column; align-items:center; gap:5px; flex:1; }
.step-item__num {
  width:34px; height:34px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:.88rem;
  border:2px solid var(--border); background:var(--white); color:var(--muted);
  transition:all .2s;
}
.step-item--active .step-item__num { border-color:var(--blu); background:var(--blu); color:#fff; }
.step-item--done   .step-item__num { border-color:var(--verde-md); background:var(--verde-md); color:#fff; }
.step-item__label  { font-size:.7rem; font-weight:600; color:var(--muted); text-align:center; white-space:nowrap; }
.step-item--active .step-item__label { color:var(--blu); }
.step-item--done   .step-item__label { color:var(--verde-md); }
.step-line { flex:1; height:2px; background:var(--border); margin-bottom:18px; transition:background .3s; }
.step-line--done { background:var(--verde-md); }
.step-panel { display:none; }
.step-panel.active { display:block; }