/* ============================================================
   DEV LIFE™ — GenericOS theme
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --os-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, "Cascadia Code", monospace;
  --accent: #4e8ef7;
  --danger: #e5534b;
  --ok: #57ab5a;
  --warn: #d4a72c;
}

html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--os-font);
  color: #e6e6e6;
  background: #0c0e14;
  user-select: none;
}

#desktop {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 70% 20%, #2a3550 0%, transparent 60%),
    radial-gradient(900px 700px at 20% 80%, #232a3f 0%, transparent 55%),
    linear-gradient(160deg, #161b29 0%, #0d1020 100%);
  transition: filter .5s;
}
#desktop.tired { filter: saturate(.75) brightness(.92); }
#desktop.exhausted { filter: saturate(.5) brightness(.8) blur(.6px); }

/* ===== Menu bar ===== */
#menubar {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: rgba(20, 24, 36, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.07);
  font-size: 13px;
  flex: none;
}
.mb-left, .mb-right { display: flex; align-items: center; gap: 14px; }
.os-logo { color: var(--accent); }
.mb-app { font-weight: 700; }
.mb-item { color: #aab; }
.mb-center { color: #9aa3b5; font-size: 12px; }
.mb-clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; }
.mb-clock.late { color: var(--danger); }

.meter { display: flex; align-items: center; gap: 5px; }
.meter-icon { font-size: 12px; }
.meter-track {
  width: 70px; height: 8px; border-radius: 4px;
  background: rgba(255,255,255,.12); overflow: hidden;
}
.meter-fill { height: 100%; border-radius: 4px; transition: width .3s, background .3s; }
.meter-fill.energy { background: var(--warn); width: 100%; }
.meter-fill.rep { background: var(--ok); width: 100%; }
.meter-fill.low { background: var(--danger); }

/* ===== Window ===== */
#window-area { flex: 1; padding: 14px 18px 8px; min-height: 0; display: flex; }
#app-window {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
  background: #1e1e1e;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  overflow: hidden;
}
#titlebar {
  height: 34px; flex: none;
  display: flex; align-items: center;
  background: #2b2b2e;
  border-bottom: 1px solid #1a1a1c;
  padding: 0 12px;
  font-size: 12.5px; color: #b6b6bb;
}
.traffic { display: flex; gap: 7px; width: 70px; }
.tl { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.tl.red { background: #ff5f57; } .tl.yellow { background: #febc2e; } .tl.green { background: #28c840; }
#window-title { flex: 1; text-align: center; }
.titlebar-spacer { width: 70px; }

.app { flex: 1; display: flex; min-height: 0; }
.app.hidden { display: none; }
.hidden { display: none !important; }
.dim { color: #777f8f; }

/* ===== VS Code ===== */
#app-vscode { background: #1e1e1e; font-family: var(--mono); }
.vsc-activity {
  width: 46px; flex: none; background: #333333;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 10px; gap: 16px; font-size: 17px;
}
.act-icon { opacity: .45; cursor: not-allowed; }
.act-icon.active { opacity: 1; border-left: 2px solid #fff; padding-left: 4px; margin-left: -6px; }

.vsc-sidebar {
  width: 230px; flex: none; background: #252526;
  padding: 10px 0; font-size: 12.5px; overflow-y: auto;
}
.vsc-sidebar-title { color: #8b8b8b; font-size: 10.5px; letter-spacing: .08em; padding: 0 14px 10px; font-family: var(--os-font); }
.vsc-folder { padding: 3px 14px; color: #c5c5c5; }
.vsc-folder.dim { color: #6a6a6a; }
.vsc-file {
  padding: 4px 14px 4px 28px; color: #c5c5c5; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.vsc-file:hover { background: #2a2d2e; }
.vsc-file.active { background: #37373d; }
.vsc-file.done { color: #57ab5a; }
.vsc-file .pct { font-size: 10.5px; color: #888; }

.vsc-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#vsc-tabs { height: 35px; flex: none; background: #252526; display: flex; align-items: stretch; font-size: 12.5px; }
.vsc-tab {
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
  background: #1e1e1e; color: #d4d4d4; border-right: 1px solid #252526;
  border-top: 1px solid var(--accent);
}
.vsc-tab .ticket { color: #6a9955; font-size: 11px; }

#editor {
  flex: 1; overflow-y: auto; padding: 14px 0; outline: none; cursor: text;
  font-size: 14.5px; line-height: 1.65;
}
#editor.flash { animation: flash .18s; }
@keyframes flash { 0% { background: rgba(229,83,75,.18); } 100% { background: transparent; } }

.cl { display: flex; white-space: pre; }
.ln {
  width: 48px; flex: none; text-align: right; padding-right: 18px;
  color: #585858; font-size: 13px;
}
.code-typed { color: #9cdcfe; }
.code-rest { color: #4d4d52; }
.cursor-char {
  background: var(--accent); color: #fff; border-radius: 2px;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { background: transparent; color: #4d4d52; } }
.editor-hint {
  font-family: var(--os-font); color: #6a6a72; font-size: 13px;
  padding: 20px 50px; font-style: italic;
}
.editor-done-msg { font-family: var(--os-font); color: var(--ok); padding: 16px 50px; font-size: 14px; }

.vsc-statusbar {
  height: 24px; flex: none; background: #2563c4;
  display: flex; align-items: center; gap: 18px; padding: 0 14px;
  font-size: 11.5px; color: #fff; font-family: var(--os-font);
}
.vsc-statusbar span:last-child { margin-left: auto; }

/* ===== Browser ===== */
#app-browser { flex-direction: column; background: #23252b; font-size: 13.5px; }
.browser-chrome { flex: none; background: #2e3138; }
.browser-tabs { display: flex; padding: 6px 8px 0; gap: 4px; }
.btab {
  padding: 7px 14px; border-radius: 8px 8px 0 0; background: #23252b;
  font-size: 12px; max-width: 230px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.btab.dim { background: transparent; color: #888; }
.browser-urlbar { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: #23252b; }
.url-btn { color: #888; padding: 0 4px; }
.url-field {
  flex: 1; background: #1a1c20; border-radius: 14px; padding: 6px 14px;
  font-size: 12.5px; color: #9aa3b5;
}
.browser-content { flex: 1; overflow-y: auto; padding: 18px 26px; background: #1d1f24; }
.jira-header h2 { font-size: 19px; font-weight: 700; }
.jira-sub { color: #8a93a5; font-size: 12.5px; margin: 4px 0 18px; }
.jira-section-title { font-size: 12px; letter-spacing: .06em; color: #8a93a5; margin: 14px 0 8px; text-transform: uppercase; }
.jira-section-title .hint { text-transform: none; letter-spacing: 0; }
.jira-empty, .mail-empty { color: #6c7484; font-style: italic; padding: 10px 2px; font-size: 13px; }

.jira-card {
  background: #262932; border: 1px solid #333845; border-radius: 8px;
  padding: 12px 14px; margin-bottom: 10px;
}
.jira-card.urgent { border-color: var(--danger); }
.jira-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.jira-ticket-id { color: var(--accent); font-weight: 700; font-size: 12px; }
.jira-author { font-weight: 600; font-size: 13px; }
.jira-text { color: #cdd3de; margin: 4px 0 10px; line-height: 1.45; }
.countdown { height: 5px; background: rgba(255,255,255,.1); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.countdown-fill { height: 100%; background: var(--ok); border-radius: 3px; }
.countdown-fill.warn { background: var(--warn); }
.countdown-fill.crit { background: var(--danger); }
.reply-row { display: flex; flex-wrap: wrap; gap: 7px; }
.reply-btn {
  background: #2f3542; border: 1px solid #3d4454; color: #dbe1ec;
  padding: 6px 11px; border-radius: 6px; cursor: pointer; font-size: 12.5px;
  font-family: var(--os-font);
}
.reply-btn:hover { background: #3a4252; border-color: var(--accent); }

.backlog-card {
  display: flex; gap: 10px; align-items: baseline;
  padding: 8px 2px; border-bottom: 1px solid #262932; color: #99a1b0; font-size: 13px;
}
.backlog-card .note { color: #646c7c; font-size: 12px; }

/* ===== Mail ===== */
#app-mail { background: #1d1f24; }
.mail-list { width: 300px; flex: none; border-right: 1px solid #2c2f37; display: flex; flex-direction: column; }
.mail-list-header { padding: 14px 16px; font-weight: 700; font-size: 15px; border-bottom: 1px solid #2c2f37; flex: none; }
#mail-items { overflow-y: auto; flex: 1; }
.mail-item { padding: 11px 16px; border-bottom: 1px solid #25272e; cursor: pointer; }
.mail-item:hover { background: #24262d; }
.mail-item.selected { background: #2a2d36; }
.mail-item .from { font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; gap: 6px; }
.mail-item .subj { font-size: 12.5px; color: #aab2c0; margin-top: 2px; }
.mail-item.answered .from, .mail-item.answered .subj { color: #5d6470; font-weight: 400; }
.mail-item .mini-count { font-size: 11px; color: var(--warn); font-variant-numeric: tabular-nums; }
.mail-item .mini-count.crit { color: var(--danger); }
.mail-reading { flex: 1; padding: 22px 28px; overflow-y: auto; }
.mail-placeholder { color: #6c7484; font-style: italic; padding-top: 30px; text-align: center; }
.mail-subject { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.mail-meta { color: #8a93a5; font-size: 12.5px; margin-bottom: 16px; }
.mail-body { white-space: pre-wrap; line-height: 1.55; color: #cdd3de; font-size: 14px; margin-bottom: 20px; }
.mail-reply-label { font-size: 12px; color: #8a93a5; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.mail-answered-note { color: var(--ok); font-size: 13.5px; }

/* ===== Taskbar ===== */
#taskbar {
  height: 52px; flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px;
  background: rgba(20, 24, 36, .85);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255,255,255,.07);
}
.tb-app, #tb-coffee {
  position: relative;
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: #dde2ec; font-family: var(--os-font); font-size: 13px;
  padding: 8px 14px; border-radius: 9px; cursor: pointer;
}
.tb-app:hover, #tb-coffee:hover { background: rgba(255,255,255,.12); }
.tb-app.active { background: rgba(78,142,247,.22); border-color: var(--accent); }
.tb-icon { font-size: 15px; }
.tb-spacer { flex: 1; }
#tb-coffee { background: rgba(212,167,44,.15); border-color: rgba(212,167,44,.4); }
#tb-coffee:disabled { opacity: .45; cursor: not-allowed; }
.badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.tb-app.nudge { animation: nudge .45s; }
@keyframes nudge { 0%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); } 60% { transform: translateY(-2px); } }

/* ===== Toasts ===== */
#toasts {
  position: fixed; top: 40px; right: 16px; z-index: 50;
  display: flex; flex-direction: column; gap: 8px; width: 320px;
}
.toast {
  background: rgba(36, 40, 54, .96);
  border: 1px solid rgba(255,255,255,.14);
  border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 10px 13px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  cursor: pointer; font-size: 13px;
  animation: toast-in .25s ease-out;
}
.toast.bad { border-left-color: var(--danger); }
.toast.good { border-left-color: var(--ok); }
.toast .toast-title { font-weight: 700; margin-bottom: 2px; }
.toast .toast-body { color: #b8bfcd; font-size: 12.5px; }
@keyframes toast-in { from { transform: translateX(40px); opacity: 0; } }
.toast.out { transition: opacity .3s, transform .3s; opacity: 0; transform: translateX(40px); }

/* ===== Overlays ===== */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 10, 16, .72);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.overlay-card {
  background: #20232e;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 28px 34px;
  max-width: 560px; width: calc(100% - 60px);
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  font-size: 15px;
}
.overlay-emoji { font-size: 42px; margin-bottom: 10px; }
.coffee-track { margin-top: 16px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
#coffee-bar { height: 100%; width: 0; background: var(--warn); border-radius: 4px; transition: width .2s linear; }

.coworker-card { text-align: left; }
.coworker-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.coworker-head .overlay-emoji { margin: 0; }
.cw-name { font-weight: 700; font-size: 16px; }
.cw-topic { font-size: 13px; }
.cw-line { line-height: 1.5; min-height: 48px; margin-bottom: 16px; color: #d6dbe6; }
#cw-btn {
  background: var(--accent); border: none; color: #fff;
  padding: 9px 22px; border-radius: 8px; font-size: 14px; cursor: pointer;
}
#cw-btn:disabled { opacity: .4; cursor: wait; }
.cw-warning { margin-top: 14px; font-size: 12px; color: #d4a72c; }

/* ===== Start / End ===== */
.start-card { max-width: 620px; }
.start-card h1 { font-size: 40px; letter-spacing: .02em; margin-bottom: 4px; }
.start-tagline { color: #9aa3b5; margin-bottom: 18px; font-size: 15px; }
.start-brief { text-align: left; background: rgba(255,255,255,.04); border-radius: 10px; padding: 16px 20px; margin-bottom: 22px; font-size: 14px; line-height: 1.55; }
.start-brief ul { margin: 10px 0 10px 20px; }
.start-brief li { margin-bottom: 6px; }
#start-btn, #restart-btn {
  background: var(--ok); border: none; color: #fff;
  font-size: 16px; font-weight: 700;
  padding: 12px 34px; border-radius: 10px; cursor: pointer;
}
#start-btn:hover, #restart-btn:hover { filter: brightness(1.1); }

.end-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px;
  text-align: left; background: rgba(255,255,255,.04);
  border-radius: 10px; padding: 16px 20px; margin-bottom: 16px; font-size: 13.5px;
}
.end-stats b { color: #fff; }
.end-review {
  border: 1px dashed rgba(255,255,255,.2); border-radius: 10px;
  padding: 14px 18px; margin-bottom: 22px; font-size: 14px; line-height: 1.5;
  text-align: left;
}
.end-review .grade { font-weight: 800; font-size: 16px; margin-bottom: 4px; }
