:root {
  --bg: #0f1419;
  --surface: #1a222d;
  --surface2: #243041;
  --text: #eef2f7;
  --muted: #94a3b8;
  --primary: #c2783a;
  --primary-dark: #9a5f2e;
  --primary-rgb: 194,120,58;
  --primary-light: #f0c090;
  --accent: #2d6a4f;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --warn-rgb: 217,119,6;
  --warn-light: #fbbf24;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(0,0,0,.25);
  --sidebar-w: 240px;
}

/* Paletas por usuario */
body[data-theme="clasico"]{
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface2: #d6d9de;
  --text: #1a1a1a;
  --muted: #5f6368;
  --primary: #0078d4;
  --primary-dark: #005a9e;
  --primary-rgb: 0,120,212;
  --primary-light: #a0c4ff;
  --accent: #0f766e;
  --danger: #d13438;
  --ok: #107c10;
  --warn: #ca5010;
  --warn-rgb: 202,80,16;
  --warn-light: #f7b93e;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,.14);
}

body[data-theme="minimalista"]{
  --bg: #ffffff;
  --surface: #f8f9fa;
  --surface2: #e8eaed;
  --text: #202124;
  --muted: #5f6368;
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-rgb: 26,115,232;
  --primary-light: #8ab4f8;
  --accent: #137333;
  --danger: #d93025;
  --ok: #188038;
  --warn: #e37400;
  --warn-rgb: 227,116,0;
  --warn-light: #fbbc04;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(60,64,67,.15), 0 4px 8px rgba(60,64,67,.10);
}

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

body {
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Shell: sidebar + contenido */
.app-shell-body { overflow-x: hidden; }
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}
.main-content {
  flex: 1;
  padding: 1.25rem 1.5rem 1rem;
  max-width: 1200px;
  width: 100%;
}
.app-footer {
  padding: .75rem 1.5rem 1.25rem;
  font-size: .72rem;
  border-top: 1px solid var(--surface2);
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--surface2);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: 1rem 1rem .85rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid var(--surface2);
}
.sidebar-brand:hover { text-decoration: none; opacity: .92; }
.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: .5rem .45rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.sidebar-group {
  border-radius: 9px;
  background: rgba(0, 0, 0, .12);
  overflow: hidden;
}
.sidebar-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .5rem .6rem;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: background .15s;
}
.sidebar-group-toggle:hover {
  background: rgba(255, 255, 255, .04);
}
.sidebar-group-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sidebar-group-chevron {
  width: .45rem;
  height: .45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s ease;
  opacity: .75;
  flex-shrink: 0;
  margin-top: -.15rem;
}
.sidebar-group.is-open .sidebar-group-chevron {
  transform: rotate(-135deg);
  margin-top: .1rem;
}
.sidebar-group-panel {
  display: none;
  padding: 0 .35rem .35rem;
  flex-direction: column;
  gap: .12rem;
}
.sidebar-group.is-open .sidebar-group-panel {
  display: flex;
}
.sidebar-group--general .sidebar-group-toggle {
  border-left-color: #94a3b8;
  color: #cbd5e1;
}
.sidebar-group--cliente .sidebar-group-toggle,
.sidebar-group--pedidos .sidebar-group-toggle {
  border-left-color: #fbbf24;
  color: #fde68a;
}
.sidebar-group--ops .sidebar-group-toggle {
  border-left-color: var(--primary);
  color: var(--primary-light);
}
.sidebar-group--sgc .sidebar-group-toggle {
  border-left-color: #4ade80;
  color: #bbf7d0;
}
.sidebar-group--sistema .sidebar-group-toggle {
  border-left-color: #60a5fa;
  color: #bfdbfe;
}
.sidebar-group.is-open .sidebar-group-toggle {
  background: rgba(255, 255, 255, .03);
}
.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .55rem .65rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: .88rem;
  transition: background .15s, color .15s;
}
.sidebar-link:hover {
  color: var(--text);
  background: rgba(255,255,255,.04);
  text-decoration: none;
}
.sidebar-link.active {
  color: var(--text);
  background: rgba(var(--primary-rgb),.18);
  font-weight: 600;
}
.sidebar-link.active .sidebar-link-label { color: var(--primary-light); }
.sidebar-badge {
  font-size: .68rem;
  font-weight: 700;
  min-width: 1.25rem;
  text-align: center;
  padding: .1rem .35rem;
  border-radius: 999px;
  background: rgba(217,119,6,.25);
  color: #fbbf24;
}
.sidebar-foot {
  flex-shrink: 0;
  padding: .85rem 1rem;
  padding-bottom: calc(.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--surface2);
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.sidebar-user-name {
  display: block;
  font-size: .85rem;
  font-weight: 600;
}
.sidebar-user-role {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin-top: .1rem;
}
.sidebar-logout {
  font-size: .78rem;
  color: var(--muted);
  text-decoration: none;
}
.sidebar-logout:hover { color: var(--primary); text-decoration: none; }
.sidebar-version {
  font-size: .65rem;
  color: var(--muted);
  opacity: .7;
}

.mobile-topbar {
  display: none;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--surface2);
  position: sticky;
  top: 0;
  z-index: 30;
}
.sidebar-toggle {
  background: var(--surface2);
  border: none;
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
}
.mobile-title {
  font-size: .95rem;
  font-weight: 600;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 35;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: auto;
    max-height: 100dvh;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-top: env(safe-area-inset-top, 0px);
  }
  .sidebar-brand { flex-shrink: 0; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop:not([hidden]) { display: block; }
  .mobile-topbar {
    display: flex;
    padding-top: calc(.65rem + env(safe-area-inset-top, 0px));
  }
  .main-content { padding: 1rem; }
  body.sidebar-open { overflow: hidden; }
  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
}

/* Legacy topbar — login público etc. */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--surface2);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.nav { display: flex; gap: .5rem; flex: 1; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  padding: .4rem .7rem;
  border-radius: 8px;
  text-decoration: none;
}
.nav a.active, .nav a:hover { color: var(--text); background: var(--surface2); }

.top-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-left: auto; }
.pill {
  font-size: .75rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text);
}
.pill.muted { color: var(--muted); }
.link-quiet { color: var(--muted); font-size: .85rem; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }

.hero { margin-bottom: 1.5rem; }
.hero h1 { font-size: 1.6rem; margin-bottom: .4rem; }
.muted { color: var(--muted); }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.card h2 { font-size: 1.05rem; margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .9rem; line-height: 1.45; }

.badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .2rem .45rem;
  border-radius: 6px;
  margin-bottom: .6rem;
}
.badge-soon { background: rgba(217,119,6,.15); color: #fbbf24; }
.badge-live { background: rgba(22,163,74,.15); color: #4ade80; }
.badge-warn { background: rgba(217,119,6,.2); color: #fbbf24; }

.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: .65rem 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: .9rem;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-secondary { background: var(--surface2); color: var(--text); }
.btn-secondary:hover { background: #2f3d52; text-decoration: none; }
.btn-small { padding: .35rem .55rem; font-size: .75rem; background: var(--surface2); color: var(--text); }
.btn-danger { background: rgba(220,38,38,.25); color: #fecaca; border: 1px solid rgba(220,38,38,.4); }
.btn-danger:hover { background: rgba(220,38,38,.4); text-decoration: none; color: #fff; }

.steps { margin: .75rem 0 0 1.1rem; color: var(--muted); line-height: 1.6; }

.flash {
  padding: .75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.flash.error { background: rgba(220,38,38,.15); color: #fecaca; border: 1px solid rgba(220,38,38,.3); }
.flash.ok { background: rgba(22,163,74,.15); color: #bbf7d0; border: 1px solid rgba(22,163,74,.3); }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(circle at top, rgba(194,120,58,.12), transparent 40%), var(--bg);
}

.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.auth-logo {
  font-size: .8rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: .25rem;
}

.auth-box h1 { font-size: 1.35rem; margin-bottom: .25rem; }

.form-stack { display: grid; gap: .85rem; margin-top: 1rem; }
.field { display: grid; gap: .35rem; font-size: .85rem; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: .65rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  font-size: .95rem;
}
.field textarea {
  resize: vertical;
  min-height: 4rem;
  line-height: 1.45;
  font-family: inherit;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
}

.checklist { margin-top: 1rem; padding-left: 1.1rem; color: var(--muted); line-height: 1.6; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
}

@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
}

/* Usuarios / admin */
.card-title { font-size: 1rem; margin: 0 0 1rem; }
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}
.card-title-row .card-title { margin: 0; }
.admin-form-card { margin-bottom: 1rem; }
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem 1rem;
}
@media (max-width: 700px) {
  .admin-form-grid { grid-template-columns: 1fr; }
}
.admin-form-actions { margin-top: 1rem; }
.perm-preview-box {
  margin-top: .85rem;
  padding: .65rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: rgba(0,0,0,.12);
}
.perm-preview-box summary {
  cursor: pointer;
  font-size: .82rem;
  color: var(--muted);
  user-select: none;
}
.perm-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: .65rem 0 0;
  padding: 0;
}
.perm-chip {
  font-size: .72rem;
  padding: .2rem .5rem;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
  line-height: 1.3;
}
.users-table td { vertical-align: top; }
.users-table .col-actions { width: 1%; white-space: nowrap; }
.user-cell { min-width: 180px; }
.user-name { display: block; font-size: .9rem; }
.user-email { display: block; font-size: .78rem; color: var(--muted); margin-top: .15rem; word-break: break-all; }
.user-login { font-size: .78rem; white-space: nowrap; }
.user-perm-link {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin-top: .25rem;
  text-decoration: none;
}
.user-perm-link:hover { color: var(--primary); text-decoration: underline; }
.role-pill {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--surface2);
}
.role-pill.role-admin { background: rgba(var(--primary-rgb),.2); color: var(--primary-light); }
.role-pill.role-oficina { background: rgba(96,165,250,.15); color: #93c5fd; }
.role-pill.role-taller { background: rgba(45,106,79,.25); color: #86efac; }
.role-pill.role-despacho { background: rgba(168,85,247,.15); color: #d8b4fe; }
.role-pill.role-armado { background: rgba(234,179,8,.12); color: #fde047; }
.role-pill.role-cliente { background: rgba(56,189,248,.12); color: #7dd3fc; }
.action-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
  min-width: 108px;
}
.user-edit-card { max-width: 640px; }
.user-edit-pass { margin-top: .75rem; }
.user-meta { margin-top: 1rem; font-size: .85rem; }
.form-actions-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.users-table .user-name a { color: inherit; text-decoration: none; }
.action-stack .btn { width: 100%; justify-content: center; text-align: center; }

.nav-dropdown { position: relative; }
.nav-dropdown summary {
  list-style: none;
  color: var(--muted);
  padding: .4rem .7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: inherit;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary.active,
.nav-dropdown summary:hover,
.nav-dropdown[open] summary {
  color: var(--text);
  background: var(--surface2);
}
.nav-dd-panel {
  position: absolute;
  top: calc(100% + .35rem);
  left: 0;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: 8px;
  padding: .35rem;
  box-shadow: var(--shadow);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.nav-dd-panel a {
  color: var(--muted);
  padding: .45rem .65rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: .85rem;
}
.nav-dd-panel a.active,
.nav-dd-panel a:hover {
  color: var(--text);
  background: var(--surface2);
}

.table-wrap { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table th, .data-table td {
  text-align: left;
  padding: .55rem .45rem;
  border-bottom: 1px solid var(--surface2);
  vertical-align: middle;
}
.data-table th { color: var(--muted); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.inline-form { display: inline; }

.status.ok { color: #4ade80; }
.status.off { color: #fca5a5; }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: .75rem;
  padding: 2rem 1rem;
}

.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: .75rem;
  text-align: center;
}
a.stat-link {
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .15s;
}
a.stat-link:hover {
  border-color: rgba(217,119,6,.4);
  transform: translateY(-1px);
}
.stat-n { display: block; font-size: 1.5rem; font-weight: 800; }
.stat-l { display: block; font-size: .7rem; color: var(--muted); margin-top: .15rem; }
.stat-danger .stat-n { color: #f87171; }
.stat-warn .stat-n { color: #fbbf24; }
.stat-info .stat-n { color: #60a5fa; }
.stat-ok .stat-n { color: #4ade80; }

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: .75rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}
.kanban-despacho { grid-template-columns: repeat(4, minmax(240px, 1fr)); }
@media (max-width: 900px) {
  .kanban, .kanban-despacho { grid-template-columns: repeat(4, 78vw); }
}
.kanban-col {
  background: rgba(0,0,0,.15);
  border-radius: var(--radius);
  padding: .5rem;
  min-height: 200px;
}
.kanban-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  font-weight: 700;
  padding: .35rem .4rem .6rem;
  color: var(--muted);
}
.kanban-head .count {
  background: var(--surface2);
  border-radius: 999px;
  padding: .1rem .45rem;
  font-size: .7rem;
}
.kanban-empty { color: var(--muted); font-size: .8rem; text-align: center; padding: 1rem 0; }
.kanban-cards { display: grid; gap: .5rem; }

.pedido-card {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: 8px;
  padding: .65rem;
}
.pedido-card.urgente { border-left: 3px solid var(--warn); }
.pedido-card.retraso { border-left: 3px solid var(--danger); }
.pedido-top { display: flex; justify-content: space-between; gap: .35rem; align-items: flex-start; }
.pedido-desc { font-size: .85rem; margin: .35rem 0; line-height: 1.35; }
.pedido-dir { font-size: .78rem; color: var(--muted); margin-bottom: .25rem; }
.pedido-meta { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); }
.pedido-nota { font-size: .75rem; color: var(--warn); margin-top: .25rem; }
.pedido-actions { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.planchas-stats { margin-bottom: 1rem; }
.planchas-mat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  font-size: .9rem;
}
.planchas-inline-form {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin: 0;
}
.planchas-input {
  width: 4.2rem;
  min-width: 4.2rem;
  padding: .25rem .35rem;
  font-size: .8rem;
}
.planchas-aplica-form { margin: 0; display: inline; }
.btn-turno {
  min-width: 2rem;
  font-weight: 700;
  padding: .2rem .45rem;
}
.turno-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: .1rem .35rem;
  border-radius: 4px;
  background: rgba(148,163,184,.2);
  color: var(--muted);
}
.turno-save-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 0 0 .85rem;
  padding: .65rem .85rem;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, .45);
  background: rgba(251, 191, 36, .12);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.turno-save-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
}
.turno-save-msg {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text, #1e293b);
  flex: 1 1 12rem;
}
.turno-motivo-field {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  margin: 0;
}
.turno-motivo-field input {
  min-width: 14rem;
  padding: .35rem .5rem;
  font-size: .85rem;
}
.turno-log-cambios {
  margin: .35rem 0 0;
  padding-left: 1.1rem;
  font-size: .82rem;
  color: var(--muted);
}
.btn-turno:disabled {
  opacity: .35;
  cursor: default;
}
.fids-inline-link { color: #93c5fd; }
.fids-turno-pos {
  font-size: .75rem;
  font-weight: 700;
  color: #fbbf24;
  text-decoration: none;
}
.fids-turno-pos:hover { text-decoration: underline; }
.text-danger { color: #f87171; }

.tipo-badge {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: .12rem .35rem;
  border-radius: 4px;
  white-space: nowrap;
}
.tipo-particular { background: rgba(96,165,250,.15); color: #93c5fd; }
.tipo-obra { background: rgba(194,120,58,.2); color: #fdba74; }

.trabajo-badge {
  font-size: .62rem;
  font-weight: 700;
  padding: .15rem .4rem;
  border-radius: 4px;
  white-space: nowrap;
  display: inline-block;
}
.trabajo-solo_corte { background: rgba(148,163,184,.2); color: #cbd5e1; }
.trabajo-corte_enchape { background: rgba(96,165,250,.15); color: #93c5fd; }
.trabajo-fab_particular { background: rgba(45,106,79,.25); color: #86efac; }
.trabajo-fab_obra { background: rgba(194,120,58,.2); color: #fdba74; }
.trabajo-instalacion_terreno { background: rgba(168,85,247,.15); color: #d8b4fe; }

.workflow-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.hist-list { list-style: none; margin-top: .5rem; font-size: .85rem; }
.hist-list li { padding: .35rem 0; border-bottom: 1px solid var(--surface2); }
.hist-fecha { color: var(--muted); margin-right: .5rem; font-size: .78rem; }
.check-row { flex-direction: row !important; align-items: center; gap: .5rem; color: var(--text) !important; }
.check-row input { width: auto; }
.row-retraso { background: rgba(220,38,38,.06); }

.form-card { max-width: 520px; }

.kanban-taller { grid-template-columns: repeat(4, minmax(200px, 1fr)); }

.filter-bar { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-pill {
  padding: .35rem .7rem;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
  text-decoration: none;
  font-size: .8rem;
}
.filter-pill.active, .filter-pill:hover { background: var(--primary); color: #fff; text-decoration: none; }

.stack-form { display: grid; gap: .35rem; width: 100%; }
.mini-input {
  width: 100%;
  padding: .4rem .5rem;
  border-radius: 6px;
  border: 1px solid var(--surface2);
  background: var(--bg);
  color: var(--text);
  font-size: .78rem;
}
.field textarea {
  width: 100%;
  min-height: 120px;
  padding: .65rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: var(--bg);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  resize: vertical;
}
code { font-size: .78rem; color: #fdba74; }

.perm-table-wrap { overflow-x: auto; padding: 0; }
.perm-table th, .perm-table td { text-align: center; vertical-align: middle; }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; min-width: 200px; }
.perm-key { font-size: .7rem; color: var(--muted); margin-top: .15rem; }
.perm-cell { width: 70px; }
.perm-check input { width: 18px; height: 18px; cursor: pointer; }
.perm-fixed { color: #4ade80; font-weight: 700; }
.perm-summary { margin: .75rem 0 0 1rem; color: var(--muted); line-height: 1.55; font-size: .85rem; }
.perm-col { max-width: 220px; font-size: .75rem; color: var(--muted); }
.perm-preview { background: var(--bg); border-radius: 8px; padding: .6rem .75rem; border: 1px solid var(--surface2); }

.pedido-files { margin-top: .45rem; }
.btn-files { background: rgba(96,165,250,.12); color: #93c5fd; }

.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: .45rem .75rem;
  font-size: .9rem;
  margin-top: .5rem;
}
.detail-grid dt { color: var(--muted); }
.section-head { margin-bottom: .75rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.section-head h2 { margin-bottom: .2rem; }

.upload-box {
  background: var(--bg);
  border: 1px dashed var(--surface2);
  border-radius: 8px;
  padding: .85rem;
  margin-bottom: 1rem;
}
.upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: flex-end;
}
.upload-row .btn { margin-bottom: 2px; }

.adj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}
.adj-card {
  background: var(--bg);
  border: 1px solid var(--surface2);
  border-radius: 8px;
  overflow: hidden;
}
.adj-thumb { aspect-ratio: 4/3; background: #0a0f14; display: grid; place-items: center; }
.adj-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.adj-pdf {
  display: grid; place-items: center; width: 100%; height: 100%;
  color: #f87171; font-weight: 800; font-size: 1.4rem; text-decoration: none;
}
.adj-body { padding: .6rem; display: grid; gap: .25rem; }
.adj-tipo { font-size: .68rem; text-transform: uppercase; color: var(--primary); font-weight: 700; }
.adj-name { font-size: .82rem; color: var(--text); word-break: break-word; }
.adj-meta { font-size: .7rem; color: var(--muted); }

/* Producción / operarios */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.prod-col-head h2 { font-size: 1.1rem; margin-bottom: .2rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .35rem; }
.skill-tag {
  font-size: .65rem;
  padding: .1rem .35rem;
  border-radius: 4px;
  background: var(--surface2);
  color: var(--muted);
}
.tarea-card, .tarea-plan-row {
  background: var(--bg);
  border: 1px solid var(--surface2);
  border-radius: 8px;
  padding: .65rem;
  margin-bottom: .5rem;
}
.tarea-top { display: flex; justify-content: space-between; gap: .35rem; margin-bottom: .35rem; }
.fase-tag { font-size: .68rem; font-weight: 700; color: var(--primary); text-transform: uppercase; }
.estado-tag { font-size: .68rem; color: var(--muted); }
.estado-en_curso { border-left: 3px solid #60a5fa; }
.estado-hecho { opacity: .65; border-left: 3px solid var(--ok); }
.op-name { font-size: .78rem; color: #93c5fd; }
.assign-form { margin-top: .4rem; }
.tarea-list { display: grid; gap: .5rem; }
.tarea-plan-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: .5rem;
  align-items: center;
}
@media (max-width: 700px) {
  .tarea-plan-row { grid-template-columns: 1fr; }
}
.tarea-plan-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.flow-steps { margin: .5rem 0 0 1.1rem; line-height: 1.7; color: var(--muted); font-size: .9rem; }
.flow-help h2 { font-size: 1rem; margin-bottom: .35rem; }
.hab-fieldset { border: 1px solid var(--surface2); border-radius: 8px; padding: .65rem; }
.hab-fieldset legend { font-size: .8rem; color: var(--muted); padding: 0 .35rem; }
.op-edit { margin-top: .25rem; }
.op-edit-form { margin-top: .5rem; padding: .65rem; background: var(--bg); border-radius: 8px; }
.kanban-prod { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Barra de progreso por etapas */
.prog-card { padding: 1rem 1.1rem; }
.prog-wrap { width: 100%; }
.prog-header { display: flex; align-items: baseline; gap: 1rem; margin-bottom: .5rem; flex-wrap: wrap; }
.prog-pct { font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.prog-now { font-size: .85rem; }
.prog-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: .75rem;
}
.prog-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width .3s ease;
}
.prog-steps {
  display: flex;
  justify-content: space-between;
  gap: .15rem;
  position: relative;
}
.prog-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  min-width: 0;
}
.prog-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--muted);
  flex-shrink: 0;
}
.prog-step.status-done .prog-dot {
  background: var(--ok);
  border-color: var(--ok);
}
.prog-step.status-current .prog-dot {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194,120,58,.25);
}
.prog-label {
  font-size: .62rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}
.prog-step.status-done .prog-label { color: #86efac; }
.prog-step.status-current .prog-label { color: var(--primary); font-weight: 700; }
.prog-compact { margin: .35rem 0; }
.prog-compact .prog-bar { height: 4px; margin-bottom: .35rem; }
.prog-compact .prog-steps { gap: 0; }
.prog-compact .prog-dot { width: 7px; height: 7px; }
.prog-cell { min-width: 140px; }

/* Seguimiento público */
.public-body { background: var(--bg); }
.public-top {
  text-align: center;
  padding: 1.25rem 1rem .5rem;
  border-bottom: 1px solid var(--surface2);
}
.public-brand { display: inline-flex; align-items: center; gap: .5rem; }
.public-tagline { margin: .35rem 0 0; font-size: .85rem; color: var(--muted); }
.public-wrap { max-width: 640px; }
.public-hero { padding: 1.25rem 1.35rem; margin-bottom: 1rem; }
.public-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.public-ref { font-size: .8rem; margin: 0 0 .25rem; }
.public-hero h1 { margin: 0; font-size: 1.5rem; }
.public-service { margin: .35rem 0 0; color: var(--muted); font-size: .9rem; }
.public-status-pill {
  padding: .4rem .75rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  background: var(--surface2);
  white-space: nowrap;
}
.public-status-pill.status-active { background: rgba(194,120,58,.15); color: var(--primary); }
.public-status-pill.status-done { background: rgba(34,197,94,.12); color: #86efac; }
.public-card { padding: 1rem 1.25rem; margin-bottom: 1rem; }
.public-card h2 { margin: 0 0 .75rem; font-size: 1rem; }
.public-stages { list-style: none; margin: 0; padding: 0; }
.public-stage {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--surface2);
}
.public-stage:last-child { border-bottom: 0; }
.public-stage-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  flex-shrink: 0;
}
.public-stage.status-done .public-stage-icon { background: var(--ok); border-color: var(--ok); }
.public-stage.status-current .public-stage-icon {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194,120,58,.2);
}
.public-stage-label { flex: 1; font-size: .9rem; }
.public-stage.status-current .public-stage-label { font-weight: 700; color: var(--primary); }
.public-stage-now { font-size: .75rem; color: var(--muted); }
.public-stage-now.done { color: #86efac; }
.public-detail { margin: 0; }
.public-note { text-align: center; font-size: .8rem; margin: 0 0 2rem; }
.public-footer { text-align: center; }
.seguimiento-card { padding: 1rem 1.25rem; }
.seguimiento-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: stretch;
}
.seguimiento-input {
  flex: 1;
  min-width: 200px;
  padding: .55rem .65rem;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: var(--bg);
  color: var(--text);
  font-size: .82rem;
}

/* Portal cliente mueblista */
.cliente-body { background: var(--bg); }
.topbar-cliente { border-bottom-color: rgba(194,120,58,.25); }
.cliente-info {
  padding: .85rem 1.1rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--primary);
  font-size: .9rem;
}
.cliente-form .upload-section {
  padding: 1rem;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--surface2);
}
.cliente-form .upload-section h3 { margin: 0 0 .35rem; font-size: .95rem; }
.upload-field { margin-bottom: .65rem; }

.captura-fotos {
  position: relative;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px dashed rgba(194,120,58,.35);
  border-radius: var(--radius);
  background: rgba(194,120,58,.04);
}
.captura-fotos-head { margin-bottom: .75rem; }
.captura-fotos-title { margin: 0 0 .25rem; font-size: .95rem; }
.captura-fotos-hint { margin: 0; font-size: .8rem; }
.btn-captura-foto {
  width: 100%;
  max-width: 280px;
  padding: .75rem 1rem;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
  margin: 0;
}
/* No usar [hidden]/display:none: en móvil el label no abre la cámara. */
.captura-fotos .captura-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}
.captura-status {
  margin: .5rem 0 0;
  font-size: .8rem;
  min-height: 1.1em;
}
.captura-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .85rem;
  align-items: flex-start;
}
.captura-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  min-width: 72px;
  max-width: 72px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: var(--surface2);
}
.captura-preview-item img,
.captura-fotos img.captura-thumb {
  width: 72px !important;
  height: 72px !important;
  max-width: 72px !important;
  max-height: 72px !important;
  object-fit: cover !important;
  display: block;
  margin: 0;
  border: none;
  border-radius: 0;
}
.captura-preview-cap {
  display: none;
}
.captura-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  width: 1.35rem;
  height: 1.35rem;
  border: none;
  border-radius: 999px;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.upload-label { display: block; font-size: .85rem; margin-bottom: .35rem; color: var(--text); }
.upload-section.compact { padding: .75rem; margin-bottom: .75rem; }
.pill-portal { background: rgba(96,165,250,.15); color: #93c5fd; font-size: .72rem; }
.status.warn { color: #fbbf24; }
.status.info { color: #93c5fd; }
.fecha-tag {
  display: inline-block;
  font-size: .68rem;
  padding: .1rem .4rem;
  border-radius: 4px;
  margin-left: .25rem;
  vertical-align: middle;
}
.fecha-tag.solicitada { background: rgba(251,191,36,.12); color: #fbbf24; }
.fecha-tag.confirmada { background: rgba(34,197,94,.12); color: #86efac; }
td .fecha-tag { margin-left: 0; margin-top: .15rem; }
.flow-arrow { color: var(--muted); font-size: .9rem; opacity: .5; }
.flow-help-card { margin-bottom: 1rem; }
.flow-help-card h2 { font-size: 1rem; margin: 0 0 .35rem; }
.flow-next { font-size: .85rem; margin: .65rem 0 0; }

.pedido-cards {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1rem;
}
.pedido-cards .pedido-card {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
}
.pedido-card--late { border-color: rgba(220,38,38,.35); }
.pedido-card-main {
  display: block;
  padding: .9rem 1rem .65rem;
  color: inherit;
  text-decoration: none;
}
.pedido-card-main:hover { text-decoration: none; background: rgba(255,255,255,.02); }
.pedido-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  margin-bottom: .35rem;
}
.pedido-card-title {
  font-size: 1rem;
  margin: 0 0 .35rem;
  line-height: 1.3;
}
.pedido-card-desc {
  font-size: .85rem;
  color: var(--muted);
  margin: 0 0 .5rem;
  line-height: 1.4;
}
.pedido-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .55rem;
  align-items: center;
  font-size: .78rem;
}
.pedido-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: 0 1rem .75rem;
  align-items: center;
}
.pedido-abrir-form {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: flex-end;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--surface2);
  margin-top: .15rem;
  padding-top: .75rem;
}
.pedido-abrir-form .mini-input { min-width: 120px; }
.pedido-table-wrap { display: none; }

.solicitud-abrir-form { flex-wrap: wrap; gap: .35rem; max-width: 220px; }
.solicitud-abrir-form .mini-input { min-width: 88px; }

.solicitud-cards {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1rem;
}
.solicitud-card { padding: 0; overflow: hidden; }
.solicitud-card-main {
  display: block;
  padding: .9rem 1rem .65rem;
  color: inherit;
  text-decoration: none;
}
.solicitud-card-main:hover { text-decoration: none; background: rgba(255,255,255,.02); }
.solicitud-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  margin-bottom: .35rem;
}
.solicitud-card-title {
  font-size: 1rem;
  margin: 0 0 .35rem;
  line-height: 1.3;
}
.solicitud-card-desc {
  font-size: .85rem;
  color: var(--muted);
  margin: 0 0 .5rem;
  line-height: 1.4;
}
.solicitud-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .55rem;
  align-items: center;
  font-size: .78rem;
}
.solicitud-card-sub { font-size: .75rem; margin: .35rem 0 0; }
.solicitud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: 0 1rem .75rem;
  align-items: center;
}
.solicitud-actions--stack .inline-form { display: inline; }
.solicitud-abrir-inline {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: flex-end;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--surface2);
  margin-top: .15rem;
  padding-top: .75rem;
}
.solicitud-abrir-inline .mini-input { min-width: 120px; }
.pill-urgente {
  background: rgba(220,38,38,.2);
  color: #fecaca;
  font-size: .65rem;
  padding: .1rem .4rem;
  border-radius: 999px;
}
.filter-count {
  display: inline-block;
  min-width: 1.1rem;
  padding: 0 .3rem;
  border-radius: 999px;
  background: rgba(217,119,6,.3);
  color: #fde68a;
  font-size: .68rem;
  font-weight: 700;
}
.solicitud-table-wrap { display: none; }
.field-hint { font-size: .85rem; margin: .5rem 0; }

.filter-bar-sub { margin-top: -.35rem; margin-bottom: 1rem; }
.filter-pill-sm { font-size: .72rem; padding: .25rem .55rem; }

/* Flujo unificado: Entrada → Taller → Salida */
.flow-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .5rem;
  margin-bottom: 1rem;
  padding: .65rem .75rem;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
}
.flow-step {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .75rem;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.flow-step:hover { color: var(--text); background: rgba(255,255,255,.06); text-decoration: none; }
.flow-step.active {
  background: rgba(217,119,6,.2);
  color: #fde68a;
  box-shadow: inset 0 0 0 1px rgba(217,119,6,.35);
}
.flow-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(0,0,0,.25);
  font-size: .72rem;
  font-weight: 800;
}
.flow-step.active .flow-num { background: var(--accent); color: #1a1a1a; }
.flow-step--all { margin-left: auto; }
.flow-count {
  min-width: 1.15rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: rgba(217,119,6,.35);
  color: #fde68a;
  font-size: .68rem;
  font-weight: 700;
}
.flow-etapa-pill {
  font-size: .65rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 999px;
  white-space: nowrap;
}
.flow-etapa-entrada { background: rgba(251,191,36,.15); color: #fde68a; }
.flow-etapa-taller { background: rgba(96,165,250,.18); color: #93c5fd; }
.flow-etapa-salida { background: rgba(34,197,94,.15); color: #86efac; }
.flow-etapa-anulado { background: rgba(220,38,38,.15); color: #fecaca; }
.flow-step--muted { opacity: .85; }
.flow-step--muted.active { opacity: 1; border-color: rgba(220,38,38,.45); }
.cancel-banner { border: 1px solid rgba(220,38,38,.35); background: rgba(220,38,38,.08); }
.cancel-banner h2 { color: #fecaca; margin-top: 0; }
.cancel-form-card { border: 1px dashed rgba(220,38,38,.35); }
.cancel-form-card textarea { min-height: 4.5rem; resize: vertical; }
.pedido-cancel-motivo { font-size: .85rem; margin: .35rem 0 0; font-style: italic; }
.public-status-pill.status-cancelled { background: rgba(220,38,38,.12); color: #fecaca; }
.ot-estado-pill.prod-cancelada,
.ot-estado-pill.prod-anulado { background: rgba(220,38,38,.2); color: #fecaca; }

.ot-seg-cards {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1rem;
}
.ot-seg-card { padding: 0; overflow: hidden; }
.ot-seg-card--late { border-color: rgba(220,38,38,.35); }
.ot-seg-card--urgente { border-color: rgba(217,119,6,.4); }
.ot-seg-main {
  display: block;
  padding: .9rem 1rem .5rem;
  color: inherit;
  text-decoration: none;
}
.ot-seg-main:hover { text-decoration: none; background: rgba(255,255,255,.02); }
.ot-seg-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  margin-bottom: .35rem;
}
.ot-seg-title { font-size: 1rem; margin: 0 0 .3rem; line-height: 1.3; }
.ot-seg-desc { font-size: .82rem; color: var(--muted); margin: 0 0 .5rem; line-height: 1.35; }
.ot-seg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .55rem;
  align-items: center;
  font-size: .78rem;
  margin-top: .45rem;
}
.ot-seg-task { font-size: .75rem; margin: .4rem 0 0; }
.ot-seg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: 0 1rem .85rem;
}
.ot-estado-pill {
  font-size: .68rem;
  font-weight: 600;
  padding: .12rem .45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.ot-estado-pill.prod-pendiente { background: rgba(148,163,184,.2); color: #cbd5e1; }
.ot-estado-pill.prod-corte { background: rgba(96,165,250,.2); color: #93c5fd; }
.ot-estado-pill.prod-enchape { background: rgba(var(--primary-rgb),.25); color: var(--primary-light); }
.ot-estado-pill.prod-preparacion { background: rgba(45,106,79,.25); color: #86efac; }
.ot-estado-pill.prod-listo { background: rgba(22,163,74,.2); color: #86efac; }
.ot-seg-table-wrap { display: none; }
.prog-cell { min-width: 140px; }

@media (min-width: 901px) {
  .solicitud-cards { display: none; }
  .solicitud-table-wrap { display: block; }
  .pedido-cards { display: none; }
  .pedido-table-wrap { display: block; }
  .ot-seg-cards { display: none; }
  .ot-seg-table-wrap { display: block; }
}

/* Descripción de cargos (SGC) */
.cargos-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 800px) {
  .cargos-layout { grid-template-columns: 1fr; }
}
.cargos-nav { padding: .85rem; position: sticky; top: 1rem; }
.cargos-nav .card-title { font-size: .85rem; margin-bottom: .65rem; }
.cargos-list { list-style: none; display: flex; flex-direction: column; gap: .2rem; }
.cargo-link {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .5rem .55rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
}
.cargo-link:hover { background: rgba(255,255,255,.03); color: var(--text); text-decoration: none; }
.cargo-link.active {
  background: rgba(194,120,58,.12);
  border-color: rgba(194,120,58,.25);
  color: var(--text);
}
.cargo-link-title { font-size: .82rem; font-weight: 600; line-height: 1.3; }
.cargo-link-code { font-size: .65rem; color: var(--muted); font-family: ui-monospace, monospace; }
.cargo-doc { padding: 1.1rem 1.25rem; }
.cargo-doc-head { margin-bottom: 1rem; padding-bottom: .85rem; border-bottom: 1px solid var(--surface2); }
.cargo-doc-head h2 { margin: .35rem 0 0; font-size: 1.35rem; }
.cargo-doc-meta { font-size: .78rem; margin: 0; }
.sgc-tag {
  display: inline-block;
  font-family: ui-monospace, monospace;
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 4px;
  background: rgba(96,165,250,.12);
  color: #93c5fd;
  margin-right: .35rem;
}
.cargo-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem 1.5rem;
  margin-bottom: 1.25rem;
  font-size: .85rem;
}
.cargo-meta-grid dt { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .2rem; }
.cargo-meta-grid dd { margin: 0; }
.cargo-section { margin-bottom: 1.1rem; }
.cargo-section h3 {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--primary);
  margin: 0 0 .45rem;
  font-weight: 700;
}
.cargo-section p { font-size: .9rem; line-height: 1.55; color: var(--text); }
.cargo-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--text);
}
.cargo-list.bullets { list-style: disc; }
.cargo-list li { margin-bottom: .35rem; }
.cargo-doc-foot {
  margin-top: 1.25rem;
  padding-top: .85rem;
  border-top: 1px solid var(--surface2);
  font-size: .72rem;
  line-height: 1.45;
}
.cargo-form .field { margin-top: .65rem; }

/* Optimización de corte */
.card-warn { border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.06); }
.corte-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .65rem;
  margin-top: .65rem;
}
.corte-params-grid--4 { grid-template-columns: repeat(4, minmax(80px, 1fr)); }
.corte-piezas-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.corte-piezas-table .mini-input { width: 100%; min-width: 52px; }
.corte-piezas-table .mini-input.wide { min-width: 120px; }
.corte-piezas-table .mini-input.qty { max-width: 56px; }
.corte-piezas-table td.center { text-align: center; }
.corte-dim-cell { min-width: 110px; vertical-align: top; }
.corte-cantos-bajo-cota {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .35rem;
  margin-top: .3rem;
  align-items: center;
}
.corte-canto-mini {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  font-size: .68rem;
  color: var(--muted, #666);
}
.corte-canto-mini select.corte-canto-select {
  max-width: 3.2rem;
  padding: .1rem .15rem;
  font-size: .72rem;
}
.corte-cantos-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: .25rem .4rem;
  min-width: 160px;
}
.corte-canto-check {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .68rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.corte-canto-select {
  font-size: .68rem;
  padding: .15rem .2rem;
  border-radius: 4px;
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  max-width: 78px;
}
.corte-svg-wrap svg {
  background: #fff;
  border: 1px solid var(--surface2);
}
.corte-form-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.corte-result-stats { display: flex; flex-wrap: wrap; gap: .65rem; }
.corte-result-stats .stat { min-width: 88px; padding: .55rem .75rem; }
.corte-layouts { display: grid; gap: 1rem; margin-top: 1rem; }
.corte-svg-wrap { margin-top: .5rem; overflow: auto; }
.corte-placa-list { list-style: none; font-size: .8rem; margin: .5rem 0 0; padding: 0; }
.corte-placa-list li { padding: .2rem 0; border-bottom: 1px solid var(--surface2); }
.corte-errors { color: #f87171; font-size: .85rem; margin: .75rem 0 0; padding-left: 1.1rem; }
@media (max-width: 700px) {
  .corte-params-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* Seguimiento operativo taller */
.plazo-wrap { margin-top: .35rem; }
.plazo-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .5rem; margin-bottom: .35rem; font-size: .78rem; }
.plazo-label { font-weight: 600; }
.plazo-sub { font-size: .72rem; }
.plazo-bar {
  height: 8px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.plazo-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .3s;
}
.plazo-ok .plazo-bar-fill { background: linear-gradient(90deg, #22c55e, #4ade80); }
.plazo-warn .plazo-bar-fill { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.plazo-late .plazo-bar-fill { background: linear-gradient(90deg, #dc2626, #f87171); }
.plazo-muted .plazo-bar-fill { background: #64748b; }
.plazo-compact { display: flex; flex-direction: column; gap: .2rem; min-width: 120px; }
.plazo-compact .plazo-bar { height: 6px; }
.plazo-compact-label { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.plazo-late .plazo-compact-label { color: #f87171; }
.plazo-warn .plazo-compact-label { color: #fbbf24; }

.taller-ops-mobile {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1rem;
}
.taller-ops-line {
  padding: 0;
  overflow: hidden;
  margin: 0;
}
.taller-ops-line--late { border-color: rgba(220,38,38,.4); }
.taller-ops-line--active { border-color: rgba(194,120,58,.5); }
.taller-ops-line-sum {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto minmax(5.5rem, 0.9fr);
  gap: .4rem .55rem;
  align-items: center;
  padding: .7rem .8rem;
  cursor: pointer;
  list-style: none;
}
.taller-ops-line-sum::-webkit-details-marker { display: none; }
.taller-ops-line-sum::marker { content: ''; }
.taller-ops-line-cliente {
  display: flex;
  align-items: center;
  gap: .35rem;
  min-width: 0;
}
.taller-ops-line-cliente strong {
  font-size: .92rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.taller-ops-line-urg {
  flex: 0 0 auto;
  padding: .05rem .35rem;
  font-size: .65rem;
}
.taller-ops-line-status {
  justify-self: center;
  font-size: .68rem !important;
  padding: .15rem .45rem !important;
  white-space: nowrap;
}
.taller-ops-line-tiempo {
  justify-self: end;
  text-align: right;
  font-size: .72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}
.taller-ops-line-tiempo.tiempo-queue { color: #fbbf24; }
.taller-ops-line-tiempo.tiempo-run { color: #4ade80; }
.taller-ops-line-tiempo.tiempo-wait { color: #94a3b8; }
.taller-ops-line[open] .taller-ops-line-sum {
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(194,120,58,.07);
}
.taller-ops-line-body {
  padding: .65rem .8rem .8rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.taller-ops-line-meta { font-size: .72rem; line-height: 1.35; }
.taller-ops-line-links {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.taller-ops-line .taller-etapa-acciones {
  flex-direction: column;
  align-items: stretch;
}
.taller-ops-line .taller-etapa-form,
.taller-ops-line .taller-btn-hecho,
.taller-ops-line .btn { width: 100%; }
.taller-ops-line .taller-etapa-form.assign {
  flex-direction: column;
  align-items: stretch;
}
.taller-ops-line .taller-etapa-form.assign .mini-input {
  max-width: none;
  width: 100%;
}

.taller-ops-cards { display: none; }
.taller-ops-card { padding: 0; overflow: hidden; }
.taller-ops-card--late { border-color: rgba(220,38,38,.35); }
.taller-ops-card--active {
  border-color: rgba(194,120,58,.55);
  box-shadow: 0 0 0 1px rgba(194,120,58,.2);
}
.taller-ops-main {
  display: block;
  padding: .9rem 1rem .35rem;
  color: inherit;
  text-decoration: none;
}
.taller-ops-linkblock { color: inherit; text-decoration: none; display: block; }
.taller-ops-top { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .35rem; font-size: .78rem; }
.taller-ops-title { font-size: 1rem; margin: 0 0 .25rem; line-height: 1.3; }
.taller-ops-desc { font-size: .82rem; margin: 0 0 .65rem; line-height: 1.35; }
.taller-ops-resp {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .65rem;
  align-items: baseline;
  padding: .55rem .65rem;
  background: rgba(255,255,255,.03);
  border-radius: 8px;
  margin-bottom: .65rem;
  font-size: .8rem;
}
.taller-ops-resp-name { font-weight: 700; color: var(--primary); }
.taller-ops-resp-fase { font-size: .75rem; }
.taller-ops-resp-desde { font-size: .72rem; }
.taller-ops-stage-panel {
  margin: .65rem 0 .75rem;
  padding: .75rem .85rem;
  border-radius: 10px;
  border: 1px solid rgba(194,120,58,.35);
  background: rgba(194,120,58,.08);
}
.taller-ops-stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .65rem;
  margin-bottom: .55rem;
}
.taller-ops-stage-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--primary);
}
.taller-etapa-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}
.taller-etapa-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  margin: 0;
}
.taller-etapa-form.assign .mini-input {
  min-width: 9rem;
  max-width: 12rem;
}
.taller-btn-hecho {
  font-weight: 700;
  min-height: 2.1rem;
  padding-left: .9rem;
  padding-right: .9rem;
}
.taller-ops-accion-cell .taller-etapa-acciones {
  flex-direction: column;
  align-items: stretch;
}
.taller-ops-accion-cell .taller-etapa-form { width: 100%; }
.taller-ops-accion-cell .taller-btn-hecho,
.taller-ops-accion-cell .btn {
  width: 100%;
  justify-content: center;
}
.taller-ops-plazo { margin-bottom: .55rem; }
.taller-ops-plazo-fecha { font-size: .75rem; display: block; margin-bottom: .25rem; }
.taller-ops-pipeline { margin-top: .5rem; }
.taller-ops-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: 0 1rem .85rem;
}
.taller-ops-table-wrap { display: none; }

.live-update-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.25rem;
  margin: 0 0 1rem;
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(194,120,58,.45);
  background: linear-gradient(135deg, rgba(194,120,58,.18), rgba(194,120,58,.06));
  box-shadow: 0 0 0 1px rgba(194,120,58,.08);
}
.live-update-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem .75rem;
}
.live-update-dot {
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74,222,128,.25);
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .7; transform: scale(.92); }
}
.live-update-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--primary);
}
.live-update-time {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.live-update-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
}
.live-update-next { font-size: .8rem; }
.live-update-next strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.plazo-cell { min-width: 140px; }

@media (max-width: 900px) {
  .live-update-banner {
    flex-direction: column;
    align-items: stretch;
    padding: .65rem .8rem;
    gap: .45rem;
  }
  .live-update-time { font-size: .95rem; }
  .live-update-meta { justify-content: space-between; }
  .page-head .head-actions { display: none; }
  .flow-strip--compact { margin-bottom: .65rem; }
  .filter-bar { margin-bottom: .65rem; gap: .3rem; }
  .filter-pill { font-size: .72rem; padding: .3rem .55rem; }
}

@media (min-width: 901px) {
  .taller-ops-mobile { display: none; }
  .taller-ops-table-wrap { display: block; }
}

/* ===== Overrides para temas claros (clasico + minimalista) ===== */
body[data-theme="clasico"],
body[data-theme="minimalista"] {
  /* Sidebar: fondo ligeramente tintado para que se distinga */
  --sidebar-bg: #f0f1f4;
  --sidebar-hover: rgba(0,0,0,.05);
  --sidebar-active-bg: rgba(26,115,232,.12);
}

body[data-theme="clasico"] .sidebar {
  background: #1f2937;
  border-right-color: #111827;
  color: #d1d5db;
}
body[data-theme="minimalista"] .sidebar {
  background: var(--sidebar-bg);
  border-right-color: #d1d5db;
}

body[data-theme="clasico"] .sidebar-group {
  background: rgba(255,255,255,.06);
}
body[data-theme="minimalista"] .sidebar-group {
  background: rgba(0,0,0,.04);
}

body[data-theme="clasico"] .sidebar-group-toggle:hover {
  background: rgba(255,255,255,.08);
}
body[data-theme="minimalista"] .sidebar-group-toggle:hover {
  background: var(--sidebar-hover);
}

body[data-theme="clasico"] .sidebar-group.is-open .sidebar-group-toggle {
  background: rgba(255,255,255,.05);
}
body[data-theme="minimalista"] .sidebar-group.is-open .sidebar-group-toggle {
  background: rgba(0,0,0,.03);
}

/* Sidebar group label colors — Clásico (sidebar oscuro: tonos claros) */
body[data-theme="clasico"] .sidebar-group--general .sidebar-group-toggle {
  border-left-color: #94a3b8; color: #cbd5e1;
}
body[data-theme="clasico"] .sidebar-group--cliente .sidebar-group-toggle,
body[data-theme="clasico"] .sidebar-group--pedidos .sidebar-group-toggle {
  border-left-color: #fbbf24; color: #fde68a;
}
body[data-theme="clasico"] .sidebar-group--ops .sidebar-group-toggle {
  border-left-color: #60a5fa; color: #93c5fd;
}
body[data-theme="clasico"] .sidebar-group--sgc .sidebar-group-toggle {
  border-left-color: #4ade80; color: #bbf7d0;
}
body[data-theme="clasico"] .sidebar-group--sistema .sidebar-group-toggle {
  border-left-color: #60a5fa; color: #bfdbfe;
}

/* Sidebar group label colors — Minimalista (sidebar claro: tonos oscuros) */
body[data-theme="minimalista"] .sidebar-group--general .sidebar-group-toggle {
  border-left-color: #64748b; color: #475569;
}
body[data-theme="minimalista"] .sidebar-group--cliente .sidebar-group-toggle,
body[data-theme="minimalista"] .sidebar-group--pedidos .sidebar-group-toggle {
  border-left-color: #d97706; color: #92400e;
}
body[data-theme="minimalista"] .sidebar-group--ops .sidebar-group-toggle {
  color: var(--primary-dark);
}
body[data-theme="minimalista"] .sidebar-group--sgc .sidebar-group-toggle {
  border-left-color: #16a34a; color: #166534;
}
body[data-theme="minimalista"] .sidebar-group--sistema .sidebar-group-toggle {
  border-left-color: #2563eb; color: #1e40af;
}

/* Sidebar links — Clásico (sidebar oscuro) */
body[data-theme="clasico"] .sidebar-link {
  color: #94a3b8;
}
body[data-theme="clasico"] .sidebar-link:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,.08);
}
body[data-theme="clasico"] .sidebar-link.active {
  color: #ffffff;
  background: rgba(0,120,212,.3);
}
body[data-theme="clasico"] .sidebar-link.active .sidebar-link-label {
  color: #a0c4ff;
}

/* Sidebar links — Minimalista (sidebar claro) */
body[data-theme="minimalista"] .sidebar-link:hover {
  background: var(--sidebar-hover);
}
body[data-theme="minimalista"] .sidebar-link.active {
  background: var(--sidebar-active-bg);
}
body[data-theme="minimalista"] .sidebar-link.active .sidebar-link-label {
  color: var(--primary-dark);
}

/* Sidebar badge — Clásico */
body[data-theme="clasico"] .sidebar-badge {
  background: rgba(217,119,6,.25);
  color: #fbbf24;
}
/* Sidebar badge — Minimalista */
body[data-theme="minimalista"] .sidebar-badge {
  background: rgba(217,119,6,.15);
  color: #92400e;
}

/* Sidebar footer */
body[data-theme="clasico"] .sidebar-foot {
  border-top-color: rgba(255,255,255,.1);
}
body[data-theme="minimalista"] .sidebar-foot {
  border-top-color: #d1d5db;
}

/* Sidebar brand — Clásico (sidebar oscuro) */
body[data-theme="clasico"] .sidebar-brand {
  color: #f1f5f9;
  border-bottom-color: rgba(255,255,255,.1);
}
/* Sidebar user — Clásico */
body[data-theme="clasico"] .sidebar-user-name { color: #e2e8f0; }
body[data-theme="clasico"] .sidebar-user-role { color: #94a3b8; }
body[data-theme="clasico"] .sidebar-logout { color: #94a3b8; }
body[data-theme="clasico"] .sidebar-logout:hover { color: #93c5fd; }
body[data-theme="clasico"] .sidebar-version { color: #64748b; }

/* Botones */
body[data-theme="clasico"] .btn-secondary:hover,
body[data-theme="minimalista"] .btn-secondary:hover {
  background: #d1d5db;
}
body[data-theme="clasico"] .btn-danger,
body[data-theme="minimalista"] .btn-danger {
  background: rgba(220,38,38,.1);
  color: #b91c1c;
  border-color: rgba(220,38,38,.3);
}
body[data-theme="clasico"] .btn-danger:hover,
body[data-theme="minimalista"] .btn-danger:hover {
  background: rgba(220,38,38,.2);
  color: #7f1d1d;
}

/* Flash messages */
body[data-theme="clasico"] .flash.error,
body[data-theme="minimalista"] .flash.error {
  background: rgba(220,38,38,.08);
  color: #991b1b;
  border-color: rgba(220,38,38,.25);
}
body[data-theme="clasico"] .flash.ok,
body[data-theme="minimalista"] .flash.ok {
  background: rgba(22,163,74,.08);
  color: #166534;
  border-color: rgba(22,163,74,.25);
}

/* Badges / pills de estado: texto saturado oscuro */
body[data-theme="clasico"] .badge-soon,
body[data-theme="minimalista"] .badge-soon,
body[data-theme="clasico"] .badge-warn,
body[data-theme="minimalista"] .badge-warn {
  color: #92400e;
}
body[data-theme="clasico"] .badge-live,
body[data-theme="minimalista"] .badge-live {
  color: #166534;
}

/* Role pills */
body[data-theme="clasico"] .role-pill.role-admin,
body[data-theme="minimalista"] .role-pill.role-admin {
  color: var(--primary-dark);
}
body[data-theme="clasico"] .role-pill.role-oficina,
body[data-theme="minimalista"] .role-pill.role-oficina {
  color: #1e40af;
}
body[data-theme="clasico"] .role-pill.role-taller,
body[data-theme="minimalista"] .role-pill.role-taller {
  color: #166534;
}
body[data-theme="clasico"] .role-pill.role-despacho,
body[data-theme="minimalista"] .role-pill.role-despacho {
  color: #6b21a8;
}
body[data-theme="clasico"] .role-pill.role-armado,
body[data-theme="minimalista"] .role-pill.role-armado {
  color: #854d0e;
}
body[data-theme="clasico"] .role-pill.role-cliente,
body[data-theme="minimalista"] .role-pill.role-cliente {
  color: #0369a1;
}

/* Tipo/trabajo badges */
body[data-theme="clasico"] .tipo-particular,
body[data-theme="minimalista"] .tipo-particular { color: #1e40af; }
body[data-theme="clasico"] .tipo-obra,
body[data-theme="minimalista"] .tipo-obra { color: #9a3412; }
body[data-theme="clasico"] .trabajo-solo_corte,
body[data-theme="minimalista"] .trabajo-solo_corte { color: #475569; }
body[data-theme="clasico"] .trabajo-corte_enchape,
body[data-theme="minimalista"] .trabajo-corte_enchape { color: #1e40af; }
body[data-theme="clasico"] .trabajo-fab_particular,
body[data-theme="minimalista"] .trabajo-fab_particular { color: #166534; }
body[data-theme="clasico"] .trabajo-fab_obra,
body[data-theme="minimalista"] .trabajo-fab_obra { color: #9a3412; }
body[data-theme="clasico"] .trabajo-instalacion_terreno,
body[data-theme="minimalista"] .trabajo-instalacion_terreno { color: #6b21a8; }

/* OT estado pills */
body[data-theme="clasico"] .ot-estado-pill.prod-pendiente,
body[data-theme="minimalista"] .ot-estado-pill.prod-pendiente { color: #475569; }
body[data-theme="clasico"] .ot-estado-pill.prod-corte,
body[data-theme="minimalista"] .ot-estado-pill.prod-corte { color: #1e40af; }
body[data-theme="clasico"] .ot-estado-pill.prod-enchape,
body[data-theme="minimalista"] .ot-estado-pill.prod-enchape { color: var(--primary-dark); }
body[data-theme="clasico"] .ot-estado-pill.prod-preparacion,
body[data-theme="minimalista"] .ot-estado-pill.prod-preparacion { color: #166534; }
body[data-theme="clasico"] .ot-estado-pill.prod-listo,
body[data-theme="minimalista"] .ot-estado-pill.prod-listo { color: #166534; }

/* Code tag */
body[data-theme="clasico"] code,
body[data-theme="minimalista"] code {
  color: #c2410c;
}

/* Hover transparencias invertidas (blanco→negro) */
body[data-theme="clasico"] .pedido-card-main:hover,
body[data-theme="minimalista"] .pedido-card-main:hover,
body[data-theme="clasico"] .solicitud-card-main:hover,
body[data-theme="minimalista"] .solicitud-card-main:hover,
body[data-theme="clasico"] .ot-seg-main:hover,
body[data-theme="minimalista"] .ot-seg-main:hover,
body[data-theme="clasico"] .cargo-link:hover,
body[data-theme="minimalista"] .cargo-link:hover {
  background: rgba(0,0,0,.03);
}

/* Flow strip labels */
body[data-theme="clasico"] .flow-etapa-entrada,
body[data-theme="minimalista"] .flow-etapa-entrada { color: #92400e; }
body[data-theme="clasico"] .flow-etapa-taller,
body[data-theme="minimalista"] .flow-etapa-taller { color: #1e40af; }
body[data-theme="clasico"] .flow-etapa-salida,
body[data-theme="minimalista"] .flow-etapa-salida { color: #166534; }

/* Flow step colors */
body[data-theme="clasico"] .flow-step .flow-label,
body[data-theme="minimalista"] .flow-step .flow-label { color: var(--muted); }
body[data-theme="clasico"] .flow-step.active .flow-label,
body[data-theme="minimalista"] .flow-step.active .flow-label { color: var(--text); }
body[data-theme="clasico"] .flow-step:hover,
body[data-theme="minimalista"] .flow-step:hover {
  background: rgba(0,0,0,.04);
}

/* Stat warn */
body[data-theme="clasico"] .stat-warn .stat-n,
body[data-theme="minimalista"] .stat-warn .stat-n { color: #b45309; }

/* Status pills */
body[data-theme="clasico"] .status.warn,
body[data-theme="minimalista"] .status.warn { color: #b45309; }
body[data-theme="clasico"] .status.info,
body[data-theme="minimalista"] .status.info { color: #1e40af; }

/* Fecha tags */
body[data-theme="clasico"] .fecha-tag.solicitada,
body[data-theme="minimalista"] .fecha-tag.solicitada { color: #92400e; }
body[data-theme="clasico"] .fecha-tag.confirmada,
body[data-theme="minimalista"] .fecha-tag.confirmada { color: #166534; }

/* Progreso step labels */
body[data-theme="clasico"] .prog-step.status-done .prog-label,
body[data-theme="minimalista"] .prog-step.status-done .prog-label { color: #166534; }

/* Portal public status */
body[data-theme="clasico"] .public-status-pill.status-done,
body[data-theme="minimalista"] .public-status-pill.status-done { color: #166534; }
body[data-theme="clasico"] .public-stage-now.done,
body[data-theme="minimalista"] .public-stage-now.done { color: #166534; }

/* Pill portal */
body[data-theme="clasico"] .pill-portal,
body[data-theme="minimalista"] .pill-portal { color: #1e40af; }

/* Op name */
body[data-theme="clasico"] .op-name,
body[data-theme="minimalista"] .op-name { color: #1e40af; }

/* Cargo section link */
body[data-theme="clasico"] .cargo-section-link,
body[data-theme="minimalista"] .cargo-section-link { color: #1e40af; }

/* Perm fixed */
body[data-theme="clasico"] .perm-fixed,
body[data-theme="minimalista"] .perm-fixed { color: #16a34a; }

/* Auth wrap */
body[data-theme="clasico"] .auth-wrap,
body[data-theme="minimalista"] .auth-wrap {
  background: radial-gradient(circle at top, rgba(26,115,232,.06), transparent 40%), var(--bg);
}

/* Plazo bars */
body[data-theme="clasico"] .plazo-warn .plazo-compact-label,
body[data-theme="minimalista"] .plazo-warn .plazo-compact-label { color: #b45309; }

/* Taller ops */
body[data-theme="clasico"] .taller-ops-line-tiempo.tiempo-queue,
body[data-theme="minimalista"] .taller-ops-line-tiempo.tiempo-queue { color: #b45309; }

body[data-theme="clasico"] .taller-ops-resp-name,
body[data-theme="minimalista"] .taller-ops-resp-name { color: var(--primary); }

/* Files btn */
body[data-theme="clasico"] .btn-files,
body[data-theme="minimalista"] .btn-files { color: #1e40af; }

/* Perm preview */
body[data-theme="clasico"] .perm-preview-box,
body[data-theme="minimalista"] .perm-preview-box {
  background: rgba(0,0,0,.03);
}

/* Tabla line separators */
body[data-theme="clasico"] .taller-ops-line,
body[data-theme="minimalista"] .taller-ops-line {
  border-bottom-color: #e5e7eb;
}

/* Taller table hovers */
body[data-theme="clasico"] .taller-ops-line:hover,
body[data-theme="minimalista"] .taller-ops-line:hover {
  background: rgba(0,0,0,.02);
}

/* Requerimientos de compra */
.compra-nuevo {
  padding: 0;
}
.compra-nuevo-sum {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem;
  cursor: pointer;
  user-select: none;
}
.compra-nuevo-sum::-webkit-details-marker { display: none; }
.compra-nuevo-sum::marker { content: ''; }
.compra-nuevo-title {
  font-size: 1.05rem;
  font-weight: 650;
}
.compra-nuevo-title::before {
  content: '▸ ';
  display: inline-block;
  color: var(--muted);
  transition: transform .15s ease;
}
.compra-nuevo[open] .compra-nuevo-title::before {
  transform: rotate(90deg);
}
.compra-nuevo-hint { font-size: .82rem; }
.compra-nuevo-hint-open { display: none; }
.compra-nuevo[open] .compra-nuevo-hint-closed { display: none; }
.compra-nuevo[open] .compra-nuevo-hint-open { display: inline; }
.compra-nuevo .compra-form {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--surface2);
}
.compra-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .65rem 1rem;
  margin-top: .5rem;
}
.compra-desc { max-width: 280px; font-size: .85rem; }
.compra-tipo { font-size: .78rem; color: var(--muted); }
.compra-nat {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 4px;
  line-height: 1.3;
  white-space: nowrap;
}
.compra-nat-compra { background: rgba(59,130,246,.18); color: #93c5fd; }
.compra-nat-consumo_interno { background: rgba(16,185,129,.15); color: #6ee7b7; }
.compra-nat-despacho_obra { background: rgba(245,158,11,.18); color: #fcd34d; }
.compra-nat-suministro_terreno { background: rgba(244,114,182,.15); color: #f9a8d4; }
.compra-prio {
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.compra-prio-normal { background: rgba(148,163,184,.2); color: var(--muted); }
.compra-prio-urgente { background: rgba(220,38,38,.18); color: #fecaca; }
.compra-estado {
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 6px;
  white-space: nowrap;
}
.compra-estado-solicitado { background: rgba(96,165,250,.15); color: #93c5fd; }
.compra-estado-en_revision { background: rgba(168,85,247,.15); color: #d8b4fe; }
.compra-estado-aprobado { background: rgba(34,197,94,.15); color: #86efac; }
.compra-estado-en_compra { background: rgba(251,191,36,.18); color: #fbbf24; }
.compra-estado-recibido_parcial { background: rgba(45,106,79,.2); color: #6ee7b7; }
.compra-estado-recibido { background: rgba(22,163,74,.2); color: #4ade80; }
.compra-estado-preparando { background: rgba(251,191,36,.18); color: #fbbf24; }
.compra-estado-listo_retiro { background: rgba(45,106,79,.2); color: #6ee7b7; }
.compra-estado-entregado_bodega { background: rgba(22,163,74,.2); color: #4ade80; }
.compra-estado-en_ruta { background: rgba(14,165,233,.18); color: #7dd3fc; }
.compra-estado-entregado_obra { background: rgba(22,163,74,.2); color: #4ade80; }
.compra-estado-rechazado { background: rgba(220,38,38,.15); color: #fca5a5; }
.compra-estado-anulado { background: rgba(100,116,139,.2); color: #94a3b8; }
.compra-row--urgente { border-left: 3px solid var(--danger); }
.compra-estado-form { margin: 0; min-width: 140px; }
.compra-estado-select { min-width: 138px; font-size: .78rem; }
@media (max-width: 700px) {
  .compra-hide-m { display: none; }
  .compra-table { width: 100%; }
  .compra-desc { max-width: none; }
  .compra-estado-form, .compra-estado-select { min-width: 0; width: 100%; }
}
.compra-side { display: flex; flex-direction: column; gap: 1rem; }
.compra-detail-grid { align-items: start; }
body[data-theme="clasico"] .compra-prio-urgente,
body[data-theme="minimalista"] .compra-prio-urgente { color: #991b1b; background: rgba(220,38,38,.1); }
body[data-theme="clasico"] .compra-estado-solicitado,
body[data-theme="minimalista"] .compra-estado-solicitado { color: #1e40af; }
body[data-theme="clasico"] .compra-estado-en_revision,
body[data-theme="minimalista"] .compra-estado-en_revision { color: #6b21a8; }
body[data-theme="clasico"] .compra-estado-aprobado,
body[data-theme="minimalista"] .compra-estado-aprobado,
body[data-theme="clasico"] .compra-estado-recibido,
body[data-theme="minimalista"] .compra-estado-recibido { color: #166534; }
body[data-theme="clasico"] .compra-estado-en_compra,
body[data-theme="minimalista"] .compra-estado-en_compra { color: #92400e; }
body[data-theme="clasico"] .compra-estado-rechazado,
body[data-theme="minimalista"] .compra-estado-rechazado { color: #991b1b; }
body[data-theme="clasico"] .compra-nat-compra,
body[data-theme="minimalista"] .compra-nat-compra { color: #1e40af; background: rgba(59,130,246,.12); }
body[data-theme="clasico"] .compra-nat-consumo_interno,
body[data-theme="minimalista"] .compra-nat-consumo_interno { color: #065f46; background: rgba(16,185,129,.12); }
body[data-theme="clasico"] .compra-nat-despacho_obra,
body[data-theme="minimalista"] .compra-nat-despacho_obra { color: #92400e; background: rgba(245,158,11,.12); }
body[data-theme="clasico"] .compra-nat-suministro_terreno,
body[data-theme="minimalista"] .compra-nat-suministro_terreno { color: #9d174d; background: rgba(244,114,182,.12); }
body[data-theme="clasico"] .compra-estado-preparando,
body[data-theme="minimalista"] .compra-estado-preparando,
body[data-theme="clasico"] .compra-estado-listo_retiro,
body[data-theme="minimalista"] .compra-estado-listo_retiro { color: #92400e; }
body[data-theme="clasico"] .compra-estado-en_ruta,
body[data-theme="minimalista"] .compra-estado-en_ruta { color: #0369a1; }
body[data-theme="clasico"] .compra-estado-entregado_bodega,
body[data-theme="minimalista"] .compra-estado-entregado_bodega,
body[data-theme="clasico"] .compra-estado-entregado_obra,
body[data-theme="minimalista"] .compra-estado-entregado_obra { color: #166534; }

/* Proyectos particulares */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .65rem 1rem;
}
.dropzone-img {
  border: 1.5px dashed var(--border, #3a4458);
  border-radius: 10px;
  padding: 1.1rem 1rem;
  text-align: center;
  background: rgba(255,255,255,.03);
  margin-bottom: .85rem;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone-img.is-dragover {
  border-color: var(--accent, #60a5fa);
  background: rgba(96,165,250,.08);
}
.dropzone-img-title {
  margin: 0 0 .2rem;
  font-weight: 600;
  font-size: .95rem;
}
.dropzone-img-hint { margin: 0 0 .75rem; font-size: .8rem; }
.dropzone-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.dropzone-img { position: relative; }
.dropzone-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: .85rem;
  justify-content: flex-start;
  text-align: left;
}
.dropzone-thumb-item {
  position: relative;
  width: 88px;
}
.dropzone-thumb {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border, #3a4458);
  display: block;
  background: #111;
}
.dropzone-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.dropzone-thumb-cap {
  display: block;
  margin-top: .25rem;
  font-size: .68rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dropzone-thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: .9rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.dropzone-count {
  margin: .65rem 0 0;
  font-size: .8rem;
  text-align: left;
}
.dropzone-file-list {
  list-style: none;
  margin: .75rem 0 0;
  padding: 0;
  text-align: left;
  font-size: .8rem;
  color: var(--muted);
}
.dropzone-file-list li { padding: .15rem 0; }

/* ——— Pizarra tipo aeropuerto (FIDS) ——— */
.fids-board {
  margin: 1.25rem 0 2rem;
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  color: #e2e8f0;
  font-family: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
.fids-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .85rem 1.1rem;
  background: linear-gradient(180deg, #111827, #0b1220);
  border-bottom: 1px solid #243044;
}
.fids-brand {
  font-weight: 700;
  letter-spacing: .12em;
  color: #fbbf24;
  margin-right: .65rem;
}
.fids-subtitle {
  font-size: .78rem;
  color: #94a3b8;
  letter-spacing: .04em;
}
.fids-clock {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fde68a;
  letter-spacing: .08em;
}
.fids-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .55rem 1rem;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
}
.fids-filter {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  text-decoration: none;
  padding: .28rem .55rem;
  border: 1px solid transparent;
  border-radius: 4px;
}
.fids-filter:hover { color: #fde68a; border-color: #334155; }
.fids-filter.active {
  color: #0b1220;
  background: #fbbf24;
  border-color: #fbbf24;
  font-weight: 700;
}
.fids-table-wrap { overflow: auto; max-height: min(70vh, 720px); }
.fids-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}
.fids-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #111827;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .65rem;
  padding: .55rem .5rem;
  border-bottom: 1px solid #334155;
  white-space: nowrap;
  text-align: left;
}
.fids-table tbody td {
  padding: .55rem .5rem;
  border-bottom: 1px solid #1a2332;
  vertical-align: top;
  color: #e2e8f0;
}
.fids-table tbody tr {
  animation: fids-row-in .35s ease both;
}
.fids-table tbody tr:nth-child(even) { background: rgba(15, 23, 42, .55); }
.fids-table tbody tr:hover { background: rgba(251, 191, 36, .08); }
@keyframes fids-row-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.fids-code code {
  color: #fde68a;
  background: transparent;
  font-size: .85rem;
  letter-spacing: .04em;
}
.fids-code a { text-decoration: none; }
.fids-flag {
  display: inline-block;
  margin-left: .3rem;
  font-size: .58rem;
  font-weight: 700;
  color: #0b1220;
  background: #f97316;
  padding: .1rem .28rem;
  border-radius: 2px;
  letter-spacing: .04em;
}
.fids-flag-late {
  background: #ef4444;
  color: #fff;
  animation: fids-blink 1.4s ease-in-out infinite;
}
@keyframes fids-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}
.fids-client { font-weight: 600; color: #f8fafc; max-width: 160px; }
.fids-desc, .fids-obs { max-width: 180px; color: #cbd5e1; }
.fids-date { white-space: nowrap; }
.fids-status { min-width: 130px; }
.fids-status-txt { display: block; margin-top: .2rem; color: #cbd5e1; font-size: .72rem; }
.fids-pill {
  display: inline-block;
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .12rem .35rem;
  border-radius: 3px;
  background: #334155;
  color: #e2e8f0;
}
.fids-etapa-entrada { background: rgba(251,191,36,.2); color: #fbbf24; }
.fids-etapa-taller { background: rgba(96,165,250,.2); color: #93c5fd; }
.fids-etapa-salida { background: rgba(52,211,153,.2); color: #6ee7b7; }
.fids-etapa-cerrado { background: rgba(148,163,184,.2); color: #94a3b8; }
.fids-late {
  box-shadow: inset 4px 0 0 #ef4444;
  background: rgba(239, 68, 68, .18) !important;
}
.fids-late td,
.fids-late .fids-client,
.fids-late .fids-desc,
.fids-late .fids-obs,
.fids-late .fids-status-txt {
  color: #fecaca !important;
  font-weight: 600;
}
.fids-late .fids-code code,
.fids-late .fids-date {
  color: #fca5a5 !important;
  font-weight: 700;
}
.fids-late .fids-pill {
  background: rgba(239, 68, 68, .45);
  color: #fff;
}
.fids-late:hover {
  background: rgba(239, 68, 68, .28) !important;
}
.fids-urgent { box-shadow: inset 3px 0 0 #f97316; }
.fids-internal .fids-client::before {
  content: "INT · ";
  color: #a78bfa;
  font-size: .65rem;
}
.fids-done { opacity: .72; }
.fids-done td { color: #94a3b8; }
.fids-new .fids-pill { background: rgba(251,191,36,.25); }
.fids-empty td {
  text-align: center;
  padding: 2rem;
  color: #64748b;
  letter-spacing: .08em;
}
.fids-th-turno { width: 4.5rem; text-align: center; }
.fids-turno { text-align: center; vertical-align: middle; white-space: nowrap; }
.fids-turno-ctl {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
}
.fids-turno-form { display: inline; margin: 0; }
.fids-turno-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: 1px solid #334155;
  border-radius: 4px;
  background: #1e293b;
  color: #fbbf24;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.fids-turno-btn:hover { background: #334155; color: #fde68a; }
.fids-turno-btn--off {
  opacity: .25;
  cursor: default;
  border-color: transparent;
  background: transparent;
  color: #64748b;
}
.fids-turno-pos {
  font-size: .7rem;
  font-weight: 700;
  color: #94a3b8;
  min-width: 1.4rem;
  text-align: center;
}
.fids-turno-na { color: #475569; }
.fids-foot-link { color: #93c5fd; text-decoration: none; }
.fids-foot-link:hover { text-decoration: underline; }
.fids-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1rem;
  padding: .55rem 1rem;
  font-size: .68rem;
  color: #64748b;
  border-top: 1px solid #1e293b;
  background: #0f172a;
}
.fids-legend { display: flex; flex-wrap: wrap; gap: .55rem; }
.fids-leg::before {
  content: "";
  display: inline-block;
  width: .55rem;
  height: .55rem;
  margin-right: .25rem;
  border-radius: 1px;
  vertical-align: middle;
}
.fids-leg-late::before { background: #ef4444; }
.fids-leg-urgent::before { background: #f97316; }
.fids-leg-internal::before { background: #a78bfa; }
.fids-leg-done::before { background: #64748b; }

@media (max-width: 900px) {
  .fids-table { font-size: .72rem; }
  .fids-desc, .fids-obs, .fids-client { max-width: 120px; }
}

.corte-med-corte { font-size: .72rem; color: #b45309; margin-top: .2rem; white-space: nowrap; }

.btn-success, .btn-small.btn-success { background: #15803d; color: #fff; }
.btn-success:hover { background: #166534; text-decoration: none; }
.entrega-card { border-left: 4px solid #15803d; }
.entrega-form { display: grid; gap: .6rem; max-width: 560px; margin-top: .5rem; }
.entrega-modos { display: flex; flex-wrap: wrap; gap: 1rem; }
.entrega-hecha { border-left-color: #64748b; }
.entrega-quick { display: inline-block; margin: 0; }
.entrega-quick .btn { white-space: nowrap; }
.fids-entregado .btn { padding: .2rem .45rem; font-size: .7rem; }

/* Inicio: resumen compacto */
.stats-mini { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .75rem; }
.stats-mini-item {
  display: inline-flex; align-items: baseline; gap: .3rem;
  padding: .28rem .6rem; border-radius: 999px; font-size: .78rem;
  background: var(--surface2, #e2e8f0); color: var(--text); text-decoration: none; white-space: nowrap;
}
.stats-mini-item:hover { text-decoration: none; filter: brightness(.95); }
.stats-mini-item b { font-size: .95rem; }
.stats-mini-item.sm-danger b { color: #dc2626; }
.stats-mini-item.sm-warn b { color: #d97706; }
.stats-mini-item.sm-info b { color: #2563eb; }
.stats-mini-item.sm-ok b { color: #16a34a; }

/* Pizarra: arrastre de turnos */
.fids-grip {
  display: inline-block; cursor: grab; touch-action: none; user-select: none;
  padding: .15rem .35rem; margin-right: .2rem; font-size: 1.05rem; line-height: 1;
  color: #fbbf24; border-radius: 4px;
}
.fids-grip:active { cursor: grabbing; background: rgba(251,191,36,.2); }
.fids-grip-hint { color: #fbbf24; }
.fids-table tr.fids-dragging { outline: 2px solid #fbbf24; opacity: .85; }
.fids-table tr.fids-moved .fids-turno-pos { color: #fbbf24; font-weight: 700; }
.fids-save-bar {
  position: sticky; bottom: .5rem; top: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin: .6rem 0 0; background: #fffbeb;
}
.fids-save-bar[hidden] { display: none; }
.fids-save-bar .mini-input { flex: 1 1 10rem; min-width: 8rem; }

.fids-clock-box { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.fids-planchas-total { font-size: .78rem; color: #cbd5e1; text-decoration: none; white-space: nowrap; }
.fids-planchas-total:hover { text-decoration: underline; }
.fids-planchas-total b { font-size: 1.05rem; color: #fde68a; }
.fids-planchas-sin { color: #94a3b8; font-size: .7rem; }
.fids-planchas { text-align: center; font-weight: 700; color: #fde68a; }

/* Pizarra en móvil: encabezado y filtros en una línea, más alto para la lista */
@media (max-width: 720px) {
  .stats-mini { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: .5rem; }
  .stats-mini::-webkit-scrollbar { display: none; }
  .stats-mini-item { padding: .22rem .5rem; font-size: .72rem; }
  .fids-head { align-items: center; gap: .5rem; padding: .5rem .7rem; }
  .fids-title { flex: 0 0 auto; }
  .fids-subtitle { display: none; }
  .fids-clock-box { flex-direction: row; align-items: baseline; gap: .6rem; min-width: 0; }
  .fids-clock { font-size: .95rem; }
  .fids-planchas-total { font-size: .72rem; }
  .fids-planchas-sin { display: none; }
  .fids-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: .4rem .6rem; }
  .fids-filters::-webkit-scrollbar { display: none; }
  .fids-filter { flex: 0 0 auto; }
  .fids-table-wrap { max-height: calc(100vh - 190px); }
}

.fids-planchas-total {
  display: inline-flex; align-items: baseline; gap: .35rem;
  background: #16a34a; color: #fff; font-weight: 700; font-size: .9rem;
  padding: .3rem .7rem; border-radius: 6px; box-shadow: 0 0 0 1px rgba(255,255,255,.12);
}
.fids-planchas-total:hover { background: #15803d; text-decoration: none; color: #fff; }
.fids-planchas-total b { color: #fff; font-size: 1.25rem; }
.fids-planchas-sin { color: #dcfce7; font-weight: 500; }
@media (max-width: 720px) {
  .fids-planchas-total { font-size: .8rem; padding: .25rem .55rem; }
  .fids-planchas-total b { font-size: 1.1rem; }
}

.table-scroll { -webkit-overflow-scrolling: touch; }
@media (max-width: 720px) {
  .hide-sm { display: none; }
  .corte-lista-table code { white-space: nowrap; }
  .corte-lista-table th, .corte-lista-table td { padding: .45rem .4rem; }
  .corte-lista-table .planchas-input { width: 3.2rem; }
}

/* Retrabajos */
.nowrap { white-space: nowrap; }
.rt-form-sum { cursor: pointer; font-weight: 700; font-size: 1rem; }
.rt-form { display: grid; gap: .65rem; margin-top: .75rem; }
.rt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; }
.rt-form textarea { width: 100%; resize: vertical; }
.rt-actions { display: flex; gap: .5rem; }
.rt-filtros { align-items: center; gap: .4rem; flex-wrap: wrap; margin: .75rem 0 .5rem; }
.rt-desc { min-width: 16rem; }
.rt-desc .pill { font-size: .68rem; margin-right: .25rem; }
.rt-ot-list { margin: .4rem 0 0; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .85rem; }

/* Discos de sierra */
.ds-alerta { border-left: 4px solid #dc2626; background: rgba(220,38,38,.08); }
.ds-maquinas { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.ds-maquina { margin: 0; }
.ds-slots { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .5rem 0 .75rem; }
.ds-slot { border: 1px solid var(--border, #cbd5e1); border-radius: 8px; padding: .55rem .65rem; display: grid; gap: .3rem; align-content: start; }
.ds-slot-tit { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ds-slot-cod { font-weight: 700; }
.ds-slot-meta { font-size: .75rem; color: var(--muted); }
.ds-slot-vacio { font-size: .8rem; }
.ds-bar { height: 8px; border-radius: 99px; background: rgba(148,163,184,.3); overflow: hidden; }
.ds-bar span { display: block; height: 100%; background: #16a34a; }
.ds-bar--warn span { background: #d97706; }
.ds-bar--over span { background: #dc2626; }
.ds-inline { display: flex; gap: .3rem; }
.ds-inline select { flex: 1; min-width: 0; }
.ds-uso-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .4rem; }
.ds-uso-form .field { margin: 0; }
.ds-uso-form input[name="nota"] { flex: 1 1 9rem; }
.ds-estado { font-size: .75rem; font-weight: 700; padding: .12rem .45rem; border-radius: 4px; background: rgba(148,163,184,.25); white-space: nowrap; }
.ds-estado--montado { background: rgba(22,163,74,.18); color: #16a34a; }
.ds-estado--por_rectificar { background: rgba(217,119,6,.18); color: #d97706; }
.ds-estado--en_rectificado { background: rgba(37,99,235,.18); color: #2563eb; }
.ds-acciones { display: flex; flex-wrap: wrap; gap: .3rem; align-items: flex-start; min-width: 14rem; }
.ds-det > summary { list-style: none; }
.ds-det > summary::-webkit-details-marker { display: none; }
.ds-det-form { display: grid; gap: .3rem; margin-top: .35rem; min-width: 13rem; }
@media (max-width: 720px) { .ds-slots { grid-template-columns: 1fr; } }
