/* =============================================================================
   Desktop redesign — só aplicado em desktop.html (body.layout-desktop)
   Telemóvel continua com styles.css + index.html
   ============================================================================= */

body.layout-desktop {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 107, 0, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(29, 78, 216, 0.08), transparent 50%),
    var(--white);
  min-height: 100vh;
}

body.layout-desktop .center-view {
  background: transparent;
}

/* ---- Auth desktop: hero + card ---- */
.desktop-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
  padding: 48px clamp(24px, 5vw, 72px);
  max-width: 1200px;
  margin: 0 auto;
}

.desktop-auth-hero h1 {
  font-size: clamp(2.2rem, 3.5vw, 3.2rem);
  margin: 16px 0 12px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.desktop-auth-hero > p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 34ch;
  line-height: 1.5;
}

.desktop-auth-points {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.desktop-auth-points li {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--gray);
  border: 1px solid var(--border);
  font-weight: 600;
}

.brand-mark.lg {
  width: 72px;
  height: 72px;
  font-size: 1.6rem;
  border-radius: 18px;
}

.desktop-auth-card {
  width: 100%;
  max-width: 420px;
  margin: 0;
  justify-self: end;
}

.desktop-center-card {
  margin: 48px auto;
}

.desktop-switch-device {
  margin-top: 16px;
  text-align: center;
  font-size: 0.85rem;
}

.desktop-switch-device a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
}

/* ---- App shell: sidebar + main ---- */
.desktop-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 1fr;
  height: 100vh;
  max-height: 100dvh;
  min-height: 0;
}

.desktop-shell.hidden {
  display: none !important;
}

.desktop-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 14px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--white) 92%, var(--gray));
  min-height: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-brand strong {
  display: block;
  font-size: 0.95rem;
}

.sidebar-brand .muted {
  display: block;
  font-size: 0.78rem;
  margin-top: 2px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow: auto;
  border: 0;
  padding: 0;
  background: transparent;
}

.side-nav .nav-item {
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  color: var(--black);
  text-align: left;
}

.side-nav .nav-item .nav-ico {
  width: 22px;
  text-align: center;
}

.side-nav .nav-item:hover {
  background: var(--gray);
}

.side-nav .nav-item.active {
  background: color-mix(in srgb, var(--orange) 16%, var(--white));
  color: var(--orange);
  font-weight: 700;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.side-link {
  border: 0;
  background: transparent;
  color: var(--black);
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

.side-link:hover {
  background: var(--gray);
}

.desktop-main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 0;
  background: transparent;
}

.desktop-topbar {
  padding: 18px 28px 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--white) 88%, transparent);
  backdrop-filter: blur(10px);
  gap: 14px;
}

.desktop-topbar-title-wrap {
  flex: 1;
  min-width: 0;
}

.desktop-eyebrow {
  margin: 0 0 2px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.desktop-topbar h1 {
  text-align: left;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.desktop-content {
  padding: 0;
  background: transparent;
}

body.layout-desktop .screen {
  padding: 24px 28px 40px;
  max-width: 1120px;
}

/* Home / grids */
.desktop-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}

.desktop-home-aside {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 8px;
}

.desktop-aside-card h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.desktop-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.desktop-mini-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  font-size: 0.9rem;
}

.desktop-mini-list li span {
  color: var(--muted);
  font-size: 0.82rem;
}

body.layout-desktop .grid-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

body.layout-desktop .action-card {
  min-height: 110px;
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--white);
}

body.layout-desktop .action-card:hover {
  border-color: color-mix(in srgb, var(--orange) 45%, var(--border));
  transform: translateY(-1px);
}

body.layout-desktop .hero h2 {
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}

body.layout-desktop .list,
body.layout-desktop .card {
  max-width: none;
}

body.layout-desktop .list-row,
body.layout-desktop .card {
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

/* Playbook desktop */
body.layout-desktop .playbook-desktop {
  display: grid;
  gap: 16px;
}

body.layout-desktop .playbook-meta {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

body.layout-desktop .board-layout {
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}

body.layout-desktop .tools {
  flex-direction: column;
  gap: 8px;
}

body.layout-desktop .tool-btn {
  min-height: 44px;
  font-size: 0.78rem;
}

body.layout-desktop .board-wrap {
  min-height: 520px;
  display: grid;
  place-items: center;
}

body.layout-desktop #tactical-canvas {
  max-height: min(72vh, 780px);
  width: auto;
  max-width: 100%;
}

body.layout-desktop .steps-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

/* Forms / profile wider */
body.layout-desktop #screen-add-member,
body.layout-desktop #screen-settings,
body.layout-desktop #screen-notes {
  max-width: 720px;
}

body.layout-desktop .fab {
  right: 36px;
  bottom: 36px;
}

/* Sheet on desktop: centered panel instead of full bleed phone style */
body.layout-desktop .sheet {
  background: var(--modal-scrim);
  padding: 32px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
}

body.layout-desktop .sheet.hidden {
  display: none !important;
}

body.layout-desktop .sheet-head,
body.layout-desktop .sheet-body,
body.layout-desktop .sheet-foot {
  width: min(720px, 100%);
  margin-left: auto;
  margin-right: auto;
  background: var(--white);
}

body.layout-desktop .sheet-head {
  border-radius: 16px 16px 0 0;
  margin-top: 0;
}

body.layout-desktop .sheet-body {
  flex: 0 0 auto;
  max-height: none;
  overflow: visible;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  max-width: 720px;
  padding: 20px 24px 28px;
}

body.layout-desktop .sheet-foot {
  border-radius: 0 0 16px 16px;
  margin-bottom: 24px;
}

body.layout-desktop .sheet {
  flex-direction: column;
}

/* Auth views fill nicely */
body.layout-desktop #view-auth,
body.layout-desktop #view-force-password,
body.layout-desktop #view-create-org {
  background: transparent;
}

@media (max-width: 1100px) {
  .desktop-auth {
    grid-template-columns: 1fr;
    padding-top: 32px;
  }
  .desktop-auth-card {
    justify-self: start;
    max-width: 480px;
  }
  .desktop-shell {
    grid-template-columns: 220px 1fr;
  }
  .desktop-home {
    grid-template-columns: 1fr;
  }
  .desktop-home-aside {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
