.roles-page { width:min(100%,1040px); padding:30px 28px 48px; }
.roles-heading { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:24px; align-items:center; padding:0 0 22px; border-bottom:1px solid color-mix(in srgb,var(--app-muted),transparent 72%); }
.roles-intro { display:flex; align-items:center; gap:18px; min-width:0; }
.roles-icon { width:88px; height:88px; flex:0 0 auto; object-fit:contain; }
.roles-heading h1 { margin:0; font-size:clamp(1.7rem,4vw,2.35rem); color:var(--app-accent); }
.roles-description { margin:5px 0 0; color:var(--app-muted); }
.roles-meta { display:grid; gap:9px; justify-items:end; text-align:right; }
.roles-business { color:var(--app-text); font-size:1rem; }
.roles-clock { display:flex; align-items:center; gap:6px; color:var(--app-muted); font-size:.9rem; }
.roles-clock img { width:28px; height:28px; object-fit:contain; }
.roles-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:22px 0 14px; }
.roles-count { margin:0; color:var(--app-muted); }
.roles-people { display:grid; grid-template-columns:repeat(auto-fill,minmax(270px,1fr)); gap:16px; }
.roles-person { display:grid; gap:18px; min-height:166px; padding:19px; border:1px solid color-mix(in srgb,var(--app-muted),transparent 45%); border-radius:18px; background:linear-gradient(145deg,color-mix(in srgb,var(--app-panel),white 4%),var(--app-panel)); box-shadow:0 10px 24px #00000024; }
.roles-person-head { display:flex; align-items:center; gap:13px; min-width:0; }
.roles-avatar { width:54px; height:54px; flex:0 0 auto; border:2px solid color-mix(in srgb,var(--app-accent),transparent 45%); border-radius:50%; object-fit:cover; background:#332016; }
.roles-person-identity { display:grid; gap:3px; min-width:0; }
.roles-person-identity strong { font-size:1.05rem; overflow-wrap:anywhere; }
.roles-person-identity span { color:var(--app-muted); font-size:.88rem; }
.roles-person-footer { display:flex; align-items:center; justify-content:space-between; gap:9px; padding-top:13px; border-top:1px solid color-mix(in srgb,var(--app-muted),transparent 78%); }
.roles-badge { display:inline-flex; max-width:60%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:5px 10px; border-radius:999px; color:var(--app-accent); background:color-mix(in srgb,var(--app-accent),transparent 87%); font-size:.78rem; font-weight:700; }
.roles-presence { color:var(--app-muted); font-size:.78rem; text-align:right; }
.roles-note { margin:0; color:var(--app-muted); font-size:.82rem; overflow-wrap:anywhere; }
@media (max-width:620px) {
  .roles-page { padding:22px 18px 36px; }
  .roles-heading { grid-template-columns:1fr; gap:14px; }
  .roles-meta { justify-items:start; text-align:left; padding-left:106px; }
  .roles-icon { width:72px; height:72px; }
}
.roles-refresh { width:38px; height:38px; display:grid; place-items:center; padding:6px; border:1px solid color-mix(in srgb,var(--app-accent),transparent 42%); border-radius:50%; background:color-mix(in srgb,var(--app-surface),transparent 20%); box-shadow:0 5px 14px #120a0550; }
.roles-refresh:hover { transform:rotate(-20deg); border-color:var(--app-accent); }
.roles-refresh img { width:24px; height:24px; object-fit:contain; }
.roles-search { flex:1 1 260px; max-width:420px; display:flex; align-items:center; gap:8px; min-height:38px; padding:5px 10px; border:1px solid color-mix(in srgb,var(--app-muted),transparent 48%); border-radius:11px; background:color-mix(in srgb,var(--app-surface),transparent 16%); }
.roles-search:focus-within { border-color:var(--app-accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--app-accent),transparent 80%); }
.roles-search img { width:22px; height:22px; opacity:.78; }
.roles-search input { min-width:0; width:100%; border:0; outline:0; background:transparent; color:var(--app-text); font:inherit; }
.roles-search input::placeholder { color:var(--app-muted); }
.roles-empty { grid-column:1/-1; padding:28px; color:var(--app-muted); text-align:center; border:1px dashed color-mix(in srgb,var(--app-muted),transparent 45%); border-radius:14px; }
@media(max-width:560px) { .roles-search { order:3; max-width:none; flex-basis:100%; } }
.roles-person { background:linear-gradient(145deg,#fffdf8,#f3e9db); border-color:#d6b989; color:#2b1a0d; box-shadow:0 8px 22px #14080452; }
.roles-person:hover { border-color:var(--app-accent); background:linear-gradient(145deg,color-mix(in srgb,#fffdf8,var(--app-accent) 18%),color-mix(in srgb,#f3e9db,var(--app-accent) 18%)); box-shadow:0 13px 28px #14080472, inset 0 0 0 1px color-mix(in srgb,var(--app-accent),transparent 38%); }
.roles-person-identity strong { color:#2b1a0d; }
.roles-person-identity span,.roles-note { color:#725942; }
.roles-person-footer { border-top-color:#decba8; }
.roles-badge { background:#43240f; color:#ffe29a; }
.roles-presence { color:#356843; }
.roles-language { display:inline-flex; width:25px; height:25px; align-items:center; justify-content:center; margin-top:5px; font-size:17px; border-radius:50%; background:#fff8e9; border:1px solid #dfc390; }
.roles-person { cursor:pointer; }
.roles-manage { margin-left:auto; font-size:.78rem; font-weight:750; color:#73501f; }
.roles-dialog { width:min(430px,calc(100vw - 30px)); padding:25px; color:#2b1a0d; background:#fffaf1; border:1px solid #d3b272; border-radius:18px; box-shadow:0 24px 75px #140804aa; }
.roles-dialog::backdrop { background:#140904aa; backdrop-filter:blur(3px); }
.roles-dialog-close { position:absolute; top:10px; right:12px; border:0; background:transparent; font-size:29px; line-height:1; color:#755a3f; cursor:pointer; }
.roles-dialog-person { display:flex; align-items:center; gap:12px; padding-right:24px; }
.roles-dialog-person img { width:56px; height:56px; border-radius:50%; border:2px solid #d4af63; object-fit:cover; }
.roles-dialog-person strong,.roles-dialog-person span { display:block; }
.roles-dialog-person span { color:#71583f; font-size:.87rem; }
.roles-dialog label { display:block; margin-top:18px; font-weight:750; }
.roles-dialog select { width:100%; margin-top:7px; padding:10px; border:1px solid #c9a664; border-radius:9px; background:white; color:#2b1a0d; font:inherit; }
.roles-dialog-help { color:#725942; font-size:.9rem; }
.roles-dialog-status { min-height:1.4em; color:#356843; font-weight:650; }
.roles-dialog-submit { width:100%; margin-top:4px; }
.roles-language { width:22px; height:22px; object-fit:contain; margin-top:5px; filter:drop-shadow(0 1px 1px #6c4b2740); }
.roles-language { display:block; width:24px; height:24px; margin-top:5px; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
.roles-delete { width:30px; height:30px; display:grid; place-items:center; margin-left:6px; padding:3px; border:0; border-radius:7px; background:transparent; cursor:pointer; }.roles-delete:hover { background:#fee0d8; }.roles-delete img { width:20px; height:20px; }
.roles-company { margin-top:12px; padding-top:10px; border-top:1px solid #decba8; }.roles-company strong,.roles-company span { display:block; }.roles-company strong { color:#5a3c19; font-size:.85rem; }.roles-company span { color:#80684d; font: .73rem ui-monospace,monospace; overflow-wrap:anywhere; }
.roles-person-head { position:relative; }.roles-company-icon { position:absolute; top:-3px; right:0; width:32px; height:32px; object-fit:contain; }
.roles-badge { display:inline-flex; align-items:center; gap:6px; }.roles-role-icon { width:19px; height:19px; object-fit:contain; }.roles-person:has(.roles-badge img[src*="scientist"]),.roles-person:has(.roles-badge img[src*="delivery_man"]),.roles-person:has(.roles-badge img[src*="user.png"]) { }.roles-role-icon[src*="scientist"],.roles-role-icon[src*="delivery_man"],.roles-role-icon[src*="user.png"] { transform:scaleX(-1); }
.roles-badge { width:30px; height:30px; justify-content:center; padding:0; border-radius:0; background:transparent; }.roles-role-icon { width:30px; height:30px; }

.roles-note-edit { display:block; height:20px; box-sizing:border-box; padding:2px 2px 1px; border-bottom:1px dashed #cfb891; cursor:text; color:#725942; background:transparent; font:inherit; font-size:.82rem; line-height:17px; }
.roles-note-edit:hover, .roles-note-edit:focus-visible { color:#2b1a0d; border-bottom-color:#75d7a9; outline:none; }
.roles-note-input { display:block; width:100%; height:20px; box-sizing:border-box; border:0; border-bottom:2px solid #75d7a9; border-radius:0; padding:1px 2px; color:#725942; background:transparent; font:inherit; font-size:.82rem; line-height:17px; outline:none; }

.roles-manage-icon { width:30px; height:30px; object-fit:contain; transform:scaleX(-1); }

.roles-person-meta,.roles-person-actions { display:flex; align-items:center; gap:12px; }
.roles-person-footer .roles-language { width:24px; height:24px; margin:0; }
.roles-person-actions { margin-left:auto; }

.app-access { width:min(100% - 32px,440px); margin:auto; padding:32px 26px; display:grid; gap:12px; border:1px solid color-mix(in srgb,var(--app-accent),transparent 55%); border-radius:22px; color:var(--app-text); background:linear-gradient(145deg,color-mix(in srgb,var(--app-panel),white 5%),var(--app-panel)); box-shadow:0 18px 42px #1409047a; }
.app-access-logo { width:104px; height:104px; margin:0 auto 6px; object-fit:contain; }
.app-access h1 { margin:0; color:var(--app-accent); text-align:center; font-size:clamp(1.55rem,6vw,2rem); }
.app-access-copy { margin:0 0 12px; color:var(--app-muted); text-align:center; line-height:1.45; }
.app-access label { color:var(--app-muted); font-size:.88rem; font-weight:700; }
.app-access-input { width:100%; min-height:47px; padding:10px 13px; border:1px solid color-mix(in srgb,var(--app-muted),transparent 40%); border-radius:11px; color:var(--app-text); background:color-mix(in srgb,var(--app-surface),transparent 12%); font:inherit; font-size:1rem; outline:0; }
.app-access-input:focus { border-color:var(--app-accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--app-accent),transparent 78%); }
.app-access-pin { letter-spacing:.35em; text-align:center; font-size:1.4rem; font-weight:800; }
.app-access-error { min-height:1.4em; margin:2px 0; color:var(--app-full); font-size:.88rem; line-height:1.35; }
.app-access-submit { width:100%; margin-top:10px; }
.app-access-back { border:0; padding:9px; color:var(--app-muted); background:transparent; font:inherit; cursor:pointer; }
.app-access-back:hover { color:var(--app-accent); }
.app-connected { text-align:center; }


/* Tablero horizontal de entrada: las tres aplicaciones se muestran siempre en fila. */
.app-home { width:min(100%,1120px); padding:28px; color:var(--app-text); }
.app-home-header { display:flex; align-items:center; gap:17px; margin-bottom:20px; padding:0 0 16px; border-bottom:1px solid color-mix(in srgb,var(--app-muted),transparent 70%); }
.app-home-brand { width:72px; height:72px; flex:0 0 auto; object-fit:contain; }
.app-home h1 { margin:0; color:var(--app-accent); font-size:clamp(1.7rem,4vw,2.35rem); }
.app-home-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.app-home-card { display:flex; min-width:0; min-height:220px; flex-direction:column; align-items:center; padding:18px; border:1px solid color-mix(in srgb,var(--app-accent),transparent 58%); border-radius:20px; text-align:center; background:linear-gradient(150deg,color-mix(in srgb,var(--app-panel),white 5%),var(--app-panel)); box-shadow:0 12px 28px #1409044d; transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease; }
.app-home-card:hover { transform:translateY(-4px); border-color:var(--app-accent); box-shadow:0 18px 34px #14090474; }
.app-home-icon { width:142px; height:142px; object-fit:contain; margin:0 0 8px; }
.app-home-card h2 { margin:0 0 14px; color:var(--app-accent); font-size:1.38rem; }
.app-home-open { width:100%; margin-top:auto; padding:11px 12px; }
.app-home-notice { min-height:1.5em; margin:16px 0 0; color:var(--app-muted); text-align:center; }
@media (max-width:600px) { .app-home { padding:18px 12px 26px; } .app-home-grid { gap:8px; } .app-home-card { min-height:202px; padding:10px 6px; border-radius:14px; } .app-home-icon { width:94px; height:94px; } .app-home-open { min-height:42px; padding:8px 4px; font-size:.76rem; } .app-home-brand { width:54px; height:54px; } }
