@import url("/assets/application-6dc0ec44.css");
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* =========================================================
   TEMA MODERNO — palette brand Maia  · Material Design 3
   blu #2A33FF · ciano #38D7FC · lime #A3F700 · navy #141D3A
   ========================================================= */
:root {
  /* ── brand ─────────────────────────────────────────────── */
  --primary:        #2a33ff;
  --primary-600:    #1f27cc;
  --primary-700:    #171da3;
  --primary-soft:   #dfe1ff;
  --primary-tint:   #f0f1ff;
  --primary-container: #e8eaff;

  --accent-cyan:    #38d7fc;
  --accent-lime:    #a3f700;
  --ring-blue:      #97b5ff;

  --navy:           #141d3a;
  --navy-700:       #1b3466;
  --navy-900:       #0d1228;

  /* ── testo ──────────────────────────────────────────────── */
  --ink:            #1a1d2e;
  --muted:          #44475a;
  --faint:          #8b8fa8;

  /* ── superfici (Material surface tones) ─────────────────── */
  --canvas:         #f4f6fc;
  --surface:        #ffffff;
  --surface-1:      #f7f8fd;   /* elevation 1 tint */
  --surface-2:      #f2f4fa;   /* elevation 2 tint */
  --surface-3:      #eceeF7;   /* elevation 3 tint */
  --border:         #e8eaf4;
  --border-strong:  #d2d5e8;
  --divider:        #ecedf5;

  /* ── semantici ──────────────────────────────────────────── */
  --ok:             #1e8a4c;
  --ok-soft:        #e6f4ed;
  --ok-border:      #a8ddc1;
  --warn:           #c67b00;
  --warn-soft:      #fef3e2;
  --warn-border:    #f4d080;
  --err:            #c0303e;
  --err-soft:       #fce8eb;
  --err-border:     #f4b4bc;

  /* ── forme / elevazione ──────────────────────────────────── */
  --radius-xs:      6px;
  --radius-sm:      10px;
  --radius:         14px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  --radius-full:    999px;

  --shadow-xs:      0 1px 2px rgba(20,29,58,.04);
  --shadow-sm:      0 1px 4px rgba(20,29,58,.06), 0 2px 8px rgba(20,29,58,.04);
  --shadow:         0 2px 8px rgba(20,29,58,.07), 0 8px 24px rgba(20,29,58,.06);
  --shadow-lg:      0 4px 16px rgba(20,29,58,.09), 0 24px 48px rgba(20,29,58,.10);
  --ring:           0 0 0 3px rgba(42,51,255,.18);
  --ring-err:       0 0 0 3px rgba(192,48,62,.18);

  --ease:           cubic-bezier(.22,.61,.36,1);
  --ease-spring:    cubic-bezier(.34,1.56,.64,1);
}

/* =========================================================
   BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.25;
}
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color .15s var(--ease);
}
a:hover { color: var(--primary-600); }

code, pre, tt, .filename {
  font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;
  font-size: .88em;
}

hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 20px 0;
}

/* =========================================================
   TOP MENU — barra utility (Google-style: sottile, destra)
   ========================================================= */
#top-menu {
  background: var(--navy-900);
  padding: 0 20px;
  height: 32px;
  line-height: 32px;
  font-size: 11.5px;
  font-weight: 500;
  border: none;
  letter-spacing: .015em;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
#top-menu ul {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
#top-menu li { margin: 0; }
#top-menu a,
#top-menu #loggedas,
#top-menu #loggedas a {
  color: rgba(255,255,255,.65);
  transition: color .15s, background .15s;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-block;
}
#top-menu a:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}
/* avatar pillola per l'utente loggato */
#top-menu #loggedas {
  color: rgba(255,255,255,.55);
  font-size: 11px;
}
#top-menu #loggedas a {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
  font-weight: 600;
  border-radius: var(--radius-full);
  padding: 3px 12px 3px 10px;
}
#top-menu #loggedas a::before {
  content: "●";
  font-size: 8px;
  margin-right: 5px;
  color: var(--accent-lime);
  vertical-align: middle;
}
#top-menu #loggedas a:hover { background: rgba(255,255,255,.14); }

/* =========================================================
   WRAPPER — il base CSS ha overflow:hidden che taglia i dropdown;
   lo forziamo a visible per far emergere i .drdn-content
   ========================================================= */
#wrapper {
  overflow: visible;
}

/* =========================================================
   HEADER — Google Workspace app bar
   ========================================================= */
#header {
  background: var(--navy);
  padding: 14px 20px 0;     /* 0 bottom: il #main-menu forma la seconda riga */
  height: auto;             /* non fisso: si adatta al contenuto + nav bar */
  min-height: 58px;
  border: none;
  box-shadow: 0 1px 0 rgba(255,255,255,.07), 0 2px 10px rgba(10,14,30,.28);
  display: flex;
  flex-wrap: wrap;          /* permette a #main-menu di andare sulla riga sotto */
  align-items: center;
  gap: 12px 16px;
  position: relative;
}

/* logo — pill bianca nella app bar, estrema sinistra */
#header h1 {
  margin: 0;
  padding: 0 14px;
  width: 160px;
  height: 34px;
  flex-shrink: 0;
  order: -2;            /* prima di #quick-search (order:-1) e di tutto il resto */
  box-sizing: content-box;
  background: #fff url("/assets/themes/maia/logo_maia-d16fc448.svg") no-repeat center center;
  background-size: auto 20px;
  border-radius: var(--radius-sm);
  box-shadow: none;
  text-indent: -9999px;
  overflow: hidden;
  font-size: 0;
  transition: opacity .15s var(--ease);
}
#header h1:hover { opacity: .92; }
#header h1 a { display: block; width: 100%; height: 100%; }

/* nome progetto — chip accanto al logo (solo il link semplice, non il drdn) */
#header a.project {
  color: rgba(255,255,255,.6);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,.14);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
#header a.project:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

/* ricerca — centro della app bar, Google-style */
#quick-search {
  position: static;
  flex: 1 1 240px;   /* cresce ma ha min-width */
  max-width: 480px;
  margin: 0;
  /* non usiamo margin:auto — con flex-wrap sposterebbe l'h1 */
  order: -1;         /* va prima dell'h1 nella riga */
}
#quick-search label { display: none; }
#quick-search input[type="text"] {
  width: 100%;
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: var(--radius-full);
  color: #fff;
  padding: 8px 18px 8px 42px;
  font-size: 13.5px;
  font-family: inherit;
  transition: all .22s var(--ease);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='rgba(255,255,255,.55)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
}
#quick-search input[type="text"]::placeholder { color: rgba(255,255,255,.5); }
#quick-search input[type="text"]:hover {
  background-color: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.25);
}
#quick-search input[type="text"]:focus {
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%232a33ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  color: var(--ink);
  border-color: transparent;
  outline: none;
  box-shadow: 0 2px 20px rgba(0,0,0,.28);
}
#quick-search input[type="text"]:focus::placeholder { color: var(--faint); }

/* =========================================================
   MAIN MENU — Google Cloud Console / Workspace chip tabs
   =========================================================
   Il base CSS mette #main-menu con position:absolute; bottom:0
   dentro #header. Lo riportiamo nel flusso flex come seconda riga.
   ========================================================= */
#main-menu {
  position: static;         /* rimuove position:absolute del base */
  left: auto;
  bottom: auto;
  margin-right: 0;          /* rimuove margin-right:-500px del base */
  flex: 0 0 100%;           /* occupa tutta la larghezza → va a capo */
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border-top: 1px solid rgba(255,255,255,.07);
  margin-top: 2px;
  margin-left: -20px;       /* compensa il padding dell'header */
  margin-right: -20px;
  padding: 0 20px;
}
#main-menu ul {
  background: transparent;
  display: flex;
  gap: 2px;
  padding: 6px 16px 0;
  margin: 0;
}
/* position:relative indispensabile — ancora i menu-children sotto la tab */
#main-menu li { margin: 0; position: relative; }
#main-menu li a {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: rgba(255,255,255,.65);
  font-weight: 600;
  font-size: 13px;
  padding: 7px 16px 9px;
  border: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  position: relative;
  transition: color .15s var(--ease), background .15s var(--ease);
  letter-spacing: .01em;
  white-space: nowrap;
}
/* indicatore attivo: linea lime sul fondo */
#main-menu li a::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 0;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: var(--accent-lime);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .2s var(--ease);
}
#main-menu li a:hover {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.95);
  text-decoration: none;
}
#main-menu li a:hover::after { transform: scaleX(.4); }
#main-menu li a.selected {
  background: rgba(255,255,255,.14);
  color: #fff;
  font-weight: 700;
}
#main-menu li a.selected:hover { background: rgba(255,255,255,.17); }
#main-menu li a.selected::after { transform: scaleX(1); }

/* =========================================================
   LAYOUT
   ========================================================= */
#main { background: var(--canvas); }
#main.nosidebar #content { width: auto; }

#content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 30px;
  margin: 20px;
}

/* =========================================================
   SIDEBAR — Google navigation drawer
   ========================================================= */
#sidebar {
  background: transparent;
  padding: 16px 8px 16px 16px;
}

/* sezione card */
#sidebar .box,
#sidebar h3 + ul {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 6px 4px;
  margin-bottom: 10px;
  overflow: hidden;
}

/* etichetta sezione — come in Google Drive / Calendar */
#sidebar h3 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--faint);
  font-weight: 700;
  margin: 10px 4px 3px;
  padding: 0 10px;
  user-select: none;
}

/* divisore interno tra sezioni */
#sidebar .box + .box,
#sidebar h3 { border-top: none; }

/* navigation item — pill attivo stile Google */
#sidebar a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background .15s var(--ease), color .15s var(--ease);
  position: relative;
  line-height: 1.4;
}
/* dot decorativo a sinistra (simula icona) */
#sidebar a::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
  transition: background .15s var(--ease), transform .15s var(--ease-spring);
}
#sidebar a:hover {
  background: var(--primary-tint);
  color: var(--primary);
}
#sidebar a:hover::before {
  background: var(--primary-soft);
  transform: scale(1.25);
}
#sidebar a.selected {
  background: var(--primary-container);
  color: var(--primary);
  font-weight: 700;
}
#sidebar a.selected::before {
  background: var(--primary);
  transform: scale(1.3);
}

/* item attivo: pill highlight piena (Google Drive style) */
#sidebar li.selected > a,
#sidebar a[class*="selected"] {
  background: var(--primary-container);
  color: var(--primary);
  font-weight: 700;
}

/* numero contatore (es. 5 issue aperte) */
#sidebar a .count,
#sidebar span.count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--faint);
  background: var(--surface-2);
  border-radius: var(--radius-full);
  padding: 1px 7px;
  line-height: 1.6;
}

/* =========================================================
   BOX / PANNELLI — Material card
   ========================================================= */
.box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 20px 22px;
}
fieldset.box {
  padding-top: 12px;
  border-color: var(--border);
}
fieldset legend {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  padding: 0 8px;
  letter-spacing: .01em;
}

/* =========================================================
   BOTTONI — Material 3: filled / tonal / outlined
   ========================================================= */

/* === FILLED (primario) === */
input[type="submit"],
input[type="button"],
button,
a.button,
p.buttons input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 9px 20px;
  font-family: inherit;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background .15s var(--ease), box-shadow .15s var(--ease), transform .12s var(--ease-spring);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}
input[type="submit"]:hover,
input[type="button"]:hover,
button:hover,
a.button:hover {
  background: var(--primary-600);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}
input[type="submit"]:active,
button:active,
a.button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

/* === TONAL (azione secondaria) — sfondo tint del primary === */
a.button.icon-only {
  background: var(--primary-container);
  color: var(--primary);
  border: none;
  box-shadow: none;
}
a.button.icon-only:hover {
  background: var(--primary-soft);
  color: var(--primary-600);
  transform: translateY(-1px);
}

/* === OUTLINED (contestuale) === */
.contextual a {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: none;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.contextual a:hover {
  background: var(--primary-tint);
  color: var(--primary);
  border-color: var(--primary-soft);
  transform: none;
}

/* icone bottoni primari */
p.buttons svg, p.buttons img,
a.button svg, a.button img {
  filter: brightness(0) invert(1);
  opacity: .85;
}
p.buttons a[class*="icon-"]::before,
p.buttons button[class*="icon-"]::before,
a.button[class*="icon-"]::before {
  filter: brightness(0) invert(1);
  opacity: .85;
}
.contextual a svg, .contextual a img { filter: none; opacity: .7; }

/* =========================================================
   CAMPI FORM — Material Outlined style
   ========================================================= */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
  line-height: 1.5;
}
input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="number"]:hover,
textarea:hover { border-color: var(--muted); }

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: var(--ring);
}

label {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  letter-spacing: .005em;
}

/* ── SELECT ─────────────────────────────────────────────── */
select {
  color-scheme: light;
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink) !important;
  opacity: 1;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-height: 38px;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238b8fa8' d='M6 8 0 2l1.4-1.4L6 5.2 10.6.6 12 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%232a33ff' d='M6 8 0 2l1.4-1.4L6 5.2 10.6.6 12 2z'/%3E%3C/svg%3E");
}
select option { background: #fff; color: var(--ink); padding: 6px 10px; }
select option:checked, select option:hover { background: var(--primary-tint); color: var(--ink); }
select[multiple] {
  -webkit-appearance: listbox;
  appearance: listbox;
  background-image: none;
  padding-right: 12px;
  min-height: auto;
}
select[multiple] option:checked {
  background: var(--primary) linear-gradient(0deg, var(--primary), var(--primary));
  color: #fff;
}

/* =========================================================
   TABELLE — clean Google Sheets / Workspace look
   ========================================================= */
table.list {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: var(--shadow-xs);
  font-size: 13.5px;
}
table.list thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.list thead th a { color: var(--muted); }
table.list thead th a:hover { color: var(--primary); }
table.list tbody td {
  padding: 11px 14px;
  border-top: 1px solid var(--divider);
  vertical-align: middle;
}
table.list tbody tr.odd  { background: var(--surface); }
table.list tbody tr.even { background: var(--surface-1); }
table.list tbody tr:hover { background: var(--primary-tint); transition: background .1s; }
table.list tbody tr:hover td { border-top-color: transparent; }

/* =========================================================
   TAB INTERNE — pill/chip style (Google Workspace)
   =========================================================
   Il base CSS ha: #content .tabs { height:2.6em; overflow:hidden }
   e la ul { position:absolute; bottom:0; min-width:2000px }
   → le nostre tab più alte venivano tagliate.
   Sovrascriviamo entrambe le regole.
   ========================================================= */
#content .tabs {
  height: auto !important;    /* rimuove il 2.6em fisso del base */
  overflow: visible !important;
}
#content .tabs ul {
  position: static !important; /* rimuove position:absolute del base */
  bottom: auto !important;
  min-width: 0 !important;     /* rimuove min-width:2000px del base */
  width: auto !important;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 0;
  padding-left: 0;
  margin-bottom: 20px;
}
#content .tabs ul li a {
  display: block;
  border: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 18px;
  background: transparent;
  transition: background .15s var(--ease), color .15s var(--ease);
  position: relative;
}
#content .tabs ul li a::after {
  content: "";
  position: absolute;
  left: 8px; right: 8px; bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform .2s var(--ease);
}
#content .tabs ul li a:hover {
  background: var(--surface-2);
  color: var(--ink);
}
#content .tabs ul li a.selected {
  background: transparent;
  color: var(--primary);
  font-weight: 700;
}
#content .tabs ul li a.selected::after { transform: scaleX(1); }

/* =========================================================
   BADGE / TAG / CHIP
   ========================================================= */
span.tag-label-color,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
}
.issue.closed {
  text-decoration: line-through;
  opacity: .6;
}

/* =========================================================
   FLASH MESSAGES — tonal alert cards
   ========================================================= */
div.flash {
  border-radius: var(--radius);
  padding: 13px 18px;
  font-weight: 500;
  font-size: 13.5px;
  border: 1.5px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 16px;
}
div.flash.notice  { background: var(--ok-soft);   border-color: var(--ok-border);   color: var(--ok);   }
div.flash.warning { background: var(--warn-soft);  border-color: var(--warn-border);  color: var(--warn); }
div.flash.error   { background: var(--err-soft);   border-color: var(--err-border);   color: var(--err);  }

/* =========================================================
   PAGINAZIONE — Google-style page pills
   ========================================================= */
.pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.pagination ul li a,
.pagination ul li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  padding: 0 10px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, border-color .15s, color .15s;
}
.pagination ul li a:hover {
  background: var(--primary-tint);
  border-color: var(--primary-soft);
  color: var(--primary);
}
.pagination ul li span.current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 700;
}

/* =========================================================
   ANIMAZIONE APERTURA MENU (shared)
   ========================================================= */
@keyframes menuPopIn {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
@keyframes menuSlideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   DROPDOWN PANEL — .drdn  (Google elevated surface card)
   ========================================================= */
.drdn {
  position: relative; /* assicura che .drdn-content si ancori sempre al trigger */
}
.drdn-content {
  position: absolute;
  top: calc(100% + 4px); /* esce subito sotto il trigger, qualunque sia la sua altezza */
  inset-inline-end: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 3px rgba(20,29,58,.08),
    0 8px 28px rgba(20,29,58,.14);
  animation: menuPopIn .18s var(--ease) both;
  overflow: hidden;
  padding: 6px;
  min-width: 180px;
  z-index: 200;
}

/* barra di ricerca interna ai dropdown */
.drdn-content .quick-search {
  margin: 6px 6px 4px;
  position: relative;
}
.drdn-content .quick-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}
.drdn-content .quick-search input.autocomplete,
.drdn-content .autocomplete {
  box-sizing: border-box;
  width: 100% !important;
  height: auto !important;
  background: var(--surface-2) !important;
  border: 1.5px solid var(--border-strong) !important;
  border-radius: var(--radius-full) !important;
  padding: 7px 12px 7px 34px !important;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.drdn-content .quick-search input.autocomplete:focus,
.drdn-content .autocomplete:focus {
  border-color: var(--primary) !important;
  box-shadow: var(--ring);
  outline: none;
  background: var(--surface) !important;
}

/* lista elementi */
.drdn-items {
  max-height: 380px;
  overflow-y: auto;
  padding: 2px 0;
}
div + .drdn-items {
  border-top: 1px solid var(--divider);
  margin-top: 2px;
  padding-top: 4px;
}

/* ogni voce del menu */
.drdn-items > * {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: none !important;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.drdn-items > a:hover,
.drdn-items > *:hover {
  background: var(--primary-tint);
  color: var(--primary);
  text-decoration: none;
}
.drdn-items > *.selected,
.drdn-items > a.selected {
  background: var(--primary-container);
  color: var(--primary);
  font-weight: 700;
}
/* etichetta di sezione (span) */
.drdn-items > span {
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 10px 14px 3px;
  cursor: default;
  background: transparent !important;
}
.drdn-items > span:hover { color: var(--faint); }

/* checkbox di selezione — Material style */
.drdn-items.selection > *::before {
  content: '';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  transition: background .12s, border-color .12s;
}
.drdn-items.selection > *.selected::before {
  content: "✓";
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.drdn-items.selection:empty { border: none; }

/* ── dropdown contestuali (bottoni azione riga) ────────── */
.contextual .drdn-content,
.journal-actions .drdn-content {
  top: calc(100% + 4px); /* relativo al .drdn parent che è position:relative */
  padding: 4px;
  min-width: 170px;
}
.contextual .drdn-items,
.journal-actions .drdn-items {
  padding: 0;
}
.contextual .drdn-items > a,
.journal-actions .drdn-items > a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: none !important;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  transition: background .12s, color .12s;
}
.contextual .drdn-items > a.icon:not(:has(svg)),
.journal-actions .drdn-items > a.icon:not(:has(svg)) {
  padding-left: 12px;
  background-position-x: 4px;
}
.contextual .drdn-items > a:hover,
.journal-actions .drdn-items > a:hover {
  background: var(--primary-tint);
  color: var(--primary);
  border: none !important;
  border-radius: var(--radius-sm);
}

/* ── trigger bottone dropdown ──────────────────────────── */
.drdn-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  border-radius: var(--radius-full);
  transition: background .15s;
  padding: 4px 8px;
}
.drdn-trigger:hover { background: rgba(255,255,255,.1); }

/* =========================================================
   PROJECT JUMP — selettore progetto nella app bar
   ========================================================= */
#project-jump.drdn {
  position: relative; /* ancora il drdn-content */
  display: inline-block;
  vertical-align: middle;
}
#project-jump .drdn-trigger {
  display: inline-block; /* inline-block per compatibilità background-image */
  background-color: rgba(255,255,255,.1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='rgba(255,255,255,.65)' d='M5 6 0 1 .9.1 5 4.2 9.1.1 10 1z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: rgba(255,255,255,.88) !important;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-full);
  padding: 6px 30px 6px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
#project-jump .drdn-trigger:hover {
  background-color: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.32);
  color: #fff !important;
}
/* dropdown esce sotto il trigger, non dalla sommità del .drdn */
#project-jump .drdn-content {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  width: 300px;
}
#project-jump .drdn-items > * { color: var(--ink) !important; }
#project-jump .drdn-items > a:hover {
  background: var(--primary-tint) !important;
  color: var(--primary) !important;
}

/* =========================================================
   MAIN MENU CHILDREN — tab nav dropdown (sottomenu)
   ========================================================= */
#main-menu .menu-children {
  display: none;
  position: absolute;
  top: 100%; /* esce esattamente sotto il li (che è position:relative) */
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none; /* si attacca alla tab senza spazio */
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  box-shadow:
    0 4px 12px rgba(20,29,58,.1),
    0 16px 40px rgba(20,29,58,.12);
  min-width: 200px;
  padding: 6px;
  z-index: 50;
  animation: menuSlideDown .18s var(--ease) both;
}
#main-menu li:hover ul.menu-children,
#main-menu li ul.menu-children.visible { display: block; }
#main-menu .menu-children li {
  float: none;
  clear: none;
  width: 100%;
}
#main-menu .menu-children li a {
  display: flex;
  align-items: center;
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  font-size: 13.5px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: none;
  transition: background .12s var(--ease), color .12s var(--ease);
}
#main-menu .menu-children li a:hover {
  background: var(--primary-tint);
  color: var(--primary);
}
/* Sovrascrive il rosso del base su hover SVG dentro i sottomenu */
#main-menu .menu-children li a:hover .icon-svg {
  stroke: var(--primary) !important;
}
#main-menu .menu-children li a.selected {
  background: var(--primary-container);
  color: var(--primary);
  font-weight: 700;
}
#main-menu .menu-children li a.selected .icon-svg {
  stroke: var(--primary) !important;
}

/* =========================================================
   ADMIN MENU — pannello di amministrazione Google-style
   ========================================================= */
#admin-menu ul {
  margin: 0;
  padding: 4px 0;
  list-style: none;
}
#admin-menu li {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Annulla il dot della sidebar: le voci admin hanno già icone SVG */
#admin-menu a::before {
  display: none !important;
  content: none !important;
}

/* navigation item pill */
#admin-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
  transition: background .15s var(--ease), color .15s var(--ease);
  text-decoration: none;
}

/* SVG default: grigio (sovrascrive il teal #169 del base Redmine) */
#admin-menu a .icon-svg {
  stroke: var(--faint) !important;
  fill: none;
  flex-shrink: 0;
  transition: stroke .15s var(--ease);
}
#admin-menu a .icon-svg-filled {
  fill: var(--faint) !important;
  stroke: none !important;
}

#admin-menu a:hover {
  background: var(--primary-tint);
  color: var(--primary);
}

/* Hover: SVG primary blue (sovrascrive il rosso #c61a1a del base Redmine) */
#admin-menu a:hover .icon-svg {
  stroke: var(--primary) !important;
}
#admin-menu a:hover .icon-svg-filled {
  fill: var(--primary) !important;
  stroke: none !important;
}

/* active pill — Google Drive style */
#admin-menu a.selected {
  background: var(--primary-container) !important;
  color: var(--primary) !important;
  font-weight: 700;
  padding-left: 12px !important;
}
#admin-menu a.selected .icon-svg {
  stroke: var(--primary) !important;
}
#admin-menu a.selected .icon-svg-filled {
  fill: var(--primary) !important;
  stroke: none !important;
}

/* punto indicatore attivo a destra */
#admin-menu a.selected::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  min-width: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-left: auto;
  flex-shrink: 0;
}

/* separatori sezione */
#admin-menu ul + h3,
#admin-menu > h3 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--faint);
  font-weight: 700;
  margin: 10px 0 3px;
  padding: 0 12px;
}

/* =========================================================
   SCROLLBAR — thin track
   ========================================================= */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
  border: 2px solid var(--canvas);
}
*::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* =========================================================
   ACCESSIBILITÀ
   ========================================================= */
:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  #header {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 10px;
  }
  #header h1 { width: 130px; }
  #quick-search {
    order: 3;
    flex: 1 1 100%;
    max-width: 100%;
    margin: 0;
  }
  #quick-search input[type="text"] { width: 100%; }
  #main-menu ul { flex-wrap: wrap; padding: 4px 8px 0; }
  #content {
    margin: 10px;
    padding: 18px 16px;
    border-radius: var(--radius);
  }
}
