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

  :root {
    --navy: #1B3055;
    --navy-light: #243F6E;
    --navy-xlight: #2E5090;
    --teal: #0DA8A8;
    --teal-dark: #0B9090;
    --teal-glow: rgba(13,168,168,0.15);
    --amber: #F59E0B;
    --amber-light: #FEF3C7;
    --red: #EF4444;
    --green: #10B981;
    --blue: #3B82F6;
    --purple: #8B5CF6;
    --bg: #F0F4F8;
    --surface: #FFFFFF;
    --border: #E2E8F0;
    --text: #1E293B;
    --text-mid: #475569;
    --text-muted: #94A3B8;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  }

  body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    font-size: 14px;
  }

  /* ── SIDEBAR ── */
  .sidebar {
    width: 220px;
    min-height: 100vh;
    max-height: 100vh;
    background: var(--navy);
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .sidebar::-webkit-scrollbar { width: 6px; }
  .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
  .sidebar-logo {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .logo-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
  }
  .logo-icon {
    width: 36px; height: 36px;
    background: var(--teal);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px; color: #fff;
  }
  .logo-text { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; }
  .logo-sup { font-size: 11px; font-weight: 500; color: var(--teal); }

  .sidebar-section-label {
    padding: 14px 18px 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
  }
  .sidebar-section-label:hover { color: rgba(255,255,255,0.6); }
  .sidebar-group:first-of-type .sidebar-section-label { padding-top: 18px; }
  .sidebar-caret {
    font-size: 8px;
    opacity: 0.6;
    transition: transform 0.2s ease;
    margin-right: 18px;
  }
  .sidebar-group.collapsed .sidebar-caret { transform: rotate(-90deg); }
  .sidebar-group-body {
    overflow: hidden;
    max-height: 300px;
    transition: max-height 0.25s ease;
  }
  .sidebar-group.collapsed .sidebar-group-body { max-height: 0; }
  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    border-radius: 0;
    transition: all 0.15s;
    font-size: 13px;
    font-weight: 500;
    border-left: 3px solid transparent;
    text-decoration: none;
  }
  .nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
  .nav-item.active {
    background: rgba(13,168,168,0.15);
    color: var(--teal);
    border-left-color: var(--teal);
  }
  .nav-item .icon { font-size: 16px; width: 20px; text-align: center; }
  .badge {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
  }
  .badge.teal { background: var(--teal); }

  /* ── MAIN ── */
  .main {
    margin-left: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  .topbar {
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky; top: 0; z-index: 50;
  }
  .topbar-title { font-size: 16px; font-weight: 700; color: var(--text); flex: 1; }
  .topbar-actions { display: flex; align-items: center; gap: 12px; }
  .avatar {
    width: 34px; height: 34px;
    background: var(--navy);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 13px;
  }
  .notif-btn {
    position: relative;
    background: none; border: none; cursor: pointer;
    font-size: 18px; padding: 4px;
  }
  .notif-btn .dot {
    position: absolute; top: 2px; right: 2px;
    width: 8px; height: 8px;
    background: var(--red); border-radius: 50%;
    border: 2px solid #fff;
  }

  .content { padding: 28px; flex: 1; }

  /* ── VIEWS ── */
  .view { display: none; }
  .view.active { display: block; }

  /* ── STEP CARDS ── */
  .step-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
  }
  .step-header {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
  }
  .step-number {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .step-number.done { background: var(--green); }
  .step-title { font-size: 16px; font-weight: 700; color: var(--navy); }
  .step-body { padding: 24px; }

  /* ── FORM ELEMENTS ── */
  .form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .form-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .form-group { display: flex; flex-direction: column; gap: 6px; }
  .form-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex; align-items: center; gap: 5px;
  }
  .form-control {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    width: 100%;
  }
  .form-control:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-glow);
  }
  .form-control[readonly] { background: #F8FAFC; color: var(--text-mid); }

  /* ── COMBO DE BÚSQUEDA (select con filtro escrito) ── */
  .combo-search-wrap { position: relative; }
  .combo-search-list {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(27,48,85,0.14);
    z-index: 300;
  }
  .combo-search-list.open { display: block; }
  .combo-search-item { padding: 9px 12px; font-size: 13px; color: var(--text); cursor: pointer; }
  .combo-search-item:hover, .combo-search-item.active { background: #F0FDFA; color: var(--teal-dark); }
  .combo-search-empty { padding: 9px 12px; font-size: 12px; color: var(--text-muted); }

  /* ── BUTTONS ── */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    text-decoration: none;
  }
  .btn-teal { background: var(--teal); color: #fff; }
  .btn-teal:hover { background: var(--teal-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13,168,168,0.3); }
  .btn-navy { background: var(--navy); color: #fff; }
  .btn-navy:hover { background: var(--navy-light); }
  .btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-mid); }
  .btn-outline:hover { border-color: var(--teal); color: var(--teal); }
  .btn-danger { background: var(--red); color: #fff; }
  .btn-danger:hover { filter: brightness(0.9); }
  .btn-green { background: var(--green); color: #fff; }
  .btn-amber { background: var(--amber); color: #fff; }
  .btn-sm { padding: 6px 12px; font-size: 12px; }
  .btn-lg { padding: 12px 28px; font-size: 15px; }
  .btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.3); transform: none !important; box-shadow: none !important; }

  /* ── PRODUCT CARDS ── */
  .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
  }
  .product-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: #fff;
  }
  .product-card:hover { border-color: var(--teal); box-shadow: 0 4px 16px var(--teal-glow); }
  .product-card.selected {
    border-color: var(--teal);
    background: rgba(13,168,168,0.04);
  }
  .product-card .check {
    position: absolute;
    top: 12px; right: 12px;
    width: 22px; height: 22px;
    background: var(--teal);
    border-radius: 50%;
    display: none;
    align-items: center; justify-content: center;
    color: #fff; font-size: 12px;
  }
  .product-card.selected .check { display: flex; }
  .product-card .prod-code {
    font-size: 11px;
    font-weight: 700;
    color: var(--teal);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
  }
  .product-card .prod-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 8px;
  }
  .product-card .prod-pres {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
  }
  .product-card .prod-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--navy);
  }
  .product-card .prod-price span { font-size: 12px; font-weight: 400; color: var(--text-muted); }
  .qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
  }
  .qty-btn {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
  }
  .qty-btn:hover { border-color: var(--teal); color: var(--teal); }
  .qty-input {
    width: 60px;
    text-align: center;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 4px;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    font-family: 'Inter', sans-serif;
  }
  .qty-input:focus { border-color: var(--teal); }

  /* ── ORDER SUMMARY ── */
  .order-table {
    width: 100%;
    border-collapse: collapse;
  }
  .order-table th {
    background: var(--navy);
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
  }
  .order-table th:first-child { border-radius: 8px 0 0 0; }
  .order-table th:last-child { border-radius: 0 8px 0 0; }
  .order-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
  }
  .order-table tr:hover td { background: #F8FAFC; }
  .order-total-row td {
    font-weight: 700;
    font-size: 15px;
    background: #F8FAFC;
    border-top: 2px solid var(--navy);
    border-bottom: none;
  }
  .remove-btn {
    background: none; border: none; cursor: pointer;
    color: var(--red); font-size: 16px; padding: 4px;
    border-radius: 4px;
    transition: background 0.15s;
  }
  .remove-btn:hover { background: #FEE2E2; }

  /* ── STATUS BADGES ── */
  .status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
  }
  .status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
  .status-pending { background: #FEF3C7; color: #92400E; }
  .status-pending::before { background: var(--amber); }
  .status-produccion { background: #EDE9FE; color: #5B21B6; }
  .status-produccion::before { background: var(--purple); }
  .status-despachado { background: #DBEAFE; color: #1E40AF; }
  .status-despachado::before { background: var(--blue); }
  .status-entregado { background: #D1FAE5; color: #065F46; }
  .status-entregado::before { background: var(--green); }
  .status-cancelado { background: #FEE2E2; color: #991B1B; }
  .status-cancelado::before { background: var(--red); }

  /* ── BANDEJA ── */
  .bandeja-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
  }
  .filter-chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-mid);
  }
  .filter-chip:hover, .filter-chip.active {
    border-color: var(--teal);
    color: var(--teal);
    background: var(--teal-glow);
  }
  .search-input-wrap { position: relative; flex: 1; min-width: 200px; }
  .search-input-wrap input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    font-family: 'Inter', sans-serif;
  }
  .search-input-wrap input:focus { border-color: var(--teal); }
  .search-input-wrap .search-icon {
    position: absolute; left: 11px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted); font-size: 15px;
  }

  .radicado-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.15s;
    cursor: pointer;
  }
  .radicado-card:hover {
    border-color: var(--teal);
    box-shadow: var(--shadow);
    transform: translateX(3px);
  }
  .radicado-id {
    font-size: 15px;
    font-weight: 800;
    color: var(--navy);
    min-width: 120px;
  }
  .radicado-info { flex: 1; }
  .radicado-client { font-size: 13px; font-weight: 600; color: var(--text); }
  .radicado-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
  .radicado-total { font-size: 15px; font-weight: 700; color: var(--navy); text-align: right; min-width: 130px; }
  .radicado-actions { display: flex; gap: 8px; }

  /* ── KPI CARDS ── */
  .kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
  .kpi-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--teal);
    position: relative;
    overflow: hidden;
  }
  .kpi-card.amber { border-left-color: var(--amber); }
  .kpi-card.green { border-left-color: var(--green); }
  .kpi-card.purple { border-left-color: var(--purple); }
  .kpi-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
  .kpi-value { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1; }
  .kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
  .kpi-icon { position: absolute; right: 16px; top: 16px; font-size: 28px; opacity: 0.12; }
  .kpi-trend { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; font-weight: 600; }
  .kpi-trend.up { color: var(--green); }
  .kpi-trend.down { color: var(--red); }

  /* ── CHARTS ── */
  .charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
  .chart-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
  }
  .chart-title { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 16px; }
  .chart-wrap { position: relative; height: 220px; }

  /* ── PDF MODAL ── */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .modal-overlay.open { display: flex; }
  .modal {
    background: #fff;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
  }
  .modal-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky; top: 0; background: #fff; z-index: 1;
  }
  .modal-title { font-size: 17px; font-weight: 700; flex: 1; }
  .modal-body { padding: 28px; }

  /* PDF Preview */
  .pdf-preview { font-size: 13px; }
  .pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--navy);
  }
  .pdf-logo { font-size: 24px; font-weight: 800; color: var(--navy); }
  .pdf-logo sup { font-size: 13px; color: var(--teal); }
  .pdf-order-meta { text-align: right; }
  .pdf-order-id { font-size: 20px; font-weight: 800; color: var(--teal); }
  .pdf-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 20px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
  }
  .pdf-client-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 8px; }
  .pdf-field-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
  .pdf-field-value { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 2px; }
  .pdf-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
  .pdf-table th { background: var(--navy); color: #fff; padding: 10px 12px; font-size: 11px; text-align: left; }
  .pdf-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 12px; }
  .pdf-table tr:nth-child(even) td { background: #F8FAFC; }
  .pdf-total-row { background: var(--navy) !important; }
  .pdf-total-row td { color: #fff !important; font-weight: 700 !important; font-size: 14px !important; border: none !important; }

  /* ── TOAST ── */
  .toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .toast {
    background: var(--navy);
    color: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--teal);
  }
  .toast.success { border-left-color: var(--green); }
  .toast.error { border-left-color: var(--red); }
  @keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

  /* ── EMPTY STATE ── */
  .empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
  }
  .empty-state .icon { font-size: 48px; margin-bottom: 12px; }
  .empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-mid); margin-bottom: 6px; }

  /* ── DIVIDER ── */
  .divider { height: 1px; background: var(--border); margin: 20px 0; }

  /* ── DETAIL MODAL ── */
  .timeline { position: relative; padding-left: 24px; }
  .timeline::before { content:''; position:absolute; left:7px; top:4px; bottom:4px; width:2px; background:var(--border); }
  .tl-item { position:relative; margin-bottom:16px; }
  .tl-dot {
    position:absolute; left:-21px; top:4px;
    width:14px; height:14px; border-radius:50%;
    background:var(--teal); border:2px solid #fff;
    box-shadow: 0 0 0 2px var(--teal);
  }
  .tl-dot.done { background:var(--green); box-shadow:0 0 0 2px var(--green); }
  .tl-dot.pending { background:var(--text-muted); box-shadow:0 0 0 2px var(--text-muted); }
  .tl-label { font-size:12px; font-weight:600; color:var(--text); }
  .tl-date { font-size:11px; color:var(--text-muted); }

  /* ── HOME CHIPS ── */
  .hchip {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: #fff;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-mid);
    font-family: 'Inter', sans-serif;
  }
  .hchip:hover, .hchip.active {
    border-color: var(--teal);
    color: var(--teal);
    background: var(--teal-glow);
  }

  /* ── HOME SUMMARY CARDS ── */
  .sum-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px 18px 16px;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--teal);
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
  }
  .sum-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
  .sum-card .sc-icon {
    position: absolute; right: 14px; top: 14px;
    font-size: 32px; opacity: 0.1;
  }
  .sum-card .sc-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 8px;
  }
  .sum-card .sc-value {
    font-size: 24px; font-weight: 800; color: var(--navy); line-height: 1;
    margin-bottom: 6px;
  }
  .sum-card .sc-sub {
    font-size: 11px; color: var(--text-muted);
  }
  .sum-card .sc-pill {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 10px; padding: 3px 8px;
    border-radius: 10px; font-size: 11px; font-weight: 700;
  }

  /* ── HOME TABLE ROWS ── */
  .hrow { cursor: pointer; transition: background 0.12s; }
  .hrow:hover td { background: #F0F9F9 !important; }
  .hrow td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
  }
  .hrow:last-child td { border-bottom: none; }

  @media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main { margin-left: 0; }
    .modal-overlay { position: static; background: none; padding: 0; }
    .modal { box-shadow: none; max-height: none; }
  }

  /* ── ÓRDENES INTERNAS ── */
  .status-borrador { background:#F1F5F9; color:#475569; }
  .status-borrador::before { background:#94A3B8; }
  .status-aprobada { background:#DCFCE7; color:#166534; }
  .status-aprobada::before { background:#22C55E; }
  .status-en-proceso { background:#EDE9FE; color:#5B21B6; }
  .status-en-proceso::before { background:#8B5CF6; }
  .status-completada { background:#D1FAE5; color:#065F46; }
  .status-completada::before { background:#10B981; }
  .status-cancelada { background:#FEE2E2; color:#991B1B; }
  .status-cancelada::before { background:#EF4444; }
  .prio-alta { background:#FEE2E2; color:#991B1B; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:700; }
  .prio-media { background:#FEF3C7; color:#92400E; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:700; }
  .prio-baja { background:#D1FAE5; color:#065F46; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:700; }
  .oi-ref-table { width:100%; border-collapse:collapse; }
  .oi-ref-table th { background:var(--navy); color:#fff; padding:10px 14px; font-size:12px; font-weight:600; text-align:left; }
  .oi-ref-table th:first-child { border-radius:8px 0 0 0; }
  .oi-ref-table th:last-child { border-radius:0 8px 0 0; }
  .oi-ref-table td { padding:10px 14px; border-bottom:1px solid var(--border); font-size:13px; vertical-align:middle; }
  .oi-ref-table tr:hover td { background:#F8FAFC; }

/* ── PLANIF EXTRA CSS ── */
.pp-ref-chip { display:inline-flex;align-items:center;gap:4px;background:#EDE9FE;color:#5B21B6;padding:2px 8px;border-radius:10px;font-size:11px;font-weight:700;margin:2px; }
.pp-prio-badge { display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;font-size:13px;font-weight:800;color:#fff; }
.pp-jornada-manana { background:#FEF3C7;color:#92400E;padding:3px 10px;border-radius:10px;font-size:11px;font-weight:700; }
.pp-jornada-tarde { background:#DBEAFE;color:#1E40AF;padding:3px 10px;border-radius:10px;font-size:11px;font-weight:700; }
.pp-status-pendiente { background:#FEF3C7;color:#92400E; }
.pp-status-pendiente::before { background:#F59E0B; }
.pp-status-proceso { background:#EDE9FE;color:#5B21B6; }
.pp-status-proceso::before { background:#8B5CF6; }
.pp-status-realizada { background:#D1FAE5;color:#065F46; }
.pp-status-realizada::before { background:#10B981; }
.pp-ref-row { display:flex;align-items:center;justify-content:space-between;padding:10px 16px;border-bottom:1px solid var(--border);font-size:13px; }
.pp-ref-row:last-child { border-bottom:none; }
.pp-ref-row:hover { background:#F8FAFC; }
.pp-day-block { background:#F8FAFC;border-radius:10px;padding:12px 16px;margin-bottom:12px;border-left:4px solid var(--purple); }
.pp-day-title { font-size:13px;font-weight:800;color:var(--navy);margin-bottom:8px; }

/* ── PRODUCCIÓN TABLET CSS ── */
.prod-jorn-card {
  background:#fff;
  border-radius:20px;
  padding:28px;
  box-shadow:var(--shadow);
  cursor:pointer;
  transition:all 0.2s;
  border:3px solid transparent;
  user-select:none;
  -webkit-user-select:none;
}
.prod-jorn-card:hover, .prod-jorn-card:active {
  transform:scale(1.02);
  border-color:var(--teal);
  box-shadow:0 8px 32px rgba(13,168,168,0.2);
}
.prod-jorn-card .jorn-icon { font-size:48px; margin-bottom:12px; }
.prod-jorn-card .jorn-name { font-size:22px;font-weight:800;color:var(--navy);margin-bottom:6px; }
.prod-jorn-card .jorn-hora { font-size:14px;color:var(--text-muted);margin-bottom:16px; }
.prod-jorn-card .jorn-stat { display:flex;gap:12px;flex-wrap:wrap; }
.prod-jorn-card .jorn-pill { padding:6px 14px;border-radius:20px;font-size:13px;font-weight:700; }

.prod-ref-card {
  background:#fff;
  border-radius:18px;
  padding:22px;
  box-shadow:var(--shadow);
  border:3px solid transparent;
  transition:all 0.2s;
  cursor:pointer;
  user-select:none;
  position:relative;
  overflow:hidden;
}
.prod-ref-card:hover { transform:translateY(-2px); box-shadow:0 8px 24px rgba(0,0,0,0.1); }
.prod-ref-card.estado-completada { border-color:#22C55E; opacity:0.7; }
.prod-ref-card.estado-en-proceso { border-color:#F59E0B; }
.prod-ref-card.estado-parada { border-color:#EF4444; }
.prod-ref-card .ref-estado-strip {
  position:absolute;top:0;left:0;right:0;height:5px;border-radius:18px 18px 0 0;
}
.prod-ref-card .ref-cod { font-size:13px;font-weight:700;color:var(--teal);margin-bottom:4px; }
.prod-ref-card .ref-nom { font-size:15px;font-weight:700;color:var(--navy);margin-bottom:4px;line-height:1.3; }
.prod-ref-card .ref-pres { font-size:12px;color:var(--text-muted);margin-bottom:14px; }
.prod-ref-card .ref-nums { display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:14px; }
.prod-ref-card .ref-num-box { background:#F8FAFC;border-radius:10px;padding:10px;text-align:center; }
.prod-ref-card .ref-num-val { font-size:22px;font-weight:800;color:var(--navy); }
.prod-ref-card .ref-num-lbl { font-size:11px;color:var(--text-muted);margin-top:2px; }
.prod-ref-card .ref-actions { display:flex;gap:10px; }
.prod-ref-card .ref-btn {
  flex:1;padding:14px 10px;border:none;border-radius:12px;
  font-size:14px;font-weight:700;cursor:pointer;
  transition:all 0.15s;display:flex;align-items:center;justify-content:center;gap:6px;
}
.prod-ref-card .ref-btn:active { transform:scale(0.97); }
.prod-ref-card .btn-producir { background:var(--teal);color:#fff; }
.prod-ref-card .btn-parar    { background:#EF4444;color:#fff; }
.prod-ref-card .btn-ver      { background:#F1F5F9;color:var(--navy); }

.paro-causal-btn {
  background:#F8FAFC;
  border:2px solid var(--border);
  border-radius:12px;
  padding:14px 16px;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  text-align:left;
  transition:all 0.15s;
  color:var(--navy);
  display:flex;
  align-items:center;
  gap:10px;
}
.paro-causal-btn:hover, .paro-causal-btn.selected {
  background:#FEE2E2;
  border-color:#EF4444;
  color:#991B1B;
}

/* ── DESPACHO CSS ── */
.dsp-card {
  background:#fff;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  margin-bottom:14px;
  overflow:hidden;
  border-left:5px solid transparent;
  transition:all 0.2s;
  cursor:pointer;
}
.dsp-card:hover { transform:translateX(3px); box-shadow:0 6px 24px rgba(0,0,0,0.1); }
.dsp-card-header { display:flex;align-items:center;gap:14px;padding:16px 20px; }
.dsp-card-body { padding:0 20px 16px;display:grid;grid-template-columns:repeat(4,1fr);gap:12px; }
.dsp-stat { text-align:center;background:#F8FAFC;border-radius:8px;padding:10px; }
.dsp-stat-val { font-size:18px;font-weight:800;color:var(--navy); }
.dsp-stat-lbl { font-size:11px;color:var(--text-muted);margin-top:2px; }
.timeline-item { display:flex;gap:12px;align-items:flex-start;padding-bottom:16px;position:relative; }
.timeline-item:not(:last-child)::after {
  content:'';position:absolute;left:11px;top:24px;bottom:0;width:2px;background:var(--border);
}
.timeline-dot { width:24px;height:24px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:12px;position:relative;z-index:1; }
.dsp-orden-row { padding:12px 20px;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:12px; }
.dsp-orden-row:last-child { border-bottom:none; }
.nd-orden-item { display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border);cursor:pointer;transition:background 0.15s; }
.nd-orden-item:hover { background:#F8FAFC; }
.nd-orden-item:last-child { border-bottom:none; }
.nd-orden-item.selected { background:#F0F9F9; }
.dsp-status-programado { background:#EDE9FE;color:#5B21B6; }
.dsp-status-programado::before { background:#8B5CF6; }
.dsp-status-transito { background:#DBEAFE;color:#1E40AF; }
.dsp-status-transito::before { background:#3B82F6; }
.dsp-status-entregado { background:#D1FAE5;color:#065F46; }
.dsp-status-entregado::before { background:#22C55E; }
.dsp-status-novedad { background:#FEE2E2;color:#991B1B; }
.dsp-status-novedad::before { background:#EF4444; }
