/* os.css — capa de sistema: arranque, bloqueo, ajustes rápidos, notificaciones */
#boot, #lock { position: fixed; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; color: #fff; font-family: 'Ubuntu', system-ui, sans-serif; }
#boot { background: #1a0013; z-index: 9990; gap: 28px; }
.booting #boot { display: flex; }
#boot img { width: 96px; height: 96px; animation: os-pulse 1.6s ease-in-out infinite; }
#boot .bar { width: 160px; height: 4px; background: rgba(255,255,255,.18); border-radius: 4px; overflow: hidden; }
#boot .bar i { display: block; height: 100%; width: 0; background: #E95420; border-radius: 4px; transition: width 2s ease-out; }
#boot.out { opacity: 0; transition: opacity .5s; pointer-events: none; }
@keyframes os-pulse { 50% { transform: scale(1.06); opacity: .85; } }

#lock { z-index: 9980; background: #2C001E center/cover; transition: transform .6s ease; }
#lock.on { display: flex; }
#lock.up { transform: translateY(-100%); }
#lock::before { content: ''; position: absolute; inset: 0; background: rgba(20,0,14,.55); backdrop-filter: blur(6px); }
#lock > * { position: relative; }
#lock .lk-time { font-size: 5.5rem; font-weight: 300; line-height: 1; }
#lock .lk-date { margin: 8px 0 36px; font-size: 1.2rem; opacity: .85; text-transform: capitalize; }
#lock img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
#lock form { display: flex; gap: 8px; margin-top: 14px; }
#lock input { width: 230px; padding: 10px 12px; border-radius: 6px; border: 2px solid transparent; background: rgba(255,255,255,.16); color: #fff; font: inherit; }
#lock input:focus-visible { outline: none; border-color: #E95420; }
#lock button { padding: 0 14px; border: 0; border-radius: 6px; background: #E95420; color: #fff; font: inherit; cursor: pointer; }
#lock .lk-err { min-height: 1.3em; margin-top: 10px; color: #ffb4a1; font-size: .9rem; }
#lock.shake form { animation: os-shake .35s; }
@keyframes os-shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

#os-dim, #os-night { position: fixed; inset: 0; pointer-events: none; z-index: 9970; }
#os-night { background: rgba(255,140,0,.14); mix-blend-mode: multiply; opacity: 0; transition: opacity .3s; }
#os-night.on { opacity: 1; }

/* Menú del sistema (estilo Ubuntu: todo en un mismo panel) */
.volume-image, .power-menu { display: none !important; }
.header2 > .sysmenu { position: fixed; top: 4px; right: 10px; height: 32px; display: flex !important; align-items: center; gap: 12px; padding: 0 12px; border: 0; border-radius: 16px; background: transparent; color: #f2f2f2; cursor: pointer; z-index: 1100; }
.sysmenu:hover, .sysmenu[aria-expanded=true] { background: rgba(255,255,255,.14); }
.sysmenu:focus-visible { outline: 2px solid #E95420; }
.sysmenu span { display: inline-flex; }
.sysmenu svg, #os-quick svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sysmenu svg .f, #os-quick svg .f { fill: currentColor; stroke: none; }
#os-quick { position: fixed; top: 46px; right: 10px; width: 330px; z-index: 6500; padding: 14px; border-radius: 16px; box-sizing: border-box;
    background: #2b2b2b; color: #eee; box-shadow: 0 10px 34px rgba(0,0,0,.55); font: 14px 'Ubuntu', system-ui, sans-serif; display: none; }
#os-quick.on { display: block; animation: os-pop .15s ease-out; }
@keyframes os-pop { from { opacity: 0; transform: translateY(-6px); } }
#os-quick button { font: inherit; color: inherit; cursor: pointer; border: 0; }
#os-quick .q-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
#os-quick .q-batt { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 18px; background: #3d3d3d; font-size: .92em; }
#os-quick .q-sp { flex: 1; }
#os-quick .q-top > button { display: flex; align-items: center; justify-content: center; gap: 4px; width: 36px; height: 36px; border-radius: 50%; background: #3d3d3d; }
#os-quick .q-top > button:hover, #os-quick .q-pow button:hover { background: #4f4f4f; }
#os-quick .q-top > button[aria-expanded=true] { background: #E95420; }
#os-quick .q-pow { margin: -4px 0 12px; padding: 6px; border-radius: 12px; background: #333; }
#os-quick .q-pow button { display: block; width: 100%; padding: 9px 12px; border-radius: 8px; background: transparent; text-align: left; }
#os-quick .q-slider { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
#os-quick .q-slider > button, #os-quick .q-slider > .q-ic { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: #3d3d3d; }
#os-quick .q-slider > button[aria-pressed=true] { background: #E95420; }
#os-quick input[type=range] { flex: 1; accent-color: #E95420; }
#os-quick .q-num { width: 38px; text-align: right; opacity: .75; font-size: .9em; }
#os-quick .q-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#os-quick .q-tile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 22px; background: #3d3d3d; text-align: left; min-width: 0; }
#os-quick .q-tile[aria-pressed=true] { background: #E95420; color: #fff; }
#os-quick .q-tile b { display: block; font-weight: 500; }
#os-quick .q-tile small { display: block; opacity: .8; font-size: .8em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#os-quick .q-tile > span { min-width: 0; }
#os-osd { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 9600; display: none; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 30px; background: rgba(30,30,30,.92); color: #fff; font: 14px 'Ubuntu', system-ui, sans-serif; pointer-events: none; }
#os-osd.on { display: flex; }
#os-osd svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#os-osd svg .f { fill: currentColor; stroke: none; }
#os-osd .bar { width: 140px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }
#os-osd .bar i { display: block; height: 100%; background: #E95420; }
.os-offline { position: absolute; inset: 0; z-index: 5; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #f9f9fb; color: #333; font: 15px 'Ubuntu', system-ui, sans-serif; text-align: center; padding: 20px; }
.os-offline.on { display: flex; }
.os-offline h2 { margin: 0; font-weight: 500; }
.os-offline button { padding: 9px 18px; border: 0; border-radius: 6px; background: #0060df; color: #fff; font: inherit; cursor: pointer; }

/* Vista de actividades: ventanas reales en miniatura */
#appsModal.apps-modal { background: linear-gradient(rgba(24,22,22,.84), rgba(24,22,22,.84)), var(--os-wall, none) center / cover !important; }
.apps-header-inline { display: none !important; }
.ov-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin: 18px auto 26px; max-width: 1200px; }
.ov-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px; border: 2px solid transparent; border-radius: 14px; background: rgba(255,255,255,.06); color: #eee; font: 13px 'Ubuntu', system-ui, sans-serif; cursor: pointer; }
.ov-card:hover, .ov-card:focus-visible { border-color: #E95420; background: rgba(255,255,255,.1); outline: none; }
.ov-thumb { position: relative; overflow: hidden; border-radius: 8px; background: #111; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.ov-thumb .ov-clone { pointer-events: none !important; user-select: none; }
.ov-title { display: flex; align-items: center; gap: 6px; }
.ov-title img { width: 18px; height: 18px; }
.ov-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; display: none; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.ov-card:hover .ov-x, .ov-card:focus-within .ov-x { display: flex; }
.ov-empty { color: #bbb; font: 14px 'Ubuntu', system-ui, sans-serif; text-align: center; }
.ov-desktop { width: 280px; height: 170px; border-radius: 8px; background: var(--os-wall, #2C001E) center / cover; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
@media (max-width: 768px) { .header2 > .sysmenu { display: flex !important; } }

#os-notifs { position: fixed; top: 48px; left: 50%; transform: translateX(-50%); z-index: 9500; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.os-notif { min-width: 280px; max-width: 360px; padding: 10px 14px; border-radius: 10px; background: #2b2b2b; color: #eee; box-shadow: 0 6px 22px rgba(0,0,0,.45);
    font: 14px 'Ubuntu', system-ui, sans-serif; animation: os-pop .2s ease-out; pointer-events: auto; }
.os-notif b { display: block; margin-bottom: 2px; }
.os-notif.out { opacity: 0; transform: translateY(-8px); transition: .3s; }
@media (prefers-reduced-motion: reduce) { #boot img, #os-quick.on, .os-notif { animation: none; } }

/* Escritorio: renombrado en el sitio, menú y propiedades */
.desktop-rename { position: absolute; z-index: 6; box-sizing: border-box; padding: 3px 4px; border: 2px solid #E95420; border-radius: 4px;
    background: #fff; color: #222; font: 12px 'Ubuntu', system-ui, sans-serif; text-align: center; outline: none; }
.desktop-context-menu button:disabled { opacity: .4; cursor: default; }
.os-dlg-wrap { position: fixed; inset: 0; z-index: 9400; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.35); }
.os-dlg { width: min(340px, 90vw); padding: 18px 20px; border-radius: 12px; background: #2b2b2b; color: #eee; box-shadow: 0 12px 40px rgba(0,0,0,.55); font: 14px 'Ubuntu', system-ui, sans-serif; }
.os-dlg h3 { margin: 0 0 12px; font-weight: 500; }
.os-dlg div { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.os-dlg div span { opacity: .85; text-align: right; word-break: break-all; }
.os-dlg button { margin-top: 14px; width: 100%; padding: 9px; border: 0; border-radius: 8px; background: #E95420; color: #fff; font: inherit; cursor: pointer; }

/* Selección con ratón y compresión */
.fm-lasso { position: fixed; z-index: 9300; pointer-events: none; border: 1px solid #E95420; background: rgba(233,84,32,.18); border-radius: 2px; }
.os-dlg-wide { width: min(420px, 92vw); }
.os-in { display: block; width: 100%; box-sizing: border-box; margin: 0 0 10px; padding: 9px 10px; border-radius: 8px; border: 2px solid transparent; background: #3d3d3d; color: #eee; font: inherit; }
.os-in:focus-visible { outline: none; border-color: #E95420; }
.os-note { margin: 0 0 4px; opacity: .7; font-size: .9em; }
.os-btns { display: flex; gap: 8px; margin-top: 12px; }
.os-btns button { flex: 1; margin: 0; padding: 9px; border: 0; border-radius: 8px; background: #3d3d3d; color: #eee; font: inherit; cursor: pointer; }
.os-btns button.primary { background: #E95420; color: #fff; }
.os-list { max-height: 220px; overflow: auto; margin-bottom: 8px; border-radius: 8px; background: #232323; }
.os-list div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 10px; border: 0; font-size: .9em; }
.os-list div span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }

/* htop */
.htop-ui { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; flex-direction: column; overflow: hidden; padding: 6px 8px; background: #000; color: #d0d0d0; font: 13px/1.28 'Ubuntu Mono', 'DejaVu Sans Mono', monospace; user-select: none; outline: none; }
.htop-ui .ht-top { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; white-space: pre; }
.htop-ui .ht-g { color: #3c3; } .htop-ui .ht-b { color: #59f; } .htop-ui .ht-r2 { color: #f55; } .htop-ui .ht-c { color: #3cc; }
.htop-ui .ht-h { margin-top: 6px; background: #3c3; color: #000; white-space: pre; }
.htop-ui .ht-body { flex: 1; overflow: hidden; }
.htop-ui .ht-row { white-space: pre; cursor: pointer; }
.htop-ui .ht-row.sel { background: #3cc; color: #000; }
.htop-ui .ht-msg { min-height: 1.3em; color: #dd3; }
.htop-ui .ht-f { display: flex; flex-wrap: wrap; white-space: pre; }
.htop-ui .ht-f b { color: #fff; font-weight: 400; }
.htop-ui .ht-f span { margin-right: 2px; padding: 0 4px; background: #3cc; color: #000; cursor: pointer; }
