/* Àrea de clients de CSI (complementa /assets/css/site.css) */
body.area { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.area-top { background: #fff; border-bottom: 1px solid var(--line); }
.area-top-in { display: flex; align-items: center; justify-content: space-between; min-height: 76px; }
.area-top img { display: block; height: 48px; width: auto; }
.area-top .lang { display: flex; gap: 4px; }
.area-top .lang a { font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.area-top .lang a[aria-current] { background: var(--dark); color: #fff; }
.area-main { flex: 1; padding: 40px 0 56px; }
.area-main .wrap { max-width: 960px; }
.area-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.area-card + .area-card { margin-top: 22px; }
.area-card h1 { font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 900; margin: 10px 0 6px; }
.area-card h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 14px; }
.area-card h3 { font-size: 1rem; font-weight: 800; margin: 22px 0 10px; }
.area-card .sub { color: var(--muted); margin-bottom: 18px; }
.area-login { max-width: 460px; margin: 0 auto; }
.area-logo { display: block; width: 200px; height: auto; margin: 0 auto 18px; }
.area-login .area-logo + h1 { text-align: center; }
.area-login .area-logo ~ .sub { text-align: center; }
.area-login .field { margin-bottom: 14px; }
.area-card .field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.area-card .field input { width: 100%; font: inherit; padding: 11px 14px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; }
.area-card .field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgb(0 102 196 / .15); }
.area-error, .area-ok { border-radius: 10px; padding: 11px 14px; margin-bottom: 16px; font-weight: 600; font-size: 14.5px; }
.area-error { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; }
.area-ok { background: var(--green-bg); color: var(--green); border: 1px solid #a7f3d0; }
.area-help { color: var(--soft); font-size: 14px; margin-top: 18px; }
.area-empty { color: var(--muted); padding: 18px; background: var(--bg); border-radius: 12px; text-align: center; }
.area-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.area-head h1 { margin-top: 0; }
.admin-head { margin-bottom: 22px; }
.area-files { list-style: none; padding: 0; display: grid; gap: 12px; margin-top: 8px; }
.area-file { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.area-file-ic { width: 46px; height: 46px; border-radius: 12px; background: var(--bg-blue); color: var(--dark); display: grid; place-items: center; flex: none; }
.area-file-tx { flex: 1 1 220px; min-width: 0; }
.area-file-tx strong { display: block; overflow-wrap: anywhere; }
.area-file-tx small { color: var(--muted); font-size: 13.5px; }
.area-table { overflow-x: auto; }
.area-table table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.area-table th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--soft); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.area-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.area-table tr.off td { color: var(--soft); }
.area-actions { white-space: nowrap; text-align: right; }
.area-actions form { display: inline; }
.btn-link { background: none; border: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--blue); cursor: pointer; padding: 4px 6px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--red); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; background: #f1f5f9; color: var(--muted); border-radius: 999px; padding: 2px 8px; margin-left: 4px; }
.area-new { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; }
.area-new .field { margin-bottom: 10px; }
.area-new > .btn { justify-self: start; margin-bottom: 10px; }
.pw-row { display: flex; gap: 8px; }
.pw-row input { flex: 1; font-family: ui-monospace, Consolas, monospace; }
.upload { margin-top: 18px; }
.upload-drop { display: block; border: 2px dashed #93c5fd; border-radius: 14px; background: var(--bg-blue); padding: 24px; text-align: center; cursor: pointer; transition: background-color .15s, border-color .15s; }
.upload-drop:hover, .upload-drop.over { border-color: var(--blue); background: #dbeafe; }
.upload-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-drop strong { display: block; color: var(--dark); font-size: 1.05rem; }
.upload-drop span { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.upload-progress { margin-top: 14px; }
.upload-bar { height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.upload-progress p { font-size: 14px; color: var(--muted); margin-top: 8px; }
.area-foot { border-top: 1px solid var(--line); background: #fff; padding: 18px 0; font-size: 14px; color: var(--soft); text-align: center; }
.area-foot a { color: var(--muted); }

/* Seguretat */
.pill-red { background: #fef2f2; color: var(--red); }
.pill-amber { background: #fffbeb; color: #b45309; }
.muted { color: var(--soft); }
.sec-stats { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 6px 0 4px; }
.sec-stats li { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.sec-stats b { display: block; font-size: 1.6rem; font-weight: 900; color: var(--dark); line-height: 1.1; }
.sec-stats span { font-size: 13px; color: var(--muted); }
.sec-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.sec-filter button { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.sec-filter button[aria-pressed="true"] { background: var(--dark); border-color: var(--dark); color: #fff; }
.sec-table { font-size: 13.5px; }
.sec-table td { white-space: nowrap; }
.sec-table td:last-child { white-space: normal; min-width: 220px; }
.sev { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; }
.sev-ok { background: var(--green-bg); color: var(--green); }
.sev-warn { background: #fffbeb; color: #b45309; }
.sev-bad { background: #fef2f2; color: var(--red); }
.sev-info { background: var(--bg-blue); color: var(--dark); }
.sev-dl { background: #f5f3ff; color: #6d28d9; }
.pill-green { background: var(--green-bg); color: var(--green); }
.area-actions a.btn-link { text-decoration: none; display: inline-block; }
.area-actions a.btn-link:hover { text-decoration: underline; }
/* Historial d'un usuari */
.hist-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 14px 0 4px; }
.hist-facts p { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.hist-facts span { display: block; font-size: 13px; color: var(--muted); }
.hist-ips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hist-ips li { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 14px; }
.area-head h1 .pill { vertical-align: middle; font-size: 13px; }
/* Avís de resultat: a dalt al centre, gran i amb icona */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 50; width: min(620px, calc(100% - 32px)); display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 14px; font-weight: 700; font-size: 16px; box-shadow: 0 18px 40px rgb(15 23 42 / .22); animation: toast-in .25s ease-out; transition: opacity .3s, transform .3s; }
.toast-ok { background: #047857; color: #fff; }
.toast-err { background: #b91c1c; color: #fff; }
.toast-ic { flex: none; width: 32px; height: 32px; border-radius: 50%; background: rgb(255 255 255 / .2); display: grid; place-items: center; font-size: 18px; font-weight: 900; }
.toast-tx { flex: 1; }
.toast-x { flex: none; background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; opacity: .8; padding: 0 4px; }
.toast-x:hover { opacity: 1; }
.toast.out { opacity: 0; transform: translate(-50%, -10px); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.inline-msg { animation: toast-in-inline .25s ease-out; }
@keyframes toast-in-inline { from { opacity: 0; } to { opacity: 1; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
