/* ==========================================================================
   LUVINA FOLDERWORKS 0.9.1-BETA WEB (app.luvinafilma.mx)
   Clon visual 1:1 de la aplicación de escritorio Luvina FolderWorks BETA 0.9
   Paleta oficial T de folderworks_app.py + Puro Pixel Art .PNG
   ========================================================================== */

:root {
  --black: #171B23;
  --red: #E32946;
  --cream: #FFF2E0;
  --orange: #FFA400;

  --bg: #10141b;
  --side: #141821;
  --panel: #171B23;
  --card: #1d2330;
  --card-hi: #252c3a;
  --row-alt: #1a202b;
  --border: #2c3444;

  --text: #FFF2E0;
  --muted: #b9b3a9;
  --faint: #8d95a3;
  --credit: #6f747c;

  --btn: #d4203d;
  --btn-hover: #ff5c75;
  --btn-press: #9f1730;
  --on-btn: #ffffff;
  --on-hover: #171B23;

  --accent: #ff5c75;
  --ok: #7ee2a8;
  --warn: #FFA400;
  --bad: #ff8a8a;
  --blue: #7fb2ff;
  --hover: #2a2230;
  --sel: #3a1a22;
  --bar-bg: #273041;
  --bar-fg: #E32946;

  --font-mono: 'Consolas', 'Cascadia Mono', 'JetBrains Mono', 'Courier New', monospace;
  --font-title: 'Bahnschrift', 'Oswald', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --font-sans: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

img.pixel-art,
.pixel-sprite,
.kpi-sprite,
.stage-pill img,
.side-brand-fish,
.side-gear-icon {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ==========================================================================
   PANTALLA DE ACCESO OBLIGATORIA (LOGIN CORREO Y CONTRASEÑA)
   ========================================================================== */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, rgba(227, 41, 70, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(227, 41, 70, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 50% 25%, rgba(227, 41, 70, 0.14), transparent 60%);
  background-size: 32px 32px, 32px 32px, 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-overlay.hidden {
  display: none !important;
}

.login-window {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, #1b202b 0%, #151922 100%);
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
  position: relative;
}

.login-window-topbar {
  height: 5px;
  background: var(--red);
  width: 100%;
}

.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--side);
}

.login-brand-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-brand-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  object-position: left center;
}

.login-brand-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
}

.login-brand-fish {
  width: 64px;
  height: auto;
  image-rendering: pixelated;
}

.login-body {
  padding: 20px 24px 22px;
}

.login-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}

.login-field {
  margin-bottom: 12px;
}

.login-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fw-input,
.fw-select,
.fw-textarea {
  width: 100%;
  background: var(--card-hi);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.fw-input:focus,
.fw-select:focus,
.fw-textarea:focus {
  border-color: var(--accent);
}

.fw-textarea {
  min-height: 68px;
  resize: vertical;
}

.login-error {
  color: var(--bad);
  font-size: 11.5px;
  min-height: 18px;
  margin-bottom: 8px;
}

.login-crew-quick {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.login-crew-title {
  font-size: 11px;
  color: var(--faint);
  margin-bottom: 8px;
}

.login-crew-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.login-crew-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}

.login-crew-pill:hover {
  background: var(--hover);
  border-color: var(--accent);
}

.login-crew-pill img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.login-footer {
  padding: 10px 24px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

/* ==========================================================================
   CASCARÓN PRINCIPAL DE LA APP DE ESCRITORIO (SIDEBAR + HEADER + BODY + STRIP)
   ========================================================================== */

.app-shell {
  display: grid;
  grid-template-columns: 216px 1fr;
  grid-template-rows: 82px 1fr 30px;
  width: 100vw;
  height: 100vh;
  background: var(--bg);
}

/* --- BARRA LATERAL IZQUIERDA (SIDEBAR) --- */
.app-sidebar {
  grid-column: 1 / 2;
  grid-row: 1 / 4;
  background: linear-gradient(180deg, #161a24 0%, #12161f 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
  z-index: 20;
}

.side-top {
  display: flex;
  flex-direction: column;
}

.side-brand {
  padding: 14px 16px 12px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.side-brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.side-logo-img {
  height: 22px;
  width: auto;
  object-fit: contain;
  object-position: left center;
}

.side-folderworks-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.06em;
}

.side-brand-fish {
  width: 44px;
  height: auto;
  margin-top: 1px;
}

.side-nav {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
}

.side-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 16px 0 24px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

.side-nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: transparent;
}

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

.side-nav-item.active {
  background: var(--sel);
  color: var(--accent);
}

.side-nav-item.active::before {
  background: var(--red);
}

.side-nav-badge {
  font-size: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 2px;
}

.side-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 16px;
}

.side-actions {
  padding: 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- BOTONES OFICIALES 0.9.1-BETA --- */
.fw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--btn-press);
  background: linear-gradient(180deg, #e32946 0%, #c01b36 100%);
  color: var(--on-btn);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 0.1s ease, background 0.1s ease, color 0.1s ease;
}

.fw-btn:hover {
  background: var(--btn-hover);
  color: var(--on-hover);
  border-color: var(--red);
}

.fw-btn:active {
  background: var(--btn-press);
  color: var(--on-btn);
}

.fw-btn-ghost {
  background: linear-gradient(180deg, #252c3a 0%, #1d2330 100%);
  color: var(--text);
  border: 1px solid var(--border);
}

.fw-btn-ghost:hover {
  background: var(--hover);
  color: var(--text);
  border-color: var(--accent);
}

.fw-btn-sm {
  height: 27px;
  padding: 0 9px;
  font-size: 11.5px;
}

.fw-btn-full {
  width: 100%;
}

.fw-btn img {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

/* --- PARTE INFERIOR DE LA BARRA LATERAL --- */
.side-bottom {
  padding: 0 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-crew-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-crew-top {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.side-crew-avatar {
  width: 30px;
  height: 30px;
  background: var(--panel);
  border: 1px solid var(--red);
  image-rendering: pixelated;
  flex-shrink: 0;
}

.side-crew-info {
  min-width: 0;
  flex: 1;
}

.side-crew-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-crew-mail {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-crew-btns {
  display: flex;
  gap: 4px;
}

.side-mini-btn {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 4px;
  cursor: pointer;
  text-align: center;
}

.side-mini-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--hover);
}

.side-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
}

.side-gear-btn {
  width: 44px;
  height: 32px;
  background: transparent;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.side-gear-btn:hover,
.side-gear-btn.active {
  background: var(--sel);
  border-color: var(--border);
}

.side-gear-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--red);
}

.side-gear-icon {
  width: 22px;
  height: 22px;
}

.side-cloud-dot {
  font-size: 10px;
  color: var(--ok);
  font-family: var(--font-mono);
}

.side-credit {
  font-size: 10.5px;
  color: var(--credit);
  padding-left: 2px;
}

.side-beta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 24px;
  border: 1px solid var(--orange);
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   ENCABEZADO SUPERIOR (HEAD)
   ========================================================================== */

.app-head {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  background: linear-gradient(180deg, #1b202b 0%, #171B23 100%);
  border-bottom: 1px solid var(--border);
  padding: 0 18px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.head-left {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.head-red-bar {
  width: 7px;
  height: 44px;
  background: var(--red);
  margin-top: 2px;
  flex-shrink: 0;
}

.head-titles {
  display: flex;
  flex-direction: column;
}

.head-title {
  font-family: var(--font-title);
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.head-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.head-hook-btn {
  width: 32px;
  height: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.head-hook-btn:hover {
  border-color: var(--accent);
  background: var(--hover);
}

.head-hook-btn img {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
}

/* ==========================================================================
   CUERPO PRINCIPAL (BODY) Y PANELES DE ESCRITORIO
   ========================================================================== */

.app-body {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  background-color: var(--panel);
  background-image:
    linear-gradient(to right, rgba(227, 41, 70, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(227, 41, 70, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  padding: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.page-view {
  display: none;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.page-view.active {
  display: flex;
}

/* --- TARJETAS KPI SUPERIORES (GCARD) --- */
.kpi-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  flex-shrink: 0;
}

.gcard {
  height: 112px;
  background: linear-gradient(180deg, #222836 0%, #1a202c 100%);
  border: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  transition: border-color 0.12s ease;
}

.gcard:hover {
  border-color: var(--accent);
}

.gcard-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-width: 0;
  flex: 1;
  padding-right: 8px;
}

.gcard-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.gcard-sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gcard-value {
  font-family: var(--font-mono);
  font-size: 25px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-top: auto;
}

.gcard-sprite {
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

/* --- PANEL OFICIAL (panel() de folderworks_app.py) --- */
.fw-panel {
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.fw-panel-projects-main {
  flex: 1;
  min-height: 230px;
}

.fw-panel-head {
  height: 42px;
  padding: 0 14px;
  background: linear-gradient(180deg, #202634 0%, #1b202c 100%);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-shrink: 0;
}

.fw-panel-head-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-top: 9px;
}

.fw-panel-title {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.fw-panel-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.fw-panel-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: center;
}

.fw-tab-pill {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  cursor: pointer;
}

.fw-tab-pill.active {
  background: var(--sel);
  color: var(--text);
  border-color: var(--red);
}

.fw-panel-body {
  flex: 1;
  background: var(--card);
  padding: 4px 10px 8px 10px;
  overflow-y: auto;
  min-height: 0;
}

/* --- TABLA DE PROYECTOS Y COTIZACIONES --- */
.fw-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
}

.fw-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fw-table td {
  padding: 6px 8px;
  vertical-align: middle;
  height: 46px;
  font-size: 12.5px;
  color: var(--text);
}

.fw-table tbody tr {
  background: var(--card);
  transition: background 0.08s ease;
}

.fw-table tbody tr:nth-child(even) {
  background: var(--row-alt);
}

.fw-table tbody tr:hover {
  background: var(--hover);
}

.proj-cell-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}

.proj-cell-name {
  font-size: 13px;
  color: var(--text);
}

.proj-cell-sub {
  font-size: 12px;
  color: var(--text);
}

.quote-hook-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
}

.quote-hook-cell img {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
}

/* --- PILLS DE ETAPA CON DEGRADADO Y SPRITE (Pill class de folderworks_app.py) --- */
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 186px;
  height: 34px;
  padding: 0 10px 0 6px;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-mono);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: filter 0.12s ease;
}

.stage-pill:hover {
  filter: brightness(1.1);
}

.stage-pill img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.stage-pill-texts {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.stage-pill-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
}

.stage-pill-sub {
  font-size: 10px;
  color: #f4f4f4;
}

.pill-pro {
  background: linear-gradient(180deg, #e04258 0%, #c8253c 100%);
}

.pill-entregado,
.pill-pagado {
  background: linear-gradient(180deg, #35a862 0%, #248148 100%);
}

.pill-pre {
  background: linear-gradient(180deg, #2b8a9e 0%, #1d6475 100%);
}

.pill-post {
  background: linear-gradient(180deg, #d87a22 0%, #a85810 100%);
}

.pill-revision,
.pill-activa {
  background: linear-gradient(180deg, #3c6ec4 0%, #294e93 100%);
}

.pill-escapada {
  background: linear-gradient(180deg, #525968 0%, #3a404d 100%);
}

/* --- CELDA DE RESPALDO (WIP / Backup) --- */
.backup-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
}

.backup-cell img {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
}

.backup-wip {
  color: var(--blue);
}

.backup-safe {
  color: var(--muted);
}

.actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- FILA INFERIOR DE 3 PANELES EN INICIO (TRAYECTORIAS, ACTIVIDAD, UNIDADES) --- */
.inicio-bottom-3 {
  display: grid;
  grid-template-columns: 40fr 35fr 25fr;
  gap: 12px;
  height: 222px;
  flex-shrink: 0;
}

.chart-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#trayectoriasCanvas {
  width: 100%;
  height: 164px;
  display: block;
}

.recent-log-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 2px 4px;
}

.recent-log-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-log-time {
  color: var(--accent);
  flex-shrink: 0;
}

.recent-log-text {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}

.drives-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 4px;
}

.drive-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drive-item img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.drive-item-body {
  flex: 1;
  min-width: 0;
}

.drive-item-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.drive-bar-track {
  width: 100%;
  height: 4px;
  background: var(--bar-bg);
  overflow: hidden;
}

.drive-bar-fill {
  height: 100%;
}

.drives-freeable {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
}

.drives-freeable-title {
  color: var(--muted);
  margin-bottom: 2px;
}

.drives-freeable-item {
  color: var(--ok);
  font-weight: 700;
  padding-left: 6px;
}

.drives-freeable-note {
  color: var(--faint);
  font-size: 10px;
  margin-top: 3px;
}

/* ==========================================================================
   FRANJA INFERIOR DE ALMACENAMIENTO (STRIP)
   ========================================================================== */

.app-strip {
  grid-column: 2 / 3;
  grid-row: 3 / 4;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  user-select: none;
}

.strip-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.strip-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.strip-drives {
  display: flex;
  align-items: center;
  gap: 20px;
}

.strip-drive {
  display: flex;
  flex-direction: column;
  width: 148px;
  gap: 2px;
}

.strip-drive-text {
  font-size: 10px;
  color: var(--text);
}

.strip-drive-bar {
  width: 100%;
  height: 4px;
  background: var(--bar-bg);
}

.strip-drive-fill {
  height: 100%;
}

.strip-credit {
  font-size: 10.5px;
  color: var(--credit);
}

/* ==========================================================================
   VISTAS SECUNDARIAS (COTIZADOR 4 PASOS, AGENDA, CLIENTES, ENTREGAS, MODALES)
   ========================================================================== */

.split-2-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.split-cotiz-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.wizard-steps-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.wizard-step-card {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.wizard-step-card.active {
  background: var(--sel);
  border-color: var(--red);
}

.wizard-step-card img {
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* --- MODALES FLOTANTES --- */
.fw-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(10, 12, 18, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.fw-modal-backdrop.open {
  display: flex;
}

.fw-modal {
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  background: var(--card);
  border: 1px solid var(--red);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
}

.fw-modal-head {
  padding: 10px 16px;
  background: var(--side);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fw-modal-title {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
}

.fw-modal-body {
  padding: 16px;
  overflow-y: auto;
}

.personajes-20-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.personaje-option {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  text-align: center;
}

.personaje-option:hover,
.personaje-option.selected {
  background: var(--sel);
  border-color: var(--red);
}

.personaje-option img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

/* --- TOAST FLOTANTE ESTILO 0.9.1-BETA --- */
.fw-toast {
  position: fixed;
  bottom: 44px;
  left: calc(216px + (100vw - 216px) / 2);
  transform: translateX(-50%);
  background: var(--card-hi);
  border: 2px solid var(--ok);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 9px 18px;
  z-index: 6000;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
  display: none;
}

.fw-toast.show {
  display: block;
}

/* Scrollbars sutiles oscuros */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--card);
}
::-webkit-scrollbar-thumb {
  background: var(--card-hi);
  border: 1px solid var(--border);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border);
}

.hidden {
  display: none !important;
}

/* --- ALIASES 1:1 PARA DASHBOARD INICIO (KPIs HORIZONTALES + 3 PANELES INFERIORES) --- */
.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 12px;
}

.kpi-card {
  height: 108px;
  background: linear-gradient(180deg, #222836 0%, #1a202c 100%);
  border: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  transition: border-color 0.12s ease;
}

.kpi-card:hover {
  border-color: var(--accent);
}

.kpi-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-width: 0;
  flex: 1;
  padding-right: 8px;
}

.kpi-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.kpi-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-num {
  font-family: var(--font-mono);
  font-size: 25px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-top: auto;
}

.kpi-sprite {
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.projects-panel {
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.panel-header {
  height: 42px;
  padding: 0 14px;
  background: linear-gradient(180deg, #202634 0%, #1b202c 100%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.panel-title small {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}

.bottom-grid-3 {
  display: grid;
  grid-template-columns: 40fr 35fr 25fr;
  gap: 12px;
  min-height: 224px;
}

.bottom-panel {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bottom-panel .panel-title {
  margin-bottom: 8px;
}

.actividad-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.actividad-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.act-time {
  color: var(--accent);
  flex-shrink: 0;
}

.act-msg {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}

.unidades-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.unidad-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.unidad-top {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
}

.unidad-icon {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.unidad-bar-bg {
  width: 100%;
  height: 5px;
  background: var(--bar-bg);
  overflow: hidden;
}

.unidad-bar-fill {
  height: 100%;
}

.unidad-footer {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: var(--muted);
}

.liberar-link {
  color: var(--ok);
  font-weight: 700;
  margin-top: 2px;
}

.liberar-note {
  color: var(--faint);
  font-size: 10px;
  margin-top: 2px;
}

.btn-fw-action {
  background: var(--card-hi);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-fw-action:hover {
  border-color: var(--accent);
}

.btn-fw-action.primary {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
}

.btn-fw-action img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}
