﻿

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

/* ===== Fundo do ambiente ===== */
body {
  background-color: #08111f !important;
  background-image: var(--desktop-wallpaper-image, linear-gradient(135deg, #08111f 0%, #10243d 52%, #18384f 100%));
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
  font-family: var(--desktop-font, 'Montserrat', sans-serif);
  font-size: 14px;
  line-height: 1.35;
  color: var(--desktop-text, #fff);
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.18), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(250, 204, 21, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(4, 10, 24, 0.08), rgba(4, 10, 24, 0.32));
  pointer-events: none;
  z-index: 0;
}

#desktop {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

#windows-container {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

#windows-container .window,
#windows-container .login-window {
  pointer-events: auto;
}

/* ===== Scrollbars globais estilo VisionOS ===== */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) rgba(10, 18, 32, 0.08);
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: rgba(10, 18, 32, 0.08);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(148, 163, 184, 0.24));
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(148, 163, 184, 0.34));
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

/* ===== Janelas ===== */
.window {
  width: 500px;
  background: linear-gradient(160deg, rgba(18, 26, 44, 0.72), rgba(11, 17, 32, 0.52));
  backdrop-filter: blur(calc(var(--window-blur, 12px) + 8px)) saturate(1.45);
  -webkit-backdrop-filter: blur(calc(var(--window-blur, 12px) + 8px)) saturate(1.45);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  box-shadow: 0 22px 65px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.14);
  position: absolute;
  top: 100px;
  left: 100px;
  display: none;
  flex-direction: column;
  resize: both; /* permite redimensionar */
  overflow: hidden;
  pointer-events: auto;
  transform-origin: center center;
  animation: window-fade-in 180ms ease-out;
}

.window.minimized {
  display: none !important;
}

@keyframes window-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* ===== CabeÃ§alho das janelas ===== */
.window-header {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.05));
  backdrop-filter: blur(18px) saturate(1.28);
  -webkit-backdrop-filter: blur(18px) saturate(1.28);
  cursor: move; /* sÃ³ o cabeÃ§alho arrasta */
}

/* BotÃµes estilo MacOS */
.window-header .btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;              /* impede de deformar */
  display: inline-block;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
  padding: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.34), 0 1px 4px rgba(0,0,0,0.15);
}

/* Estado normal */
.window-header .btn.red    { background: #ff5f56; }
.window-header .btn.yellow { background: #ffbd2e; }
.window-header .btn.green  { background: #27c93f; }

/* Hover */
.window-header .btn:hover {
  box-shadow: 0 0 4px rgba(255,255,255,0.6);
  filter: brightness(1.15);
  transform: scale(1.1);
}

/* TÃ­tulo */
.window-header .title {
  margin-left: 10px;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 0.01em;
  color: #fff;
}


/* Corpo da janela */
.window-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;       /* mantÃ©m sem scroll duplo */
  min-height: 0;          /* ðŸ”‘ evita cortar conteÃºdo flex */
  position: relative;     /* garante posicionamento interno */
}


/* Inputs */
.form-input {
  width: 90%;
  padding: 10px;
  margin: 6px 0;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  outline: none;
}

.form-input::placeholder {
  color: #ddd;
}

/* BotÃ£o padrÃ£o */
.btn-primary {
  background: #27c93f;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: bold;
  color: #fff;
  transition: background 0.2s;
}
.btn-primary:hover {
  background: #1fa530;
}

.login-bg {
  background: url('../img/background.jpg') no-repeat center center fixed;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
}

.login-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 360px;
  max-width: min(360px, calc(100vw - 32px));
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  overflow: hidden;
  z-index: 30;
}

body.login-bg {
  display: grid !important;
  place-items: center !important;
  padding: 24px;
}

body.login-bg > .login-window {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  margin: 0 auto !important;
}

.login-window .window-header {
  display: flex;
  align-items: center;
  padding: 8px;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
}

.login-window .title {
  margin-left: 10px;
  font-weight: bold;
  font-size: 14px;
  color: #fff;
}

/* Ajustes especÃ­ficos do Login */
.login-window .form-input {
  width: 100%;                  /* ocupa toda a largura do box */
  padding: 12px 14px;           /* mais confortÃ¡vel */
  margin: 0;                    /* remove margens extras */
  border-radius: 0px;          /* cantos arredondados suaves */
   color: #fff;
  font-size: 20px;
}

.login-window .form-input::placeholder {
  color: rgba(255,255,255,0.6); /* placeholder mais discreto */
}

.login-window .btn-primary {
  width: 100%;
  border-radius: 0px;
  font-size: 20px;
  padding: 12px;
}

.external-app-window {
  min-width: 760px;
  min-height: 520px;
}

.external-app-body {
  padding: 0 !important;
  background: rgba(8, 14, 28, 0.98);
  overflow: hidden;
}

.external-app-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b1220;
}



/* ===== Topbar (usuÃ¡rio logado) ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 39px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  z-index: 9999;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(7, 12, 24, 0.78), rgba(7, 12, 24, 0.48));
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
  box-shadow: 0 12px 30px rgba(0,0,0,0.24);
  overflow: visible;
}

.taskbar-left {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.taskbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 3px 10px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  cursor: pointer;
}

.taskbar-brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.25), rgba(56, 189, 248, 0.18));
  border: 1px solid rgba(255,255,255,0.10);
  color: #fff;
}

.taskbar-brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.taskbar-brand-copy strong {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.taskbar-brand-copy small {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255,255,255,0.62);
}

.taskbar-search-shell {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.taskbar-search-toggle {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, width 140ms ease;
  flex: 0 0 auto;
}

.taskbar-search-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
}

.taskbar-search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.taskbar-search[hidden] {
  display: none !important;
}

.taskbar-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 14px;
}

.taskbar-search input::placeholder {
  color: rgba(255,255,255,0.45);
}

.taskbar-search kbd {
  padding: 5px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.72);
  font-size: 11px;
}

.taskbar-user-apps {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.taskbar-user-apps::-webkit-scrollbar {
  display: none;
}

.taskbar-user-apps .taskbar-app-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
  flex: 0 0 auto;
}

.taskbar-user-apps .taskbar-app-btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
}

.taskbar-user-apps .taskbar-app-btn i {
  font-size: 15px;
}

.taskbar-tray {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: min(32vw, 560px);
  overflow-x: auto;
  scrollbar-width: none;
}

.taskbar-tray::-webkit-scrollbar {
  display: none;
}

.taskbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.taskbar-icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.taskbar-icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
}

.taskbar-icon-btn i {
  font-size: 16px;
}

#task-tray {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  flex: 1;
  min-width: 0;
  z-index: 9950;
  pointer-events: auto;
}

#root-assistant-launcher {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 10020;
  pointer-events: auto;
}

.root-assistant-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(7, 12, 24, 0.72);
  color: #fff;
  backdrop-filter: blur(20px) saturate(1.35);
  box-shadow: 0 18px 42px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.14);
  cursor: pointer;
  user-select: none;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

.root-assistant-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 46px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.18);
}

.root-assistant-launcher .root-assistant-launcher-mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2dd4bf, #38bdf8);
  box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.14);
}

.root-assistant-launcher .root-assistant-launcher-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.root-assistant {
  position: fixed;
  right: 30px;
  bottom: 88px;
  width: min(420px, calc(100vw - 60px));
  height: min(580px, calc(100vh - 128px));
  z-index: 10010;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.16);
  background:
    linear-gradient(180deg, rgba(13, 18, 33, 0.88), rgba(7, 12, 24, 0.86)),
    radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.22), transparent 34%);
  box-shadow: 0 28px 80px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.10);
  backdrop-filter: blur(24px) saturate(1.35);
  transform-origin: bottom right;
  transition: transform 180ms ease, opacity 180ms ease, width 180ms ease, height 180ms ease;
}

.root-assistant[data-state="closed"] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.98);
}

.root-assistant[data-state="open"] {
  opacity: 1;
  pointer-events: auto;
}

.root-assistant[data-state="minimized"] {
  height: 68px;
  width: min(300px, calc(100vw - 60px));
}

.root-assistant[data-state="expanded"] {
  width: min(560px, calc(100vw - 60px));
  height: min(72vh, calc(100vh - 110px));
}

.root-assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 12px 0 14px;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.05));
  backdrop-filter: blur(14px);
}

.root-assistant-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.root-assistant-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.32), rgba(56, 189, 248, 0.28));
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.root-assistant-copy {
  min-width: 0;
}

.root-assistant-copy strong {
  display: block;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.root-assistant-copy span {
  display: block;
  font-size: 11px;
  opacity: 0.72;
}

.root-assistant-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.root-assistant-controls .btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.34), 0 1px 4px rgba(0,0,0,0.16);
}

.root-assistant-controls .btn.red { background: #ff5f56; }
.root-assistant-controls .btn.yellow { background: #ffbd2e; }
.root-assistant-controls .btn.green { background: #27c93f; }

.root-assistant-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 14px;
  gap: 14px;
}

.root-assistant[data-state="minimized"] .root-assistant-body {
  display: none;
}

.root-assistant-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.root-assistant-hero strong {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.root-assistant-hero span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  line-height: 1.45;
}

.root-assistant-hero-badge {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: #d7e2ef;
  font-size: 11px;
  white-space: nowrap;
}

.root-assistant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.root-assistant-chip {
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  padding: 9px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

.root-assistant-chip:hover {
  transform: translateY(-1px);
  background: rgba(45, 212, 191, 0.16);
}

.root-assistant-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.root-assistant-message {
  max-width: 84%;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.45;
  font-size: 13px;
  word-break: break-word;
}

.root-assistant-message.is-user {
  align-self: flex-end;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
}

.root-assistant-message.is-root {
  align-self: flex-start;
  background: linear-gradient(145deg, rgba(45, 212, 191, 0.16), rgba(56, 189, 248, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.root-assistant-compose {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

.root-assistant-compose input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
}

.root-assistant-compose input::placeholder {
  color: rgba(255,255,255,0.48);
}

.root-assistant-compose button {
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.82), rgba(56, 189, 248, 0.82));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}

.root-assistant-compose button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

@media (max-width: 960px) {
  #root-assistant-launcher {
    right: 16px;
    bottom: 16px;
  }

  .root-assistant {
    right: 16px;
    bottom: 74px;
    width: min(360px, calc(100vw - 32px));
    height: min(520px, calc(100vh - 104px));
  }
}

@media (max-width: 640px) {
  .root-assistant {
    width: calc(100vw - 24px);
    height: min(58vh, calc(100vh - 90px));
    right: 12px;
    bottom: 72px;
  }

  .root-assistant[data-state="minimized"] {
    width: calc(100vw - 24px);
  }

  .taskbar-user-apps {
    display: none;
  }
}

.task-tray-item {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(7, 12, 24, 0.72);
  color: #fff;
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
  font-size: 11px;
  cursor: pointer;
}

.task-tray-item:hover {
  transform: translateY(-1px);
}

.task-tray-item .task-tray-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #27c93f;
  box-shadow: 0 0 0 6px rgba(39, 201, 63, 0.16);
}

.window-switcher {
  position: fixed;
  inset: auto 24px 120px auto;
  z-index: 9960;
  min-width: 320px;
  max-width: min(500px, calc(100vw - 48px));
  display: none;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(6, 12, 28, 0.82);
  backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}

.window-switcher.open {
  display: grid;
}

.window-switcher-card {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.window-switcher-card strong {
  display: block;
  margin-bottom: 3px;
}

.window-switcher-card small {
  color: rgba(255,255,255,0.66);
}

.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #fff;
  font-weight: 500;
  font-size: 11px;
  margin-left: auto;
  padding: 0 6px;
}

.user-menu .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.user-menu .username {
  white-space: nowrap;
}

body.theme-aurora {
  --desktop-wallpaper: radial-gradient(circle at top left, rgba(20, 184, 166, 0.85), transparent 32%), radial-gradient(circle at 76% 12%, rgba(250, 204, 21, 0.54), transparent 24%), linear-gradient(135deg, #07111f 0%, #143349 45%, #0b1020 100%);
  --window-bg: rgba(7, 17, 31, 0.58);
  --desktop-text: #f8fafc;
}

body.theme-solar {
  --desktop-wallpaper: radial-gradient(circle at 20% 20%, rgba(255, 209, 102, 0.9), transparent 30%), linear-gradient(135deg, #1f1305 0%, #9a3412 42%, #172554 100%);
  --window-bg: rgba(32, 18, 8, 0.52);
  --desktop-text: #fff7ed;
}

body.theme-graphite {
  --desktop-wallpaper: linear-gradient(135deg, #020617 0%, #111827 48%, #374151 100%);
  --window-bg: rgba(2, 6, 23, 0.64);
  --desktop-text: #e5e7eb;
}

body.theme-ocean {
  --desktop-wallpaper: radial-gradient(circle at 50% 8%, rgba(56, 189, 248, 0.74), transparent 34%), linear-gradient(145deg, #082f49 0%, #0f766e 50%, #042f2e 100%);
  --window-bg: rgba(8, 47, 73, 0.58);
  --desktop-text: #ecfeff;
}

.role-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(39, 201, 63, 0.18);
  border: 1px solid rgba(39, 201, 63, 0.25);
  color: #d6ffe0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Dropdown escondido por padrÃ£o */
.user-menu .dropdown {
  display: none;
  position: absolute;
  top: 45px;
  right: 0;
  background: rgba(0,0,0,0.85);
  border-radius: 8px;
  padding: 6px 0;
  flex-direction: column;
  min-width: 140px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

.user-menu .dropdown a {
  padding: 8px 14px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}

.user-menu .dropdown a:hover {
  background: rgba(255,255,255,0.1);
}




/* ===== Apps Manager ===== */
.apps-body {
  padding: 10px;
}

#apps-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-item {
  background: rgba(255,255,255,0.05);
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.app-item:hover {
  background: rgba(255,255,255,0.1);
}

.window#formiproject {
  width: 1180px;
  height: 760px;
  top: 46px;
  left: 60px;
}

.window#workforce-monitor {
  width: 1080px;
  height: 720px;
  top: 70px;
  left: 90px;
}

/* ===== IDE ===== */
.ide-body{
  display:flex;
  gap:12px;
  min-height:520px;
}
.ide-sidebar{
  width:260px;
  background: rgba(255,255,255,0.06);
  border-radius:10px;
  padding:10px;
  overflow:auto;
}
.ide-section-title{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:#ddd;
  margin-bottom:6px;
}
.ide-actions{
  display:flex; gap:6px; margin-top:8px;
}
.btn-xs{
  background: rgba(255,255,255,0.12);
  color:#fff; border:none; border-radius:6px;
  padding:6px 10px; cursor:pointer; font-size:12px;
}
.btn-xs.danger{ background: rgba(255, 80, 80, .35); }
.btn-xs:hover{ filter: brightness(1.1); }

.ide-tree{ font-size:14px; }
.tree-node{
  padding:4px 6px; border-radius:6px; margin:2px 0;
  cursor:pointer; display:flex; align-items:center; gap:6px; color:#fff;
}
.tree-node:hover{ background: rgba(255,255,255,0.08); }
.tree-children{ margin-left:4px; display:none; }
.tree-children.show{ display:block; }
.tree-node.dir i{ color:#facc14; }
.tree-node.file i{ color:#cbd5e1; }

.ide-docs{ display:flex; flex-direction:column; gap:6px; }
.doc-item{
  padding:6px 8px; border-radius:6px; cursor:pointer; background: rgba(255,255,255,0.05);
}
.doc-item:hover{ background: rgba(255,255,255,0.1); }

.ide-main{ flex:1; display:flex; flex-direction:column; }
.ide-tabs{ display:flex; gap:6px; margin-bottom:8px; }
.tab-btn{
  background: rgba(255,255,255,0.12); color:#fff; border:none; border-radius:8px;
  padding:8px 12px; cursor:pointer; font-size:13px;
}
.tab-btn.active{ background:#27c93f; }
.tab-panel{ display:none; }
.tab-panel.show{ display:block; }

.ide-editor-toolbar{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:8px; gap:8px;
}
#ide-current-path{ font-size:12px; opacity:.8; }

.ide-editor{
  width:100%; min-height:420px;
  background: rgba(0,0,0,0.35); color:#fff; border:none; border-radius:10px;
  padding:12px; outline:none; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size:14px; line-height:1.45;
}

.ide-preview-toolbar{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:8px;
}
.ide-preview{
  width:100%; height:460px; background:#fff; border:none; border-radius:10px; overflow:hidden;
}

.ide-chat-messages{
  height:460px; overflow:auto; display:flex; flex-direction:column; gap:8px;
  padding-right:6px;
}
.chat-msg .bubble{
  max-width:80%; padding:10px 14px; border-radius:12px;
  word-wrap:break-word; white-space:pre-wrap;
}
.chat-msg.user{ display:flex; justify-content:flex-end; }
.chat-msg.user .bubble{ background: rgba(200,200,200,0.2); color:#eee; }
.chat-msg.ai{ display:flex; justify-content:flex-start; }
.chat-msg.ai .bubble{ background: rgba(50,50,50,0.6); border-left: 3px solid #27c93f; color:#fff; }

.ide-chat-input{
  display:flex; gap:8px; margin-top:8px; align-items:center;
}
.ide-chat-input input{
  flex:1; border:none; border-radius:12px; padding:10px 14px;
  background: rgba(255,255,255,0.1); color:#fff; font-size:14px; outline:none;
}
.ide-chat-input button{
  border:none; background:#27c93f; color:#fff; border-radius:50%; width:36px; height:36px;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}


/* window maximized sem header */
.window.maximized > .window-header { display: none !important; }
.window.maximized { border-radius: 0 !important; }

/* tray estados */
.task-tray-item { position: relative; }
.task-tray-item.is-open {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.2);
}
.task-tray-item.is-open::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #38bdf8;
}
.task-tray-item.is-maximized {
  background: rgba(99,102,241,0.2);
  border-color: rgba(99,102,241,0.45);
}
.task-tray-item.is-minimized { opacity: 0.6; }
.task-tray-item.is-minimized:hover { opacity: 1; }

/* traffic lights no chip do maximizado */
.tray-win-btns {
  display: none;
  align-items: center;
  gap: 3px;
  margin-right: 3px;
}
.task-tray-item.is-maximized:hover .tray-win-btns { display: flex; }
.tray-wbtn {
  width: 9px; height: 9px; border-radius: 50%;
  border: none; cursor: pointer; padding: 0; flex-shrink: 0;
  transition: filter .12s, transform .12s;
}
.tray-wbtn.red    { background: #ff5f57; }
.tray-wbtn.yellow { background: #ffbd2e; }
.tray-wbtn.green  { background: #27c93f; }
.tray-wbtn:hover  { filter: brightness(1.15); transform: scale(1.12); }

/* ---- Desktop icons (custom web apps) ---- */
#desktop-icons {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.desktop-icon {
  position: absolute;
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 10px;
  cursor: grab;
  pointer-events: all;
  touch-action: none;
  user-select: none;
}
.desktop-icon:hover { background: rgba(255,255,255,0.08); }
.desktop-icon.dragging { cursor: grabbing; background: rgba(255,255,255,0.14); z-index: 50; }
.desktop-icon-glyph {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 22px;
  color: #e2e8f0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}
.desktop-icon-glyph img { width: 26px; height: 26px; object-fit: contain; }
.desktop-icon-label {
  font-size: 11px;
  color: #f1f5f9;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  line-height: 1.2;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---- Custom app icon picker ---- */
.desktop-icon-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin: 6px 0 10px;
}
.desktop-icon-pick {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,.2);
  background: rgba(15,23,42,.4);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
}
.desktop-icon-pick:hover { color: #f1f5f9; border-color: rgba(99,102,241,.4); }
.desktop-icon-pick.active { background: rgba(99,102,241,.25); color: #c7d2fe; border-color: #6366f1; }
.desktop-app-added-fb { font-size: 12px; color: #4ade80; margin-top: 8px; }

/* ---- Lock screen ---- */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lock-screen-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #0b1220 0%, #131c33 55%, #1c2745 100%);
  backdrop-filter: blur(18px);
}
.lock-screen-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: #f8fafc;
  text-align: center;
}
.lock-clock { font-size: 76px; font-weight: 200; letter-spacing: -1px; }
.lock-date { font-size: 16px; color: #cbd5e1; text-transform: capitalize; margin-top: -8px; }
.lock-user { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 28px; }
.lock-avatar { font-size: 64px; color: #94a3b8; }
.lock-username { font-size: 16px; font-weight: 600; }
.lock-form { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.lock-form input {
  width: 220px;
  padding: 10px 14px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 14px;
  outline: none;
  text-align: center;
}
.lock-form input:focus { border-color: #6366f1; background: rgba(255,255,255,0.12); }
.lock-form button {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: #6366f1;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.lock-form button:hover { background: #4f46e5; }
.lock-error { min-height: 18px; font-size: 12px; color: #f87171; }
body.is-locked { overflow: hidden; }

.taskbar-brand-logo-img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }

/* ---- Widget toggle grid (appearance panel) ---- */
.desktop-widget-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.desktop-widget-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(148,163,184,.2);
  background: rgba(15,23,42,.4);
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.desktop-widget-toggle i { font-size: 14px; }
.desktop-widget-toggle:hover { color: #f1f5f9; border-color: rgba(99,102,241,.4); }
.desktop-widget-toggle.active {
  background: rgba(99,102,241,.22);
  color: #c7d2fe;
  border-color: #6366f1;
}

/* Lock screen widgets */
.lock-screen {
  flex-direction: column;
  justify-content: space-between;
  padding: 34px 28px 22px;
}

.lock-screen-bg {
  background:
    radial-gradient(circle at top, rgba(73, 102, 180, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(42, 157, 203, 0.16), transparent 24%),
    linear-gradient(160deg, #0b1220 0%, #131c33 55%, #1c2745 100%);
}

.lock-screen-content {
  width: min(960px, calc(100vw - 48px));
  margin: auto;
}

.lock-widgets {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.lock-widget-kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(155, 184, 255, 0.82);
}

.lock-screen-music-widget {
  position: relative;
  inset: auto;
  right: auto;
  bottom: auto;
  z-index: 2;
  width: min(352px, 100%);
  cursor: default;
  user-select: none;
}

.lock-screen-music-widget .music-mini-cover {
  width: 58px;
  height: 58px;
}

.lock-screen-music-widget .music-mini-meta {
  text-align: left;
}

.lock-screen-music-widget .music-mini-meta strong {
  font-size: 18px;
}

.lock-screen-music-widget .music-mini-meta span:last-child {
  font-size: 13px;
  color: rgba(212, 222, 242, 0.74);
}

.lock-screen-music-widget .music-mini-controls {
  justify-content: flex-end;
}

.lock-screen-music-widget .music-mini-controls button {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.lock-news-footer {
  position: relative;
  z-index: 2;
  width: min(1280px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 16px 18px 14px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(180deg, rgba(10, 16, 29, 0.66), rgba(7, 10, 19, 0.78));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 24px 70px rgba(0,0,0,0.42);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
}

.lock-news-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.lock-news-source {
  font-size: 12px;
  color: rgba(212, 222, 242, 0.7);
}

.lock-news-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.lock-news-pill {
  flex: 0 0 auto;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  color: #eef5ff;
  font-size: 12px;
  line-height: 1.35;
  text-decoration: none;
}


.lock-news-footer .nw-card {
  flex: 0 0 220px;
}

.lock-news-footer .nw-card:hover {
  transform: translateY(-3px);
}

.lock-news-footer .nw-card-img {
  height: 118px;
}

.lock-news-footer .nw-card-title {
  font-size: 13px;
}

.lock-news-footer .nw-card-meta {
  color: rgba(212, 222, 242, 0.68);
}
.lock-news-empty {
  color: rgba(212, 222, 242, 0.72);
  font-size: 12px;
}

@media (max-width: 720px) {
  .lock-screen {
    padding: 24px 16px 16px;
  }

  .lock-screen-content,
  .lock-news-footer {
    width: calc(100vw - 32px);
  }

  .lock-screen-music-widget {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .lock-screen-music-widget .music-mini-meta,
  .lock-screen-music-widget .music-mini-controls {
    justify-content: center;
    text-align: center;
  }
}


.taskbar-user-apps .taskbar-app-btn .taskbar-app-icon-img { width: 18px; height: 18px; object-fit: contain; border-radius: 4px; display: block; }
.task-tray-item .tray-icon-img { width: 16px; height: 16px; object-fit: contain; border-radius: 4px; display: inline-block; }


/* Lock screen refinement: inherit wallpaper, profile avatar, clean news rail */
.lock-screen-bg {
  background-image: var(--desktop-wallpaper-image, var(--desktop-wallpaper, linear-gradient(135deg, #08111f 0%, #10243d 52%, #18384f 100%))) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  filter: none;
}
.lock-screen-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 22%, rgba(15, 23, 42, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(5, 10, 20, 0.34), rgba(5, 10, 20, 0.18));
  pointer-events: none;
}
.lock-avatar {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #94a3b8;
  font-size: 64px;
  background: rgba(15, 23, 42, 0.25);
  border: 2px solid rgba(226, 232, 240, 0.58);
  box-shadow: 0 14px 34px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.14);
}
.lock-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lock-news-footer {
  width: min(1280px, calc(100vw - 48px));
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible !important;
}
.lock-news-head {
  padding: 0 18px 8px;
  margin-bottom: 0 !important;
}
.lock-news-track {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
  overflow: hidden !important;
  padding: 0 18px !important;
  scrollbar-width: none;
}
.lock-news-track::-webkit-scrollbar { display: none; }
.lock-news-footer .nw-card {
  flex: initial !important;
  min-width: 0;
  background: rgba(8, 13, 24, 0.34) !important;
  border-color: rgba(255,255,255,0.08) !important;
  box-shadow: none !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.lock-news-footer .nw-card:nth-child(n+7) { display: none; }
.lock-news-footer .nw-card-img { height: 116px; }
.lock-news-footer .nw-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 1180px) {
  .lock-news-track { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
  .lock-news-footer .nw-card:nth-child(n+5) { display: none; }
}
@media (max-width: 720px) {
  .lock-news-track { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 !important; }
  .lock-news-head { padding-inline: 0; }
  .lock-news-footer .nw-card:nth-child(n+3) { display: none; }
}
