/* ═══════════════════════════════════════════════════════════════════
   TEMA "ESCRITORIO" — estilo programa de Windows clásico (VB6 / .NET)
   Archivo UNIVERSAL: se activa con <html data-theme="escritorio">.
   Todo lo estético son PROPIEDADES de la sección 1: se cambia ahí y
   se actualiza en toda la app. Las secciones 2 en adelante solo usan
   esas propiedades (no tienen colores propios).
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. PROPIEDADES (editar aca) ─────────────────────────────────── */
html[data-theme="escritorio"]{
  color-scheme:light;

  /* Colores de superficie */
  --esc-face:#d4d0c8;          /* fondo de formulario / cara de boton */
  --esc-window:#ffffff;        /* fondo de cajas de texto y listas */
  --esc-grid:#c0c0c0;          /* lineas de grilla */

  /* Barra de titulo */
  --esc-title-bg:#0a246a;
  --esc-title-bg2:#a6caf0;
  --esc-title-fg:#ffffff;

  /* Seleccion (fila resaltada) */
  --esc-select-bg:#0a246a;
  --esc-select-fg:#ffffff;

  /* Bordes de relieve */
  --esc-hi:#ffffff;
  --esc-mid:#808080;
  --esc-dark:#404040;
  --esc-black:#000000;

  /* Tipografia y tamaños de controles */
  --esc-font:Tahoma,"Segoe UI","MS Sans Serif",Arial,sans-serif;
  --esc-font-size:13px;
  --esc-ctrl-h:32px;           /* alto de botones y cajas */
  --esc-pad-x:14px;            /* relleno horizontal de botones */

  /* Relieves (no tocar salvo que cambies el estilo 3D) */
  --esc-raised:var(--esc-hi) var(--esc-black) var(--esc-black) var(--esc-hi);
  --esc-sunken:var(--esc-mid) var(--esc-hi) var(--esc-hi) var(--esc-mid);
  --esc-sh-raised:inset -1px -1px var(--esc-mid), inset 1px 1px var(--esc-face);
  --esc-sh-sunken:inset 1px 1px var(--esc-dark), inset -1px -1px var(--esc-face);

  /* Se redefinen los tokens que ya usa toda la app */
  --bg:var(--esc-face);
  --surface:var(--esc-window);
  --card:var(--esc-face);
  --border:var(--esc-mid);
  --border-hi:var(--esc-dark);
  --text:#000000;
  --muted:#404040;
  --muted2:#808080;
  --accent:var(--esc-title-bg);
  --accent-dim:rgba(10,36,106,.12);
  --accent-border:rgba(10,36,106,.45);
  --danger:#a00000;
  --ok:#006400;
  --top-h:44px;
}

/* ── 2. BASE ─────────────────────────────────────────────────────── */
html[data-theme="escritorio"]{font-size:var(--esc-font-size);}
html[data-theme="escritorio"] body{font-family:var(--esc-font);}
html[data-theme="escritorio"] .page.entering{animation:none;}

/* ── 3. BARRA DE TITULO (superior) ───────────────────────────────── */
html[data-theme="escritorio"] :is(.topbar,.detail-topbar){
  background:linear-gradient(90deg,var(--esc-title-bg),var(--esc-title-bg2));
  backdrop-filter:none;
  border-bottom:2px solid var(--esc-black);
}
html[data-theme="escritorio"] :is(.topbar-title,.detail-topbar-title){
  color:var(--esc-title-fg);font-size:var(--esc-font-size);
  letter-spacing:0;text-transform:none;font-weight:700;
}
html[data-theme="escritorio"] :is(.topbar-back,.btn-icon){color:var(--esc-title-fg);border-radius:0;}
html[data-theme="escritorio"] :is(.topbar-back,.btn-icon):hover{background:rgba(255,255,255,.22);color:var(--esc-title-fg);}

/* ── 4. BARRA INFERIOR (pestañas / estado) ───────────────────────── */
html[data-theme="escritorio"] .nav-bottom{
  background:var(--esc-face);border-top:2px solid var(--esc-hi);
  box-shadow:0 -1px 0 var(--esc-mid);
}
html[data-theme="escritorio"] .nav-bottom a{
  color:var(--text);letter-spacing:0;text-transform:none;font-size:11px;
}
html[data-theme="escritorio"] .nav-bottom a.active{
  color:var(--text);font-weight:700;background:var(--esc-window);
  border-top-color:var(--esc-title-bg);
}

/* ── 5. BOTONES con relieve ──────────────────────────────────────── */
html[data-theme="escritorio"] :is(.btn-primary,.btn-secondary,.btn-danger,.btn-add-linea,.pg-btn,.chip,.fab,.mcard){
  background:var(--esc-face);color:var(--text);
  border:2px solid;border-color:var(--esc-raised);border-radius:0;
  box-shadow:var(--esc-sh-raised);
  font-family:var(--esc-font);font-size:var(--esc-font-size);
  font-weight:400;letter-spacing:0;text-transform:none;
  transition:none;
}
html[data-theme="escritorio"] :is(.btn-primary,.btn-secondary,.btn-danger,.btn-add-linea,.pg-btn){
  min-height:var(--esc-ctrl-h);padding:3px var(--esc-pad-x);
}
html[data-theme="escritorio"] .btn-primary{font-weight:700;outline:1px solid var(--esc-black);outline-offset:-1px;}
html[data-theme="escritorio"] .btn-danger{color:var(--danger);}
html[data-theme="escritorio"] :is(.btn-primary,.btn-secondary,.btn-danger,.btn-add-linea,.pg-btn,.chip,.fab,.mcard):hover{
  background:#e2dfd8;color:var(--text);border-color:var(--esc-raised);
}
html[data-theme="escritorio"] :is(.btn-primary,.btn-secondary,.btn-danger,.btn-add-linea,.pg-btn,.chip,.fab,.mcard):active,
html[data-theme="escritorio"] :is(.chip.active,.pg-btn.active){
  border-color:var(--esc-black) var(--esc-hi) var(--esc-hi) var(--esc-black);
  box-shadow:var(--esc-sh-sunken);transform:none;
  background:var(--esc-face);color:var(--text);font-weight:700;
}
html[data-theme="escritorio"] .chip{padding:2px 10px;}
html[data-theme="escritorio"] .fab{width:44px;height:44px;border-radius:0;}
html[data-theme="escritorio"] .mcard::after,
html[data-theme="escritorio"] .mcard:hover::after{display:none;}
html[data-theme="escritorio"] .mc-icon,
html[data-theme="escritorio"] .mc-icon svg{color:var(--esc-title-bg);stroke:var(--esc-title-bg);}
html[data-theme="escritorio"] .mc-label{color:var(--text);font-weight:700;}

/* ── 6. CAMPOS DE TEXTO (hundidos) ───────────────────────────────── */
html[data-theme="escritorio"] :is(.search-input,.field input,.field select,.field textarea,.det-add-row input,.det-add-row select){
  background:var(--esc-window);color:var(--text);
  border:2px solid;border-color:var(--esc-sunken);border-radius:0;
  box-shadow:var(--esc-sh-sunken);
  font-family:var(--esc-font);font-size:var(--esc-font-size);
  min-height:var(--esc-ctrl-h);
}
html[data-theme="escritorio"] :is(.search-input,.field input,.field select,.field textarea,.det-add-row input,.det-add-row select):focus{
  outline:1px dotted var(--esc-black);outline-offset:-4px;
  border-color:var(--esc-sunken);
}
html[data-theme="escritorio"] .field label{color:var(--text);letter-spacing:0;text-transform:none;font-size:12px;}

/* ── 7. LISTAS / GRILLAS ─────────────────────────────────────────── */
html[data-theme="escritorio"] :is(.list-header,.art-list-header,.cli-list-header,.prov-list-header,.ped-list-header){
  background:var(--esc-face);color:var(--text);
  border:2px solid;border-color:var(--esc-raised);
  letter-spacing:0;text-transform:none;font-weight:700;
}
html[data-theme="escritorio"] :is(.art-row,.cli-row,.prov-row,.ped-row){
  background:var(--esc-window);color:var(--text);
  border-bottom:1px solid var(--esc-grid);border-radius:0;
}
html[data-theme="escritorio"] :is(.art-row,.cli-row,.prov-row,.ped-row):hover{
  background:var(--esc-select-bg);color:var(--esc-select-fg);
}
html[data-theme="escritorio"] :is(.art-row,.cli-row,.prov-row,.ped-row):hover *{
  color:var(--esc-select-fg);
}

/* ── 8. TABLAS DE DETALLE ────────────────────────────────────────── */
html[data-theme="escritorio"] :is(.ped-detail-table,.det-table,.detail-table){
  background:var(--esc-window);border-collapse:collapse;
}
html[data-theme="escritorio"] :is(.ped-detail-table,.det-table,.detail-table) th{
  background:var(--esc-face);color:var(--text);
  border:2px solid;border-color:var(--esc-raised);
  letter-spacing:0;text-transform:none;font-weight:700;
}
html[data-theme="escritorio"] :is(.ped-detail-table,.det-table,.detail-table) td{
  border:1px solid var(--esc-grid);color:var(--text);
}

/* ── 9. VENTANAS (modales y paneles) ─────────────────────────────── */
html[data-theme="escritorio"] .modal-overlay{background:rgba(0,0,0,.35);backdrop-filter:none;}
html[data-theme="escritorio"] .modal-box,
html[data-theme="escritorio"] .detail-panel{
  background:var(--esc-face);color:var(--text);
  border:2px solid;border-color:var(--esc-raised);border-radius:0;
  box-shadow:var(--esc-sh-raised),3px 3px 0 rgba(0,0,0,.45);
}
html[data-theme="escritorio"] .modal-title{
  background:linear-gradient(90deg,var(--esc-title-bg),var(--esc-title-bg2));
  color:var(--esc-title-fg);padding:4px 8px;
  font-size:var(--esc-font-size);font-weight:700;letter-spacing:0;text-transform:none;
}
html[data-theme="escritorio"] :is(.detail-label,.detail-section-title){color:var(--esc-dark);letter-spacing:0;text-transform:none;}

/* ── 10. AVISOS, ETIQUETAS Y BARRAS DE DESPLAZAMIENTO ────────────── */
html[data-theme="escritorio"] .toast{
  background:var(--esc-face);color:var(--text);
  border:2px solid;border-color:var(--esc-raised);border-radius:0;
  box-shadow:var(--esc-sh-raised),2px 2px 0 rgba(0,0,0,.45);
}
html[data-theme="escritorio"] :is(.ped-badge,.ped-badge-ok,.ped-badge-pend,.ped-badge-otro){
  border:1px solid var(--esc-mid);border-radius:0;background:var(--esc-window);color:var(--text);
}
html[data-theme="escritorio"] ::-webkit-scrollbar{width:16px;height:16px;}
html[data-theme="escritorio"] ::-webkit-scrollbar-track{background:#e8e6e0;}
html[data-theme="escritorio"] ::-webkit-scrollbar-thumb{
  background:var(--esc-face);border:2px solid;border-color:var(--esc-raised);
}

/* ── 11. AJUSTES DE FORMA (nada redondeado, como un programa de escritorio) ── */
html[data-theme="escritorio"] .mc-icon{
  border-radius:0;background:var(--esc-window);
  border:2px solid;border-color:var(--esc-sunken);box-shadow:var(--esc-sh-sunken);
}
html[data-theme="escritorio"] .mcard{border-width:2px;}
html[data-theme="escritorio"] *{border-radius:0;}
html[data-theme="escritorio"] .spin{border-radius:50%;}
