/* ═══════════════════════════════════════════
   Sandbox — Bureau Virtuel Interactif
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { overflow: hidden; font-family: 'Segoe UI', Arial, sans-serif; }

/* ── Root layout ── */
#sb-root {
  width: 100vw; height: 100vh;
  background: linear-gradient(160deg, #0050a0 0%, #002a5c 100%);
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
  user-select: none;
}

/* ── Desktop area ── */
#sb-desktop { flex: 1; position: relative; overflow: hidden; }

/* ── Desktop Icons ── */
.sb-icon {
  position: absolute; width: 82px; padding: 8px 4px;
  text-align: center; border-radius: 4px;
  cursor: pointer;
  transition: background .1s;
}
.sb-icon:hover, .sb-icon.sel { background: rgba(255,255,255,.22); }
.sb-icon-gfx { font-size: 40px; line-height: 1.1; }
.sb-icon-lbl {
  font-size: 11px; color: #fff; margin-top: 4px;
  text-shadow: 1px 1px 3px rgba(0,0,0,.9);
  line-height: 1.35;
}

/* ── Windows ── */
.sb-win {
  position: absolute; display: none; flex-direction: column;
  border-radius: 8px 8px 4px 4px;
  box-shadow: 0 12px 48px rgba(0,0,0,.65);
  overflow: hidden; min-width: 280px; min-height: 180px;
}

/* Titlebar */
.sb-tb {
  height: 32px; background: #1f1f1f;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0 0 12px; cursor: move; flex-shrink: 0;
}
.sb-tb-l {
  display: flex; align-items: center; gap: 8px;
  color: #fff; font-size: 13px; pointer-events: none;
}
.sb-tb-r { display: flex; }
.sb-btn-min, .sb-btn-close {
  width: 46px; height: 32px; border: none; background: transparent;
  color: rgba(255,255,255,.8); font-size: 13px;
  cursor: pointer; transition: background .1s;
  display: flex; align-items: center; justify-content: center;
}
.sb-btn-min:hover   { background: rgba(255,255,255,.1); }
.sb-btn-close:hover { background: #c42b1c; color: #fff; }

.sb-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* ── CMD Window ── */
.cmd-body { background: #0c0c0c; }

#cmd-out {
  flex: 1; overflow-y: auto; padding: 8px 10px;
  font-family: 'Consolas', 'Courier New', monospace; font-size: 14px;
  color: #cccccc; white-space: pre-wrap;
}
#cmd-out::-webkit-scrollbar { width: 6px; }
#cmd-out::-webkit-scrollbar-track { background: #1a1a1a; }
#cmd-out::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }

.cline { line-height: 1.55; }
.cline.ok   { color: #4ec9b0; }
.cline.err  { color: #f48771; }
.cline.info { color: #569cd6; }
.cline.sent { color: #dcdcaa; }

.cmd-row {
  display: flex; align-items: center; flex-shrink: 0;
  padding: 4px 10px 8px;
  border-top: 1px solid #1e1e1e; background: #0c0c0c;
  font-family: 'Consolas', 'Courier New', monospace; font-size: 14px;
}
.cmd-ps { color: #cccccc; white-space: nowrap; flex-shrink: 0; }
.cmd-in {
  flex: 1; background: transparent; border: none; outline: none;
  color: #cccccc; font-family: inherit; font-size: inherit;
  caret-color: #fff;
}

/* ── Calculator Window ── */
.calc-body { background: #202020; }

.calc-disp {
  padding: 12px 16px 8px; background: #1c1c1c; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: flex-end;
  min-height: 88px; justify-content: flex-end;
}
.calc-expr { font-size: 14px; color: #777; min-height: 18px; }
.calc-val  {
  font-size: 36px; color: #fff; font-weight: 300;
  transition: font-size .1s; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}

.calc-pad {
  flex: 1; display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 1fr) 52px;
  gap: 1px; background: #3a3a3a;
}
.cb {
  background: #2d2d2d; border: none; color: #fff;
  font-size: 16px; font-family: 'Segoe UI', Arial, sans-serif;
  cursor: pointer; transition: background .08s;
}
.cb:hover  { background: #404040; }
.cb:active { background: #555; }
.cb.op { color: #60cdff; background: #252525; }
.cb.op:hover { background: #3a3a3a; }
.cb.sp { color: #bbb; }
.cb.eq {
  background: #0078d4; color: #fff;
  grid-column: 1 / -1; font-size: 18px;
}
.cb.eq:hover  { background: #006dc0; }
.cb.eq:active { background: #005aa3; }

/* ── Taskbar ── */
#sb-tb-bar {
  height: 48px; background: rgba(0,0,0,.82);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; align-items: center; padding: 0 8px; gap: 4px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0; z-index: 9999;
}

#sb-start {
  width: 48px; height: 48px; background: transparent; border: none;
  color: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; transition: background .1s;
}
#sb-start:hover { background: rgba(255,255,255,.1); }

.sb-sep { width: 1px; height: 28px; background: rgba(255,255,255,.12); margin: 0 6px; }

#sb-tasks { display: flex; gap: 4px; flex: 1; }

.tb-app {
  height: 36px; padding: 0 14px;
  background: rgba(255,255,255,.07);
  border: none; border-bottom: 2px solid transparent;
  color: rgba(255,255,255,.65); cursor: pointer;
  border-radius: 4px; font-size: 13px;
  font-family: 'Segoe UI', Arial, sans-serif;
  display: flex; align-items: center; gap: 6px;
  transition: all .1s;
}
.tb-app:hover  { background: rgba(255,255,255,.14); color: #fff; }
.tb-app.active { border-bottom-color: #60cdff; color: #fff; background: rgba(255,255,255,.14); }
.tb-app.minimized { opacity: .55; }

.sb-tb-right { display: flex; align-items: center; gap: 8px; }

#sb-back {
  padding: 6px 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.85);
  border-radius: 4px; cursor: pointer; font-size: 13px;
  transition: background .2s;
  font-family: 'Segoe UI', Arial, sans-serif;
}
#sb-back:hover { background: rgba(255,255,255,.18); color: #fff; }

#sb-clock {
  color: rgba(255,255,255,.75); font-size: 11px;
  text-align: right; line-height: 1.5; min-width: 58px;
}

/* ── Context menu ── */
.sb-ctx-menu {
  position: fixed; display: none;
  background: rgba(28,28,28,.97);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px; padding: 4px 0;
  min-width: 190px;
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
  z-index: 999999;
  font-family: 'Segoe UI', Arial, sans-serif; font-size: 13px;
}
.sb-ctx-menu.open { display: block; }
.sb-ctx-item {
  padding: 7px 16px; color: rgba(255,255,255,.85);
  cursor: pointer; display: flex; align-items: center; gap: 10px;
  transition: background .1s;
}
.sb-ctx-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.sb-ctx-item.disabled { color: rgba(255,255,255,.3); cursor: default; pointer-events: none; }
.sb-ctx-sep {
  height: 1px; background: rgba(255,255,255,.1);
  margin: 3px 0;
}

/* ── Toast notification ── */
#sb-toast {
  position: fixed; bottom: 64px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(28,28,28,.96); color: #fff;
  padding: 12px 22px; border-radius: 8px;
  font-size: 14px; font-family: 'Segoe UI', Arial, sans-serif;
  box-shadow: 0 4px 24px rgba(0,0,0,.6);
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 99999;
  border: 1px solid rgba(255,255,255,.12);
}
#sb-toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
