/* ==========================================
   FiveZone Police PC - desktop OS
   ========================================== */

#os { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.72); }
#os.fade-in { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* monitor bezel */
.bezel {
    position: relative;
    width: min(94vw, calc(88vh * 16 / 9)); aspect-ratio: 16 / 9;
    padding: 14px 14px 30px;
    background: linear-gradient(180deg, #1d2126, #121418);
    border-radius: 18px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.bezel .brand { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 800; letter-spacing: 0.35em; color: #4a5059; }
.bezel .led { position: absolute; bottom: 12px; right: 24px; width: 6px; height: 6px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 6px #2ecc71; }
.bezel.laptop { border-radius: 16px 16px 6px 6px; padding: 16px 16px 22px; }
.bezel.laptop .brand { bottom: 5px; }
.bezel.vehicle { background: linear-gradient(180deg, #23262a, #15171a); border-radius: 10px; padding: 12px; }
.bezel.vehicle .brand, .bezel.vehicle .led { display: none; }
.bezel.noframe { width: 100vw; height: 100vh; aspect-ratio: auto; padding: 0; border-radius: 0; background: none; box-shadow: none; }
.bezel.noframe .brand, .bezel.noframe .led { display: none; }

.screen {
    position: relative; width: 100%; height: 100%;
    overflow: hidden; border-radius: 6px;
    background: #05070a center/cover no-repeat;
    container-type: size;
}
.bezel.noframe .screen { border-radius: 0; }
.screen-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.35)); pointer-events: none; }

/* ---------- lock / login screen ---------- */
#lock {
    position: absolute; inset: 0; z-index: 50;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6vh;
    background: rgba(5, 7, 10, 0.55) center/cover no-repeat;
    transition: opacity 0.35s, transform 0.35s;
}
#lock::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(5, 7, 10, 0.35), rgba(5, 7, 10, 0.9)); }
#lock > * { position: relative; }
#lock.out { opacity: 0; transform: scale(1.04); pointer-events: none; }
.lk-clock { font-size: clamp(44px, 8.5vh, 84px); font-weight: 200; letter-spacing: -0.02em; line-height: 1; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5); }
.lk-date { font-size: 15px; color: #c6ced8; margin-top: -8px; text-transform: capitalize; }
.lk-card {
    margin-top: 1.5vh; width: 340px; padding: 22px 24px 20px;
    background: rgba(15, 18, 23, 0.92); border: 1px solid var(--line-2); border-radius: 16px;
    display: flex; flex-direction: column; align-items: center; gap: 12px; box-shadow: var(--shadow);
}
.lk-badge { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); border: 2px solid var(--accent-line); color: var(--accent); }
.lk-badge svg.i { width: 36px; height: 36px; }
.lk-name { font-size: 17px; font-weight: 700; }
.lk-dept { font-size: 11.5px; color: var(--muted); margin-top: -8px; text-align: center; }
.lk-field { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.lk-input { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line-2); font-size: 13px; }
.lk-input svg.i { width: 15px; height: 15px; color: var(--dim); }
.lk-input .v { flex: 1; min-height: 18px; }
.lk-input .v.pw { letter-spacing: 0.3em; font-size: 16px; line-height: 14px; }
.lk-input.focus { border-color: var(--accent-line); }
.lk-caret { width: 1.5px; height: 15px; background: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lk-btn { width: 100%; margin-top: 4px; padding: 10px; }
.lk-status { font-size: 11.5px; color: var(--muted); min-height: 16px; display: flex; align-items: center; gap: 8px; }
.lk-status .spinner { width: 14px; height: 14px; border-width: 2px; }
.lk-hint { position: absolute; bottom: 12px; font-size: 11px; color: rgba(255, 255, 255, 0.4); }

/* ---------- desktop ---------- */
#desktop { position: absolute; inset: 0 0 46px 0; }
.icons { position: absolute; inset: 10px; }
.dicon {
    position: absolute; width: 88px; padding: 8px 4px 6px; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    cursor: pointer; text-align: center; transition: background 0.12s;
}
.dicon:hover { background: rgba(255, 255, 255, 0.08); }
.dicon.sel { background: rgba(241, 196, 15, 0.14); box-shadow: inset 0 0 0 1px var(--accent-line); }
.dicon.drag { opacity: 0.7; z-index: 5; }
.dicon .ico { position: relative; }
.dicon .lbl { font-size: 11.5px; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.9); line-height: 1.25; }
.dicon .badge { position: absolute; top: -5px; right: -7px; }

.app-ico {
    width: 46px; height: 46px; border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(160deg, var(--c1, #2c3440), var(--c2, #171c23));
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    color: var(--ic, #fff);
}
.app-ico svg.i { width: 24px; height: 24px; stroke-width: 1.7; }
.app-ico.sm { width: 22px; height: 22px; border-radius: 6px; box-shadow: none; }
.app-ico.sm svg.i { width: 13px; height: 13px; }
.app-ico.md { width: 32px; height: 32px; border-radius: 9px; }
.app-ico.md svg.i { width: 17px; height: 17px; }

/* desktop widget (clock + user) */
.widget {
    position: absolute; right: 18px; top: 16px; width: 260px;
    background: rgba(13, 16, 21, 0.86); border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.widget .w-time { font-size: 34px; font-weight: 300; line-height: 1; }
.widget .w-date { font-size: 11.5px; color: var(--muted); margin-top: 4px; text-transform: capitalize; }
.widget .w-user { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.widget .w-user .n { font-weight: 700; font-size: 12.5px; }
.widget .w-user .r { font-size: 11px; color: var(--muted); }
.widget .w-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.widget .w-stat { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; cursor: pointer; }
.widget .w-stat:hover { border-color: var(--accent-line); }
.widget .w-stat b { font-size: 18px; display: block; }
.widget .w-stat span { font-size: 10.5px; color: var(--muted); }

/* ---------- taskbar ---------- */
#taskbar {
    position: absolute; left: 0; right: 0; bottom: 0; height: 46px; z-index: 40;
    display: flex; align-items: center; gap: 4px; padding: 0 8px;
    background: rgba(10, 12, 16, 0.96); border-top: 1px solid var(--line-2);
}
.tb-start { width: 40px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--accent); transition: 0.12s; }
.tb-start:hover, .tb-start.on { background: rgba(241, 196, 15, 0.14); }
.tb-start svg.i { width: 22px; height: 22px; }
.tb-sep { width: 1px; height: 24px; background: var(--line-2); margin: 0 4px; }
.tb-apps { display: flex; align-items: center; gap: 3px; flex: 1; min-width: 0; overflow: hidden; }
.tb-app {
    height: 36px; padding: 0 10px; border-radius: 8px; display: flex; align-items: center; gap: 8px;
    max-width: 190px; position: relative; transition: background 0.12s; color: var(--muted);
}
.tb-app:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.tb-app.focus { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.tb-app.focus::after { content: ''; position: absolute; left: 30%; right: 30%; bottom: 2px; height: 2.5px; border-radius: 2px; background: var(--accent); }
.tb-app.min { opacity: 0.6; }
.tb-app span { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-tray { display: flex; align-items: center; gap: 2px; }
.tb-btn { height: 36px; min-width: 36px; padding: 0 9px; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); position: relative; }
.tb-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.tb-btn .badge { position: absolute; top: 3px; right: 2px; transform: scale(0.85); }
.tb-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; padding: 0 8px; font-size: 11.5px; }
.tb-clock b { font-weight: 600; font-size: 12px; }
.tb-clock span { color: var(--muted); font-size: 10.5px; }
.tb-mode { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; padding: 3px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); margin-right: 4px; }

/* ---------- start menu ---------- */
#start {
    position: absolute; left: 8px; bottom: 54px; z-index: 45; width: 430px; max-height: calc(100% - 70px);
    background: rgba(15, 18, 23, 0.98); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; overflow: hidden; animation: popUp 0.16s ease;
}
@keyframes popUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.st-head { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.st-head .n { font-weight: 700; font-size: 14px; }
.st-head .r { font-size: 11.5px; color: var(--muted); }
.st-search { padding: 12px 16px 6px; }
.st-apps { padding: 8px 10px 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; overflow-y: auto; }
.st-app { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 10px; text-align: center; font-size: 11px; font-weight: 600; }
.st-app:hover { background: rgba(255, 255, 255, 0.06); }
.st-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.2); }
.st-certs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }

/* ---------- notifications ---------- */
#toasts { position: absolute; top: 14px; right: 14px; z-index: 60; display: flex; flex-direction: column; gap: 8px; width: 320px; pointer-events: none; }
.toast {
    pointer-events: auto; cursor: pointer;
    display: flex; gap: 11px; padding: 12px 13px; border-radius: 12px;
    background: rgba(18, 22, 28, 0.98); border: 1px solid var(--line-2); box-shadow: var(--shadow);
    animation: toastIn 0.25s ease;
}
.toast.out { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.toast .t { font-weight: 700; font-size: 12.5px; }
.toast .x { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.toast .ago { font-size: 10px; color: var(--dim); margin-left: auto; white-space: nowrap; }
.toast.error { border-color: rgba(231, 76, 60, 0.4); }
.toast.success { border-color: rgba(46, 204, 113, 0.35); }

#notif-center {
    position: absolute; right: 8px; bottom: 54px; z-index: 45; width: 360px; max-height: 70%;
    background: rgba(15, 18, 23, 0.98); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; overflow: hidden; animation: popUp 0.16s ease;
}
.nc-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; }
.nc-list { overflow-y: auto; }
.nc-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.nc-item:hover { background: rgba(255, 255, 255, 0.03); }
.nc-item .t { font-weight: 600; font-size: 12px; }
.nc-item .x { font-size: 11.5px; color: var(--muted); }

/* ---------- windows ---------- */
#windows { position: absolute; inset: 0 0 46px 0; pointer-events: none; }
.win {
    position: absolute; pointer-events: auto;
    display: flex; flex-direction: column;
    background: var(--panel); border: 1px solid var(--line-2); border-radius: 11px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6);
    min-width: 380px; min-height: 260px; overflow: hidden;
    animation: winIn 0.16s ease;
}
@keyframes winIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.win.closing { animation: winOut 0.13s ease forwards; }
@keyframes winOut { to { opacity: 0; transform: scale(0.97); } }
.win.inactive { box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); }
.win.inactive .w-bar { background: #12161c; }
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; }
.w-bar {
    height: 38px; flex-shrink: 0; display: flex; align-items: center; gap: 9px; padding: 0 6px 0 11px;
    background: #171c23; border-bottom: 1px solid var(--line); cursor: default;
}
.w-title { font-size: 12.5px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-btns { display: flex; gap: 2px; }
.w-btn { width: 30px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.w-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.w-btn.close:hover { background: #c0392b; color: #fff; }
.w-btn svg.i { width: 14px; height: 14px; }
.w-body { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.w-resize { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; z-index: 3; }
.w-resize::after { content: ''; position: absolute; right: 4px; bottom: 4px; width: 7px; height: 7px; border-right: 2px solid var(--dim); border-bottom: 2px solid var(--dim); opacity: 0.6; }

/* ---------- context menu ---------- */
.ctx { position: absolute; z-index: 70; min-width: 190px; padding: 5px; background: rgba(18, 22, 28, 0.99); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); }
.ctx button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 7px; font-size: 12px; text-align: left; }
.ctx button:hover { background: rgba(255, 255, 255, 0.06); }

/* ---------- dialogs (inside the screen) ---------- */
.modal-bg { position: absolute; inset: 0; z-index: 80; background: rgba(4, 6, 9, 0.66); display: grid; place-items: center; animation: fadeIn 0.15s ease; }
.modal {
    width: 460px; max-width: calc(100% - 40px); max-height: calc(100% - 40px);
    background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; overflow: hidden; animation: popUp 0.16s ease;
}
.modal.wide { width: 680px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.modal-body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.15); }

/* pickers */
.pick-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-item:last-child { border-bottom: none; }
.pick-item:hover { background: rgba(255, 255, 255, 0.04); }
.pick-item.on { background: var(--accent-soft); }
.pick-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.pick-tags .chip { cursor: pointer; }

/* shutdown / boot */
#boot { position: absolute; inset: 0; z-index: 90; background: #05070a; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; transition: opacity 0.4s; }
#boot.out { opacity: 0; pointer-events: none; }
#boot .logo { color: var(--accent); }
#boot .logo svg.i { width: 64px; height: 64px; stroke-width: 1.4; }
#boot .bar { width: 180px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
#boot .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width linear; }
#boot .txt { font-size: 11px; color: var(--dim); letter-spacing: 0.2em; text-transform: uppercase; }
