@charset "UTF-8";

/* Cromo Launchpad (ondas vectoriales + cristal). Las pantallas de cada app
   conservan clases y comportamiento; esto solo cambia el aspecto. */

:root {
  --topbar: 84px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --text: #f7fbff;
  --navy: #f7fbff;
  --navy-deep: #e2e6fa;
  --ink: #f7fbff;
  --muted: #d0dee9;
  --quiet: #b6cad8;
  --glass: rgba(218, 241, 255, 0.09);
  --glass-edge: rgba(231, 248, 255, 0.22);
  --glass-hover: rgba(235, 248, 255, 0.16);
  --bg: transparent;
  --card: rgba(16, 38, 56, 0.42);
  --line: rgba(231, 248, 255, 0.22);
  --accent: #91e5c6;
  --lavender: rgba(218, 241, 255, 0.16);
  --lavender-soft: rgba(218, 241, 255, 0.1);
}

html[data-theme="light"] {
  color-scheme: light;
  --text: #183950;
  --navy: #183950;
  --navy-deep: #13263e;
  --ink: #183950;
  --muted: #36566a;
  --quiet: #476378;
  --glass: rgba(250, 255, 255, 0.3);
  --glass-edge: rgba(255, 255, 255, 0.55);
  --glass-hover: rgba(255, 255, 255, 0.45);
  --bg: transparent;
  --card: rgba(250, 255, 255, 0.55);
  --line: rgba(255, 255, 255, 0.55);
  --accent: #1a6b5c;
  --lavender: rgba(255, 255, 255, 0.45);
  --lavender-soft: rgba(255, 255, 255, 0.32);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #17354c;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.wallpaper {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: #1d3953;
}

.wallpaper-art {
  position: absolute;
  inset: 0;
  background: url("wallpaper.svg") center center / cover no-repeat;
  transition: filter 0.65s, opacity 0.65s;
}

.wallpaper-wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(3, 20, 43, 0.27), rgba(13, 32, 50, 0.12) 56%, rgba(31, 28, 72, 0.18));
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.012;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' opacity='.6' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}

html[data-theme="light"] .wallpaper-art {
  filter: brightness(1.45) saturate(0.65);
}

html[data-theme="light"] .wallpaper-wash {
  background: linear-gradient(120deg, #e2f2faaf, #e5f5f19c 55%, #e9eafda0);
}

.shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 32px;
}

.topbar,
html[data-theme="dark"] .topbar,
html[data-theme="light"] .topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: auto;
  min-height: var(--topbar);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 12px 0;
  background: transparent;
  color: var(--text);
  border-bottom: none;
}

.brand {
  display: flex;
  align-items: center;
  color: var(--text);
  font-size: 28px;
  letter-spacing: -1.6px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  gap: 0;
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-wordmark:hover { color: inherit; text-decoration: none; }

button.brand-switch {
  cursor: pointer;
  flex-shrink: 0;
  font: inherit;
}

.brand-switch {
  width: 33px;
  height: 19px;
  border-radius: 20px;
  background: #e6f5f323;
  margin: 6px 0 0 3px;
  border: 1px solid #eefcff90;
  box-shadow: inset 0 1px 3px #ffffff21;
  display: flex;
  align-items: center;
  padding: 3px;
}

.brand-switch i {
  display: block;
  width: 11px;
  height: 11px;
  background: #f0fcfa;
  border-radius: 50%;
  box-shadow: 0 1px 5px #081e4330;
  transform: translateX(13px);
  transition: transform 0.3s;
}

html[data-theme="light"] .brand-switch {
  border-color: #264e6a80;
  background: #40647c22;
}

html[data-theme="light"] .brand-switch i {
  background: #254f65;
  transform: translateX(0);
}

.header-divider {
  height: 19px;
  width: 1px;
  background: #d8efff2b;
}

html[data-theme="light"] .header-divider { background: #2c52652b; }

.portal-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.1px;
  font-weight: 500;
}

.chrome-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
  align-items: center;
}

.chrome-nav a,
.chrome-nav .sg-nav-link,
.chrome-nav .tabbtn {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  border: 0;
}

.chrome-nav a:hover,
.chrome-nav a.is-active,
.chrome-nav a.active,
.chrome-nav .sg-nav-link.is-active,
.chrome-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--glass);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar time {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 #ffffff15, 0 6px 24px #0821300a;
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
}

.icon-button:hover {
  background: var(--glass-hover);
  transform: rotate(12deg);
}

.icon-button svg {
  width: 17px;
  height: 17px;
  display: block;
}

.workspace-badge {
  display: grid;
  place-items: center;
  position: relative;
  width: 35px;
  height: 35px;
  border: 1px solid #e6f2fe59;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: inherit;
  text-decoration: none;
  background: linear-gradient(140deg, #bcdcd536, #c6beed26);
}

.workspace-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #91e5c6;
  border-radius: 50%;
  right: -1px;
  bottom: 0;
  border: 1px solid #345366;
}

.account-link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.account-link:hover {
  background: var(--glass-hover);
  text-decoration: none;
}

.role-badge {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
  text-transform: capitalize;
}

.page,
.sg-wrap,
.calc-wrap,
.wrap {
  flex: 1;
  padding: 12px 0 48px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

h1, h2, h3 { color: var(--text); }

.search-bar,
.card,
.dashboard-card,
.table-wrap,
.empty,
.modal-card,
.admin-block {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 #ffffff15, 0 8px 28px #08213014;
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.panel,
.calc-panel,
.sg-side,
.sg-article,
.form-grid,
.report,
.help-box,
.create-panel {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 #ffffff15, 0 8px 28px #08213014;
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.tab,
.tabs a {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  color: var(--text);
}

.tab.is-active,
.tabs a.is-active,
.tabs a:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--text);
}

.btn-primary,
.btn.primary,
.button-primary {
  background: rgba(145, 229, 198, 0.92);
  color: #13263e;
  border-color: transparent;
}

html[data-theme="dark"] .btn-primary,
html[data-theme="light"] .btn-primary,
html[data-theme="dark"] .btn.primary,
html[data-theme="light"] .btn.primary {
  color: #13263e;
}

.btn-secondary,
.btn-ghost,
.button-secondary,
.btn {
  background: var(--glass);
  border-color: var(--glass-edge);
  color: var(--text);
}

.accion-btn {
  background: var(--glass);
  border-color: var(--glass-edge);
  color: var(--text);
}

.accion-btn:hover:not(:disabled) {
  background: var(--glass-hover);
  border-color: var(--accent);
}

input, select, textarea {
  background: rgba(7, 24, 38, 0.35);
  border-color: var(--glass-edge);
  color: var(--text);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: rgba(255, 255, 255, 0.55);
}

.modal::backdrop,
dialog::backdrop { background: rgba(7, 20, 32, 0.45); }

.data-table th {
  background: transparent;
  color: var(--muted);
}

.data-table tr:hover td {
  background: var(--glass-hover);
}

/* Planning: sidebar bajo la topbar launchpad */
.shell > .app {
  flex: 1;
  min-height: 0;
  width: 100%;
}

.shell .sidebar,
html[data-theme="dark"] .shell .sidebar {
  top: var(--topbar);
  height: calc(100% - var(--topbar));
  background: rgba(16, 38, 56, 0.72);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  border-right: 1px solid var(--glass-edge);
}

html[data-theme="light"] .shell .sidebar {
  background: rgba(250, 255, 255, 0.72);
  color: var(--text);
}

html[data-theme="light"] .shell .sidebar .nav-item,
html[data-theme="light"] .shell .sidebar .subtitle,
html[data-theme="light"] .shell .sidebar-back,
html[data-theme="light"] .shell .sidebar-footer {
  color: inherit;
}

.shell .sidebar-toggle {
  top: calc(var(--topbar) + 14px);
}

.shell .main {
  background: transparent;
}

.page-visor {
  max-width: none;
  width: calc(100% + 64px);
  margin-left: -32px;
  margin-right: -32px;
  padding: 0;
}

@media (max-width: 900px) {
  .shell { padding: 0 18px; }
  .topbar { gap: 12px; }
  .portal-label { display: none; }
  .header-divider { display: none; }
  .topbar time { display: none; }
  .brand { font-size: 24px; }
  .chrome-nav { width: 100%; order: 3; }
}

@media (max-width: 600px) {
  .workspace-badge { display: none; }
  .role-badge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wallpaper-art, .brand-switch i, .icon-button { transition: none; }
}
