/* ═══════════════════════════════════════════════════════
   TALLER APP — CSS Principal
   ═══════════════════════════════════════════════════════ */

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

:root {
  --bg:         #F7F6F3;
  --surface:    #FFFFFF;
  --surface-2:  #F0EFEB;
  --border:     #E2E0DA;
  --border-2:   #D0CEC7;
  --text:       #1A1917;
  --text-2:     #6B6860;
  --text-3:     #9E9B94;
  --accent:     #1A1917;
  --blue:       #2563EB;
  --blue-bg:    #EFF4FF;
  --green:      #16A34A;
  --green-bg:   #F0FDF4;
  --yellow:     #CA8A04;
  --yellow-bg:  #FEFCE8;
  --red:        #DC2626;
  --red-bg:     #FEF2F2;
  --orange:     #EA580C;
  --orange-bg:  #FFF7ED;
  --purple:     #7C3AED;
  --purple-bg:  #F5F3FF;
  --sidebar-w:  220px;
  --topbar-h:   56px;
  --radius:     8px;
  --radius-sm:  5px;
  --shadow:     0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 12px rgba(0,0,0,.09);
  --font:       'DM Sans', sans-serif;
  --mono:       'DM Mono', monospace;
}

html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: var(--font); }
img { max-width: 100%; }

/* ── SHELL ── */
.app-shell { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
  position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 100;
  transition: width .22s ease, background .22s ease, border-color .22s ease, transform .2s ease;
  overflow-x: hidden;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.brand-icon {
  width: 32px; height: 32px; background: var(--text); border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-icon svg { width: 17px; height: 17px; stroke: #fff; }
.brand-name { font-weight: 600; font-size: 14px; display: block; }
.brand-sub  { font-size: 11px; color: var(--text-3); display: block; }
.brand-test { font-size: 11px; font-weight: 700; color: var(--red); }

/* Botón colapsar */
.sidebar-collapse-btn {
  margin-left: auto; flex-shrink: 0;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-3); padding: 5px; border-radius: 5px;
  display: flex; align-items: center; transition: color .12s;
}
.sidebar-collapse-btn:hover { color: var(--text); }
.sidebar-collapse-btn svg { width: 18px; height: 18px; stroke-width: 2.5; transition: transform .22s; }

.sidebar-nav { flex: 1; padding: 12px 8px; }
.nav-group { margin-bottom: 8px; }
.nav-group-label {
  font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); padding: 4px 10px 6px;
  white-space: nowrap; overflow: hidden; transition: opacity .15s, height .22s;
}
.nav-label { white-space: nowrap; overflow: hidden; transition: opacity .15s; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; font-weight: 450;
  transition: all .12s; margin-bottom: 1px; cursor: pointer;
  white-space: nowrap; overflow: hidden;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--text); color: #fff; font-weight: 500; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 20px;
  flex-shrink: 0;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.3); }

/* Submenú sidebar — acordeón */
.nav-item-group { position: relative; }
.nav-submenu {
  max-height: 0; overflow: hidden;
  transition: max-height .25s ease, opacity .2s ease;
  opacity: 0;
  background: var(--surface-2); border-radius: var(--radius-sm);
  margin: 4px 0px 0px; padding: 0 4px;
}
.nav-item-group.open .nav-submenu,
.nav-item-group:hover .nav-submenu {
  max-height: 300px; opacity: 1; padding: 4px;
}
.nav-subitem {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; font-size: 13px; color: var(--text-2);
  text-decoration: none; border-radius: var(--radius-sm); transition: all .12s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-subitem svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .6; }
.nav-subitem:hover { color: var(--text); background: var(--bg); }
.nav-subitem:hover svg { opacity: 1; }
.nav-subitem.active { color: var(--text); background: var(--bg); font-weight: 600; }
.nav-subitem.active svg { opacity: 1; }
.sidebar.collapsed .nav-submenu { max-height: 0 !important; opacity: 0 !important; padding: 0 !important; margin: 0 !important; }

.sidebar-footer { padding: 10px 8px; border-top: 1px solid var(--border); flex-shrink: 0; }
.user-info {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius-sm);
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--text);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.user-name  { font-size: 13px; font-weight: 500; display: block; line-height: 1.3; }
.user-role  { font-size: 11px; color: var(--text-3); display: block; }
.btn-logout {
  background: transparent; border: none; cursor: pointer; padding: 5px;
  color: var(--text-3); border-radius: 5px; display: flex; align-items: center;
}
.btn-logout:hover { background: var(--surface-2); color: var(--text); }
.btn-logout svg { width: 15px; height: 15px; }

/* ── SIDEBAR COLAPSADO ── */
.sidebar.collapsed {
  width: 56px;
  background: #111;
  border-right: none;
}

/* Cabecera: solo ícono de bici + flecha centrados */
.sidebar.collapsed .sidebar-brand {
  justify-content: space-between;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 8px;
  gap: 8px;
  border-bottom-color: #2a2a2a;
}
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-details { display: none; }

/* Brand icon: gris claro + bici negra */
.sidebar.collapsed .brand-icon {
  background: #e8e8e8;
}
.sidebar.collapsed .brand-icon svg { stroke: #111; }

/* Botón de expandir: visible, centrado, flecha más gruesa y grande */
.sidebar.collapsed .sidebar-collapse-btn {
  margin: 0;
  color: #888;
  display: flex;
  padding: 6px;
}
.sidebar.collapsed .sidebar-collapse-btn:hover { color: #eee; }
.sidebar.collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
  width: 18px; height: 18px;
  stroke-width: 2.5;
}

/* Nav: ítems sin padding lateral, tocan el borde derecho */
.sidebar.collapsed .sidebar-nav { padding: 10px 0; }
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
  color: #aaa;
  border-radius: 0;
  width: 100%;
  position: relative;
}
.sidebar.collapsed .nav-item svg {
  width: 20px; height: 20px;
  opacity: .75;
}
.sidebar.collapsed .nav-item:hover {
  background: #1e1e1e;
  color: #fff;
}
.sidebar.collapsed .nav-item:hover svg { opacity: 1; }

/* Activo: fondo unido al panel, ícono rojo, sin línea */
.sidebar.collapsed .nav-item.active {
  background: #F7F6F3;
  color: var(--red);
  border-radius: 0;
}
.sidebar.collapsed .nav-item.active svg {
  opacity: 1;
  stroke: var(--red);
}
.sidebar.collapsed .nav-badge { display: none; }

/* Footer: avatar centrado + logout debajo, alineados con la barra */
.sidebar.collapsed .sidebar-footer {
  padding: 8px 0;
  border-top-color: #2a2a2a;
}
.sidebar.collapsed .user-info {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 0;
}
.sidebar.collapsed .user-avatar {
  background: #2e2e2e;
  border: 1px solid #555;
  width: 32px; height: 32px;
}
.sidebar.collapsed .user-info form {
  margin-left: 0 !important;
  display: flex;
  justify-content: center;
}
.sidebar.collapsed .btn-logout {
  color: #666;
  margin-left: 0;
  padding: 7px;
  width: 32px; height: 32px;
  justify-content: center;
}
.sidebar.collapsed .btn-logout:hover { background: #1e1e1e; color: #ddd; }
.sidebar.collapsed .btn-logout svg { width: 16px; height: 16px; }

/* ── MAIN AREA ── */
.main-area {
  flex: 1; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-height: 100vh;
  transition: margin-left .22s ease;
}
.app-shell.sidebar-collapsed .main-area { margin-left: 56px; }

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  position: sticky; top: 0; z-index: 50; flex-shrink: 0;
}
.sidebar-toggle {
  display: none; background: transparent; border: none; cursor: pointer;
  padding: 6px; border-radius: var(--radius-sm); color: var(--text-2);
}
.sidebar-toggle svg { width: 18px; height: 18px; }
.topbar-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); }
.topbar-breadcrumb .current { color: var(--text); font-weight: 500; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ── PAGE CONTENT ── */
.page-content { flex: 1; padding: 20px; }

/* ── ALERTS ── */
.alert {
  padding: 11px 14px; border-radius: var(--radius); margin-bottom: 16px;
  font-size: 13.5px; font-weight: 500;
}
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid #bbf7d0; }
.alert-error   { background: var(--red-bg);   color: var(--red);   border: 1px solid #fecaca; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm); border: none;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .12s; white-space: nowrap; line-height: 1;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-primary   { background: var(--text); color: #fff; }
.btn-primary:hover { background: #333; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost     { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger    { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm  { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── FORM ELEMENTS ── */
.input, .select, .textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13.5px; color: var(--text);
  background: var(--surface); outline: none; transition: border .12s;
  appearance: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--text); }
.textarea { resize: vertical; min-height: 80px; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239E9B94' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  padding-right: 28px; cursor: pointer;
}
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 5px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-width: 0; }
.form-grid-2 > * { min-width: 0; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-full   { grid-column: 1 / -1; }

/* ── CARDS ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.card-title  { font-size: 13.5px; font-weight: 600; }
.card-body   { padding: 16px; }

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-title  { font-size: 20px; font-weight: 600; margin-bottom: 2px; }
.page-sub    { font-size: 13px; color: var(--text-3); }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── METRICS ── */
.metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.metric-card { display:flex; align-items:center; gap:16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.metric-icon { flex-shrink:0; width:52px; height:52px; display:flex; align-items:center; justify-content:center; border-radius:14px; background:var(--surface-2); }
.metric-icon svg { width:28px; height:28px; }
.metric-body { flex:1; min-width:0; }
.metric-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; margin-bottom: 8px; }
.metric-value { font-size: 28px; font-weight: 600; line-height: 1; margin-bottom: 3px; }
.metric-sub   { font-size: 12px; color: var(--text-3); }
.metric-blue   .metric-value { color: var(--blue); }
.metric-orange .metric-value { color: var(--orange); }
.metric-green  .metric-value { color: var(--green); }

/* ── FILTERS BAR ── */
.filters-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.search-wrap {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 11px; min-width: 240px;
}
.search-wrap:focus-within { border-color: var(--text); }
.search-wrap svg  { width: 14px; height: 14px; color: var(--text-3); flex-shrink: 0; }
.search-wrap input { border: none; background: transparent; font-size: 13px; color: var(--text); outline: none; width: 100%; }
.filter-select-sm {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 26px 7px 10px; font-size: 13px; color: var(--text); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239E9B94' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center;
  appearance: none; outline: none; font-family: var(--font);
}
.ml-auto { margin-left: auto; }
/* ── ESTADO SELECT CON COLOR ── */
.estado-wrap { position: relative; display: inline-block; }
.estado-wrap::before {
  content: ''; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%; pointer-events: none; z-index: 1;
}
.estado-wrap .estado-rapido { padding-left: 24px; font-weight: 600; }

.estado-wrap[data-estado=ingresado]::before    { background: var(--yellow); }
.estado-wrap[data-estado=diagnostico]::before  { background: var(--orange); }
.estado-wrap[data-estado=reparacion]::before   { background: var(--blue); }
.estado-wrap[data-estado=listo]::before        { background: var(--green); }
.estado-wrap[data-estado=entregado]::before    { background: var(--text-3); }
.estado-wrap[data-estado=revision_falla]::before { background: var(--red); }
.estado-wrap[data-estado=reparada]::before      { background: var(--purple); }

.estado-wrap[data-estado=ingresado]    .estado-rapido { color: var(--yellow); }
.estado-wrap[data-estado=diagnostico]  .estado-rapido { color: var(--orange); }
.estado-wrap[data-estado=reparacion]   .estado-rapido { color: var(--blue); }
.estado-wrap[data-estado=listo]        .estado-rapido { color: var(--green); }
.estado-wrap[data-estado=entregado]    .estado-rapido { color: var(--text-2); }
.estado-wrap[data-estado=revision_falla] .estado-rapido { color: var(--red); }
.estado-wrap[data-estado=reparada]   .estado-rapido { color: var(--purple); }


/* ── TABLE ── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table  { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 9px 13px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.hidden-row { display: none; }
tbody td { padding: 9px 13px; font-size: 13px; vertical-align: middle; }
.td-mono { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.td-bold { font-weight: 500; }
.td-sub  { font-size: 12px; color: var(--text-3); margin-top: 1px; }

/* ── PAGINATION ── */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-top: 1px solid var(--border); background: var(--surface);
}
.page-info { font-size: 12.5px; color: var(--text-3); }
.page-btns { display: flex; gap: 4px; }
.page-btn {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 12px; cursor: pointer; color: var(--text-2);
  font-family: var(--font); white-space: nowrap;
}
.page-btn.active { background: var(--text); color: #fff; border-color: var(--text); }
.page-btn:hover:not(.active) { background: var(--surface-2); }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  white-space: nowrap;
}
.badge-dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.badge-blue   { background: var(--blue-bg);   color: var(--blue);   }
.badge-blue   .badge-dot { background: var(--blue); }
.badge-green  { background: var(--green-bg);  color: var(--green);  }
.badge-green  .badge-dot { background: var(--green); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-yellow .badge-dot { background: var(--yellow); }
.badge-red    { background: var(--red-bg);    color: var(--red);    }
.badge-red    .badge-dot { background: var(--red); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-orange .badge-dot { background: var(--orange); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-purple .badge-dot { background: var(--purple); }
.badge-neutral{ background: var(--surface-2); color: var(--text-2); }
.badge-neutral .badge-dot { background: var(--text-3); }

/* ── PRIORITY ── */
.prio      { font-size: 12px; font-weight: 600; white-space: nowrap; }
.prio-alta { color: var(--red); }
.prio-media{ color: var(--yellow); }
.prio-baja { color: var(--text-3); }

/* ── DETAIL LAYOUT ── */
.detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.detail-header {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 16px; display: flex; align-items: center; gap: 14px;
}
.detail-id    { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-bottom: 3px; }
.detail-title { font-size: 17px; font-weight: 600; }

.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.section-head {
  padding: 11px 15px; border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; gap: 7px; text-transform: uppercase; letter-spacing: .04em;
}
.section-head svg { width: 14px; height: 14px; }
.side-label { font-size:12px; font-weight:700; color:#938f88; text-transform:uppercase; letter-spacing:0; padding:0 0 6px 0; border-bottom:1px solid var(--border); margin-bottom:12px; }
.section-body { padding: 14px 16px; }
.field-row    { margin-bottom: 12px; }
.field-row:last-child { margin-bottom: 0; }
.field-label  { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 4px; }
.field-value  { font-size: 13.5px; }
.field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── ACTIVITY / HISTORY ── */
.history-list { padding: 0 16px; }
.history-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.history-item:last-child { border-bottom: none; }
.history-dot  { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); margin-top: 4px; flex-shrink: 0; }
.history-dot.blue   { background: var(--blue); }
.history-dot.orange { background: var(--orange); }
.history-dot.green  { background: var(--green); }
.history-dot.red    { background: var(--red); }
.history-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ── PHOTO GRID ── */
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.photo-thumb {
  aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); cursor: pointer; position: relative;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb:hover .photo-delete { opacity: 1; }
.photo-delete {
  position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.55);
  color: #fff; border: none; border-radius: 4px; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity .15s; font-size: 12px;
}
.photo-add {
  aspect-ratio: 1; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border-2); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; color: var(--text-3); cursor: pointer; transition: all .12s;
}
.photo-add:hover { border-color: var(--text-2); color: var(--text-2); }
.photo-add svg   { width: 18px; height: 18px; }

/* ── STORAGE BAR ── */
.storage-track { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 6px 0 4px; }
.storage-fill  { height: 100%; background: var(--blue); border-radius: 3px; }
.storage-info  { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty-state svg { width: 36px; height: 36px; margin: 0 auto 12px; display: block; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.empty-sub   { font-size: 13px; }

/* ── CLIENTS / BIKES GRID ── */
.items-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.item-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: all .12s;
}
.item-card:hover { border-color: var(--text); box-shadow: var(--shadow-md); }
.item-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--text);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 13px; margin-bottom: 10px;
}
.item-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.item-sub  { font-size: 12px; color: var(--text-3); margin-bottom: 10px; line-height: 1.6; }
.item-footer { display: flex; align-items: center; justify-content: space-between; }

.bike-card { padding: 0; }
.bike-card-img {
  height: 100px; background: var(--surface-2); display: flex; align-items: center;
  justify-content: center; border-bottom: 1px solid var(--border); overflow: hidden;
}
.bike-card-img img { width: 100%; height: 100%; object-fit: cover; }
.bike-card-img svg { width: 44px; height: 44px; color: var(--border-2); }
.bike-card-body { padding: 13px 14px; }

/* ── AUTH ── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.auth-box  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 32px; width: 100%; max-width: 380px; box-shadow: var(--shadow-md); }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .brand-icon { width: 44px; height: 44px; background: var(--text); border-radius: 10px; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.auth-logo .brand-icon svg { width: 22px; height: 22px; stroke: #fff; }
.auth-logo h1 { font-size: 18px; font-weight: 600; margin-bottom: 3px; }
.auth-logo p  { font-size: 13px; color: var(--text-3); }
.auth-footer  { margin-top: 14px; text-align: center; font-size: 12px; color: var(--text-3); }
.auth-remember { display:flex; align-items:center; gap:7px; font-size:13px; color:var(--text-2); margin:12px 0 4px; cursor:pointer; }
.auth-remember input[type=checkbox] { width:15px; height:15px; cursor:pointer; accent-color:var(--text); }
.auth-link-row { text-align:center; margin-top:14px; font-size:13px; color:var(--text-3); }
.auth-link-row a { color:var(--blue); text-decoration:none; }
.auth-link-row a:hover { text-decoration:underline; }
.pwd-reqs { margin:8px 0 4px; padding:10px 12px; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm); font-size:12px; display:none; }
.pwd-reqs.visible { display:block; }
.pwd-req { display:flex; align-items:center; gap:6px; padding:2px 0; color:var(--text-3); }
.pwd-req.ok { color:#1a7f37; }
.pwd-req.fail { color:#c0392b; }
.pwd-strength-bar { height:4px; border-radius:2px; margin-bottom:8px; background:var(--border); overflow:hidden; }
.pwd-strength-fill { height:100%; border-radius:2px; transition:width .2s, background .2s; width:0; }
@media(max-width:699px){
  .auth-wrap { align-items: flex-start; background: var(--surface); }
  .auth-box { border: none; border-radius: 0; box-shadow: none; max-width: 100%; min-height: 100vh; padding: 60px 28px 40px; }
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 520px;
  box-shadow: var(--shadow-md); overflow: hidden;
  transform: translateY(8px); transition: transform .15s;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title  { font-size: 14px; font-weight: 600; }
.modal-close  { background: transparent; border: none; cursor: pointer; color: var(--text-3); padding: 4px; border-radius: 4px; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-close svg  { width: 16px; height: 16px; }
.modal-body   { padding: 16px; }
.modal-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .metrics-row { grid-template-columns: 1fr 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .items-grid { grid-template-columns: 1fr 1fr; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .metrics-row { grid-template-columns: 1fr; }
  .items-grid  { grid-template-columns: 1fr; }
  .photo-grid  { grid-template-columns: repeat(3, 1fr); }
  .page-content { padding: 14px; }
}
/* ── CARDS ACORDEÓN (global — usadas en órdenes, configuración, etc.) ── */
.orden-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.orden-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
}
.orden-card-main { flex: 1; min-width: 0; }
.orden-card-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.orden-card-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}
.orden-card-client {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.orden-card-row2 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.orden-expand-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg, #f4f4f5);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.orden-expand-btn:active { background: var(--border); }
.orden-expand-btn svg { transition: transform .25s; }
.orden-expand-btn.open svg { transform: rotate(180deg); }
.orden-card-detail {
  display: none;
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  background: var(--bg, #fafafa);
}
.orden-card-detail.open { display: block; }
.ocd-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.ocd-row:last-child { border-bottom: none; }
.ocd-label { color: var(--text-3); font-size: 12px; }
.ocd-val { font-weight: 500; text-align: right; }
.ocd-ver-btn {
  display: block;
  margin-top: 12px;
  text-align: center;
  background: var(--text);
  color: #fff;
  padding: 10px;
  border-radius: var(--radius-sm, 8px);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.ocd-ver-btn:active { opacity: .85; }

@media (max-width: 699px) {
  /* Topbar: ocultar breadcrumb, acciones sin margen automático */
  .topbar-breadcrumb { display: none; }
  .topbar-actions { margin-left: auto; }
  .topbar { padding: 0 12px; gap: 8px; }

  /* Paginador: mostrar solo Ant / página actual / Sig  */
  .page-btn:not(.page-nav):not(.active) { display: none; }
  .pagination { padding: 10px 12px; flex-wrap: wrap; gap: 8px; justify-content: center; }
  .page-info { width: 100%; text-align: center; font-size: 12px; }
  .page-btns { gap: 8px; justify-content: center; }
  .page-btn.page-nav { padding: 7px 16px; font-size: 13px; }
  .page-btn.active   { padding: 7px 14px; font-size: 13px; }
}

/* ── MÉTRICAS RESUMEN (órdenes + kanban) ── */
#metricas-resumen-wrap { margin-bottom: 4px; }
.metricas-resumen-panel { margin-bottom: 0; }
.metrics-row-ordenes { margin-bottom: 8px; }
.sp-bottom-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.sp-pills-wrap{display:flex;align-items:center;gap:5px;flex-wrap:wrap;flex:1;min-width:0}
.sp-label{font-size:11px;font-weight:700;color:var(--text-3);text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;flex-shrink:0}
.sp-pill{padding:3px 10px;border-radius:20px;border:1px solid var(--border);background:var(--surface);color:var(--text-3);font-size:11px;font-weight:600;cursor:pointer;font-family:var(--font);white-space:nowrap;transition:all .12s;display:inline-flex;align-items:center;gap:4px}
.sp-pill:hover{color:var(--text)}
.sp-pill-active{background:var(--text);color:#fff;border-color:var(--text)}
.sp-rep-link{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;color:var(--text-3);text-decoration:none;padding:3px 0;white-space:nowrap;flex-shrink:0;transition:color .12s}
.sp-rep-link:hover{color:var(--text)}
.metricas-toggle-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.btn-toggle-metricas {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.btn-toggle-metricas:hover {
  background: var(--surface-2);
  color: var(--text);
}
@media(max-width:699px){
  .btn-toggle-metricas .btn-toggle-label { display:none; }
  .btn-toggle-metricas { padding: 7px 8px; }
}

/* ── APARIENCIA: selector de tema y escala ── */
.tema-selected { border-color: var(--blue) !important; }
.scale-btn { border: 2px solid var(--border); border-radius: 8px; }
.scale-selected { border-color: var(--blue) !important; background: var(--surface-2); outline: 2px solid var(--blue); outline-offset: 0; }
.tema-card:hover, .scale-btn:hover { border-color: var(--border-2) !important; }

/* ── Ocultar spinners en inputs number ── */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
input[type=number] { -moz-appearance:textfield; }

/* ── Lightbox ─────────────────────────────────────────────────────── */
#lb-overlay {
  display:none; position:fixed; inset:0; z-index:9000;
  background:rgba(0,0,0,.88); align-items:center; justify-content:center;
  cursor:zoom-out;
}
#lb-overlay.open { display:flex; }
#lb-overlay img {
  max-width:90vw; max-height:90vh; border-radius:6px;
  box-shadow:0 8px 40px rgba(0,0,0,.6); object-fit:contain;
  cursor:default; user-select:none;
}
#lb-close {
  position:fixed; top:16px; right:20px; width:36px; height:36px;
  border-radius:50%; border:none; background:rgba(255,255,255,.15);
  color:#fff; font-size:20px; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:background .15s;
}
#lb-close:hover { background:rgba(255,255,255,.3); }

/* ── Emoji picker global ── */
.emoji-bar-wrap { position:relative; display:inline-block; }
.emoji-bar { display:inline-flex; align-items:center; gap:5px; cursor:pointer; font-size:11.5px; color:#9E9B94; padding:3px 8px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-2); user-select:none; line-height:1; }
.emoji-bar:hover { color:var(--text-2); border-color:var(--border-2); }
.emoji-popover { position:fixed; z-index:9999; display:none; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-md); width:300px; }
.emoji-popover.open { display:block; }
.emoji-cats { display:flex; border-bottom:1px solid var(--border); padding:4px 4px 0; gap:2px; }
.emoji-cat-btn { background:none; border:none; cursor:pointer; padding:5px 8px; border-radius:var(--radius-sm) var(--radius-sm) 0 0; font-size:18px; line-height:1; opacity:.5; transition:opacity .15s; border-bottom:2px solid transparent; margin-bottom:-1px; }
.emoji-cat-btn:hover { opacity:.8; }
.emoji-cat-btn.active { opacity:1; border-bottom-color:var(--blue); }
.emoji-grid { display:flex; flex-wrap:wrap; gap:1px; padding:6px; max-height:200px; overflow-y:auto; }
.emoji-grid span { cursor:pointer; padding:4px; border-radius:4px; line-height:1; display:inline-flex; font-size:20px; }
.emoji-grid span:hover { background:var(--surface-2); }
.emoji-grid-empty { padding:12px; font-size:12px; color:var(--text-3); text-align:center; width:100%; }

/* ── Custom Autocomplete (ac) — componente global ── */
.ac { position:relative; }
.ac-drop { display:none; position:absolute; top:100%; left:0; right:0; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); box-shadow:var(--shadow-md); z-index:200; max-height:220px; overflow-y:auto; margin-top:2px; }
.ac-item { padding:8px 12px; cursor:pointer; font-size:12.5px; border-bottom:1px solid var(--border); }
.ac-item:last-child { border-bottom:none; }
.ac-item:hover { background:var(--surface-2); }
.ac-name { font-weight:600; color:var(--text); }
.ac-sub { font-size:11px; color:var(--text-3); margin-top:1px; }
#sidebar-flyout .nav-subitem { color: #fff !important; }
#sidebar-flyout .nav-subitem:hover { background: #ffffff45 !important; color: #fff !important; }
#sidebar-flyout .nav-subitem.active { background: #ffffff45 !important; color: #fff !important; }
