/* ============================================================
   Archivio d'Istituto — stile applicazione
   ============================================================ */
:root {
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --surface: #ffffff;
  --bg: #f5f7fb;
  --brand: #1d4ed8;
  --brand-dark: #173ea8;
  --brand-soft: #e8efff;
  --brand-soft-2: #dbe7ff;
  --teal: #0e7490;
  --teal-soft: #e0f5f9;
  --green: #15803d;
  --green-soft: #e7f6ec;
  --red: #b91c1c;
  --red-soft: #fdeaea;
  --amber: #b45309;
  --amber-soft: #fdf3df;
  --purple: #6d28d9;
  --purple-soft: #f0e9ff;
  --sidebar: #0b1730;
  --sidebar-2: #0f1f3d;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 30px 70px -30px rgba(15, 23, 42, .35);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

button { font-family: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
code, pre { font-family: "Cascadia Code", Consolas, "SFMono-Regular", monospace; }

.eyebrow {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ------------------------------- LOGIN ------------------------------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(900px 500px at 5% -5%, #e2ecff 0%, transparent 60%),
    radial-gradient(700px 500px at 100% 100%, #dff5f5 0%, transparent 55%),
    #f2f5fa;
}

.login-shell {
  width: 100%;
  max-width: 1180px;
  min-height: 690px;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  background: #fff;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 40px 90px -40px rgba(11, 23, 48, .45), 0 2px 6px rgba(15, 23, 42, .05);
}

.login-brand {
  position: relative;
  overflow: hidden;
  padding: 48px 50px 40px;
  color: #e8eefc;
  background:
    radial-gradient(600px 400px at 90% 0%, rgba(29, 78, 216, .55), transparent 65%),
    radial-gradient(500px 500px at 0% 100%, rgba(14, 116, 144, .45), transparent 60%),
    linear-gradient(145deg, #0b1730 0%, #10254a 55%, #0d2b49 100%);
  display: flex;
  flex-direction: column;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 70%);
  pointer-events: none;
}

.brand-mark {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 25px;
  color: #fff;
  background: linear-gradient(140deg, #3b82f6, #0e7490);
  box-shadow: 0 12px 25px -10px rgba(59, 130, 246, .9), inset 0 1px 0 rgba(255,255,255,.25);
}

.brand-mark-sm { width: 40px; height: 40px; border-radius: 12px; font-size: 19px; }

.login-brand-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; }
.login-brand-top h1 { font-size: 23px; font-weight: 700; margin: 2px 0 2px; color: #fff; letter-spacing: -.02em; }
.brand-sub { margin: 0; color: #a9bddc; font-size: 13px; }
.login-brand .eyebrow { color: #7f9ccb; }

.brand-copy { position: relative; z-index: 1; margin-top: 64px; max-width: 430px; }
.brand-copy h2 { font-size: 34px; line-height: 1.18; font-weight: 700; letter-spacing: -.03em; color: #fff; margin: 0 0 16px; }
.brand-copy p { color: #aebfdc; line-height: 1.65; font-size: 14.5px; margin: 0; }

.brand-features { position: relative; z-index: 1; list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 14px; }
.brand-features li { display: flex; align-items: center; gap: 13px; }
.feature-icon {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px;
  display: grid; place-items: center; font-size: 17px; color: #bcd3ff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .09);
}
.brand-features strong { display: block; font-size: 13.5px; color: #eef4ff; font-weight: 600; }
.brand-features small { display: block; color: #8fa6ca; font-size: 12px; margin-top: 1px; }

.brand-footer {
  position: relative; z-index: 1; margin-top: auto; padding-top: 30px;
  display: flex; align-items: center; gap: 9px;
  color: #7f96ba; font-size: 11.5px;
}

.login-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 42px 46px 26px; background: #fbfcfe;
}
.login-card { width: 100%; max-width: 388px; }
.login-heading h2 { font-size: 27px; font-weight: 700; letter-spacing: -.025em; margin: 0 0 5px; }
.login-heading p { color: var(--muted); font-size: 13.5px; margin: 0 0 26px; }

.form-label { font-size: 12.5px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.form-control, .form-select {
  border-color: #dbe3ee; border-radius: 10px; padding: .62rem .8rem; font-size: 14px;
  background-color: #fff; color: var(--ink);
}
.form-control:focus, .form-select:focus {
  border-color: #93b4f5; box-shadow: 0 0 0 3.5px rgba(29, 78, 216, .1);
}
.form-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

.input-icon { position: relative; }
.input-icon > i {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; font-size: 15px; pointer-events: none;
}
.input-icon .form-control { padding-left: 39px; }
.input-icon .form-control[type="password"], .input-icon .form-control.has-reveal { padding-right: 42px; }
.input-reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: #94a3b8; padding: 7px 9px; border-radius: 7px;
}
.input-reveal:hover { color: var(--ink); background: #f1f5f9; }

.btn { border-radius: 10px; font-size: 13.5px; font-weight: 600; padding: .58rem .95rem; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 18px -10px rgba(29, 78, 216, .8); }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-soft { background: #f1f5fb; border: 1px solid #e4eaf4; color: #334155; }
.btn-soft:hover { background: #e8eef8; color: var(--ink); border-color: #d5dfee; }
.btn-ms {
  background: #2f2f2f; border: 1px solid #2f2f2f; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: .66rem 1rem;
}
.btn-ms:hover { background: #1f1f1f; color: #fff; border-color: #1f1f1f; }

.btn-login { position: relative; padding: .7rem 1rem; margin-top: 4px; }
.btn-login .btn-label { display: inline-flex; align-items: center; gap: 7px; }
.btn-login.is-loading .btn-label { visibility: hidden; }
.btn-login.is-loading .spinner-border { position: absolute; left: 50%; top: 50%; margin: -8px 0 0 -8px; }

.login-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #a3b0c2; font-size: 11.5px; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; background: #e5eaf2; flex: 1; }

.demo-box {
  margin-top: 22px; padding: 12px 14px; border: 1px dashed #cbd8ea; border-radius: 11px;
  background: #f7faff; font-size: 11.5px; color: #475569;
}
.demo-title { font-weight: 700; color: #334155; margin-bottom: 7px; display: flex; gap: 6px; align-items: center; }
.demo-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.demo-row span { width: 94px; color: var(--muted); }
.demo-row code { background: #e9eff9; color: #24406e; padding: 1px 6px; border-radius: 5px; font-size: 10.5px; }

.login-copyright { margin: auto 0 0; padding-top: 28px; font-size: 10.5px; color: #a8b4c4; text-align: center; }

/* ------------------------------- APP SHELL ------------------------------- */
.app { display: flex; height: 100vh; overflow: hidden; background: var(--bg); }

.sidebar {
  width: 274px; flex-shrink: 0; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--sidebar) 0%, #0a142a 100%);
  color: #c7d3e8; z-index: 1040;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 18px; border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.brand-text { min-width: 0; }
.brand-text strong { display: block; color: #fff; font-size: 14px; line-height: 1.25; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { display: block; color: #7f93b5; font-size: 10.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { padding: 14px 12px 6px; display: grid; gap: 3px; }
.nav-item {
  width: 100%; border: 0; background: transparent; color: #a9b9d4;
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  border-radius: 9px; font-size: 13px; font-weight: 500; text-align: left;
}
.nav-item i { font-size: 16px; color: #7f93b5; width: 18px; text-align: center; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #eaf1ff; }
.nav-item:hover i { color: #c0d2f2; }
.nav-item.active { background: rgba(59, 130, 246, .16); color: #fff; box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .22); }
.nav-item.active i { color: #7db2ff; }
.nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 700; color: #dbeafe;
  background: rgba(59, 130, 246, .35); padding: 1px 7px; border-radius: 20px;
}
.nav-separator {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .12em;
  color: #5f7394; padding: 16px 12px 5px; font-weight: 700;
}

.sidebar-section { padding: 10px 12px 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 8px; font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: #5f7394;
}
.section-add { border: 0; background: transparent; color: #7f93b5; padding: 0 3px; font-size: 12px; border-radius: 4px; }
.section-add:hover { color: #fff; background: rgba(255,255,255,.08); }

.folder-tree { overflow-y: auto; padding-bottom: 14px; scrollbar-width: thin; scrollbar-color: #2b3f61 transparent; }
.tree-item {
  width: 100%; border: 0; background: transparent; color: #a9b9d4;
  display: flex; align-items: center; gap: 8px; padding: 6px 9px;
  border-radius: 7px; font-size: 12.5px; text-align: left; min-height: 31px;
}
.tree-item > i { font-size: 14px; color: #6981a6; flex-shrink: 0; }
.tree-item .tree-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-item .tree-count { margin-left: auto; font-size: 10px; color: #64789b; background: rgba(255,255,255,.05); border-radius: 20px; padding: 0 6px; }
.tree-item:hover { background: rgba(255,255,255,.055); color: #eaf1ff; }
.tree-item.active { background: rgba(255, 255, 255, .09); color: #fff; }
.tree-item.active > i { color: #7db2ff; }
.tree-item.tree-root { color: #c9d6ea; font-weight: 600; }
.tree-children { padding-left: 12px; margin-left: 9px; border-left: 1px solid rgba(255,255,255,.07); }

.sidebar-footer { padding: 14px 16px 16px; border-top: 1px solid rgba(255,255,255,.06); }
.storage-mini { margin-bottom: 12px; color: #8ea3c2; font-size: 10.5px; }
.storage-mini strong { color: #c8d7ee; font-weight: 600; }
.storage-mini .progress { height: 4px; background: rgba(255,255,255,.09); border-radius: 20px; }
.storage-mini .progress-bar { background: linear-gradient(90deg, #3b82f6, #22d3ee); border-radius: 20px; }

.user-chip {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 9px;
  border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.04);
  border-radius: 11px; color: #dbe6f7; text-align: left;
}
.user-chip:hover { background: rgba(255,255,255,.08); }
.user-chip-text { min-width: 0; flex: 1; }
.user-chip-text strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-text small { display: block; color: #8ea3c2; font-size: 10px; text-transform: capitalize; }
.user-chip > i { color: #6d82a5; font-size: 12px; }

.avatar {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: linear-gradient(140deg, #3b82f6, #0e7490); color: #fff;
  letter-spacing: .02em;
}
.avatar.lg { width: 54px; height: 54px; border-radius: 14px; font-size: 18px; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 76px; flex-shrink: 0; display: flex; align-items: center; gap: 18px;
  padding: 0 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); z-index: 1020;
}
.topbar-menu { display: none; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: #475569; display: inline-grid; place-items: center;
}
.icon-btn:hover { background: #f8fafc; color: var(--ink); }

.topbar-heading { min-width: 150px; }
.topbar-heading h1 { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.topbar-heading p { margin: 1px 0 0; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }

.topbar-search {
  margin-left: auto; flex: 1; max-width: 430px; position: relative; display: flex; align-items: center;
}
.topbar-search > i { position: absolute; left: 13px; color: #94a3b8; font-size: 14px; pointer-events: none; }
.topbar-search input {
  width: 100%; height: 40px; border: 1px solid #e4eaf3; background: #f4f7fb;
  border-radius: 11px; padding: 0 38px 0 38px; font-size: 12.5px; color: var(--ink);
  outline: none; transition: .15s;
}
.topbar-search input:focus { background: #fff; border-color: #a8c2f2; box-shadow: 0 0 0 3.5px rgba(29,78,216,.08); }
.topbar-search input::placeholder { color: #94a3b8; }
.search-clear {
  position: absolute; right: 7px; border: 0; background: transparent; color: #94a3b8;
  width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center;
}
.search-clear:hover { color: var(--ink); background: #e9eef7; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-actions .btn { padding: .5rem .8rem; font-size: 12.5px; }
.topbar-actions .btn i { margin-right: 4px; }
.dropdown-menu { border-color: var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; font-size: 13px; }
.dropdown-item { border-radius: 7px; padding: 7px 10px; display: flex; align-items: center; gap: 8px; }
.dropdown-item i { color: #64748b; width: 16px; }
.dropdown-item:hover i { color: var(--brand); }
.dropdown-header { padding: 8px 10px; }
.dropdown-header strong { display: block; color: var(--ink); font-size: 12.5px; }
.dropdown-header small { color: var(--muted); font-size: 10.5px; }

.user-menu-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 11px;
  display: flex; align-items: center; gap: 6px; padding: 3px 7px 3px 3px; color: #64748b;
}
.user-menu-btn:hover { background: #f8fafc; }
.user-menu-btn .avatar { width: 30px; height: 30px; border-radius: 8px; font-size: 10.5px; }
.user-dropdown { min-width: 245px; }

.view-root { flex: 1; overflow-y: auto; padding: 26px 30px 60px; scroll-behavior: smooth; }
.view-root > * { max-width: 1560px; margin-left: auto; margin-right: auto; }

/* ------------------------------- COMPONENTS ------------------------------- */
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-intro h2 { font-size: 24px; letter-spacing: -.03em; font-weight: 700; margin: 0 0 3px; }
.page-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.page-intro-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 19px; border-bottom: 1px solid var(--line-soft);
}
.panel-head h3 { font-size: 13.5px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.panel-head h3 i { color: var(--brand); }
.panel-body { padding: 19px; }
.panel-link { font-size: 11.5px; font-weight: 600; color: var(--brand); background: transparent; border: 0; padding: 0; }
.panel-link:hover { color: var(--brand-dark); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 18px; display: flex; align-items: flex-start; gap: 13px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-size: 19px; flex-shrink: 0;
}
.stat-icon.blue { background: var(--brand-soft); color: var(--brand); }
.stat-icon.teal { background: var(--teal-soft); color: var(--teal); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.purple { background: var(--purple-soft); color: var(--purple); }
.stat-meta { min-width: 0; }
.stat-value { font-size: 23px; font-weight: 700; line-height: 1.1; letter-spacing: -.03em; }
.stat-label { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.stat-extra { font-size: 10.5px; color: var(--muted-2); margin-top: 5px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dash-col { display: grid; gap: 18px; }

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-action {
  border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px;
  display: flex; align-items: center; gap: 10px; text-align: left; color: var(--ink);
}
.quick-action:hover { border-color: #bfd2f2; background: #f8fbff; }
.quick-action .stat-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }
.quick-action strong { display: block; font-size: 12px; }
.quick-action small { color: var(--muted); font-size: 10.5px; }

.recent-list { display: flex; flex-direction: column; }
.recent-row {
  display: flex; align-items: center; gap: 11px; padding: 9px 4px; border-radius: 9px;
  border: 0; background: transparent; text-align: left; color: var(--ink); width: 100%;
}
.recent-row + .recent-row { border-top: 1px solid var(--line-soft); border-radius: 0; }
.recent-row:hover { background: #f8fafd; }
.recent-text { min-width: 0; flex: 1; }
.recent-text strong { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-text small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.recent-row > .bi-chevron-right { color: #cbd5e1; font-size: 11px; }

.circular-spotlight {
  border-radius: var(--radius); padding: 22px; color: #fff; position: relative; overflow: hidden;
  background:
    radial-gradient(300px 200px at 100% 0%, rgba(14, 116, 144, .65), transparent 70%),
    linear-gradient(135deg, #142a52 0%, #1d4ed8 100%);
}
.circular-spotlight::after {
  content: ""; position: absolute; right: -30px; bottom: -50px; font-size: 180px;
  background: radial-gradient(circle, rgba(255,255,255,.06), transparent 65%);
  width: 220px; height: 220px; border-radius: 50%;
}
.circular-spotlight .eyebrow { color: #a9c4ff; position: relative; z-index: 1; }
.spotlight-number { font-size: 42px; line-height: 1; font-weight: 700; letter-spacing: -.04em; margin: 8px 0 2px; position: relative; z-index: 1; }
.spotlight-number small { font-size: 12px; font-weight: 500; color: #b9ccf5; letter-spacing: 0; margin-left: 6px; }
.circular-spotlight p { color: #c3d4f5; font-size: 11.5px; margin: 4px 0 16px; position: relative; z-index: 1; }
.circular-spotlight .btn { position: relative; z-index: 1; }
.circular-spotlight .btn-light { color: #173ea8; font-weight: 700; }

/* ------------------------------- EXPLORER ------------------------------- */
.explorer { display: flex; flex-direction: column; gap: 14px; position: relative; min-height: 420px; }

.explorer-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 15px; background: #fff; border: 1px solid var(--line); border-radius: 13px;
  box-shadow: var(--shadow-sm);
}
.breadcrumb-trail { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; flex: 1; min-width: 200px; }
.crumb {
  border: 0; background: transparent; padding: 4px 6px; border-radius: 6px;
  font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; max-width: 240px;
}
.crumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb:hover { background: #f1f5fb; color: var(--ink); }
.crumb.current { color: var(--ink); font-weight: 700; }
.crumb-sep { color: #cbd5e1; font-size: 10px; }
.explorer-tools { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.sort-select { width: auto; min-width: 128px; height: 34px; padding: .25rem 2rem .25rem .6rem; font-size: 11.5px; border-radius: 8px; }
.view-switch { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view-switch button { border: 0; background: #fff; color: #94a3b8; width: 32px; height: 32px; display: grid; place-items: center; font-size: 13px; }
.view-switch button.active { background: #eef4ff; color: var(--brand); }
.view-switch button + button { border-left: 1px solid var(--line); }

.file-table { width: 100%; border-collapse: collapse; }
.file-table th {
  font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: #8493a8; font-weight: 700;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap;
  background: #fbfcfe;
}
.file-table td { padding: 9px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; font-size: 12.5px; }
.file-table tbody tr:last-child td { border-bottom: 0; }
.file-table tbody tr { cursor: pointer; transition: background .1s; }
.file-table tbody tr:hover { background: #f8fafd; }
.file-table .name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-name { font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; min-width: 0; }
.file-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-sub { font-size: 10px; color: var(--muted-2); margin-top: 1px; }
.file-table .meta-cell { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.file-table .actions-cell { width: 48px; text-align: right; }
.row-actions { border: 0; background: transparent; color: #94a3b8; width: 30px; height: 30px; border-radius: 7px; }
.row-actions:hover { background: #eef2f8; color: var(--ink); }
.row-actions.show { background: #eef2f8; color: var(--ink); }

.file-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: inline-grid; place-items: center; font-size: 17px;
  background: #eef2f8; color: #64748b;
}
.file-icon.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 22px; }
.file-icon.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }
.fi-folder { background: #fdf1da; color: #b45309; }
.fi-pdf { background: #fdeaea; color: #dc2626; }
.fi-word { background: #e7efff; color: #1d4ed8; }
.fi-excel { background: #e5f7ec; color: #15803d; }
.fi-slides { background: #fdeee5; color: #c2410c; }
.fi-image { background: #f1eaff; color: #7c3aed; }
.fi-text { background: #eef2f7; color: #475569; }
.fi-audio { background: #e6f8f6; color: #0f766e; }
.fi-video { background: #fdeaf3; color: #be185d; }
.fi-zip { background: #f3f0e6; color: #a16207; }
.fi-doc { background: #e7f2fb; color: #0369a1; }
.fi-other { background: #eef2f8; color: #64748b; }

.badge-soft {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 20px; background: #eef2f8; color: #475569; white-space: nowrap;
}
.badge-soft.green { background: var(--green-soft); color: var(--green); }
.badge-soft.blue { background: var(--brand-soft); color: var(--brand); }
.badge-soft.amber { background: var(--amber-soft); color: var(--amber); }
.badge-soft.red { background: var(--red-soft); color: var(--red); }
.badge-soft.purple { background: var(--purple-soft); color: var(--purple); }
.badge-soft.teal { background: var(--teal-soft); color: var(--teal); }

.empty-state { padding: 56px 24px; text-align: center; }
.empty-state .empty-icon {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 14px;
  background: #f1f5fb; color: #94a3b8; display: grid; place-items: center; font-size: 27px;
}
.empty-state h3 { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.empty-state p { font-size: 12px; color: var(--muted); margin: 0 auto 16px; max-width: 360px; line-height: 1.55; }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.file-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 13px;
  padding: 15px; display: flex; flex-direction: column; gap: 10px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: .15s;
}
.file-card:hover { border-color: #c3d4ee; box-shadow: 0 10px 24px -18px rgba(15,23,42,.35); transform: translateY(-1px); }
.file-card .file-icon { width: 42px; height: 42px; font-size: 20px; }
.file-card .card-name { font-size: 12px; font-weight: 600; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.file-card .card-meta { font-size: 10px; color: var(--muted); margin-top: auto; }
.card-menu { position: absolute; top: 10px; right: 9px; }

.search-banner {
  display: flex; align-items: center; gap: 9px; padding: 11px 15px;
  background: #eef4ff; border: 1px solid #dbe7ff; border-radius: 11px;
  font-size: 12px; color: #1e40af;
}
.search-banner button { margin-left: auto; border: 0; background: transparent; color: #1d4ed8; font-size: 11.5px; font-weight: 600; }

.circ-files-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid #e3ebf7; background: linear-gradient(135deg, #f7faff, #ffffff);
}
.circ-files-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; background: #eaf1ff; color: #1d4ed8; font-size: 20px;
}
.circ-files-text { flex: 1; min-width: 0; }
.circ-files-text h3 { font-size: 13.5px; font-weight: 700; margin: 0 0 2px; color: var(--ink); }
.circ-files-text p { font-size: 11px; color: var(--muted); margin: 0; line-height: 1.5; }
.circ-files-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.circ-files-banner { background: #f5f9ff; border-color: #e1eafb; color: #334155; }
.circ-files-banner strong { color: #1e3a8a; }

.drop-active::after {
  content: "Rilascia qui i file da caricare";
  position: absolute; inset: 0; z-index: 30;
  display: grid; place-items: center; border-radius: var(--radius);
  background: rgba(232, 239, 255, .92); border: 2px dashed #6f9bf0;
  color: #1d4ed8; font-weight: 700; font-size: 15px; backdrop-filter: blur(2px);
}

/* ------------------------------- TABLES / LISTS ------------------------------- */
.table-panel { overflow: hidden; }
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 10px 16px; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .1em; color: #8493a8; border-bottom: 1px solid var(--line-soft);
  background: #fbfcfe; font-weight: 700; white-space: nowrap;
}
.data-table td { padding: 11px 16px; border-bottom: 1px solid #f1f5f9; font-size: 12px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafcff; }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table .actions .btn { padding: .3rem .5rem; font-size: 11px; border-radius: 7px; }

.user-cell { display: flex; align-items: center; gap: 9px; }
.user-cell strong { display: block; font-size: 12px; }
.user-cell small { display: block; color: var(--muted); font-size: 10.5px; }
.role-pill { text-transform: capitalize; }

.activity-list { display: flex; flex-direction: column; }
.activity-row { display: flex; gap: 13px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.activity-row:last-child { border-bottom: 0; }
.activity-dot {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center;
  background: #f1f5fb; color: #64748b; font-size: 13px;
}
.activity-text { min-width: 0; flex: 1; }
.activity-text strong { display: block; font-size: 12px; font-weight: 600; }
.activity-text small { color: var(--muted); font-size: 10.5px; }
.activity-time { color: var(--muted-2); font-size: 10px; white-space: nowrap; }

/* ------------------------------- CIRCULARS ------------------------------- */
.circulars-top { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; margin-bottom: 18px; align-items: stretch; }
.circular-hero {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 26px 28px; color: #fff;
  background:
    radial-gradient(420px 260px at 100% 0%, rgba(14, 165, 233, .5), transparent 68%),
    linear-gradient(135deg, #0b1730, #1e3a8a 75%, #1d4ed8);
  display: flex; flex-direction: column; justify-content: center;
}
.circular-hero h2 { color: #fff; font-size: 22px; letter-spacing: -.02em; margin: 0 0 6px; position: relative; z-index: 1; }
.circular-hero p { color: #b7cbf2; font-size: 12.5px; max-width: 520px; margin: 0 0 18px; line-height: 1.55; position: relative; z-index: 1; }
.circular-hero .btn { align-self: flex-start; position: relative; z-index: 1; }
.circular-next-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; justify-content: center; box-shadow: var(--shadow-sm); }
.circular-next-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.circular-next-number { font-size: 52px; font-weight: 700; line-height: 1; letter-spacing: -.05em; color: var(--brand); margin: 7px 0 4px; }
.circular-next-card small { color: var(--muted); font-size: 11px; }
.circular-next-card .badge-soft { align-self: flex-start; margin-top: 12px; }

.number-badge {
  display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px;
  border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 12px;
}
.circular-object { font-weight: 600; color: var(--ink); max-width: 440px; display: block; line-height: 1.35; }
.circular-object small { display: block; font-weight: 400; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.file-attached { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--red); font-weight: 600; background: var(--red-soft); padding: 2px 7px; border-radius: 5px; }
.file-attached.missing { color: var(--muted); background: #f1f5f9; }

/* ------------------------------- EDITOR ------------------------------- */
.editor-modal { height: min(92vh, 980px); display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; }
.editor-head { flex-shrink: 0; align-items: center; padding: 14px 20px; }
.editor-title-wrap { flex: 1; min-width: 0; }
.editor-title {
  border: 0; padding: 1px 0; margin: 0; background: transparent; width: 100%;
  font-size: 19px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); outline: none;
}
.editor-title:focus { box-shadow: 0 1px 0 var(--brand); }
.editor-title-static { font-size: 19px; font-weight: 700; margin: 2px 0 0; letter-spacing: -.02em; }
.save-state { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.save-state.dirty { color: var(--amber); }

.editor-toolbar {
  flex-shrink: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 7px 16px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}
.toolgroup { display: flex; align-items: center; gap: 2px; padding-right: 5px; margin-right: 3px; border-right: 1px solid #e7edf6; }
.toolgroup:last-child { border-right: 0; }
.tool {
  border: 0; background: transparent; color: #475569; width: 30px; height: 29px; border-radius: 6px;
  display: inline-grid; place-items: center; font-size: 13px; position: relative;
}
.tool:hover { background: #e9eff8; color: var(--ink); }
.tool.active { background: var(--brand-soft); color: var(--brand); }
.tool-color { cursor: pointer; overflow: hidden; }
.tool-color input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.tool-select {
  height: 29px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
  font-size: 11.5px; color: #475569; padding: 0 22px 0 7px;
}
.tool-slash { position: absolute; width: 19px; height: 1.5px; background: currentColor; transform: rotate(-45deg); opacity: .65; }

.editor-scroll { flex: 1; overflow-y: auto; padding: 26px 20px 40px; background: #eef2f8; }
.paper {
  width: 100%; max-width: 830px; margin: 0 auto; background: #fff; border-radius: 4px;
  padding: 54px 62px 70px; box-shadow: 0 18px 40px -22px rgba(15,23,42,.32), 0 1px 3px rgba(15,23,42,.08);
  min-height: 100%;
}
.paper-doc { min-height: 1100px; }
.modal-dialog.modal-fullscreen .paper-doc { width: min(900px, calc(100% - 40px)); margin: 16px auto 60px; }
.paper-brand {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-bottom: 13px; margin-bottom: 26px; border-bottom: 1px solid #e9eef5;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .12em; color: #94a3b8; font-weight: 600;
}

/* ------------------------------- INTESTAZIONE UFFICIALE -------------------------------
   Geometria ricavata da intestazione.docx (PDF di riferimento):
   banner 517,5x76,5 pt, testi 12/10 pt, piè di pagina 9 pt con riga
   divisoria fra la prima e la seconda riga. Le misure sono espresse in
   cqw (percentuale della larghezza del foglio) così da restare identiche
   a qualsiasi zoom e in anteprima.
   ------------------------------------------------------------------------------------- */
.letterhead {
  container-type: inline-size;
  margin: 0 0 24px;
  font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
  color: #000;
}
.letterhead-banner {
  display: block;
  width: 104.3cqw;
  max-width: none;
  height: auto;
  margin: 0 0 0 -2.056cqw;
}
.letterhead-main { position: relative; height: 15.16cqw; }
.letterhead-text { position: absolute; inset: 0; padding-top: 1.914cqw; text-align: center; }
.letterhead-text p { margin: 0; line-height: 1; color: #000; }
.letterhead-ministry, .letterhead-istituto, .letterhead-name {
  font-weight: 700; font-size: 2.418cqw; letter-spacing: .001em;
}
.letterhead-text p + p { margin-top: 0.532cqw; }
.letterhead-address, .letterhead-site { font-size: 2.015cqw; }
.letterhead-address { margin-top: 0.471cqw !important; }
.letterhead-site { margin-top: 0.427cqw !important; }
.letterhead-stemma { position: absolute; left: 86.32cqw; top: 0; width: 10.117cqw; height: auto; }
.letterhead-eu { position: absolute; left: -1.048cqw; top: 1.834cqw; width: 12.919cqw; height: auto; }
.doc-letterhead, .circ-letterhead { flex-shrink: 0; }
.letterhead-footer {
  container-type: inline-size;
  margin-top: 38px;
  font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
  color: #000;
}
.letterhead-footer-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 2cqw; font-size: 1.814cqw; line-height: 1;
}
.letterhead-footer-row > span:first-child { flex: 1 1 auto; min-width: 0; }
.letterhead-footer-row > span:last-child { text-align: right; white-space: nowrap; }
.letterhead-footer-rule { border-top: 0.12cqw solid #000; margin: 0.103cqw 0 0.308cqw; }
.letterhead-page { font-weight: 700; }

.modal-dialog.modal-fullscreen {
  width: 100%; max-width: none; height: 100vh; max-height: 100vh; margin: 0;
  display: flex; align-items: stretch;
}
@supports (height: 100dvh) {
  .modal-dialog.modal-fullscreen { height: 100dvh; max-height: 100dvh; }
}
.modal-dialog.modal-fullscreen .editor-modal,
.modal-dialog.modal-fullscreen .modal-content {
  height: 100%; max-height: 100%; border-radius: 0;
}
.modal-dialog.modal-fullscreen .editor-scroll { padding: 14px 16px 34px; }
.modal-dialog.modal-fullscreen .modal-body { overflow-y: auto; }

.new-doc-preview {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  border: 1px dashed #c9d6ea; border-radius: 10px; background: #f8fbff;
  color: #33507c; font-size: 11.5px; font-weight: 600;
}
.new-doc-preview .bi { color: var(--brand); font-size: 16px; }

.signature-form { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafd; }
.signature-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.signature-tools .form-hint { flex: 1; min-width: 170px; }
.signature-preview {
  display: flex; align-items: center; justify-content: center; min-height: 62px;
  padding: 8px; border: 1px dashed #cbd5e1; border-radius: 9px; background: #fff;
}
.signature-preview:empty::before { content: 'Nessuna firma grafica'; color: #94a3b8; font-size: 11px; }
.signature-preview img { max-width: 100%; max-height: 82px; object-fit: contain; }
.signature-draw { margin-top: 9px; }
.signature-draw canvas {
  display: block; width: 100%; height: auto; background: #fff; border: 1px solid #cbd5e1;
  border-radius: 9px; touch-action: none; cursor: crosshair;
}
.signature-draw-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.signature-edit-note {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px;
  padding-top: 8px; border-top: 1px solid #e7edf6; color: #1d4ed8; font-size: 11px;
}
.signature-edit-note .btn { font-size: 11px; }
.signature-thumb { width: 42px; height: 42px; object-fit: contain; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; }
.signature-render { display: block; max-width: 210px; max-height: 80px; object-fit: contain; }
.circular-paper-sign .signature-render { margin-left: 0; margin-right: 0; }
.signature-line { display: block; width: 170px; border-top: 1px solid #cbd5e1; margin: 7px 0 2px; }
.signature-thumb-placeholder {
  width: 42px; height: 42px; display: grid; place-items: center; border: 1px dashed #cbd5e1;
  border-radius: 7px; background: #fff; color: #94a3b8;
}
.rich-content { outline: none; font-size: 14px; line-height: 1.7; color: #1e293b; min-height: 420px; }
.rich-content:empty::before { content: "Inizia a scrivere…"; color: #b6c2d2; }
.rich-content h1 { font-size: 26px; font-weight: 700; letter-spacing: -.03em; color: #0f172a; margin: 0 0 18px; line-height: 1.25; }
.rich-content h2 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; color: #0f172a; margin: 26px 0 10px; }
.rich-content h3 { font-size: 15.5px; font-weight: 700; color: #1e293b; margin: 20px 0 7px; }
.rich-content h4, .rich-content h5, .rich-content h6 { font-size: 13.5px; font-weight: 700; margin: 16px 0 6px; }
.rich-content p { margin: 0 0 11px; }
.rich-content ul, .rich-content ol { margin: 0 0 12px; padding-left: 24px; }
.rich-content li { margin: 3px 0; }
.rich-content blockquote {
  margin: 16px 0; padding: 11px 16px; border-left: 3px solid #93b4f5;
  background: #f6f9ff; color: #475569; font-style: italic; border-radius: 0 6px 6px 0;
}
.rich-content hr { border: 0; border-top: 1px solid #e2e8f0; margin: 22px 0; }
.rich-content table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 12.5px; }
.rich-content th, .rich-content td { border: 1px solid #dbe3ee; padding: 7px 9px; text-align: left; vertical-align: top; }
.rich-content th { background: #f3f7fd; font-weight: 700; }
.rich-content pre { background: #f5f7fa; border: 1px solid #e8edf5; border-radius: 8px; padding: 12px; font-size: 12px; overflow-x: auto; }
.rich-content a { color: var(--brand); text-decoration: underline; }
.rich-content mark { background: #fef3c7; padding: 0 2px; }
.rich-content img { max-width: 100%; }

.editor-footer { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; flex-wrap: wrap; }
.editor-footer .attachment-list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.editor-footer .attachment-chip { padding: 2px 8px; font-size: 11px; }
.editor-status { font-size: 10.5px; color: var(--muted); }
.editor-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.editor-actions .btn { padding: .45rem .75rem; font-size: 12px; }

.circular-form { flex-shrink: 0; padding: 17px 22px 19px; border-bottom: 1px solid var(--line-soft); background: #fff; }
.circular-form .form-label { font-size: 11.5px; }
.circular-form .form-control, .circular-form .input-group-text { font-size: 12.5px; padding: .45rem .6rem; }
.circular-form .input-group-text { background: #f4f7fb; color: #64748b; border-color: #dbe3ee; font-weight: 700; }
.recipient-picker { min-width: 0; }
.recipient-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.recipient-chips:empty { display: none; }
.recipient-chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 2px 3px 2px 9px; border-radius: 999px; border: 1px solid #d6e3fa;
  background: #eef4ff; color: #1e3a8a; font-size: 11px; font-weight: 600;
}
.recipient-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipient-chip button {
  width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: transparent; color: #64748b; font-size: 9px;
}
.recipient-chip button:hover { background: #dbe7fb; color: #1e3a8a; }
/* ------------------------------- CIRCOLARE · EDITOR A TUTTO SCHERMO -------------------------------
   Il foglio è disegnato in punti PDF (1 pt = --k pixel): larghezza, margini, corpo del testo e
   interlinea sono gli stessi usati da assets/pdf.js, così a capo e interruzioni di pagina
   dell'editor coincidono con quelle del PDF generato.
   ------------------------------------------------------------------------------------------- */
.circ-dialog { width: 100vw; max-width: none; height: 100%; margin: 0; }
@supports (height: 100dvh) { .circ-dialog { height: 100dvh; } }
.circ-workspace { height: 100%; display: flex; flex-direction: column; border-radius: 0 !important; overflow: hidden; background: #fff; }

.circ-top { flex: none; display: flex; align-items: center; gap: 14px; padding: 7px 16px; background: #fff; border-bottom: 1px solid var(--line-soft); }
.circ-top-title { min-width: 0; flex: 0 1 auto; }
.circ-top-title .eyebrow { font-size: 9.5px; }
.circ-top-title h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.circ-summary {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 11px;
  border: 1px solid var(--line); border-radius: 9px; background: #f8fafd; color: #334155; font-size: 12px; text-align: left;
}
.circ-summary:hover { background: #f1f5fb; border-color: #cfd9e8; }
.circ-summary .bi:first-child { color: var(--brand); }
.circ-summary-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.circ-summary-caret { font-size: 10px; color: var(--muted); transition: transform .18s; }
.circ-summary[aria-expanded="false"] .circ-summary-caret { transform: rotate(180deg); }
.circ-top-actions { flex: none; display: flex; align-items: center; gap: 9px; }
.circ-pages-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; white-space: nowrap;
}
.circ-pages-chip.is-multi { background: var(--amber-soft); color: var(--amber); }
.circ-zoom { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; overflow: hidden; }
.circ-zoom button { border: 0; background: transparent; height: 29px; min-width: 29px; padding: 0 7px; color: #475569; font-size: 12px; }
.circ-zoom button:hover { background: #eef3fb; color: var(--ink); }
.circ-zoom .circ-zoom-label { min-width: 58px; font-weight: 600; border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); }

.circ-data { flex: none; padding: 10px 16px 8px; background: #fff; border-bottom: 1px solid var(--line); }
.circ-data.is-collapsed { display: none; }
.circ-data-grid {
  display: grid; gap: 8px 14px; align-items: start;
  grid-template-columns: 92px 148px minmax(220px, 1.5fr) minmax(240px, 1.5fr);
  grid-template-areas: "num date ogg dest" "firma firma firma att";
}
.circ-data-grid .cd { min-width: 0; }
.cd-num { grid-area: num; } .cd-date { grid-area: date; } .cd-ogg { grid-area: ogg; }
.cd-dest { grid-area: dest; } .cd-firma { grid-area: firma; display: grid; grid-template-columns: minmax(200px, 360px) 1fr; column-gap: 12px; align-items: end; }
.cd-firma > label { grid-column: 1 / -1; }
.cd-firma .form-hint { margin: 0 0 6px; }
.cd-att { grid-area: att; }
.circ-data .form-label { font-size: 11px; font-weight: 600; color: #475569; margin-bottom: 3px; }
.circ-data .form-control, .circ-data .form-select { font-size: 12.5px; }
.circ-link-btn { font-size: 10.5px; font-weight: 600; text-decoration: none; }
.circ-att-list { margin-top: 0; max-height: 64px; overflow: auto; gap: 4px; }
.circ-att-list .attachment-row { padding: 4px 8px; }
.circ-att-list .attachment-icon { width: 24px; height: 24px; font-size: 12px; }
.circ-num-hint { margin: 4px 0 0; }
.circ-data .recipient-chips { margin-bottom: 4px; max-height: 52px; overflow: auto; }

.circ-toolbar { border-top: 0; padding: 6px 16px; }

.circ-stage { flex: 1 1 auto; min-height: 0; overflow: auto; background: #e6ecf5; padding: 0 24px; scroll-behavior: auto; }

.circ-sheet {
  --k: 1.6;
  --pt: calc(var(--k) * 1px);
  position: relative; display: flex; flex-direction: column;
  width: calc(595.28 * var(--pt)); min-height: calc(841.89 * var(--pt));
  margin: 22px auto 70px; background: #fff;
  padding: calc(22.5 * var(--pt)) calc(56 * var(--pt)) calc(19 * var(--pt));
  box-shadow: 0 18px 40px -22px rgba(15, 23, 42, .38), 0 1px 3px rgba(15, 23, 42, .1);
  font-family: Helvetica, Arial, "Liberation Sans", "Segoe UI", sans-serif; color: #1e293b;
}
.circ-sheet > * { flex: none; }
.circ-sheet .circ-letterhead { margin: 0 0 calc(10.5 * var(--pt)) calc(.7 * var(--pt)); width: calc(496 * var(--pt)); }
.circ-sheet .circ-letterhead .letterhead { margin: 0; }
.circ-footer { margin: calc(14 * var(--pt)) 0 0 calc(.7 * var(--pt)); width: calc(496 * var(--pt)); }
.circ-footer .letterhead-footer { margin-top: 0; }

.circ-head { padding-top: calc(2 * var(--pt)); }
.circ-date-row { text-align: right; font-size: calc(9 * var(--pt)); line-height: calc(14 * var(--pt)); color: var(--muted); min-height: calc(20 * var(--pt)); }
.circ-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: calc(16 * var(--pt)); border-bottom: calc(1.6 * var(--pt)) solid #1e3a8a; padding-bottom: calc(8 * var(--pt)); }
.circ-sheet .circular-paper-label { font-size: calc(8 * var(--pt)); font-weight: 700; letter-spacing: 0; color: #94a3b8; text-transform: uppercase; margin: 0 0 calc(4 * var(--pt)); }
.circ-sheet .circular-paper-number { font-size: calc(15 * var(--pt)); line-height: calc(18 * var(--pt)); font-weight: 700; color: #1e3a8a; }
.circ-year { font-size: calc(8 * var(--pt)); color: var(--muted); padding-bottom: calc(2 * var(--pt)); }
.circ-field-label { margin-top: calc(14 * var(--pt)); font-size: calc(8 * var(--pt)); font-weight: 700; color: #94a3b8; text-transform: uppercase; line-height: calc(11 * var(--pt)); }
.circ-paper-oggetto { margin-top: calc(3 * var(--pt)); font-size: calc(11.5 * var(--pt)); line-height: calc(16 * var(--pt)); font-weight: 700; color: #0f172a; overflow-wrap: anywhere; min-height: calc(16 * var(--pt)); }
.circ-paper-oggetto:empty::before { content: "Oggetto della circolare"; font-weight: 400; color: #b6c2d2; }
.circ-field-label-dest { margin-top: calc(8 * var(--pt)); }
.circ-paper-dest { margin-top: calc(1 * var(--pt)); font-size: calc(9 * var(--pt)); line-height: calc(12.5 * var(--pt)); color: #475569; white-space: pre-line; overflow-wrap: anywhere; }
.circ-head-rule { border-top: calc(.7 * var(--pt)) solid #dbe3ee; margin: calc(8 * var(--pt)) 0 calc(24 * var(--pt)); }

.circ-sheet .circ-body {
  flex: 1 0 auto; outline: none; min-height: calc(280 * var(--pt));
  font-size: calc(10.5 * var(--pt)); line-height: 1.5; color: #1e293b; text-align: left;
  padding-bottom: calc(10 * var(--pt)); caret-color: #1d4ed8;
}
.circ-sheet .circ-body:empty::before { content: "Scrivi qui il testo della circolare…"; color: #b6c2d2; }
.circ-body > *:first-child { margin-top: 0 !important; }
.circ-body p, .circ-body > div { margin: 0 0 calc(8 * var(--pt)); }
.circ-body h1 { font-size: calc(19 * var(--pt)); line-height: calc(25 * var(--pt)); margin: calc(10.45 * var(--pt)) 0 calc(11 * var(--pt)); letter-spacing: 0; }
.circ-body h2 { font-size: calc(14.5 * var(--pt)); line-height: calc(20 * var(--pt)); margin: calc(7.98 * var(--pt)) 0 calc(7.7 * var(--pt)); letter-spacing: 0; }
.circ-body h3 { font-size: calc(12.5 * var(--pt)); line-height: calc(17 * var(--pt)); margin: calc(6.9 * var(--pt)) 0 calc(6 * var(--pt)); }
.circ-body h4, .circ-body h5, .circ-body h6 { font-size: calc(11 * var(--pt)); line-height: calc(15 * var(--pt)); margin: calc(6 * var(--pt)) 0 calc(5 * var(--pt)); }
.circ-body ul, .circ-body ol { margin: 0 0 calc(4 * var(--pt)); padding-left: calc(18 * var(--pt)); }
.circ-body li { margin: 0 0 calc(6 * var(--pt)); line-height: calc(15.5 * var(--pt)); }
.circ-body blockquote { margin: 0 0 calc(10 * var(--pt)); padding: calc(8 * var(--pt)) calc(16 * var(--pt)); font-size: calc(10.5 * var(--pt)); }
.circ-body table { font-size: calc(8.5 * var(--pt)); }
.circ-body pre { font-size: calc(8.5 * var(--pt)); }

.circ-sheet .circular-paper-sign { display: flex; flex-direction: column; align-items: flex-end; margin-top: calc(24 * var(--pt)); font-size: calc(9.5 * var(--pt)); color: #64748b; gap: calc(3 * var(--pt)); }
.circ-sheet .circular-paper-sign > span:first-child { font-size: calc(10.5 * var(--pt)); font-weight: 700; color: #0f172a; }
.circ-sheet .circular-paper-sign small { font-size: calc(9.5 * var(--pt)); }

/* Interruzioni di pagina calcolate dal motore PDF */
.circular-page-guides { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.circular-page-guide { position: absolute; left: -24px; right: -24px; height: 0; border-top: 2px dashed #6c93e0; }
.circular-page-guide span {
  position: absolute; right: 24px; top: -11px; display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border: 1px solid #c3d4f5; border-radius: 999px; background: #eef4ff;
  color: #1e3a8a; font-size: 10px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.circ-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border-top: 1px solid var(--line); background: #fff; }
.circ-foot .editor-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) {
  .circ-data-grid { grid-template-columns: 92px 148px 1fr; grid-template-areas: "num date ogg" "dest dest dest" "firma firma att"; }
}
@media (max-width: 760px) {
  .circ-top { flex-wrap: wrap; gap: 8px; }
  .circ-summary { order: 3; flex: 1 0 100%; }
  .circ-save-top span { display: none; }
  .circ-data-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "num date" "ogg ogg" "dest dest" "firma firma" "att att"; }
  .circ-stage { padding: 0 8px; }
  .circ-foot .editor-status { display: none; }
}

/* ------------------------------- PREVIEW ------------------------------- */
.preview-modal { height: min(90vh, 1000px); display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; }
.preview-modal .modal-header { flex-shrink: 0; padding: 14px 20px; }
.preview-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.preview-heading-text { min-width: 0; }
.preview-heading h2 { font-size: 15.5px; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62vw; }
.preview-heading p { font-size: 10.5px; color: var(--muted); margin: 2px 0 0; }
.preview-modal .modal-body { flex: 1; overflow: auto; padding: 0; background: #eef2f8; display: flex; flex-direction: column; }
.preview-loading { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.preview-loading .spinner-border { width: 26px; height: 26px; }
.preview-frame { width: 100%; height: 100%; min-height: 480px; border: 0; background: #fff; flex: 1; }
.preview-image-wrap { flex: 1; display: grid; place-items: center; padding: 22px; min-height: 420px; }
.preview-image-wrap img { max-width: 100%; max-height: 72vh; object-fit: contain; border-radius: 4px; box-shadow: var(--shadow); background: #fff; }
.preview-media-wrap { flex: 1; display: grid; place-items: center; padding: 24px; }
.preview-media-wrap video { max-width: 100%; max-height: 70vh; border-radius: 10px; background: #000; }
.preview-media-wrap audio { width: min(560px, 100%); }
.preview-text { margin: 0; padding: 22px 26px; background: #fff; min-height: 100%; white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.65; color: #334155; }
.preview-docx { width: 100%; padding: 22px 14px 50px; }
.preview-docx .docx-wrapper { background: transparent !important; padding: 0 !important; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.preview-docx .docx-wrapper > section.docx { box-shadow: var(--shadow) !important; border-radius: 2px; margin: 0 auto !important; }
.preview-sheet { background: #fff; padding: 20px; min-height: 100%; }
.preview-sheet h4 { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 4px 0 10px; }
.preview-sheet table { width: 100%; border-collapse: collapse; font-size: 11px; margin-bottom: 28px; }
.preview-sheet td, .preview-sheet th { border: 1px solid #e2e8f0; padding: 5px 7px; vertical-align: top; }
.preview-sheet th { background: #f8fafc; }
.preview-unsupported { margin: auto; text-align: center; padding: 40px 20px; max-width: 460px; }
.preview-unsupported .file-icon { width: 62px; height: 62px; border-radius: 17px; font-size: 27px; margin-bottom: 14px; }
.preview-unsupported h3 { font-size: 15px; font-weight: 700; margin: 0 0 5px; }
.preview-unsupported p { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 0 0 16px; }
.preview-modal .modal-footer { flex-shrink: 0; padding: 10px 16px; gap: 6px; flex-wrap: wrap; }
.preview-modal .modal-footer .btn { padding: .42rem .7rem; font-size: 11.5px; }
.preview-meta-line { margin-right: auto; font-size: 10.5px; color: var(--muted); }
.preview-paper {
  width: min(820px, calc(100% - 36px)); margin: 24px auto; background: #fff; border-radius: 3px;
  padding: 50px 58px 62px; box-shadow: var(--shadow); min-height: 600px;
}
.preview-paper .doc-heading { border-bottom: 1px solid #e8edf4; padding-bottom: 18px; margin-bottom: 24px; }
.preview-paper .doc-heading h1 { font-size: 25px; font-weight: 700; letter-spacing: -.03em; margin: 0 0 4px; }
.preview-paper .doc-heading p { font-size: 10.5px; color: #94a3b8; margin: 0; text-transform: uppercase; letter-spacing: .08em; }
.preview-paper .rich-content { min-height: 0; }

/* ------------------------------- MODALS / FORMS ------------------------------- */
.modal-content { border: 0; border-radius: 16px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--line-soft); padding: 15px 19px; }
.modal-footer { border-top: 1px solid var(--line-soft); padding: 12px 17px; }
.modal-title { font-weight: 700; letter-spacing: -.02em; }
.modal-body { padding: 19px; }

.confirm-modal { text-align: center; border-radius: 18px; }
.confirm-modal .modal-body { padding: 26px 24px 18px; }
.confirm-icon {
  width: 50px; height: 50px; border-radius: 14px; background: var(--red-soft); color: var(--red);
  display: grid; place-items: center; font-size: 22px; margin: 0 auto 12px;
}
.confirm-modal h2 { font-size: 17px; font-weight: 700; margin: 0 0 5px; }
.confirm-modal p { font-size: 12px; color: var(--muted); line-height: 1.55; margin: 0; }
.confirm-modal .modal-footer { justify-content: center; border-top: 0; padding: 0 24px 24px; }
.confirm-modal .modal-footer .btn { min-width: 110px; }

.form-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #64748b; margin: 0 0 10px; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head strong { font-size: 15px; }

.pdf-ready { display: flex; align-items: center; gap: 13px; padding: 13px; background: #f8fafd; border: 1px solid var(--line); border-radius: 12px; }
.pdf-ready-icon { width: 44px; height: 44px; border-radius: 11px; background: var(--red-soft); color: #dc2626; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.pdf-ready p { font-size: 11px; color: var(--muted); margin: 2px 0 0; }

.text-editor {
  width: 100%; height: 58vh; border: 0; outline: none; resize: none; padding: 18px 20px;
  font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; line-height: 1.65; color: #1e293b;
  background: #fbfcfe; white-space: pre; tab-size: 4;
}

/* ------------------------------- TOASTS / LOADER ------------------------------- */
.toast-container { z-index: 1090; }
.app-toast { border: 0; border-radius: 11px; box-shadow: var(--shadow); overflow: hidden; min-width: 280px; }
.app-toast .toast-body { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; padding: 11px 13px; }
.app-toast .toast-body i { font-size: 15px; margin-top: 1px; }
.app-toast.success { border-left: 3px solid var(--green); }
.app-toast.success i { color: var(--green); }
.app-toast.error { border-left: 3px solid var(--red); }
.app-toast.error i { color: var(--red); }
.app-toast.info { border-left: 3px solid var(--brand); }
.app-toast.info i { color: var(--brand); }

.upload-toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 1085; width: 310px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px;
  box-shadow: var(--shadow-lg); font-size: 11.5px;
}
.upload-toast .progress { height: 5px; }
.upload-toast .progress-bar { transition: width .18s ease; }

.global-loader {
  position: fixed; inset: 0; z-index: 1080; background: rgba(15, 23, 42, .28);
  display: grid; place-items: center; backdrop-filter: blur(2px);
}
.global-loader-card {
  background: #fff; border-radius: 13px; padding: 18px 22px; display: flex;
  align-items: center; gap: 12px; font-size: 12.5px; color: #334155; box-shadow: var(--shadow-lg);
}

/* ------------------------------- CONTEXT MENU ------------------------------- */
.context-menu {
  position: fixed; z-index: 1095; min-width: 200px; padding: 5px;
  background: #fff; border: 1px solid var(--line); border-radius: 11px;
  box-shadow: 0 24px 50px -22px rgba(15, 23, 42, .42), 0 2px 6px rgba(15, 23, 42, .06);
}
.context-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent;
  border-radius: 7px; padding: 7px 9px; font-size: 12px; color: var(--ink-2); text-align: left;
}
.context-menu button:hover { background: #f1f5fb; }
.context-menu button.danger { color: var(--red); }
.context-menu button.danger:hover { background: var(--red-soft); }
.context-menu button i { width: 16px; text-align: center; font-size: 13px; color: #64748b; flex-shrink: 0; }
.context-menu .sep { height: 1px; margin: 4px 6px; background: var(--line-soft); }

/* ------------------------------- ADMIN TABLES ------------------------------- */
.data-table .name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.data-table .meta-cell { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.data-table .user-cell strong { font-weight: 600; }
.badge-soft i { font-size: 10px; }
.role-pill { text-transform: lowercase; }

/* ------------------------------- RESPONSIVE ------------------------------- */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .circulars-top { grid-template-columns: 1fr; }
  .circular-next-card { flex-direction: row; align-items: center; gap: 16px; }
  .circular-next-card .badge-soft { margin: 0 0 0 auto; }
  .circular-next-number { font-size: 40px; margin: 0; }
  .topbar-heading p { display: none; }
}

@media (max-width: 1100px) {
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1035; }
  body.sidebar-open .sidebar-overlay { display: block; }
  .topbar-menu { display: inline-grid; }
  .topbar { padding: 0 18px; gap: 12px; }
  .view-root { padding: 20px 20px 50px; }
}

@media (max-width: 900px) {
  .login-screen { padding: 16px; }
  .login-shell { grid-template-columns: 1fr; min-height: 0; max-width: 520px; border-radius: 22px; }
  .login-brand { padding: 28px 28px 26px; }
  .brand-copy, .brand-features, .brand-footer { display: none; }
  .login-brand-top { gap: 13px; }
  .login-brand-top h1 { font-size: 19px; }
  .login-panel { padding: 28px 26px 22px; }
  .login-copyright { padding-top: 18px; }
  .topbar-search { max-width: none; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn i { margin-right: 0; }
  .topbar-heading { min-width: 0; }
  .topbar-heading h1 { font-size: 16px; }
  .file-table .hide-sm { display: none; }
  .data-table .hide-sm { display: none; }
  .paper { padding: 34px 26px 46px; }
  .preview-paper { padding: 32px 24px 42px; width: calc(100% - 20px); margin: 10px auto; }
  .editor-modal { height: 96vh; }
  .preview-modal { height: 94vh; }
  .preview-heading h2 { max-width: 55vw; }
  .circular-paper-head { flex-direction: column; gap: 8px; }
  .circ-files-card { align-items: flex-start; flex-wrap: wrap; }
  .circ-files-actions { width: 100%; justify-content: flex-start; }
}

@media (max-width: 640px) {
  .view-root { padding: 16px 14px 50px; }
  .topbar { height: 66px; padding: 0 12px; }
  .topbar-search { display: none; }
  .topbar-actions .btn-upload { display: none; }
  .topbar-heading h1 { font-size: 15px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 13px; gap: 9px; }
  .stat-icon { width: 36px; height: 36px; font-size: 16px; }
  .stat-value { font-size: 20px; }
  .quick-grid { grid-template-columns: 1fr; }
  .page-intro h2 { font-size: 20px; }
  .explorer-bar { padding: 9px 11px; }
  .explorer-tools { width: 100%; }
  .file-table th:nth-child(3), .file-table td:nth-child(3) { display: none; }
  .file-table th:nth-child(4), .file-table td:nth-child(4) { display: none; }
  .editor-toolbar { padding: 5px 8px; }
  .toolgroup { padding-right: 2px; margin-right: 0; }
  .tool { width: 28px; }
  .editor-footer { flex-direction: column; align-items: stretch; }
  .editor-actions { justify-content: stretch; }
  .editor-actions .btn { flex: 1; }
  .circular-form { padding: 12px 14px; }
  .paper { padding: 26px 19px 40px; }
  .rich-content h1 { font-size: 22px; }
  .rich-content { font-size: 13px; }
  .login-brand { padding: 22px 22px 20px; }
  .login-panel { padding: 24px 20px 18px; }
  .topbar-heading p { display: none; }
  .modal-dialog { margin: 8px; }
  .preview-heading h2 { max-width: 48vw; font-size: 13.5px; }
  .preview-meta-line { width: 100%; }
}

/* ------------------------------- RUOLI / UTENTI ------------------------------- */
button.stat-card {
  font: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
button.stat-card:disabled { cursor: default; }
.stat-card-link:hover { border-color: #bdd1f4; box-shadow: 0 10px 24px -14px rgba(29, 78, 216, .45); transform: translateY(-1px); }
.stat-card-link:focus-visible { outline: 2px solid #a8c2f2; outline-offset: 2px; }
.stat-go {
  position: absolute; right: 14px; bottom: 12px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 10px;
}
.stat-card-disabled { opacity: .92; }

.activation-panel {
  margin-bottom: 16px; border-color: #c9dbfa;
  background: linear-gradient(180deg, #f7fbff, #ffffff);
}
.activation-panel .panel-body { padding: 14px 16px; }
.activation-url {
  display: block; margin-top: 4px; padding: 6px 9px; font-size: 11px; line-height: 1.5;
  color: var(--brand); background: #fff; border: 1px solid #dbe3ee; border-radius: 7px;
  word-break: break-all;
}
.min-w-0 { min-width: 0; }

.pending-panel { margin-bottom: 16px; border-color: #f1dba8; }
.pending-panel .panel-head { background: #fffaf0; border-radius: var(--radius) var(--radius) 0 0; }
.pending-panel .data-table tbody tr:first-child td { border-top-color: #f6e6c5; }
.row-pending td { background: #fffdf8; }

.user-position { display: flex !important; align-items: center; gap: 4px; color: var(--muted-2) !important; font-size: 10px !important; }
.user-position .bi { font-size: 9.5px; }

.authorize-person {
  display: flex; align-items: center; gap: 14px; padding: 13px 15px;
  background: #f7faff; border: 1px solid #dbe7fb; border-radius: 12px;
}
.authorize-person strong { display: block; font-size: 14px; }
.authorize-person .text-muted { font-size: 11.5px; }
.authorize-person .avatar.lg { font-size: 17px; }

.list-editor { display: flex; flex-direction: column; gap: 8px; }
.list-editor-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 12.5px; color: var(--ink);
}
.list-editor-row > span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.list-editor-row > span .bi { color: var(--brand); }
.list-editor-row .btn { --bs-btn-padding-y: .18rem; --bs-btn-padding-x: .45rem; }

.lists-tabs { gap: 6px; border-bottom: 1px solid var(--line-soft); padding-bottom: 10px; }
.lists-tabs .nav-link { font-size: 12.5px; padding: 6px 12px; color: var(--muted); border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; }
.lists-tabs .nav-link.active { background: var(--brand-soft); color: var(--brand); }

.attachment-picker {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px dashed #c9d6ea; border-radius: 10px; background: #f8fbff;
}
.attachment-list { display: flex; flex-direction: column; gap: 7px; margin-top: 9px; }
.attachment-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.attachment-icon {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 14px; flex-shrink: 0;
}
.attachment-text { min-width: 0; flex: 1; }
.attachment-text strong { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-text small { display: block; color: var(--muted); font-size: 10.5px; }

.circular-paper-sign { flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.circular-paper-sign small { color: #94a3b8; font-size: 10.5px; }
.preview-sign {
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  margin-top: 38px; padding-top: 10px; font-size: 12.5px; color: #475569;
}
.preview-sign small { color: #94a3b8; }

@media (max-width: 640px) {
  .activation-panel .panel-body { align-items: flex-start !important; }
  .authorize-person { align-items: flex-start; }
  .list-editor-row { align-items: flex-start; }
}
