/* Touch-first workshop layer (tablets and phones). Loaded after the other workshop styles. */
#tech-app .tech-bottom-nav{display:none}
#tech-app .tech-bottom-count[hidden]{display:none}

.tech-sync-banner{position:sticky;top:12px;z-index:30;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px;padding:10px 12px 10px 14px;border:1px solid #f1c27d;border-left:4px solid #d97706;border-radius:12px;background:#fff8ec;color:#5c3b00;box-shadow:0 6px 18px #1233491a}
.tech-sync-banner span{font-size:13px;line-height:1.45}
.tech-sync-banner b{display:block;font-size:14px;color:#4a2f00}
.tech-sync-banner .btn{flex:none;min-height:44px}
.tech-sync-banner[data-state="offline"]{border-color:#cbd5e1;border-left-color:#475569;background:#f1f5f9;color:#334155}
.tech-sync-banner[data-state="offline"] b{color:#1e293b}
#tech-refresh[aria-busy="true"]{cursor:progress;opacity:.75}

.tech-dialog.workshop-sale-dialog{width:min(520px,95vw);color:#183247}
.workshop-sale-dialog .tech-dialog-head{padding:10px 16px}
.workshop-sale-dialog .tech-dialog-head h2{font-size:20px}
.workshop-sale-dialog .tech-dialog-body{padding:0 16px 16px}
.tech-dialog .workshop-sale-form{display:grid;gap:12px;margin:0}
.tech-dialog .workshop-sale-form label{display:grid;gap:5px;min-width:0;font-size:13px;font-weight:650;color:#29445d}
.tech-dialog .workshop-sale-form :is(input,select,textarea){box-sizing:border-box;min-width:0;width:100%;margin:0;min-height:44px;padding:10px 12px;border:1px solid #becfdb;border-radius:10px;background:#fbfdff;color:#183247;font:inherit;font-size:16px}
.tech-dialog .workshop-sale-form :is(input,select,textarea):focus-visible{outline:3px solid #087e8b33;outline-offset:1px;border-color:#087e8b}
.workshop-sale-form .workshop-sale-intro{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0;font-size:12px;color:#526b7e}
.workshop-sale-intro span{padding:4px 8px;border-radius:20px;background:#e8f4f3;color:#075e69;font-weight:700}
.workshop-sale-form .workshop-sale-amounts{display:grid;grid-template-columns:minmax(80px,.65fr) minmax(0,1.35fr);gap:12px}
.workshop-sale-form [data-catalog]{font-size:12px;font-weight:400;color:#526b7e;overflow-wrap:anywhere}
.workshop-sale-notes{border:1px solid #dbe5ed;border-radius:10px;padding:0 12px}
.workshop-sale-notes summary{min-height:44px;align-content:center;cursor:pointer;font-size:13px;font-weight:650;color:#33566a}
.workshop-sale-notes summary span{margin-left:6px;color:#607589;font-size:12px;font-weight:400}
.workshop-sale-notes[open]{padding-bottom:12px}
.workshop-sale-notes[open] summary{margin-bottom:4px}
.workshop-sale-form .workshop-sale-hint{margin:0;color:#526b7e;font-size:12px;line-height:1.4}
.workshop-sale-form .workshop-sale-footer{position:sticky;bottom:0;z-index:3;display:grid;gap:10px;margin:0 -16px -16px;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));border-top:1px solid #dbe5ed;background:#fff;box-shadow:0 -5px 16px #16324c08}
.workshop-sale-summary>div{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.workshop-sale-summary>div>span{font-size:13px;font-weight:650;color:#526b7e}
.workshop-sale-summary strong{font-size:26px;letter-spacing:-.7px;color:#075e69}
.workshop-sale-summary>small{display:block;color:#526b7e;font-size:12px;margin-top:3px}
.tech-dialog .workshop-sale-form .workshop-sale-footer button{width:100%;min-height:48px;white-space:normal;background:#087e8b;color:#fff;border:1px solid #087e8b;border-radius:12px;font-size:15px;font-weight:750;box-shadow:none}
.tech-dialog .workshop-sale-form .workshop-sale-footer button:hover{background:#066975}
.workshop-sale-form .workshop-sale-footer button:disabled{opacity:.6;cursor:progress}
.workshop-sale-form [role="alert"]{margin:0;color:#b42318;overflow-wrap:anywhere;font-size:13px;line-height:1.4}
.workshop-sale-form [role="alert"]:empty{display:none}

.intake-wizard footer [data-error]{flex-basis:100%;margin:0;font-size:14px;line-height:1.45}
.intake-wizard footer [data-error]:empty{display:none}

.tech-photo-preview{grid-column:1/-1;display:flex;align-items:center;gap:12px;margin:-4px 0 14px;padding:8px 10px;border:1px solid #d6e4eb;border-radius:10px;background:#f5fafb;color:#2f5164;font-size:13px;line-height:1.4}
.tech-photo-preview img{flex:none;width:64px;height:64px;object-fit:cover;border-radius:8px;background:#e3edf1}
.tech-photo-preview small{color:#5f7b8a}

.tech-dialog-head:has(.tech-discard){flex-wrap:wrap}
.tech-discard{flex-basis:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;padding:10px 12px;border:1px solid #f0c48a;border-radius:10px;background:#fff7eb;color:#5c3b00}
.tech-discard p{margin:0;font-size:14px;line-height:1.4}
.tech-discard div{display:flex;flex-wrap:wrap;gap:8px}
.tech-discard .btn{min-height:44px}
.tech-discard [data-discard]{background:#b42318;border-color:#b42318;color:#fff}

@keyframes tech-spin{to{transform:rotate(360deg)}}
@keyframes tech-sheet-up{from{transform:translateY(32px);opacity:.4}to{transform:none;opacity:1}}

@media(max-width:1024px),(hover:none) and (pointer:coarse){
  /* Drawer: "Cerrar sesión" goes to the end of the menu instead of covering "Cerrar menú". */
  #tech-app .tech-sidebar .tech-side-user{display:flex;margin-top:auto;padding:12px 0}
  #tech-app .tech-sidebar #tech-logout{position:static;width:100%;min-height:48px;margin-top:4px;font-size:14px}

  #tech-app .tech-bottom-nav{position:fixed;left:0;right:0;bottom:0;z-index:45;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;padding:4px max(4px,env(safe-area-inset-right,0px)) calc(4px + env(safe-area-inset-bottom,0px)) max(4px,env(safe-area-inset-left,0px));background:#fff;border-top:1px solid #d6e4eb;box-shadow:0 -6px 20px #1233491a;box-sizing:border-box}
  #tech-app .tech-bottom-nav button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;min-height:56px;padding:6px 2px;border:0;border-radius:12px;background:transparent;color:#4b6677;font:inherit;font-size:11px;font-weight:700;line-height:1.15;cursor:pointer;-webkit-tap-highlight-color:transparent}
  #tech-app .tech-bottom-icon{font-size:20px;line-height:1}
  #tech-app .tech-bottom-label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #tech-app .tech-bottom-nav button[aria-current="page"]{background:#e6f4f5;color:#06606b}
  #tech-app .tech-bottom-nav [data-touch-nav="scan"] .tech-bottom-icon{display:grid;place-items:center;width:34px;height:26px;border-radius:9px;background:#087e8b;color:#fff;font-size:16px}
  #tech-app .tech-bottom-nav button:focus-visible{outline:3px solid #087e8b;outline-offset:-3px}
  #tech-app .tech-bottom-count{position:absolute;top:3px;left:calc(50% + 7px);min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#c2410c;color:#fff;font-size:11px;line-height:18px;text-align:center;box-sizing:border-box}
  #tech-app[data-tech-page="new"] .tech-bottom-nav{display:none}
  /* Separate rule: browsers without :has() drop only this one. Frees the screen while the keyboard is open. */
  #tech-app:has(:is(input:not([type=checkbox],[type=radio],[type=file],[type=button],[type=submit]),textarea):focus) .tech-bottom-nav{display:none}
  #tech-app:not([data-tech-page="new"]) .tech-main{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))}
  body:has(#tech-app:not([hidden]):not([data-tech-page="new"])) #toast:not(.critical){bottom:calc(84px + env(safe-area-inset-bottom,0px))}

  .tech-sync-banner{top:calc(72px + env(safe-area-inset-top,0px))}

  /* Compact header: scanning lives in the bottom bar, the rest stays on one row. */
  #tech-app .tech-workspace .tech-header{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:8px 12px}
  #tech-app .tech-workspace .tech-header::-webkit-scrollbar{display:none}
  #tech-app .tech-workspace .tech-header .btn{flex:none;min-height:44px;padding:8px 12px;font-size:13px}
  #tech-app .tech-header [data-tech-scan],#tech-app [data-queue-scan]{display:none}
  #tech-app .tech-queue-tools input{flex:1 1 auto;max-width:none;min-width:0}
  #tech-app .tech-section-head{margin-bottom:10px}
  #tech-app .tech-section-head small{display:none}

  #tech-app .queue-stage-filter,#tech-app .summary-controls .btn{min-height:44px}
  #tech-app .queue-secondary,#tech-app .tech-filters{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding:3px 2px;margin-left:-2px;margin-right:-2px}
  #tech-app .queue-secondary::-webkit-scrollbar,#tech-app .tech-filters::-webkit-scrollbar{display:none}
  #tech-app .queue-secondary>*,#tech-app .tech-filters>*{flex:none}

  /* Intake: the action buttons stay within thumb reach on every step. */
  #tech-app .intake-wizard footer{position:sticky;bottom:0;z-index:5;margin:16px -16px -16px;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));background:#fff;border-top:1px solid #dce7ed;border-radius:0 0 11px 11px;box-shadow:0 -8px 20px #1233490f}
  #tech-app .intake-wizard footer button{white-space:normal;line-height:1.25}
  #tech-app .intake-wizard footer [data-submit]{flex:2 1 0}
  #tech-app .intake-wizard :is(input,textarea,select){scroll-margin-bottom:140px}

  .tech-dialog :is(input,select,textarea){font-size:16px}
}

@media(max-width:650px){
  #tech-app #tech-refresh{font-size:0;min-width:44px;padding:0 12px}
  #tech-app #tech-refresh::before{content:'↻';display:inline-block;font-size:20px;line-height:1}

  #tech-app .tech-metrics{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-bottom:12px}
  #tech-app .queue-metric-primary{flex-direction:column;align-items:flex-start;justify-content:center;gap:3px;min-width:0;min-height:64px;padding:8px}
  #tech-app .queue-metric-primary strong{font-size:22px;line-height:1.1;min-width:0}
  #tech-app .queue-metric-primary span{font-size:11px;line-height:1.2;overflow-wrap:anywhere}

  #tech-app .tech-dispatch-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 12px;padding:12px}
  #tech-app .tech-dispatch-row>div:first-child,#tech-app .tech-dispatch-row>.tech-row-actions{grid-column:1/-1}

  /* Dialogs open as a bottom sheet, closer to the thumb. */
  dialog.tech-dialog:modal{width:100%;max-width:none;margin:auto 0 0;max-height:92vh;max-height:92dvh;border-radius:20px 20px 0 0;padding-bottom:env(safe-area-inset-bottom,0px)}
}

@media(max-width:650px) and (prefers-reduced-motion:no-preference){
  dialog.tech-dialog[open]{animation:tech-sheet-up .22s ease-out}
  #tech-app #tech-refresh[aria-busy="true"]::before{animation:tech-spin .8s linear infinite}
}

/* Taller Pro palette: navy navigation, clean work surface, and teal actions. */
#tech-app{
  --tech-navy:#12243a;
  --tech-navy-deep:#0b1728;
  --tech-teal:#087e8b;
  --tech-teal-dark:#066975;
  --tech-mint:#8be3d3;
  --tech-ink:#183247;
  --tech-muted:#607589;
  --tech-line:#dbe5ef;
  background:#f3f6fb;
  color:var(--tech-ink);
}
#tech-app .tech-sidebar{
  background:linear-gradient(165deg,var(--tech-navy),var(--tech-navy-deep));
  border-right-color:#26394f;
  color:#e7f0f8;
}
#tech-app .tech-logo>b{background:linear-gradient(135deg,#2879d0,var(--tech-teal));box-shadow:0 6px 16px #050e1d55}
#tech-app .tech-logo small,#tech-app .tech-side-user small{color:#a7bacd}
#tech-app .tech-side-label{color:#90a8bd}
#tech-app .tech-sidebar .tech-tabs button{color:#cfdae6}
#tech-app .tech-sidebar .tech-tabs button span{color:var(--tech-mint)}
#tech-app .tech-sidebar .tech-tabs button:hover{background:#ffffff12}
#tech-app .tech-sidebar .tech-tabs button.selected{
  background:linear-gradient(100deg,#17465c,#1c3e60);
  border-color:#315a72;
  border-left-color:var(--tech-mint);
  color:#fff;
}
#tech-app .tech-sidebar .tech-tabs button[data-tech-tab="new"]{background:var(--tech-teal);border-color:var(--tech-teal);color:#fff}
#tech-app .tech-sidebar .tech-tabs button[data-tech-tab="new"]:hover{background:var(--tech-teal-dark)}
#tech-app .tech-sidebar .tech-tabs button[data-marketplace]{background:#e8f4f6;border-color:#b9dce0;color:#075e69}
#tech-app .tech-sidebar .tech-tabs button[data-marketplace]:hover{background:#d6ecef}
#tech-app .tech-side-user{color:#e2ebf4}
#tech-app .tech-avatar{background:#1d3c51;color:var(--tech-mint)}
#tech-app .tech-sidebar #tech-logout{background:transparent;border-color:#486075;color:#e2ebf4}
#tech-app .tech-sidebar #tech-logout:hover{background:#ffffff12}
#tech-app .tech-workspace .tech-header{background:#fff;border-bottom:1px solid var(--tech-line);box-shadow:0 4px 14px #142c4308}
#tech-app .tech-header h1{color:var(--tech-ink)}
#tech-app .tech-header .tech-brand{color:var(--tech-teal);font-weight:800}
#tech-app .tech-header p{color:var(--tech-muted)}
#tech-app .tech-workspace .tech-header .btn{background:#edf5f8;border-color:#cddde7;color:#244a61}
#tech-app .tech-main{background:transparent}
#tech-app .queue-metric{border-color:var(--tech-line);box-shadow:0 3px 12px #16324c08}
#tech-app .queue-metric strong{color:var(--tech-ink)}
#tech-app .queue-metric-primary:first-child{background:#e8f5f4;border-color:#b9dfdc}
#tech-app .queue-metric-primary:first-child strong{color:#08717a}
#tech-app .tech-lane{background:#eaf0f6;border-color:#dbe4ed}
#tech-app .tech-lane:last-child{background:#e6f3ef;border-color:#cfe6dd}
#tech-app .tech-dispatch-row{border-color:var(--tech-line);border-left-color:#159b91;box-shadow:0 3px 12px #142e4709}
#tech-app .tech-dispatch-row.urgent{border-left-color:#e39224}
#tech-app .tech-filters button{border-color:#d5e0ea;color:#38556b}
#tech-app .tech-filters button.selected{background:var(--tech-navy);border-color:var(--tech-navy);color:#fff}
#tech-app .tech-queue-tools input:focus-visible,
#tech-app .tech-filters button:focus-visible,
#tech-app .tech-row-actions .btn:focus-visible{outline:3px solid #21a99d;outline-offset:2px}
#tech-app .tech-card,#tech-app .intake-wizard{border-color:var(--tech-line)}
#tech-app .tech-dialog-head{border-bottom-color:var(--tech-line)}
#tech-app .tech-dialog::backdrop{background:#071526a8}
#tech-app .tech-row-actions .btn.primary,
#tech-app .tech-dialog .btn.primary{background:linear-gradient(110deg,var(--tech-teal),#2569a7);border-color:transparent;color:#fff}
#tech-app .tech-row-actions .btn.primary:hover,
#tech-app .tech-dialog .btn.primary:hover{filter:brightness(.94)}

@media(max-width:1024px),(hover:none) and (pointer:coarse){
  #tech-app .tech-bottom-nav{background:#fff;border-top-color:var(--tech-line);box-shadow:0 -6px 20px #142c4317}
  #tech-app .tech-bottom-nav button{color:#536a7d}
  #tech-app .tech-bottom-nav button[aria-current="page"]{background:#e6f4f3;color:#075e69}
  #tech-app .tech-bottom-nav [data-touch-nav="scan"] .tech-bottom-icon{background:var(--tech-teal)}
  #tech-app .tech-bottom-nav button:focus-visible{outline-color:#21a99d}
}
