/* =========================================================
   operator.css — Vista Operario (Light Mode)
   ========================================================= */

/* ── Layout ───────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-rows: 56px 1fr;
  grid-template-columns: 220px 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-primary);
  border-right: 1px solid var(--separator);
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px 18px;
}

.sidebar-logo {
  width: 28px;
  height: 28px;
  background: var(--blue);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo svg { width: 16px; height: 16px; }

.sidebar-name {
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--label);
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--label-quaternary);
  padding: 10px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--label-secondary);
  transition: background var(--dur-fast), color var(--dur-fast);
  text-decoration: none;
}
.nav-item:hover { background: var(--fill-tertiary); color: var(--label); }
.nav-item.active {
  background: var(--blue-tinted);
  color: var(--blue);
  font-weight: 600;
}

.nav-icon { font-size: 15px; width: 18px; text-align: center; }

.sidebar-spacer { flex: 1; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border-top: 1px solid var(--separator);
  margin-top: 8px;
  padding-top: 16px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-name { font-size: var(--text-sm); font-weight: 600; color: var(--label); }
.user-role { font-size: 11px; color: var(--label-tertiary); }

.sidebar-back {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  color: var(--label-tertiary);
  padding: 6px 10px;
  text-decoration: none;
  transition: color var(--dur-fast);
  border-radius: var(--radius-xs);
}
.sidebar-back:hover { color: var(--blue); background: var(--blue-tinted); }

/* ── Header ───────────────────────────────────────────────── */
.top-header {
  grid-area: header;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--separator);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-title {
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-right { display: flex; align-items: center; gap: 14px; }

.header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: var(--fill-tertiary);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--label-secondary);
}

.live-clock {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--label-secondary);
  font-variant-numeric: tabular-nums;
}

/* ── Main ─────────────────────────────────────────────────── */
.main-content {
  grid-area: main;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
  background: var(--bg-base);
}

/* ── Progress Banner ──────────────────────────────────────── */
.progress-banner {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-1);
  padding: 26px 30px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}

.progress-title { font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.progress-sub   { font-size: var(--text-sm); color: var(--label-secondary); margin-bottom: 16px; }

.progress-stats { display: flex; gap: 28px; }
.stat-item      { display: flex; flex-direction: column; gap: 2px; }
.stat-value     { font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.02em; }
.stat-label     { font-size: 11px; color: var(--label-tertiary); font-weight: 500; letter-spacing: 0.01em; }

.progress-bar-wrap { display: flex; flex-direction: column; gap: 10px; min-width: 300px; }
.progress-numbers  { display: flex; justify-content: space-between; align-items: baseline; }
.progress-current  { font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.04em; color: var(--blue); }
.progress-goal     { font-size: var(--text-sm); color: var(--label-tertiary); }

.big-progress-track {
  height: 7px;
  background: var(--fill-tertiary);
  border-radius: 999px;
  overflow: hidden;
}
.big-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--blue);
  transition: width 0.8s var(--ease-out);
}

/* ── Section header ───────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-count {
  font-size: var(--text-sm);
  color: var(--label-tertiary);
  font-weight: 600;
  background: var(--fill-tertiary);
  padding: 2px 9px;
  border-radius: 999px;
}

/* ── Orders ───────────────────────────────────────────────── */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
  transition: box-shadow var(--dur), transform var(--dur);
}
.order-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }

/* Left accent line via box-shadow, no border */
.order-card.status-en_progreso { box-shadow: inset 3px 0 0 var(--blue),   var(--shadow-1); }
.order-card.status-completada  { box-shadow: inset 3px 0 0 var(--green),  var(--shadow-1); opacity: 0.6; }
.order-card.status-pendiente   { box-shadow: inset 3px 0 0 var(--separator), var(--shadow-1); }

.order-card.status-en_progreso:hover { box-shadow: inset 3px 0 0 var(--blue),  var(--shadow-2); }
.order-card.status-completada:hover  { box-shadow: inset 3px 0 0 var(--green), var(--shadow-2); }
.order-card.status-pendiente:hover   { box-shadow: inset 3px 0 0 var(--separator), var(--shadow-2); }

.order-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.order-id     { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--label-tertiary); }
.order-type   { font-size: var(--text-base); font-weight: 700; letter-spacing: -0.01em; margin-bottom: 10px; }

.order-details {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.order-detail    { display: flex; flex-direction: column; gap: 2px; }
.detail-label    { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--label-quaternary); }
.detail-value    { font-size: var(--text-sm); font-weight: 600; color: var(--label-secondary); }

.order-progress-wrap { margin-top: 14px; display: flex; flex-direction: column; gap: 5px; }
.order-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.order-progress-label { font-size: 11px; color: var(--label-tertiary); font-weight: 500; }
.order-progress-pct   { font-size: 11px; font-weight: 700; color: var(--label-secondary); }

.order-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 110px;
}
.btn-action {
  width: 100%;
  padding: 8px 14px;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

/* ── Machines ─────────────────────────────────────────────── */
.machines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 8px;
}

.machine-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow var(--dur), transform var(--dur);
}
.machine-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }

.machine-header { display: flex; align-items: center; justify-content: space-between; }
.machine-id     { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--label-quaternary); }
.machine-name   { font-size: var(--text-sm); font-weight: 700; color: var(--label); }
.machine-prod   { font-size: var(--text-xs); color: var(--label-secondary); }
