/* ============================================================
   DocuSiu - full d'estils
   Control documental de Teulera Mascaro (Qualitat / Medi Ambient /
   Riscos Laborals). Sistema de disseny heretat del prototip:
   fons neutre gris-blavos, accents per area (terracota / verd-blau /
   blau-mari), tema clar i fosc.
   ============================================================ */
:root{
  --bg:#EDEFF1; --surface:#FFFFFF; --surface-2:#E4E7EA; --surface-3:#DADEE2;
  --border:#D2D7DB; --text:#1D2327; --text-muted:#5B6570;
  --accent:#B5602E; --accent-ink:#7C3F1C; --accent-tint:#F3E2D6;
  --accent2:#2E6E62; --accent2-ink:#1E4B43; --accent2-tint:#DDEBE7;
  --accent3:#3E5CA8; --accent3-ink:#2A3F79; --accent3-tint:#DEE3F3;
  --ok:#2F8F5B; --ok-tint:#DFF0E6;
  --warn:#B4790E; --warn-tint:#F6E8CF;
  --danger:#B0322A; --danger-tint:#F4DEDB;
  --shadow: 0 1px 2px rgba(20,25,29,.06), 0 6px 20px -8px rgba(20,25,29,.18);
  --radius: 10px;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#14181B; --surface:#1C2226; --surface-2:#242B30; --surface-3:#2B333A;
    --border:#333C42; --text:#E8EAEB; --text-muted:#9AA5AC;
    --accent:#E08A52; --accent-ink:#F4C8A4; --accent-tint:#3A2A20;
    --accent2:#5FB19E; --accent2-ink:#BFE3D8; --accent2-tint:#1B2F2B;
    --accent3:#8AA0E0; --accent3-ink:#C7D2F2; --accent3-tint:#212A47;
    --ok:#57C58A; --ok-tint:#173226;
    --warn:#E0AE4E; --warn-tint:#332911;
    --danger:#E17368; --danger-tint:#3A1F1C;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 30px -10px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"]{
  --bg:#14181B; --surface:#1C2226; --surface-2:#242B30; --surface-3:#2B333A;
  --border:#333C42; --text:#E8EAEB; --text-muted:#9AA5AC;
  --accent:#E08A52; --accent-ink:#F4C8A4; --accent-tint:#3A2A20;
  --accent2:#5FB19E; --accent2-ink:#BFE3D8; --accent2-tint:#1B2F2B;
  --accent3:#8AA0E0; --accent3-ink:#C7D2F2; --accent3-tint:#212A47;
  --ok:#57C58A; --ok-tint:#173226;
  --warn:#E0AE4E; --warn-tint:#332911;
  --danger:#E17368; --danger-tint:#3A1F1C;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 30px -10px rgba(0,0,0,.55);
}

*{box-sizing:border-box;}
[hidden]{display:none !important;}
html,body{margin:0;}
body{
  background:var(--bg); color:var(--text);
  font-family:"Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-inline:20px; padding-block:0 40px;
}
h1,h2,h3{font-family:"Fraunces", Georgia, "Times New Roman", serif; text-wrap:balance; margin:0;}
code, .mono, .num{font-family:"IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace; font-variant-numeric:tabular-nums;}
a{color:var(--accent);}
button{font-family:inherit;}

.wrap{max-width:1180px; margin-inline:auto;}

/* user bar (sessio actual) */
.userbar{
  max-width:1180px; margin:0 auto; display:flex; flex-wrap:wrap; gap:10px 16px;
  align-items:center; justify-content:flex-end;
  padding-block:8px; font-size:12.5px; color:var(--text-muted);
}
.userbar .who{margin-right:auto; display:flex; align-items:center; gap:8px;}
.userbar .who strong{color:var(--text); font-weight:600;}
.userbar .rolechip{
  display:inline-block; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:700;
  background:var(--surface-2); color:var(--text-muted); border:1px solid var(--border);
}
.userbar a{color:var(--text-muted); text-decoration:none; border:1px solid var(--border);
  background:var(--surface); padding:5px 10px; border-radius:8px; font-weight:600;}
.userbar a:hover{background:var(--surface-2); color:var(--text);}
/* boto "Bustia" (comprova ara si hi ha correus nous): mateix aspecte que els enllacos de la barra */
.userbar .userbar-btn{color:var(--text-muted); border:1px solid var(--border); background:var(--surface);
  padding:5px 10px; border-radius:8px; font-weight:600; font-size:inherit; line-height:inherit; cursor:pointer;
  display:inline-flex; align-items:center; gap:4px;}
.userbar .userbar-btn:hover{background:var(--surface-2); color:var(--text);}
.userbar .userbar-btn:disabled{opacity:.65; cursor:progress;}
.userbar-badge{display:inline-block; min-width:18px; padding:1px 6px; border-radius:999px; text-align:center;
  font-size:11px; font-weight:700; line-height:1.4; background:var(--warn); color:var(--surface);}
.userbar-badge.err{background:var(--danger);}

/* header */
header.top{
  position:sticky; top:0; z-index:20; background:var(--bg);
  padding-block:14px 12px; border-bottom:1px solid var(--border);
  display:flex; flex-wrap:wrap; gap:14px 24px; align-items:flex-end; justify-content:space-between;
}
.brand{display:flex; flex-direction:column; gap:2px;}
.brand .eyebrow{
  font-family:"IBM Plex Mono", monospace; font-size:11px; letter-spacing:.08em; text-transform:uppercase;
  color:var(--text-muted);
}
.brand h1{font-size:22px; font-weight:700; color:var(--text);}
.top-controls{display:flex; gap:10px; flex-wrap:wrap; align-items:center;}
.pillgroup{display:flex; flex-wrap:wrap; background:var(--surface-2); border-radius:999px; padding:3px; gap:2px; border:1px solid var(--border);}
.pill{
  border:none; background:transparent; padding:7px 13px; border-radius:999px; font-size:13px; font-weight:600;
  color:var(--text-muted); cursor:pointer; white-space:nowrap;
  display:inline-flex; align-items:center; gap:6px;
}
.pill[aria-pressed="true"]{background:var(--surface); color:var(--text); box-shadow:var(--shadow);}
.pilldot{width:8px; height:8px; border-radius:50%; flex:none;}
.pill[data-area="totes"] .pilldot{display:none;}
input[type="search"]{
  background:var(--surface); border:1px solid var(--border); color:var(--text);
  border-radius:8px; padding:8px 12px; font-size:13px; min-width:200px;
}
input[type="search"]:focus, select:focus, input[type=text]:focus, input[type=date]:focus, input[type=password]:focus, textarea:focus{
  outline:2px solid var(--accent); outline-offset:1px;
}

.notice{
  max-width:1180px; margin:14px auto 0; background:var(--surface-2); border:1px solid var(--border);
  border-radius:var(--radius); padding:10px 14px; font-size:12.5px; color:var(--text-muted); display:flex; gap:8px; align-items:baseline;
}
.notice strong{color:var(--text); font-weight:600;}

.banner{
  max-width:1180px; margin:14px auto 0; border-radius:var(--radius); padding:10px 14px;
  font-size:13px; display:flex; gap:10px; align-items:center; justify-content:space-between;
}
.banner.warn{background:var(--warn-tint); color:var(--warn);}
.banner.danger{background:var(--danger-tint); color:var(--danger);}
.banner button{border:none; background:transparent; color:inherit; font-weight:700; cursor:pointer; font-size:13px;}

/* stat tiles */
.stats{display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-block:18px;}
@media (max-width:760px){ .stats{grid-template-columns:repeat(2,1fr);} }
.stat{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:14px 16px; box-shadow:var(--shadow); display:flex; flex-direction:column; gap:6px;
}
.stat .label{font-size:11.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); font-weight:600;}
.stat .value{font-family:"Fraunces", Georgia, serif; font-size:30px; font-weight:600; line-height:1;}
.stat.danger .value{color:var(--danger);}
.stat.warn .value{color:var(--warn);}
.stat.ok .value{color:var(--ok);}

/* targeta-boto "Bustia" (correus pendents; nomes administrador) */
.stats.amb-bustia{grid-template-columns:repeat(5,1fr);}
@media (max-width:760px){ .stats.amb-bustia{grid-template-columns:repeat(2,1fr);} }
button.stat.stat-btn{
  font:inherit; color:inherit; text-align:left; cursor:pointer; border:1px solid var(--warn);
}
button.stat.stat-btn:hover{background:var(--warn-tint);}

/* bustia de documents (modal) */
.bustia-llista{display:flex; flex-direction:column; gap:8px;}
.bustia-correu{
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
  background:var(--surface-2); border:1px solid var(--border); border-radius:10px; padding:10px 12px;
}
.bustia-correu-text{display:flex; flex-direction:column; gap:3px; min-width:0; flex:1 1 280px;}
.bustia-correu-text strong{overflow-wrap:anywhere;}
.bustia-h{font-size:14px; margin:16px 0 8px;}
.bustia-text{
  background:var(--surface-2); border:1px solid var(--border); border-radius:8px; padding:10px 12px;
  font-family:inherit; font-size:13px; white-space:pre-wrap; overflow-wrap:anywhere; max-height:200px; overflow:auto; margin:0;
}
.bustia-adjunt{border:1px solid var(--border); border-radius:10px; padding:10px 12px; margin-bottom:10px;}
.bustia-adjunt-cap{display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; margin-bottom:6px;}
.bustia-adjunt-cap strong{overflow-wrap:anywhere;}
.bustia-adjunt select[size]{height:auto;}

/* tabs */
.tabs{display:flex; gap:4px; border-bottom:1px solid var(--border); margin-bottom:16px;}
.tab{
  background:none; border:none; padding:10px 4px; margin-right:22px; font-size:14.5px; font-weight:600;
  color:var(--text-muted); cursor:pointer; border-bottom:2px solid transparent; position:relative; top:1px;
}
.tab[aria-selected="true"]{color:var(--text); border-bottom-color:var(--accent);}

.panel{display:none;}
.panel.active{display:block;}

.toolbar{display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between; margin-bottom:12px;}
.toolbar-left{display:flex; gap:8px; flex-wrap:wrap; align-items:center;}
select{background:var(--surface); border:1px solid var(--border); color:var(--text); border-radius:8px; padding:7px 10px; font-size:13px;}

.btn{
  display:inline-flex; align-items:center; gap:6px; border-radius:8px; border:1px solid var(--border);
  background:var(--surface); color:var(--text); padding:8px 14px; font-size:13.5px; font-weight:600; cursor:pointer;
  text-decoration:none;
}
.btn:hover{background:var(--surface-2);}
.btn.primary{background:var(--accent); border-color:var(--accent); color:#fff;}
.btn.primary:hover{filter:brightness(1.06);}
.btn.ghost{background:transparent; border-color:transparent; padding:6px 8px; color:var(--text-muted);}
.btn.ghost:hover{background:var(--surface-2); color:var(--text);}
.btn.small{padding:5px 9px; font-size:12px;}
.btn:disabled{opacity:.55; cursor:default;}

/* table */
.table-scroll{overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); box-shadow:var(--shadow);}
table{border-collapse:collapse; width:100%; min-width:820px; font-size:13.5px;}
thead th{
  text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted);
  font-weight:700; padding:10px 12px; border-bottom:1px solid var(--border); background:var(--surface-2);
  position:sticky; top:0; white-space:nowrap;
}
tbody td{padding:10px 12px; border-bottom:1px solid var(--border); vertical-align:top;}
tbody tr:last-child td{border-bottom:none;}
tbody tr:hover{background:var(--surface-2);}
#tableDocs tbody tr, #tableObl tbody tr, #tableUsuaris tbody tr{cursor:pointer;}
td.codi{font-family:"IBM Plex Mono", monospace; font-size:12.5px; color:var(--text-muted); white-space:nowrap;}
td.titol{font-weight:600; min-width:190px;}
td .sub{display:block; font-weight:400; color:var(--text-muted); font-size:12px; margin-top:2px;}
td.obs{color:var(--text-muted); font-size:12.5px; max-width:260px;}
td.actions{white-space:nowrap; text-align:center; width:1%;}
.btn.icon{padding:6px 8px; font-size:15px; line-height:1;}

.chip{
  display:inline-flex; align-items:center; gap:5px; border-radius:999px; padding:3px 10px; font-size:11.5px;
  font-weight:700; white-space:nowrap; letter-spacing:.01em;
}
.chip .dot{width:6px; height:6px; border-radius:50%; background:currentColor;}
.chip.vigent{background:var(--ok-tint); color:var(--ok);}
.chip.obsolet{background:var(--surface-3); color:var(--text-muted);}
.chip.revisar{background:var(--warn-tint); color:var(--warn);}
.chip.area-qualitat{background:var(--accent-tint); color:var(--accent-ink);}
.chip.area-mediambient{background:var(--accent2-tint); color:var(--accent2-ink);}
.chip.area-riscoslaborals{background:var(--accent3-tint); color:var(--accent3-ink);}
.chip.vencut{background:var(--danger-tint); color:var(--danger);}
.chip.proper{background:var(--warn-tint); color:var(--warn);}
.chip.ok{background:var(--ok-tint); color:var(--ok);}
.chip.pendent{background:var(--surface-3); color:var(--text-muted);}
.chip.sensible{background:var(--danger-tint); color:var(--danger);}
.chip.intern{background:var(--surface-3); color:var(--text-muted);}
.chip.nomesadmin{background:var(--warn-tint); color:var(--warn);}

.empty{padding:34px 16px; text-align:center; color:var(--text-muted); font-size:13.5px;}

/* modal */
.overlay{
  position:fixed; inset:0; background:rgba(15,18,20,.45); display:none; align-items:flex-start; justify-content:center;
  padding:40px 16px; z-index:100; overflow-y:auto;
}
.overlay.open{display:flex;}
.modal{
  background:var(--surface); border:1px solid var(--border); border-radius:14px; width:100%; max-width:560px;
  box-shadow:0 20px 60px -12px rgba(0,0,0,.4); padding:22px 24px 24px;
}
.modal h2{font-size:18px; margin-bottom:4px;}
.modal .modal-sub{color:var(--text-muted); font-size:12.5px; margin-bottom:18px;}
.field{display:flex; flex-direction:column; gap:5px; margin-bottom:13px;}
.field label{font-size:12px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.03em;}
.field input, .field select, .field textarea{
  background:var(--surface-2); border:1px solid var(--border); color:var(--text); border-radius:8px;
  padding:9px 11px; font-size:13.5px; font-family:inherit; width:100%;
}
.field textarea{resize:vertical; min-height:56px;}
.field.check{flex-direction:row; align-items:center; gap:8px;}
.field.check input{width:auto;}
.field.check label{text-transform:none; letter-spacing:0; font-size:13px; color:var(--text);}
.row2{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
@media (max-width:480px){.row2{grid-template-columns:1fr;}}
.modal-actions{display:flex; justify-content:space-between; align-items:center; margin-top:18px; gap:10px;}
.form-error{color:var(--danger); font-size:12.5px; margin:0 0 12px; font-weight:600;}

/* fitxers adjunts (modal document) */
.fitxers-list{list-style:none; margin:0 0 10px; padding:0; display:flex; flex-direction:column; gap:6px;}
.fitxers-list:empty{display:none;}
.fitxers-list li{
  display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; background:var(--surface-2);
  border:1px solid var(--border); border-radius:8px; padding:7px 10px; font-size:12.5px;
}
.fitxers-list .fnom{flex:1 1 100%; font-weight:600; word-break:break-word;}
.fitxers-list .fmeta{color:var(--text-muted);}
/* Les icones d'accio (Obre/Descarrega/Edita imatge/Edita etiqueta/Eliminar)
   sempre van juntes, en una linia nova propia, començant per l'esquerra
   (mai alineades a la dreta) -- per aixo van dins un contenidor amb
   flex-basis:100% en lloc de cadascuna amb margin-left:auto. */
.fitxers-list .facc{flex:1 1 100%; display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px;}
.fitxers-list .facc:empty{display:none;}
.fitxers-list .fopen{text-decoration:none; font-weight:700; color:var(--accent2-ink);}
.fitxers-list .flocal{text-decoration:none; font-weight:700; color:var(--accent2-ink);}
.fitxers-list .fdl{text-decoration:none; font-weight:700; color:var(--accent-ink);}
.fitxers-list .frotate{border:none; background:transparent; color:var(--accent2-ink); cursor:pointer; font-weight:700; font-size:12.5px; padding:0 2px;}
.fitxers-list .fedit{border:none; background:transparent; color:var(--text-muted); cursor:pointer; font-weight:700; font-size:12.5px; padding:0 2px;}
.fitxers-list .fdel{border:none; background:transparent; color:var(--danger); cursor:pointer; font-weight:700; font-size:12.5px; padding:0 2px;}
.fitxers-list .fshare{border:none; background:transparent; color:var(--text-muted); cursor:pointer; font-weight:700; font-size:12.5px; padding:0 2px;}
.fitxers-list .fshare:disabled{cursor:progress; opacity:.7;}
.fitxer-add{display:flex; flex-wrap:wrap; gap:8px; align-items:center;}
.fitxer-add input[type="file"]{flex:1 1 180px; font-size:12.5px;}
.fitxer-add select{background:var(--surface-2); border:1px solid var(--border); color:var(--text); border-radius:8px; padding:7px 8px; font-size:12.5px;}
.fitxer-add input[hidden]{display:none;}
.fitxer-seleccio{display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:var(--text); background:var(--surface-2); border:1px solid var(--border); border-radius:8px; padding:5px 8px;}
.fitxer-seleccio .fdel{border:none; background:transparent; cursor:pointer; padding:0 2px; font-size:12px;}
.fitxers-list li.fitxer-enllac{border-left:3px solid var(--accent2);}
.fitxers-list li.fitxer-enllac .fnom{overflow-wrap:anywhere;}
.fitxer-add input[type="text"]{flex:1 1 140px; background:var(--surface-2); border:1px solid var(--border); color:var(--text); border-radius:8px; padding:7px 10px; font-size:12.5px;}
.fitxer-progress{margin-top:8px; display:flex; align-items:center; gap:8px; font-size:12px; color:var(--text-muted);}
.fitxer-bar{flex:1; height:6px; background:var(--surface-3); border-radius:999px; overflow:hidden;}
.fitxer-bar span{display:block; height:100%; width:0; background:var(--accent);}
.fitxer-hint{font-size:12px; color:var(--text-muted); margin:8px 0 0;}
.fitxer-hint.err{color:var(--danger); font-weight:600;}
.paperclip{color:var(--text-muted); font-weight:700; font-size:12px; white-space:nowrap; text-decoration:none;}

/* llistes compartides */
#llistesCards{display:flex; flex-direction:column; gap:10px;}
.llista-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:12px 14px; cursor:pointer;
}
.llista-cap{display:flex; flex-wrap:wrap; align-items:center; gap:8px 10px;}
.llista-cap strong{font-size:14.5px;}
.llista-cap .btn{margin-left:auto;}
.llista-assumpte{margin:8px 0 0; font-size:13px; color:var(--text-muted); white-space:pre-wrap;}
.llista-meta{margin:6px 0 0; font-size:12px; color:var(--text-muted);}
/* arxius "nomes administrador": casella a baix a la dreta de cada arxiu (la veu nomes l'administrador) */
.fitxers-list .fadmin{
  margin-left:auto; display:inline-flex; align-items:center; gap:5px; cursor:pointer;
  font-size:12px; font-weight:600; color:var(--text-muted); white-space:nowrap; text-transform:none; letter-spacing:0;
}
.fitxers-list .fadmin input{width:auto; margin:0; cursor:pointer;}
.fitxers-list li.fitxer-nomesadmin{background:var(--warn-tint); border-color:var(--warn);}
.fitxers-list li.fitxer-nomesadmin .fadmin{color:var(--warn);}
.fadmin-tag{
  background:var(--warn-tint); color:var(--warn); border-radius:999px; padding:1px 8px;
  font-size:12px; font-weight:600; white-space:nowrap;
}
/* arxius rebuts per correu (bustia): es distingeixen amb una barra lateral i una linia d'origen */
.fitxers-list li.fitxer-correu{border-left:3px solid var(--accent3);}
.fcorreu{
  flex:1 1 100%; display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 12px;
  font-size:12px; color:var(--text-muted);
}
.fcorreu strong{color:var(--text); font-weight:600; overflow-wrap:anywhere;}
.fcorreu-tag{
  background:var(--accent3-tint); color:var(--accent3-ink); border-radius:999px;
  padding:1px 8px; font-weight:600; white-space:nowrap;
}
#llistaDocsList .fitxer-fila .fcorreu{margin-left:2px;}
#llistaDocsList .fnom{flex:1 1 100%;}
#llistaDocsList .fmeta{word-break:break-word;}
#llistaDocsList .fitxers-doc{flex:1 1 100%; display:flex; flex-direction:column; gap:4px; margin-top:2px;}
#llistaDocsList .fitxer-fila{display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 8px; font-size:12.5px; word-break:break-word;}
#llistaDocsList .fitxer-fila .fopen,
#llistaDocsList .fitxer-fila .flocal,
#llistaDocsList .fitxer-fila .fdl{margin-left:0;}
/* Dins la fila d'un fitxer (no la del document), les icones van primer i
   el nom despres, a la mateixa linia -- per aixo el nom NO ocupa tota
   l'amplada aqui, a diferencia del nom del document (#llistaDocsList .fnom). */
#llistaDocsList .fitxer-fila .fnom{flex:0 1 auto;}
/* Boto "Treu" (desvincula un document de la llista): a la dreta, en la
   seva propia linia (ve despres de .fitxers-doc, que ja es flex:1 1 100%). */
#llistaDocsList [data-treu-doc]{margin-left:auto;}
.llista-filtres{display:flex; flex-wrap:wrap; gap:6px;}
.llista-filtres input[type="text"]{flex:1 1 160px; background:var(--surface-2); border:1px solid var(--border); color:var(--text); border-radius:8px; padding:7px 10px; font-size:12.5px;}
.llista-filtres select{flex:1 1 140px;}

.legend{display:flex; gap:16px; flex-wrap:wrap; margin:14px 2px 22px; font-size:12px; color:var(--text-muted);}
.legend span{display:inline-flex; align-items:center; gap:6px;}
.legend .sw{width:10px; height:10px; border-radius:3px;}

footer.foot{margin-top:36px; padding-top:16px; border-top:1px solid var(--border); font-size:11.5px; color:var(--text-muted); display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px;}
footer.foot a{color:var(--text-muted); text-decoration:underline;}
.sync-state{display:flex; align-items:center; gap:6px;}
.sync-dot{width:7px; height:7px; border-radius:50%; background:var(--ok);}

/* ============================================================
   Pagines auxiliars (login, install, usuaris, offline)
   ============================================================ */
.auth-page{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  padding:16px; padding-block:16px;
}
.auth-card{
  background:var(--surface); border:1px solid var(--border);
  padding:32px; border-radius:14px; max-width:400px; width:100%;
  box-shadow:var(--shadow);
}
.auth-card h1{font-size:24px; margin-bottom:2px;}
.auth-card .eyebrow{
  font-family:"IBM Plex Mono", monospace; font-size:11px; letter-spacing:.08em;
  text-transform:uppercase; color:var(--text-muted);
}
.auth-card .subtitle{color:var(--text-muted); font-size:13px; margin:2px 0 22px;}
.auth-form{display:flex; flex-direction:column; gap:12px;}
.auth-form label{font-size:12px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.03em;}
.auth-form input{
  background:var(--surface-2); border:1px solid var(--border); color:var(--text);
  border-radius:8px; padding:10px 12px; font-size:14px; width:100%; font-family:inherit;
}
.auth-form .btn.primary{justify-content:center; margin-top:6px;}
.auth-foot{color:var(--text-muted); font-size:11px; margin:22px 0 0; text-align:center;}
.auth-foot a{color:var(--text-muted);}
.alert{padding:10px 14px; border-radius:8px; font-size:13px; margin-bottom:14px;}
.alert-error{background:var(--danger-tint); color:var(--danger);}
.alert-success{background:var(--ok-tint); color:var(--ok);}

/* Doble factor (dosfactors.php): camp del codi de 6 digits */
input.otp-input{
  font-family:"IBM Plex Mono", monospace; font-size:22px; letter-spacing:.3em;
  text-align:center; padding:12px 10px;
}

.page{max-width:960px; margin-inline:auto; padding-block:8px 40px;}
.page-head{display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:18px 0 16px;}
.page-head h1{font-size:22px; flex:1;}
.card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:4px 0;
}
.badge{
  display:inline-block; padding:3px 10px; border-radius:999px; font-size:11px; font-weight:700;
  background:var(--surface-2); color:var(--text-muted); border:1px solid var(--border);
}
.badge.on{background:var(--ok-tint); color:var(--ok); border-color:transparent;}
.badge.off{background:var(--surface-3); color:var(--text-muted); border-color:transparent;}
.inline-form{display:inline;}

/* pagina de copies de seguretat (copies.php) */
.modal.cp-card{max-width:1000px; margin:0 0 16px;}
.cp-taula td{vertical-align:top;}
.cp-taula td:nth-child(2){min-width:230px;}
.cp-taula td:nth-child(3){min-width:250px; font-size:12.5px; line-height:1.5;}
.cp-taula td:nth-child(4){white-space:nowrap;}
.cp-taula .chip{margin-right:4px;}
