/* ─── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ─── Spinner ────────────────────────────────────────────────── */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e0e0e0;
  border-top-color: #4f8ef7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
.mini-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e0e0e0;
  border-top-color: #4f8ef7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Login screen ───────────────────────────────────────────── */
#screen-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f2f5 0%, #e8eef7 100%);
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(0,0,0,.10);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo-text {
  font-size: 22px;
  font-weight: 800;
  color: #4f8ef7;
  letter-spacing: -0.5px;
}
.login-logo-sub {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
  font-weight: 500;
}

.login-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #1a1a2e;
}

.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  color: #1a1a2e;
  background: #fff;
  transition: border-color .15s;
  outline: none;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #4f8ef7;
  box-shadow: 0 0 0 3px rgba(79,142,247,.10);
}

.btn-primary {
  width: 100%;
  padding: 11px;
  background: #0d1f3c;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  margin-top: 4px;
}
.btn-primary:hover  { background: #1a3560; }
.btn-primary:active { background: #0d1f3c; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.login-error {
  color: #c62828;
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
  min-height: 18px;
}

/* ─── App shell ──────────────────────────────────────────────── */
#screen-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Header ─────────────────────────────────────────────────── */
.admin-header {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.admin-logo {
  font-weight: 800;
  font-size: 18px;
  color: #0d1f3c;
  letter-spacing: -0.5px;
}
.admin-logo span { color: #f59e0b; }

.btn-logout {
  padding: 6px 14px;
  background: none;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all .15s;
}
.btn-logout:hover {
  background: #fff0f0;
  border-color: #ffb3b3;
  color: #c62828;
}

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

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0d1f3c;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.admin-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #444;
}

/* ─── Login multi-step ───────────────────────────────────────── */
.login-step-hint {
  font-size: 13px;
  color: #555;
  margin: 0 0 16px;
  text-align: center;
  line-height: 1.5;
}

.btn-link {
  background: none;
  border: none;
  color: #4f8ef7;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 6px;
  display: block;
  width: 100%;
  text-align: center;
}
.btn-link:hover { text-decoration: underline; }

/* ─── Layout ─────────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.admin-sidebar {
  width: 230px;
  background: #0f1e35;
  border-right: none;
  padding: 0;
  flex-shrink: 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-logo-img  { height: 30px; width: auto; }
.sidebar-logo-text {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1;
}
.sidebar-logo-text span { color: #f59e0b; }

.sidebar-nav {
  list-style: none;
  padding: 10px 8px;
  flex: 1;
}

.sidebar-nav li {
  padding: 0;
  margin-bottom: 1px;
}

.sidebar-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  border-left: 3px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all .15s;
}
.sidebar-tab:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.90);
}
.sidebar-tab.active {
  background: rgba(245,158,11,0.13);
  color: #f59e0b;
  font-weight: 600;
  border-left-color: #f59e0b;
}

.sidebar-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  flex-shrink: 0;
}
.sidebar-tab-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.sidebar-badge {
  margin-left: auto;
  background: #f59e0b;
  color: #0f1e35;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ─── Content ────────────────────────────────────────────────── */
.admin-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  min-width: 0;
}

.content-section { display: none; }
.content-section.active { display: block; }

.section-title {
  font-size: 20px;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

/* ─── Stat cards ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); }
.stat-card-link  { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.stat-card-link:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.13); }

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1;
}

.stat-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.stat-card.blue  .stat-value { color: #4f8ef7; }
.stat-card.orange .stat-value { color: #f57c00; }
.stat-card.green .stat-value { color: #2e7d32; }
.stat-card.red   .stat-value { color: #c62828; }

/* ─── Card container ─────────────────────────────────────────── */
.admin-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  overflow: hidden;
  margin-bottom: 20px;
}

.admin-card-header,
.accordion-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ─── Accordion ──────────────────────────────────────────────── */
.accordion-card .accordion-header { border-bottom: none; }
.accordion-card .accordion-body { border-top: 1px solid #f0f0f0; }
.accordion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #e8f0fe;
  color: #1a5ccc;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.accordion-toggle:hover { background: #d0e2ff; }
.accordion-toggle[aria-expanded="true"] { background: #fce8e6; color: #c62828; }
.accordion-toggle[aria-expanded="true"]:hover { background: #fad2ce; }
.acc-icon { font-size: 16px; font-weight: 700; line-height: 1; }
.accordion-body { padding: 16px 20px; background: #f8faff; }
.accordion-body .wk-create-grid { margin-bottom: 0; }

.admin-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
}

/* ─── Inline form ────────────────────────────────────────────── */
.inline-form {
  padding: 16px 20px;
  background: #f8faff;
  border-bottom: 1px solid #e8eef7;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-form .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 140px;
}

.inline-form .form-group label {
  font-size: 11px;
}

.inline-form .form-group input,
.inline-form .form-group select {
  padding: 8px 10px;
  font-size: 13px;
}

.btn-add {
  padding: 8px 18px;
  background: #4f8ef7;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-add:hover { background: #3a7de8; }
.btn-add:disabled { opacity: .6; cursor: not-allowed; }

.form-msg {
  width: 100%;
  font-size: 12px;
  min-height: 16px;
  margin-top: 2px;
}
.form-msg.error   { color: #c62828; }
.form-msg.success { color: #2e7d32; }

/* ─── Password show/hide + required mark + field-hint ─────────── */
.req { color: #c62828; margin-left: 2px; }
.field-hint {
  font-size: 12px;
  color: #555;
  margin-top: 4px;
}
.field-hint.warn { color: #c62828; font-weight: 600; }
.pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pass-wrap input {
  flex: 1;
  padding-right: 38px !important;
}
.btn-show-pass {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 0 2px;
  color: #666;
  line-height: 1;
}

/* ─── Tables ─────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #fafbfc;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid #f5f5f5;
  transition: background .1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fafbff; }

tbody td {
  padding: 12px 20px;
  font-size: 13px;
  color: #333;
  vertical-align: middle;
}

.table-empty {
  padding: 32px 20px;
  text-align: center;
  color: #aaa;
  font-style: italic;
  font-size: 13px;
}

.table-loading {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #888;
  font-size: 13px;
}

/* ─── Status badges ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-active   { background: #e8f5e9; color: #2e7d32; }
.badge-inactive { background: #f5f5f5; color: #888; }
.badge-hold     { background: #fff3e0; color: #e65100; }
.badge-finished { background: #fdecea; color: #c62828; }
.badge-pending  { background: #fff8e1; color: #7a5800; }

.badge-consent {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-consent-ok      { background: #e8f5e9; color: #2e7d32; }
.badge-consent-pending { background: #fff3e0; color: #e65100; }

/* ─── Token display ──────────────────────────────────────────── */
.token-cell {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #666;
  background: #f5f5f5;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* ─── Action buttons ─────────────────────────────────────────── */
.actions-cell {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-action {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-action-blue {
  background: #eef3ff;
  color: #4f8ef7;
  border-color: #d0e4ff;
}
.btn-action-blue:hover { background: #dbeafe; }
.btn-action-danger { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.btn-action-danger:hover:not(:disabled) { background: #fee2e2; }
.btn-action-danger:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-action-orange {
  background: #fff8f0;
  color: #f57c00;
  border-color: #ffe0b2;
}
.btn-action-orange:hover { background: #fff3e0; }

.btn-action-green {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #c8e6c9;
}
.btn-action-green:hover { background: #d4edda; }

.btn-action-red {
  background: #fdecea;
  color: #c62828;
  border-color: #fbc9c9;
}
.btn-action-red:hover { background: #fbd8d8; }

.btn-action-gray {
  background: #f5f5f5;
  color: #666;
  border-color: #ddd;
}
.btn-action-gray:hover { background: #e8e8e8; }
.btn-action-gray:disabled { opacity: 0.4; cursor: not-allowed; }

tr.row-inactive td { opacity: 0.45; }
tr.row-inactive td:last-child { opacity: 1; }
.btn-action.disabled { pointer-events: none; opacity: 0.4; }

/* ─── Edit row (inline edit) ─────────────────────────────────── */
.edit-row-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: #f0f5ff;
  border-top: 1px solid #d0e4ff;
  border-bottom: 1px solid #d0e4ff;
}

.edit-row-form .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 120px;
}

.edit-row-form .form-group input,
.edit-row-form .form-group select {
  padding: 7px 10px;
  font-size: 13px;
}

.btn-save {
  padding: 7px 16px;
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.btn-save:hover   { background: #246228; }
.btn-save:disabled { opacity: .6; cursor: not-allowed; }

.btn-cancel {
  padding: 7px 14px;
  background: none;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-cancel:hover { background: #f5f5f5; }

/* ─── Disputes tab ───────────────────────────────────────────── */
.dispute-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dispute-supervisor {
  font-size: 11px;
  color: #888;
  font-weight: 500;
}
.btn-dispute-open {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-dispute-open:hover { background: #1d4ed8; }

/* ─── Dispute modal ───────────────────────────────────────────── */
.dispute-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dispute-modal.hidden { display: none; }
.dispute-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.dispute-modal-content {
  position: relative;
  z-index: 1;
  width: min(480px, 95vw);
  height: min(90vh, 800px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dispute-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  background: rgba(0,0,0,0.15);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dispute-modal-close:hover { background: rgba(0,0,0,0.3); }
#dispute-modal-iframe {
  width: 100%;
  flex: 1;
  border: none;
}

/* ─── Loading / error states ─────────────────────────────────── */
.state-loading {
  padding: 40px;
  text-align: center;
  color: #888;
}
.state-error {
  padding: 20px;
  color: #c62828;
  background: #fdecea;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ─── Mobile hamburger ───────────────────────────────────────── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #555;
  padding: 4px;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .menu-toggle { display: block; }

  .admin-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    height: calc(100vh - 56px);
    z-index: 150;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 16px rgba(0,0,0,.12);
    width: 240px;
  }
  .admin-sidebar.open { transform: translateX(0); }

  .admin-content { padding: 16px 12px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 28px; }
  .stat-label { font-size: 11px; }

  .section-title { font-size: 16px; margin-bottom: 12px; }

  .admin-card { padding: 14px 12px; }
  .admin-card-header { margin-bottom: 12px; }

  .inline-form { flex-direction: column; gap: 10px; }
  .inline-form .form-group { min-width: 100%; max-width: 100% !important; }
  .inline-form .btn-add { width: 100%; }

  /* Edit row in workers table */
  .edit-row-form { flex-direction: column; gap: 10px; }
  .edit-row-form .form-group { min-width: 100%; }
  .edit-row-form .btn-save,
  .edit-row-form .btn-cancel { width: 100%; }

  .admin-header { padding: 0 16px; }

  thead th,
  tbody td { padding: 10px 10px; font-size: 13px; }

  /* Make action buttons stack on very small screens */
  .actions-cell { flex-direction: column; gap: 4px; align-items: flex-start; }
  .btn-action { font-size: 12px; padding: 5px 10px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 24px; }

  /* Supervisors table: hide token column */
  .supervisors-table .col-token { display: none; }

  /* Shrink logout button text */
  .btn-logout { font-size: 12px; padding: 5px 10px; }
}

/* ─── Worker create grid ──────────────────────────────────────── */
.wk-create-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .wk-create-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .wk-create-grid { grid-template-columns: 1fr; } }

/* ─── Permission table ───────────────────────────────────────── */
.pos-perms-grid { margin-top: 8px; overflow-x: auto; }

.perm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.perm-table thead th {
  padding: 6px 10px;
  text-align: center;
  font-weight: 600;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1.5px solid #e2e8f0;
  white-space: nowrap;
}
.perm-table thead th:first-child { text-align: left; }
.perm-group-row td {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}
.perm-item-row:hover { background: #f0f4ff; }
.perm-item-label {
  padding: 5px 10px;
  color: #374151;
  white-space: nowrap;
}
.perm-radio-cell {
  text-align: center;
  padding: 4px 6px;
}
.perm-na { background: #fafafa; }
.perm-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: border-color .12s, background .12s, color .12s;
  white-space: nowrap;
}
.perm-pill input[type="radio"] { display: none; }
.perm-pill:hover { border-color: #93c5fd; background: #eff6ff; }
.perm-pill-active {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
.perm-pill-na {
  color: #cbd5e1;
  border-color: transparent;
  background: transparent;
  cursor: default;
}

/* ─── Permission presets bar ─────────────────────────────────── */
.pos-presets-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.pos-presets-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  margin-right: 2px;
}
.pos-preset-btn {
  padding: 4px 12px;
  border-radius: 99px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.pos-preset-btn:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
}

/* ─── Inline select in table ──────────────────────────────────── */
.inline-select {
  padding: 5px 8px;
  border: 1.5px solid #dde3f0;
  border-radius: 7px;
  font-size: 13px;
  color: #333;
  background: #f8f9fc;
  cursor: pointer;
  width: 100%;
  max-width: 180px;
  transition: border-color .15s;
}
.inline-select:focus { outline: none; border-color: #4f8ef7; background: #fff; }
.inline-select-status { max-width: 90px; }

/* ─── Worker edit grid ────────────────────────────────────────── */
.edit-wk-grid {
  grid-template-columns: repeat(3, 1fr) !important;
}
@media (max-width: 900px) { .edit-wk-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 600px) { .edit-wk-grid { grid-template-columns: 1fr !important; } }

/* ─── Supervisor name cell ────────────────────────────────────── */
.sup-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sup-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.sup-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f8ef7, #3a7de8);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.sup-detail {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

/* ─── Supervisor edit form ────────────────────────────────────── */
.edit-sup-form {
  padding: 16px;
  background: #f8f9fc;
  border-radius: 8px;
}

.edit-sup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.edit-sup-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 768px) {
  .edit-sup-grid { grid-template-columns: 1fr; }
  .edit-sup-actions .btn-save,
  .edit-sup-actions .btn-cancel { width: 100%; }
}

/* ─── Dashboard live sections ─────────────────────────────────── */
.dash-live-section { margin-top:28px; }
.dash-live-title {
  font-size:14px; font-weight:700; color:#1e293b;
  margin-bottom:12px; display:flex; align-items:center; gap:8px;
  border-bottom:2px solid #e8eaf6; padding-bottom:6px;
}
.dash-live-badge {
  font-size:10px; font-weight:600; background:#16a34a; color:#fff;
  border-radius:10px; padding:1px 7px; letter-spacing:.3px;
}

/* Worker hours interactive chart */
.dwc-header {
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:10px; margin-bottom:12px;
  border-bottom:2px solid #e8eaf6; padding-bottom:8px;
}
.dwc-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.dwc-period-btns { display:flex; gap:4px; }
.dwc-period-btn {
  padding:4px 12px; border-radius:20px; font-size:12px; font-weight:600;
  border:1px solid #d1d5db; background:#f8fafc; color:#64748b;
  cursor:pointer; transition:all .15s;
}
.dwc-period-btn:hover { border-color:#1a3560; color:#1a3560; }
.dwc-period-btn.active { background:#1a3560; color:#fff; border-color:#1a3560; }
.dwc-chart-wrap { position:relative; width:100%; overflow:hidden; }
.dwc-chart-wrap canvas { width:100% !important; }

/* Project progress cards */
.dp-card {
  background:#fff; border:1px solid #e2e8f0; border-radius:12px;
  padding:16px 20px; margin-bottom:14px;
  box-shadow:0 1px 4px rgba(0,0,0,.05);
}
.dp-card-header { margin-bottom:8px; }
.dp-proj-name   { font-size:15px; font-weight:700; color:#0d1f3c; display:inline; }
.dp-proj-code   { font-size:11px; color:#94a3b8; font-weight:600; margin-left:6px; }
.dp-proj-meta   { font-size:11px; color:#94a3b8; margin-top:3px; line-height:1.6; }
.dp-work-range  { font-size:11px; color:#64748b; margin-top:2px; }
.dp-alert       { font-size:12px; color:#c62828; background:#ffebee; border-radius:6px;
                  padding:5px 12px; margin-bottom:10px; font-weight:600; }

.dp-body        { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:10px; }
.dp-left        { display:flex; flex-direction:column; gap:2px; }
.dp-right       { display:flex; flex-direction:column; gap:6px; }
.dp-section-title { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.5px;
                    color:#94a3b8; margin-bottom:2px; margin-top:4px; }
.dp-cost-row    { display:flex; align-items:baseline; gap:6px; }
.dp-cost-real   { font-size:18px; font-weight:800; color:#0d1f3c; }
.dp-cost-budget { font-size:11px; color:#94a3b8; }
.dp-cost-breakdown { font-size:11px; color:#64748b; margin-bottom:4px; }

/* OT block */
.dp-ot-block    { display:flex; align-items:center; gap:6px; flex-wrap:wrap;
                  background:#fff8f0; border:1px solid #fed7aa; border-radius:6px;
                  padding:5px 10px; margin-top:6px; }
.dp-ot-label    { font-size:10px; font-weight:700; color:#f57c00; text-transform:uppercase; letter-spacing:.4px; }
.dp-ot-hours    { font-size:12px; font-weight:700; color:#ea580c; }
.dp-ot-cost     { font-size:12px; color:#7c3aed; font-weight:600; }
.dp-ot-pct      { font-size:10px; color:#94a3b8; font-weight:400; }

/* Top worker */
.dp-top-worker  { display:flex; align-items:center; gap:6px; flex-wrap:wrap;
                  background:#f0f4ff; border-radius:6px; padding:5px 10px; margin-top:8px; }
.dp-tw-label    { font-size:10px; font-weight:700; color:#1a3560; text-transform:uppercase; letter-spacing:.4px; }
.dp-tw-name     { font-size:12px; font-weight:700; color:#0d1f3c; }
.dp-tw-detail   { font-size:11px; color:#64748b; }

/* Progress bars */
.dp-bar-row-wrap { display:flex; flex-direction:column; gap:1px; }
.dp-bar-row     { display:grid; grid-template-columns:80px 1fr 52px; align-items:center; gap:8px; }
.dp-bar-lbl     { font-size:11px; color:#64748b; white-space:nowrap; }
.dp-bar-track   { height:9px; background:#e8eaf6; border-radius:5px; overflow:hidden; flex:1; }
.dp-bar-fill    { height:100%; border-radius:5px; transition:width .4s; }
.dp-bar-pct     { font-size:11px; font-weight:700; text-align:right; white-space:nowrap; }
.dp-bar-vals    { font-size:11px; font-weight:700; color:#1e293b; padding-left:88px; }
.dp-bar-budget  { font-weight:400; color:#94a3b8; }
.dp-bar-no-budget { font-weight:400; color:#94a3b8; font-style:italic; }

@media (max-width:640px) {
  .dp-body { grid-template-columns:1fr; }
}

/* ─── Charts toolbar ──────────────────────────────────────────── */
.charts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  padding: 14px 18px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.range-shortcuts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.range-shortcut {
  padding: 6px 14px;
  border: 1.5px solid #dde3f0;
  border-radius: 20px;
  background: #fff;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.range-shortcut:hover { border-color: #4f8ef7; color: #4f8ef7; }
.range-shortcut.active {
  background: #4f8ef7;
  border-color: #4f8ef7;
  color: #fff;
}

.date-range-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.date-range-group label {
  font-size: 13px;
  color: #777;
  white-space: nowrap;
}
.date-range-group input[type="date"] {
  padding: 6px 10px;
  border: 1.5px solid #dde3f0;
  border-radius: 8px;
  font-size: 13px;
  color: #333;
  background: #f8f9fc;
  cursor: pointer;
}
.date-range-group input[type="date"]:focus {
  outline: none;
  border-color: #4f8ef7;
  background: #fff;
}

.btn-apply {
  padding: 7px 16px;
  background: #4f8ef7;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.btn-apply:hover { background: #3a7de8; }

/* ─── Charts loading ──────────────────────────────────────────── */
.charts-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  color: #888;
  font-size: 14px;
}

/* ─── Charts grid ─────────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.chart-card.chart-full {
  grid-column: 1 / -1;
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 16px;
}

.chart-wrap {
  position: relative;
  height: 240px;
}

.chart-wrap-tall {
  height: 320px;
}

/* ─── Chart responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card.chart-full { grid-column: 1; }
  .date-range-group { margin-left: 0; }
}

@media (max-width: 600px) {
  .charts-toolbar { flex-direction: column; align-items: flex-start; }
}

/* ─── Global spacing fix — card body padding ──────────────────── */
/* Cards that contain free-form content (not tables) need inner padding */
.card-body {
  padding: 20px;
}

/* Tables already have their own cell padding — keep them edge-to-edge */
/* but add a small top gap between card header and table */
.admin-card .table-loading,
.admin-card .state-error {
  padding: 16px 20px;
}

/* ─── Mi cuenta ───────────────────────────────────────────────── */
.settings-wrap {
  max-width: 540px;
}

/* Top card: avatar + name summary */
.account-card-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

.account-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.account-big-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f8ef7, #3a7de8);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.account-avatar-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #dde3f0;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  transition: background .15s;
  padding: 0;
}
.account-avatar-btn:hover { background: #eef3ff; }

.account-info-summary {
  min-width: 0;
}

.account-display-name {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-display-username {
  font-size: 13px;
  color: #888;
  margin-top: 3px;
}

/* Preview text under accordion titles */
.account-field-preview {
  font-size: 13px;
  color: #888;
  margin-top: 3px;
  font-weight: 400;
}

/* Form grid inside settings accordions */
.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 600px) {
  .settings-form-grid { grid-template-columns: 1fr; }
}

.settings-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

/* form-msg ok variant */
.form-msg.ok { color: #2e7d32; }

/* ─── Modal genérico ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: white;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #0d1f3c;
  border-radius: 10px 10px 0 0;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: white;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
}
.modal-close:hover { opacity: 1; }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fafafa;
  border-radius: 0 0 10px 10px;
}

/* ─── Project ⋮ menu ──────────────────────────────────────────── */
.proj-menu-wrap { position: relative; display: inline-block; }

.btn-menu {
  font-size: 18px;
  padding: 2px 8px;
  letter-spacing: 1px;
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  color: #555;
}
.btn-menu:hover { background: #f0f2f5; }

.proj-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 100;
  min-width: 140px;
  overflow: hidden;
}
.proj-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
}
.proj-menu button:hover { background: #f5f7ff; }


/* ─── Supervisor worker-select preview ────────────────────────── */
.sup-worker-preview {
  margin: 8px 0 4px;
}
.sup-worker-preview-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f0f4ff;
  border: 1px solid #c8d5f0;
  border-radius: 8px;
  max-width: 420px;
}
.sup-mini-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.sup-mini-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #4f8ef7;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.sup-worker-preview-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sup-worker-preview-name {
  font-weight: 600;
  font-size: 14px;
  color: #1a1a2e;
}
.sup-worker-preview-sub {
  font-size: 12px;
  color: #5a6a85;
}

/* ─── Workers filter bar ──────────────────────────────────────── */
.workers-filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #eef0f4;
}
.workers-filter-bar input[type="text"] {
  flex: 1;
  max-width: 360px;
  padding: 7px 12px;
  border: 1px solid #d0d7e3;
  border-radius: 7px;
  font-size: 13px;
}
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #5a6a85;
  cursor: pointer;
  user-select: none;
}

/* ═══════════════════════════════════════════════════════════════
   INVENTORY MODULE
   ═══════════════════════════════════════════════════════════════ */

/* ─── Sub-tabs (pill nav) ──────────────────────────────────────── */
.inv-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  background: #f0f2f5;
  border-radius: 10px;
  padding: 6px;
}
.inv-tab {
  padding: 7px 16px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #5a6a85;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.inv-tab:hover  { background: #e0e4ef; color: #0d1f3c; }
.inv-tab.active { background: #fff; color: #0d1f3c; box-shadow: 0 1px 4px rgba(0,0,0,.1); }

/* ─── Sub-sections ─────────────────────────────────────────────── */
.inv-section { display: none; }
.inv-section.active { display: block; }

/* ─── Movement type badges ─────────────────────────────────────── */
.badge-mov-in         { background:#e8f5e9; color:#2e7d32; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; }
.badge-mov-out        { background:#fce4ec; color:#c62828; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; }
.badge-mov-transfer   { background:#e3f2fd; color:#1565c0; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; }
.badge-mov-adjustment { background:#fff3e0; color:#e65100; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; }
.badge-mov-return     { background:#f3e8ff; color:#7e22ce; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; }

.mov-type-badge { padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; display:inline-block; }
.mov-type-badge.mov-out           { background:#fce4ec; color:#c62828; }
.mov-type-badge.mov-in            { background:#e8f5e9; color:#2e7d32; }
.mov-type-badge.mov-return        { background:#f3e8ff; color:#7e22ce; }
.mov-type-badge.mov-transfer_out,
.mov-type-badge.mov-transfer_in   { background:#e3f2fd; color:#1565c0; }
.mov-type-badge.mov-adjustment    { background:#fff3e0; color:#e65100; }
.btn-warning { background:#fef3c7; color:#92400e; border:1px solid #fcd34d; border-radius:6px; padding:3px 8px; font-size:11px; font-weight:600; cursor:pointer; }
.btn-warning:hover { background:#fde68a; }

/* ─── Stock status colors ──────────────────────────────────────── */
.stock-ok   { color: #2e7d32; font-weight: 600; }
.stock-low  { color: #e65100; font-weight: 600; }
.stock-zero { color: #c62828; font-weight: 600; }

/* ─── Inventory toggle (supervisor table) ─────────────────────── */
.inv-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .15s;
}
.inv-toggle-on  { background: #e8f5e9; color: #2e7d32; }
.inv-toggle-off { background: #f5f5f5; color: #9e9e9e; }
.inv-toggle:hover { filter: brightness(.95); }

/* ─── Pagination ───────────────────────────────────────────────── */
.inv-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid #f0f0f0;
  font-size: 13px;
  color: #666;
}

/* ─── Stock breakdown tooltip-style ───────────────────────────── */
.stock-breakdown {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

/* ─── Operator token cell ──────────────────────────────────────── */
.op-token-cell {
  font-family: monospace;
  font-size: 12px;
  color: #5a6a85;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .inv-tabs { gap: 4px; padding: 4px; }
  .inv-tab  { padding: 6px 10px; font-size: 12px; }
  .inv-pagination { gap: 8px; }
}

/* ═══════════════════════════════════════════════════════════════
   MÓDULO DE VALIDACIÓN DE REPORTES
   ═══════════════════════════════════════════════════════════════ */

/* Sub-secciones (misma lógica que .inv-section) */
.apv-section          { display: block; }
.apv-section.hidden   { display: none !important; }

/* Badge en el sidebar */
.approval-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 10px;
  background: #e53e3e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}
.approval-badge.hidden { display: none !important; }

/* Tarjeta de reporte pendiente */
.apv-card {
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: box-shadow .15s;
}
.apv-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }

.apv-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}
.apv-card-header:hover { background: #fafbff; }

.apv-sup-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #e8eaf6;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #5a6acf;
}
.apv-sup-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.apv-card-info { flex: 1; min-width: 0; }
.apv-card-name  { font-weight: 600; font-size: 15px; color: #1a1a2e; }
.apv-card-meta  { font-size: 12px; color: #888; margin-top: 2px; }

.apv-card-stats {
  display: flex; gap: 20px; flex-shrink: 0;
  font-size: 13px; color: #444;
}
.apv-card-stat { text-align: center; }
.apv-card-stat-val { font-weight: 700; font-size: 16px; color: #2d3a8c; }
.apv-card-stat-lbl { font-size: 11px; color: #aaa; margin-top: 1px; }

.apv-card-actions {
  display: flex; gap: 8px; flex-shrink: 0; align-items: center;
}

/* Badge de disputas abiertas */
.apv-dispute-warn {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff3cd; color: #856404;
  border: 1px solid #ffc107;
  border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 600;
}

/* Semáforo de estado del reporte */
.apv-status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 600;
}
.apv-status-pending  { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.apv-status-approved { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.apv-status-disputes { background: #fce4ec; color: #c62828; border: 1px solid #ef9a9a; }

/* Detalle modal — tabla de entradas */
.apv-detail-table {
  width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px;
}
.apv-detail-table th {
  background: #f5f6fa; padding: 8px 10px;
  text-align: left; font-weight: 600; color: #555;
  border-bottom: 2px solid #e8eaf0;
}
.apv-detail-table td {
  padding: 7px 10px; border-bottom: 1px solid #f0f0f0; color: #333;
}
.apv-detail-table tr:last-child td { border-bottom: none; }
.apv-detail-table tr:hover td { background: #fafbff; }

/* Sección de resumen de totales en el modal */
.apv-totals-row {
  display: flex; gap: 20px; flex-wrap: wrap;
  background: #f5f6fa; border-radius: 10px;
  padding: 14px 18px; margin-bottom: 16px;
}
.apv-total-item { text-align: center; }
.apv-total-val  { font-size: 20px; font-weight: 700; color: #2d3a8c; }
.apv-total-lbl  { font-size: 11px; color: #999; margin-top: 2px; }

/* Nota de desbloqueo visible en tarjeta */
.apv-unlock-note {
  background: #fff8e1;
  border-left: 3px solid #ffc107;
  padding: 8px 14px;
  font-size: 12px; color: #5a4000;
  margin: 0 20px 14px;
  border-radius: 0 6px 6px 0;
}

/* Botones de acción */
.btn-action-green  { background: #38a169; color: #fff; border-color: #38a169; }
.btn-action-green:hover  { background: #276749; }
.btn-action-yellow { background: #d69e2e; color: #fff; border-color: #d69e2e; }
.btn-action-yellow:hover { background: #b7791f; }

/* ═══════════════════════════════════════════════════════════════
   EQUIPMENT MODULE
   ═══════════════════════════════════════════════════════════════ */

/* ─── Equipment sub-tab panels ────────────────────────────────── */
.eq-section {
  display: none;
}
.eq-section.active {
  display: block;
}

/* ─── Equipment status badges ─────────────────────────────────── */
.badge-eq-available  { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.badge-eq-in_use     { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.badge-eq-maintenance{ background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }
.badge-eq-retired    { background: #f5f5f5; color: #757575; border: 1px solid #e0e0e0; }

.badge-eq-available,
.badge-eq-in_use,
.badge-eq-maintenance,
.badge-eq-retired {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── Ownership badges ────────────────────────────────────────── */
.badge-owned  { background: #e8eaf6; color: #1a3560; border: 1px solid #c5cae9; }
.badge-rented { background: #fce4ec; color: #c62828; border: 1px solid #f48fb1; }

.badge-owned,
.badge-rented {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

/* ─── Maintenance type badges ─────────────────────────────────── */
.badge-mnt-preventivo  { background: #e8f5e9; color: #2e7d32; }
.badge-mnt-correctivo  { background: #ffebee; color: #c62828; }
.badge-mnt-inspeccion  { background: #e3f2fd; color: #1565c0; }

.badge-mnt-preventivo,
.badge-mnt-correctivo,
.badge-mnt-inspeccion {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── Maintenance pending highlight ──────────────────────────── */
.mnt-row-pending td { background: #fffde7; }
.mnt-row-overdue td { background: #fff3e0; }

/* ─── Rental active/closed badges ────────────────────────────── */
.badge-rental-active { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.badge-rental-closed { background: #f5f5f5; color: #757575; border: 1px solid #e0e0e0; }

.badge-rental-active,
.badge-rental-closed {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .badge-eq-available, .badge-eq-in_use,
  .badge-eq-maintenance, .badge-eq-retired,
  .badge-owned, .badge-rented { font-size: 10px; padding: 1px 5px; }
}

/* ═══════════════════════════════════════════════════════════════
   AI CHAT
   ═══════════════════════════════════════════════════════════════ */
.chat-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #f0f2f5;
}

/* Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #1976d2;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.chat-header-info { display: flex; align-items: center; gap: 12px; }
.chat-header-name { font-weight: 700; font-size: 16px; }
.chat-header-sub  { font-size: 12px; opacity: .8; margin-top: 1px; }
.chat-avatar-bot  {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.chat-avatar-bot.small { width: 32px; height: 32px; font-size: 18px; background: #e3f2fd; }
.chat-clear-btn {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13px; transition: background .15s;
}
.chat-clear-btn:hover { background: rgba(255,255,255,.25); }

/* Messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-date-divider {
  text-align: center;
  font-size: 12px;
  color: #888;
  margin: 8px 0;
  position: relative;
}
.chat-date-divider::before, .chat-date-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: #ddd;
}
.chat-date-divider::before { left: 0; }
.chat-date-divider::after  { right: 0; }

/* Bubbles */
.chat-bubble {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 75%;
  animation: chatFadeIn .18s ease;
}
@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-bubble.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-bubble.assistant { align-self: flex-start; }

.chat-bubble-content {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble.user .chat-bubble-content {
  background: #1976d2;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.assistant .chat-bubble-content {
  background: #fff;
  color: #222;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.chat-time {
  display: block;
  font-size: 10px;
  opacity: .6;
  margin-top: 4px;
  text-align: right;
}
.chat-bubble.assistant .chat-time { text-align: left; }

/* Image in bubble */
.chat-bubble-img {
  max-width: 240px;
  max-height: 240px;
  border-radius: 12px;
  display: block;
  cursor: pointer;
  object-fit: cover;
}
.chat-bubble-img:hover { opacity: .9; }

/* Audio in bubble */
.chat-bubble audio {
  max-width: 220px;
  height: 36px;
  border-radius: 20px;
  outline: none;
}

/* Typing indicator */
.chat-typing {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  width: fit-content;
}
.chat-typing span {
  width: 7px; height: 7px;
  background: #aaa; border-radius: 50%;
  animation: typingDot 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typingDot {
  0%,80%,100% { transform: scale(.8); opacity: .4; }
  40%         { transform: scale(1.1); opacity: 1; }
}

/* Input area */
.chat-input-area {
  flex-shrink: 0;
  background: #f0f2f5;
  padding: 8px 16px 12px;
  border-top: 1px solid #e0e0e0;
}
.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #fff;
  border-radius: 24px;
  padding: 6px 6px 6px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.chat-textarea {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  background: transparent;
  line-height: 1.5;
  padding: 4px 0;
}
.chat-btn-icon {
  background: none; border: none;
  font-size: 20px; cursor: pointer;
  padding: 4px 6px; border-radius: 50%;
  color: #666; transition: background .15s, color .15s;
  flex-shrink: 0;
}
.chat-btn-icon:hover { background: #f0f0f0; color: #1976d2; }
.chat-btn-send {
  width: 36px; height: 36px;
  background: #1976d2; color: #fff;
  border: none; border-radius: 50%;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s;
}
.chat-btn-send:hover { background: #1565c0; }
.chat-btn-send:disabled { background: #bbb; cursor: default; }
.chat-mic-btn.recording { color: #e53935; animation: micPulse 1s infinite; }
@keyframes micPulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.15); }
}

/* Recording indicator */
.chat-recording-indicator {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  font-size: 13px; color: #e53935; font-weight: 600;
}
.chat-rec-dot {
  width: 10px; height: 10px;
  background: #e53935; border-radius: 50%;
  animation: micPulse .8s infinite;
}

/* Preview zone */
.chat-preview-zone {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: #e3f2fd;
  border-radius: 12px;
  margin-bottom: 8px;
}
.chat-preview-zone img { height: 60px; border-radius: 8px; }
.chat-preview-close {
  background: none; border: none;
  color: #888; cursor: pointer; font-size: 16px; margin-left: auto;
}
.chat-preview-close:hover { color: #e53935; }

@media (max-width: 768px) {
  .chat-bubble { max-width: 90%; }
}

/* ═══════════════════════════════════════════════════════════
   MATERIAL LISTS v2
   ═══════════════════════════════════════════════════════════ */

/* Create-mode tabs */
.matlist-create-tabs {
  display: flex; gap: 6px; margin-bottom: 16px;
}
.matlist-create-tab {
  padding: 6px 16px; border: 1px solid #ddd; border-radius: 20px;
  background: #fff; cursor: pointer; font-size: 13px; font-weight: 500;
}
.matlist-create-tab.active {
  background: #1976d2; color: #fff; border-color: #1976d2;
}

/* List card */
.matlist-card {
  margin-bottom: 8px; padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; cursor: pointer;
  transition: box-shadow .15s;
}
.matlist-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.matlist-card-main { flex: 1; min-width: 0; }
.matlist-card-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #888; }

/* Status badges */
.matlist-status-badge {
  display: inline-block; padding: 2px 10px;
  border-radius: 12px; font-size: 11px; font-weight: 600; margin-left: 8px;
}
.matlist-status-draft     { background: #f5f5f5; color: #757575; }
.matlist-status-ready     { background: #e3f2fd; color: #1565c0; }
.matlist-status-receiving { background: #fff8e1; color: #f57f17; }
.matlist-status-completed { background: #e8f5e9; color: #2e7d32; }

/* Reception banner */
.reception-banner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding: 12px 20px;
  background: #fff8e1; border-bottom: 1px solid #ffe082;
  font-size: 13px; color: #5d4037; font-weight: 500;
}

/* Reception qty input */
.rec-qty-input:focus {
  outline: none; border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25,118,210,.2);
}

/* ── Movement modal ─────────────────────────────────────────── */
.mov-modal-box     { max-width: 560px; }
.mov-step-label    { font-size: 12px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.mov-type-cards    { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.mov-type-card     { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; border: 2px solid #e5e7eb; border-radius: 10px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.mov-type-card:hover { border-color: #d1d5db; background: #f9fafb; }
.mov-type-card.selected { border-color: currentColor; background: var(--card-bg, #f0fdf4); }
.mov-card-icon     { font-size: 22px; }
.mov-card-name     { font-size: 14px; font-weight: 700; }
.mov-card-desc     { font-size: 11px; color: #9ca3af; }

.mov-type-in.selected       { --card-bg: #f0fdf4; color: #16a34a; border-color: #16a34a; }
.mov-type-out.selected      { --card-bg: #fef2f2; color: #dc2626; border-color: #dc2626; }
.mov-type-transfer.selected { --card-bg: #eff6ff; color: #2563eb; border-color: #2563eb; }
.mov-type-adjustment.selected{ --card-bg: #fff7ed; color: #ea580c; border-color: #ea580c; }

.mov-fields        { margin-top: 16px; border-top: 1px solid #e5e7eb; padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.mov-step          { }

/* ── Movement location sections (origin / dest) ─────────────── */
.mov-location-section {
  background: #f8faff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 14px 12px;
}
.mov-location-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b7280;
}
.mov-location-icon { font-size: 15px; }
.mov-location-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.mov-location-row .form-group { min-width: 160px; margin-bottom: 0; }
.mov-section-arrow {
  text-align: center;
  font-size: 18px;
  color: #9ca3af;
  margin: -8px 0 2px;
  line-height: 1;
}
.mov-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.mov-bottom-grid .form-group { margin-bottom: 0; }
@media (max-width: 520px) { .mov-bottom-grid { grid-template-columns: 1fr; } }

.mov-adj-btns      { display: flex; gap: 8px; }
.mov-adj-btn       { flex: 1; padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; background: #f9fafb; cursor: pointer; font-size: 13px; font-weight: 600; color: #374151; }
.mov-adj-btn.active { border-color: #6366f1; background: #eef2ff; color: #4f46e5; }

.mov-stock-chips   { display: flex; flex-wrap: wrap; gap: 6px; }
.mov-stock-chip    { font-size: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; padding: 3px 8px; border-radius: 8px; }

/* ── Product picker ──────────────────────────────────────────── */
.prod-picker-filters  { display:flex; gap:8px; margin-bottom:6px; }
.prod-search-input    { flex:1; padding:8px 10px; border:1px solid #e2e8f0; border-radius:8px; font-size:13px; min-width:0; }
.prod-search-input:focus { outline:none; border-color:#4f8ef7; box-shadow:0 0 0 2px rgba(79,142,247,.15); }
.prod-picker-list     { max-height:200px; overflow-y:auto; border:1px solid #e2e8f0; border-radius:8px; }
.prod-item            { display:flex; align-items:center; gap:10px; padding:9px 12px; cursor:pointer; border-bottom:1px solid #f1f5f9; transition:background .12s; }
.prod-item:last-child { border-bottom:none; }
.prod-item:hover      { background:#f0f7ff; }
.prod-item-photo      { width:36px; height:36px; border-radius:6px; object-fit:cover; flex-shrink:0; }
.prod-item-initials   { width:36px; height:36px; border-radius:6px; flex-shrink:0; background:linear-gradient(135deg,#4f8ef7,#7b61ff); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:15px; }
.prod-item-info       { flex:1; min-width:0; }
.prod-item-name       { font-size:13px; font-weight:600; color:#1e293b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.prod-item-meta       { font-size:11px; color:#94a3b8; margin-top:1px; }
.prod-item-sku        { font-size:11px; color:#64748b; background:#f1f5f9; padding:2px 6px; border-radius:4px; flex-shrink:0; white-space:nowrap; }
.prod-no-results      { padding:18px; text-align:center; color:#94a3b8; font-size:13px; }
.prod-selected        { display:flex; align-items:center; gap:10px; padding:10px 12px; border:2px solid #4f8ef7; border-radius:8px; background:#f0f7ff; }
.prod-selected-inner  { display:flex; align-items:center; gap:10px; flex:1; min-width:0; }
.prod-change-btn      { font-size:12px; padding:4px 10px; border:1px solid #94a3b8; border-radius:6px; background:#fff; cursor:pointer; color:#64748b; flex-shrink:0; }
.prod-change-btn:hover { border-color:#4f8ef7; color:#4f8ef7; }

/* ── Almacenes con ubicaciones expandibles ───────────────────── */
.invwrh-name-cell   { display: flex; align-items: center; gap: 8px; }
.invwrh-expand-btn  { background: none; border: 1px solid #e5e7eb; border-radius: 4px; width: 22px; height: 22px; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; color: #6b7280; flex-shrink: 0; }
.invwrh-expand-btn:hover { background: #f3f4f6; }
.invwrh-addr        { font-size: 11px; color: #9ca3af; margin-left: 4px; }
.invwrh-locs-row td { background: #f9fafb; }
.invwrh-locs-panel  { border-top: 1px solid #e5e7eb; }
.invwrh-locs-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid #e5e7eb; font-size: 13px; }
.btn-sm             { padding: 4px 10px; font-size: 12px; }
.invloc-inline-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.invloc-inline-table th { padding: 6px 16px; background: #f3f4f6; text-align: left; font-size: 11px; color: #6b7280; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.invloc-inline-table td { padding: 8px 16px; border-top: 1px solid #f3f4f6; }

/* ── Project Materials Panel (admin) ─────────────────────────── */
.pmanel-tabs       { display: flex; gap: 6px; margin-bottom: 12px; }
.pmanel-tab        { padding: 6px 14px; border: 1px solid #d1d5db; border-radius: 6px; background: #f9fafb; font-size: 12px; font-weight: 600; cursor: pointer; color: #374151; }
.pmanel-tab.active { background: #6366f1; color: #fff; border-color: #6366f1; }
.pmanel-panel      { }

.pmanel-search-bar { margin-bottom: 10px; }
.pmanel-input      { width: 100%; padding: 7px 10px; border: 1px solid #d0d7e3; border-radius: 6px; font-size: 13px; margin-bottom: 6px; }
.pmanel-filters    { display: flex; gap: 6px; flex-wrap: wrap; }
.pmanel-sel        { flex: 1; min-width: 120px; padding: 6px 8px; border: 1px solid #d0d7e3; border-radius: 6px; font-size: 12px; background: #fff; }

.pmanel-results    { max-height: 280px; overflow-y: auto; }
.pmanel-result     { border: 1px solid #e5e7eb; border-radius: 8px; padding: 9px 12px; margin-bottom: 6px; cursor: pointer; background: #fff; transition: border-color .12s; }
.pmanel-result:hover { border-color: #6366f1; background: #f5f3ff; }
.pmanel-res-name   { font-size: 13px; font-weight: 600; color: #1e293b; }
.pmanel-res-meta   { display: flex; gap: 6px; margin: 3px 0; flex-wrap: wrap; }
.pmanel-sku        { font-size: 11px; background: #f1f5f9; color: #475569; padding: 1px 6px; border-radius: 4px; }
.pmanel-cat        { font-size: 11px; background: #ede9fe; color: #5b21b6; padding: 1px 6px; border-radius: 4px; }
.pmanel-res-stock  { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pmanel-stock-chip { font-size: 11px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; padding: 1px 7px; border-radius: 8px; }
.pmanel-empty      { padding: 16px; text-align: center; color: #9ca3af; font-size: 13px; }

.pmanel-picker     { border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; background: #f8faff; }
.pmanel-picker-back { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pmanel-back-btn   { padding: 4px 10px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; font-size: 12px; cursor: pointer; }
.pmanel-back-btn:hover { background: #f3f4f6; }
.pmanel-prod-name  { font-size: 13px; font-weight: 700; color: #6366f1; }
.pmanel-picker-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.pmanel-picker-fields > div { display: flex; flex-direction: column; gap: 4px; }
.pmanel-label      { font-size: 11px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.pmanel-stock-lbl  { font-size: 11px; font-weight: 600; color: #16a34a; margin-top: 3px; }
.pmanel-stock-lbl.over { color: #dc2626; }
.pmanel-err        { grid-column: 1/-1; background: #fff5f5; border: 1px solid #fca5a5; color: #dc2626; border-radius: 6px; padding: 7px 10px; font-size: 12px; }

.pmanel-lists-cont { }
.pmanel-list-card  { border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.pmanel-list-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pmanel-list-name  { font-size: 13px; font-weight: 700; color: #1e293b; }
.pmanel-list-items { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.pmanel-list-item  { font-size: 11px; background: #f3f4f6; padding: 2px 8px; border-radius: 6px; color: #374151; }

.pmanel-review     { border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; background: #f8faff; }
.pmanel-review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pmanel-review-item  { border: 1px solid #e5e7eb; border-radius: 7px; padding: 9px 11px; margin-bottom: 7px; background: #fff; }
.pmanel-review-item.pmanel-review-nst  { opacity: .6; }
.pmanel-review-item.pmanel-review-over { border-color: #fca5a5; background: #fff5f5; }
.pmanel-review-name  { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.pmanel-review-qty   { font-weight: 400; color: #6b7280; }
.pmanel-review-locrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pmanel-review-warn  { font-size: 12px; color: #9ca3af; }

.pmanel-success    { background: #dcfce7; border: 1px solid #bbf7d0; color: #16a34a; border-radius: 7px; padding: 8px 12px; font-size: 13px; font-weight: 600; margin-top: 8px; }

/* ═══════════════════════════════════════════════════════════════
   MÓDULO DE PRESUPUESTOS
   ═══════════════════════════════════════════════════════════════ */

/* ── Vista de presupuesto ── */
.budget-view-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0 16px; flex-wrap: wrap;
}
.budget-view-title {
  flex: 1; font-size: 18px; font-weight: 700; color: #0d1f3c;
}

/* ── Tarjetas de presupuesto ── */
.budget-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 8px; }
.budget-card {
  background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
  padding: 16px; cursor: pointer; transition: box-shadow .2s, border-color .2s;
}
.budget-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); border-color: #0d1f3c; }
.budget-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.budget-card-name   { font-weight: 700; font-size: 15px; color: #0d1f3c; }
.budget-card-meta   { font-size: 12px; color: #757575; margin-bottom: 6px; }
.budget-card-total  { font-size: 20px; font-weight: 700; color: #2e7d32; margin-bottom: 4px; }
.budget-card-date   { font-size: 11px; color: #9e9e9e; }

/* ── Estado del presupuesto ── */
.budget-status-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.budget-status-draft    { background: #f5f5f5; color: #757575; }
.budget-status-sent     { background: #e3f2fd; color: #1565c0; }
.budget-status-approved { background: #e8f5e9; color: #2e7d32; }
.budget-status-amended  { background: #fff3e0; color: #e65100; }

/* ── Editor ── */
.budget-editor-header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 0 14px; border-bottom: 2px solid #e8eaf6; margin-bottom: 14px;
}
.budget-editor-meta { flex: 1; display: flex; align-items: center; gap: 10px; }

/* ── Tabs del editor ── */
.budget-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid #e0e0e0; }
.budget-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 8px 16px; font-size: 13px; font-weight: 600; color: #757575;
  cursor: pointer; margin-bottom: -2px; transition: color .2s, border-color .2s;
}
.budget-tab:hover  { color: #0d1f3c; }
.budget-tab.active { color: #0d1f3c; border-bottom-color: #0d1f3c; }
.budget-tab-panel  { min-height: 120px; }

/* ── Tabla de presupuesto ── */
.budget-section-title {
  font-weight: 700; font-size: 14px; color: #0d1f3c;
  margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between;
}
.budget-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.budget-table th { background: #f5f5f5; padding: 7px 10px; text-align: left; font-weight: 600; color: #555; border-bottom: 2px solid #e0e0e0; }
.budget-table td { padding: 7px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.budget-table .num { text-align: right; }
.budget-table tbody tr:hover { background: #fafafa; }
.budget-table tfoot td { background: #f9fbe7; font-weight: 600; border-top: 2px solid #e0e0e0; }

/* ── Botones pequeños ── */
.btn-sm   { padding: 5px 10px !important; font-size: 12px !important; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 2px 4px; font-size: 14px; opacity: .7; }
.btn-icon:hover { opacity: 1; }
.btn-icon-danger:hover { opacity: 1; filter: sepia(1) saturate(5) hue-rotate(300deg); }
.btn-danger-sm { color: #c62828; border-color: #c62828; }
.btn-danger-sm:hover { background: #ffebee; }

/* ── Gran total ── */
.budget-grand-total {
  margin-top: 24px; border-top: 2px solid #e8eaf6; padding-top: 14px;
  max-width: 360px; margin-left: auto;
}
.budget-total-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; color: #424242; }
.budget-total-grand { font-size: 18px; font-weight: 700; color: #0d1f3c; border-top: 1px solid #e0e0e0; margin-top: 8px; padding-top: 8px; }

#budget-section-breakdown { border-top: 1px dashed #c5cae9; margin-top: 12px; padding-top: 10px; }
.budget-section-breakdown-title { font-size: 11px; font-weight: 700; color: #7986cb; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.budget-section-row { font-size: 13px; color: #546e7a; }
.bsec-pct { font-size: 11px; color: #90a4ae; background: #eceff1; border-radius: 4px; padding: 1px 5px; margin-right: 4px; }

/* ── Órdenes de compra en presupuesto ── */
.budget-order-card {
  background: #fafafa; border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 12px 16px; margin-bottom: 10px;
}
.budget-order-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.budget-order-name   { font-weight: 600; font-size: 14px; }
.budget-order-meta   { font-size: 12px; color: #757575; margin-bottom: 8px; }

/* ─── Proyecto: Vista detalle ──────────────────────────────── */
.proj-detail-header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 0 16px; border-bottom: 2px solid #e8eaf6; margin-bottom: 0;
}
.proj-detail-title-wrap { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proj-detail-title-wrap > span:first-child { font-size: 20px; font-weight: 700; color: #0d1f3c; }
.proj-detail-code { font-size: 13px; background: #e8eaf6; color: #1a3560; padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.proj-detail-actions { display: flex; gap: 8px; align-items: center; }

/* ── Tabs del detalle de proyecto ── */
.proj-detail-tabs {
  display: flex; gap: 4px; border-bottom: 2px solid #e0e0e0; margin: 0 0 18px;
}
.proj-detail-tab {
  background: none; border: none; border-bottom: 3px solid transparent;
  padding: 10px 18px; font-size: 13px; font-weight: 600; color: #757575;
  cursor: pointer; margin-bottom: -2px; transition: color .2s, border-color .2s;
}
.proj-detail-tab:hover  { color: #0d1f3c; }
.proj-detail-tab.active { color: #0d1f3c; border-bottom-color: #0d1f3c; }
.proj-detail-panel { min-height: 120px; padding-top: 4px; }

/* ── Tab General del proyecto ── */
.proj-info-grid { padding: 8px 0; }
.proj-chip-label { font-size: 11px; font-weight: 600; color: #9e9e9e; text-transform: uppercase; letter-spacing: .5px; }
.proj-general-chips { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.proj-chip { display: flex; align-items: center; gap: 10px; background: #f8f9fc; border: 1px solid #e8eaf0; border-radius: 10px; padding: 12px 16px; min-width: 140px; }
.proj-chip-icon { font-size: 18px; line-height: 1; }
.proj-chip-val { font-size: 14px; font-weight: 600; color: #1a1a2e; margin-top: 2px; }
.proj-general-desc { background: #f8f9fc; border: 1px solid #e8eaf0; border-radius: 10px; padding: 16px 20px; margin-bottom: 20px; }
.proj-desc-text { font-size: 14px; color: #444; line-height: 1.65; margin-top: 6px; white-space: pre-wrap; }
.proj-general-stats { margin-top: 4px; }
.proj-stat-skeleton { font-size: 13px; color: #bbb; }
.proj-stats-title { font-size: 11px; font-weight: 700; color: #9e9e9e; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.proj-stats-row { display: flex; flex-wrap: wrap; gap: 12px; }
.proj-stat-card { background: #f8f9fc; border: 1px solid #e8eaf0; border-radius: 10px; padding: 14px 20px; min-width: 140px; }
.proj-stat-card.psc-approved { background: #f0fdf4; border-color: #bbf7d0; }
.proj-stat-card.psc-draft    { background: #fffbeb; border-color: #fde68a; }
.proj-stat-num { font-size: 20px; font-weight: 800; color: #1a1a2e; }
.proj-stat-card.psc-approved .proj-stat-num { color: #16a34a; }
.proj-stat-card.psc-draft    .proj-stat-num { color: #d97706; }
.proj-stat-lbl { font-size: 11px; color: #888; margin-top: 2px; }
.budget-card-notes { font-size: 12px; color: #78716c; margin: 4px 0 6px; font-style: italic; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Nombre de proyecto clickable en tabla ── */
.proj-name-link { color: #0d1f3c; font-weight: 600; cursor: pointer; background: none; border: none; padding: 0; font-size: inherit; text-align: left; }
.proj-name-link:hover { text-decoration: underline; }

/* ── Barra de progreso temporal en tabla ── */
.proj-progress-wrap  { display:flex; align-items:center; gap:6px; min-width:100px; }
.proj-progress-track { flex:1; height:8px; background:#e8eaf6; border-radius:4px; overflow:hidden; }
.proj-progress-fill  { height:100%; border-radius:4px; transition:width .4s; }
.proj-progress-label { font-size:11px; font-weight:700; white-space:nowrap; min-width:32px; text-align:right; }

/* ── Indicador de salud del proyecto ── */
.proj-health { display:flex; align-items:flex-start; gap:5px; margin-top:5px; flex-wrap:wrap; }
.proj-health-dot   { width:8px; height:8px; border-radius:50%; flex-shrink:0; margin-top:3px; }
.proj-health-label { font-size:11px; font-weight:700; white-space:nowrap; }
.proj-health-tip   { font-size:11px; color:#64748b; line-height:1.4; }

/* ── Browser de productos para presupuesto ── */
.bmat-browser-row {
  display: flex; align-items: center; padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0; transition: background .15s;
}
.bmat-browser-row:hover { background: #f5f7ff; }
.bmat-browser-row:last-child { border-bottom: none; }
.bmat-row-selected { background: #e8f5e9; }
.bmat-row-selected:hover { background: #dcedc8; }

/* ── Supervisor detail tabs ── */
.sup-tab-btn {
  background: none; border: none; border-bottom: 3px solid transparent;
  padding: 8px 18px; font-size: 14px; font-weight: 600; color: #64748b;
  cursor: pointer; margin-bottom: -2px; transition: color .15s, border-color .15s;
}
.sup-tab-btn:hover  { color: #2d3a8c; }
.sup-tab-btn.active { color: #2d3a8c; border-bottom-color: #2d3a8c; }

/* ── Supervisor day card ── */
.sup-day-card:hover { background: #f8fafc; }
.sup-day-open       { background: #f0f4ff !important; border-color: #2d3a8c !important; }

/* ── Generic secondary button ── */
.btn-secondary {
  background: #fff; border: 1px solid #d1d5db; color: #374151;
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background .15s;
}
.btn-secondary:hover           { background: #f3f4f6; }
.btn-secondary.active          { background: #e8f0fe; border-color: #2d3a8c; color: #2d3a8c; }
.btn-secondary:disabled        { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* ═══════════════════════════════════════════════════════
   SUPERVISOR DETAIL — Week / Team view
   ═══════════════════════════════════════════════════════ */

/* Week nav */
.sup-week-nav { display:flex; align-items:center; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.sup-nav-btn { width:32px; height:32px; border-radius:50%; border:1px solid #d1d5db; background:#fff; font-size:18px; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#555; transition:background .15s; }
.sup-nav-btn:hover { background:#f3f4f6; }
.sup-nav-btn:disabled { opacity:.35; cursor:default; }
.sup-week-range { font-weight:700; font-size:15px; color:#1e293b; }
.sup-week-badge { display:inline-flex; align-items:center; padding:3px 10px; border-radius:20px; font-size:12px; font-weight:600; }
.sup-week-badge.submitted  { background:#e8f4fd; color:#2563eb; }
.sup-week-badge.approved   { background:#e8f5e9; color:#16a34a; }
.sup-week-badge.inprogress { background:#fff3cd; color:#92400e; }

/* Day items */
.sup-day-item { background:#fff; border:1px solid #e2e8f0; border-radius:10px; overflow:hidden; transition:box-shadow .15s; }
.sup-day-item:hover:not(.sup-day-future) { box-shadow:0 2px 8px rgba(0,0,0,.07); }
.sup-day-item.sup-day-open { border-color:#2d3a8c; box-shadow:0 2px 12px rgba(45,58,140,.1); }
.sup-day-future { opacity:.5; }

.sup-day-header { display:flex; align-items:center; gap:10px; padding:12px 16px; cursor:pointer; user-select:none; }
.sup-day-future .sup-day-header { cursor:default; }

.sup-day-chevron { font-size:16px; color:#aaa; transition:transform .2s; flex-shrink:0; }
.sup-day-open .sup-day-chevron { transform:rotate(90deg); }

.sup-day-status-icon { width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; flex-shrink:0; }
.sup-day-status-icon.complete   { background:#e8f5e9; color:#2e7d32; }
.sup-day-status-icon.partial    { background:#fff8e1; color:#e65100; }
.sup-day-status-icon.unreported { background:#f0f0f0; color:#888; }
.sup-day-status-icon.future     { background:#f0f0f0; color:#bbb; }

.sup-day-label { font-weight:600; font-size:14px; flex:1; color:#1e293b; }

.sup-day-badge { padding:3px 10px; border-radius:20px; font-size:11px; font-weight:600; }
.sup-day-badge.complete   { background:#e8f5e9; color:#2e7d32; }
.sup-day-badge.partial    { background:#fff8e1; color:#e65100; }
.sup-day-badge.unreported { background:#f0f0f0; color:#888; }

.sup-day-progress { font-size:12px; color:#94a3b8; font-weight:500; flex-shrink:0; }

.sup-day-bar-wrap { flex:1; height:5px; background:#e2e8f0; border-radius:3px; min-width:60px; max-width:120px; }
.sup-day-bar-fill { height:100%; border-radius:3px; transition:width .3s; background:#4fc78e; }
.sup-day-bar-fill.partial    { background:#f59e0b; }
.sup-day-bar-fill.unreported { background:#d1d5db; }

/* Day body */
.sup-day-body { border-top:1px solid #e2e8f0; background:#fafbfc; padding:10px 12px; display:flex; flex-direction:column; gap:6px; }
.sup-day-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; padding-bottom:8px; border-bottom:1px solid #eef0f4; margin-bottom:4px; }
.sup-btn-absent-all { background:#fff0f0; border:1px solid #fca5a5; color:#dc2626; padding:5px 12px; border-radius:6px; font-size:12px; font-weight:600; cursor:pointer; transition:background .15s; }
.sup-btn-absent-all:hover { background:#fee2e2; }

/* Worker cards */
.sup-wc { background:#fff; border:1px solid #e2e8f0; border-radius:8px; border-left:3px solid #d1d5db; padding:10px 12px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; transition:border-color .2s; }
.sup-wc.sup-wc-reported { border-left-color:#4fc78e; }
.sup-wc.sup-wc-absent   { border-left-color:#ef4444; background:#fffafa; }
.sup-wc.sup-wc-pending  { border-left-color:#d1d5db; }

.sup-wc-photo { width:38px; height:38px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.sup-wc-avatar { width:38px; height:38px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:15px; font-weight:700; color:#fff; background:linear-gradient(135deg,#4f8ef7,#7b61ff); }
.sup-wc-info { flex:1; min-width:100px; }
.sup-wc-name { font-weight:600; font-size:13px; color:#1e293b; }
.sup-wc-pill { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; margin-top:2px; }
.sup-wc-pill.pending  { background:#f1f5f9; color:#94a3b8; }
.sup-wc-pill.reported { background:#e8faf0; color:#15803d; }
.sup-wc-pill.absent   { background:#fff0f0; color:#dc2626; }
.sup-wc-absent-quick { background:none; border:1.5px solid #e2e8f0; color:#94a3b8; border-radius:6px; padding:3px 8px; font-size:13px; cursor:pointer; flex-shrink:0; transition:all .15s; line-height:1.4; }
.sup-wc-absent-quick:hover { border-color:#ef4444; color:#ef4444; background:#fef2f2; }
.sup-wc-absent-quick.active { border-color:#f97316; color:#f97316; background:#fff7ed; }
.sup-wc-chevron { color:#94a3b8; font-size:18px; flex-shrink:0; }

.sup-wc-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; flex-shrink:0; }
.sup-presets { display:flex; gap:4px; }
.sup-preset { padding:5px 9px; border:1px solid #d1d5db; border-radius:6px; background:#f8fafc; font-size:12px; font-weight:600; color:#475569; cursor:pointer; transition:all .15s; touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
.sup-preset:hover  { background:#e8f0fe; border-color:#2d3a8c; color:#2d3a8c; }
.sup-preset.active { background:#2d3a8c; border-color:#2d3a8c; color:#fff; }

.sup-stepper { display:flex; align-items:center; border:1px solid #d1d5db; border-radius:6px; overflow:hidden; }
.sup-step-btn { width:28px; height:30px; border:none; background:#f8fafc; font-size:16px; font-weight:700; color:#475569; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .15s; }
.sup-step-btn:hover { background:#e8f0fe; }
.sup-step-val { min-width:38px; text-align:center; font-size:13px; font-weight:700; color:#1e293b; padding:0 2px; }

.sup-assign-hint { font-size:11px; color:#3b82f6; font-weight:600; background:#eff6ff; border-radius:6px; padding:2px 7px; white-space:nowrap; }
.sup-proj-select { padding:5px 8px; border:1px solid #d1d5db; border-radius:6px; font-size:12px; color:#374151; background:#fff; max-width:160px; }
.sup-save-btn { padding:5px 12px; background:#2d3a8c; color:#fff; border:none; border-radius:6px; font-size:12px; font-weight:600; cursor:pointer; transition:background .15s; white-space:nowrap; }
.sup-save-btn:hover { background:#1e2a6e; }
.sup-save-btn.saving { opacity:.6; cursor:wait; }

.sup-absent-btn { padding:5px 10px; background:#fff0f0; border:1px solid #fca5a5; color:#dc2626; border-radius:6px; font-size:12px; font-weight:600; cursor:pointer; transition:background .15s; }
.sup-absent-btn:hover { background:#fee2e2; }
.sup-absent-btn.active { background:#dc2626; color:#fff; border-color:#dc2626; }

/* Submit area */
.sup-submit-area { margin-top:16px; padding:14px 16px; background:#fff; border:1px solid #e2e8f0; border-radius:10px; display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.sup-submit-info { flex:1; font-size:13px; color:#64748b; }
.sup-submit-btn { padding:9px 20px; background:#2d3a8c; color:#fff; border:none; border-radius:8px; font-size:14px; font-weight:600; cursor:pointer; transition:background .15s; }
.sup-submit-btn:hover { background:#1e2a6e; }

/* ── Team calendar table (sct = supervisor calendar table) ─── */
.sct-table { width:100%; min-width:680px; border-collapse:collapse; }

/* shared column widths */
.sct-worker-col { display:flex; align-items:center; gap:8px; min-width:160px; max-width:200px; flex:0 0 180px; padding-right:8px; }
.sct-day-col    { width:44px; min-width:44px; text-align:center; font-size:12px; }
.sct-total-col  { width:120px; min-width:120px; padding-left:8px; }

/* header row */
.sct-header { display:flex; align-items:center; padding:6px 12px; background:#f8fafc; border-radius:8px 8px 0 0; border:1px solid #e2e8f0; border-bottom:none; }
.sct-hdr { font-size:11px; font-weight:700; color:#94a3b8; text-transform:uppercase; letter-spacing:.4px; }

/* worker rows */
.sct-row { display:flex; align-items:center; padding:9px 12px; background:#fff; border:1px solid #e2e8f0; border-top:none; transition:background .12s; }
.sct-row:hover { background:#f8fafc; }
.sct-row:last-of-type { border-radius:0; }
.sct-inactive { opacity:.45; }

/* avatar */
.sct-avatar { width:34px; height:34px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.sct-initials { display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; color:#fff; background:linear-gradient(135deg,#4f8ef7,#7b61ff); }

.sct-worker-info { min-width:0; }
.sct-worker-name { font-weight:600; font-size:13px; color:#1e293b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:130px; }
.sct-worker-pos  { font-size:11px; color:#94a3b8; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:130px; }
.sct-worker-weeks { font-size:11px; color:#60a5fa; font-weight:600; }

/* day cells */
.sct-day-col { color:#374151; font-weight:500; }
.sct-zero    { color:#d1d5db; }
.sct-ot-day  { color:#ef4444; font-weight:700; }

/* total column */
.sct-bar-wrap  { height:5px; background:#e2e8f0; border-radius:3px; overflow:hidden; margin-bottom:3px; }
.sct-bar-fill  { height:100%; border-radius:3px; background:#4f8ef7; transition:width .4s; }
.sct-bar-fill.sct-ot { background:#ef4444; }
.sct-total-val { font-size:12px; font-weight:600; color:#374151; }
.sct-ot-text   { color:#ef4444; }

/* footer row */
.sct-footer { display:flex; align-items:center; padding:8px 12px; background:#f1f5f9; border:1px solid #e2e8f0; border-top:2px solid #cbd5e1; border-radius:0 0 8px 8px; }
.sct-footer-lbl   { font-size:11px; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:.3px; }
.sct-footer-cell  { font-size:12px; font-weight:700; color:#1e293b; text-align:center; }
.sct-footer-total { font-size:13px; font-weight:800; color:#1e293b; padding-left:8px; }

/* ── Worker report modal ─────────────────────────────────────── */
.wr-modal {
  position:relative; background:#fff; border-radius:20px;
  width:min(94vw, 500px); padding:28px 28px 22px;
  display:flex; flex-direction:column; align-items:center;
  gap:10px; box-shadow:0 20px 60px rgba(0,0,0,.18);
  animation:fadeInUp .18s ease;
}
.wr-close {
  position:absolute; top:12px; right:14px;
  background:none; border:none; font-size:18px; color:#94a3b8;
  cursor:pointer; line-height:1; padding:4px;
}
.wr-close:hover { color:#374151; }

.wr-header { width:100%; display:flex; justify-content:space-between; align-items:center; margin-bottom:2px; }
.wr-day-label { font-size:12px; font-weight:600; color:#64748b; text-transform:uppercase; letter-spacing:.5px; }
.wr-counter   { font-size:12px; color:#94a3b8; }

.wr-avatar {
  width:90px; height:90px; border-radius:50%; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  font-size:34px; font-weight:700; color:#fff;
  background:linear-gradient(135deg,#4f8ef7,#7b61ff);
  box-shadow:0 4px 16px rgba(79,142,247,.3); flex-shrink:0;
}
.wr-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }

.wr-name { font-size:19px; font-weight:700; color:#1e293b; text-align:center; }

.wr-save-status { font-size:12px; height:16px; color:#94a3b8; }
.wr-save-status.saving { color:#f59e0b; }
.wr-save-status.ok     { color:#16a34a; }
.wr-save-status.error  { color:#ef4444; }

.wr-sched-notice { font-size:13px; padding:6px 14px; border-radius:8px; text-align:center; width:100%; box-sizing:border-box; }
.wr-sched-notice.sched-absent  { background:#fef2f2; color:#b91c1c; }
.wr-sched-notice.sched-no-work { background:#f8fafc; color:#64748b; }
.wr-sched-notice.hidden        { display:none; }

#wr-controls { width:100%; display:flex; flex-direction:column; align-items:center; gap:8px; }

.wr-value-display {
  font-size:40px; font-weight:800; color:#1e293b; line-height:1;
  min-width:80px; text-align:center;
}
.wr-presets-row { justify-content:center; flex-wrap:wrap; }
.wr-stepper { display:flex; gap:12px; align-items:center; }
.wr-stepper .sup-step-btn { width:36px; height:36px; font-size:20px; border-radius:50%; border:1px solid #d1d5db; background:#f8fafc; touch-action:manipulation; }

/* Touch devices: full-width large step buttons + bigger presets */
@media (hover: none) and (pointer: coarse) {
  .wr-stepper { width:100%; gap:8px; }
  .wr-stepper .sup-step-btn {
    flex:1; width:auto; height:60px; border-radius:14px;
    font-size:32px; font-weight:300; border:2px solid #d1d5db;
    background:#f8fafc; color:#1e293b;
    display:flex; align-items:center; justify-content:center;
    touch-action:manipulation; -webkit-tap-highlight-color:transparent;
  }
  .wr-stepper .sup-step-btn:active { background:#e0e7ff; border-color:#6366f1; color:#4338ca; }
  /* Bigger preset chips in worker modal */
  .wr-presets-row .sup-preset {
    padding:10px 16px; font-size:15px; border-radius:10px; min-width:52px; text-align:center;
  }
  /* Hours bar: bigger drag handle for touch */
  .wr-bar-track { height:48px; }
  .wr-bar-handle {
    width:28px;
    background:rgba(255,255,255,.9);
    box-shadow:0 0 0 1px rgba(0,0,0,.18), 2px 0 6px rgba(0,0,0,.08), -2px 0 6px rgba(0,0,0,.08);
  }
  .wr-bar-handle::after {
    content:'';
    position:absolute; top:50%; left:50%;
    transform:translate(-50%,-50%);
    width:3px; height:20px;
    border-left:1.5px solid rgba(0,0,0,.25);
    border-right:1.5px solid rgba(0,0,0,.25);
  }
  .wr-bar-seg { font-size:13px; }
}

.wr-proj-list { width:100%; display:flex; flex-direction:column; gap:4px; }
.wr-proj-search {
  width:100%; box-sizing:border-box; padding:7px 10px; font-size:13px;
  border:1px solid #e2e8f0; border-radius:8px; background:#f8fafc;
  color:#1e293b; font-family:inherit; margin-bottom:2px;
}
.wr-proj-search:focus { outline:none; border-color:#4f8ef7; background:#fff; }
.wr-proj-items {
  max-height:200px; overflow-y:auto;
  display:flex; flex-direction:column; gap:2px;
  border:1px solid #e2e8f0; border-radius:10px;
  padding:4px; background:#f8fafc;
}
.wr-proj-item {
  display:flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:7px;
  cursor:pointer; transition:background .12s; user-select:none;
}
.wr-proj-item:hover { background:#f0f4ff; }
.wr-proj-item.selected { background:#eef2ff; }
.wr-proj-checkbox {
  width:16px; height:16px; border-radius:4px; flex-shrink:0;
  border:2px solid #cbd5e1; background:#fff; transition:all .12s;
  display:flex; align-items:center; justify-content:center;
}
.wr-proj-checkbox::after {
  content:''; display:none; width:4px; height:8px;
  border:2px solid #fff; border-top:none; border-left:none;
  transform:rotate(45deg) translate(-1px,-2px);
}
.wr-proj-item.selected .wr-proj-checkbox { background:#2d3a8c; border-color:#2d3a8c; }
.wr-proj-item.selected .wr-proj-checkbox::after { display:block; }
.wr-proj-name { flex:1; font-size:13px; color:#374151; line-height:1.3; }
.wr-proj-item.selected .wr-proj-name { font-weight:600; color:#1e3a8a; }
.wr-proj-badge {
  font-size:10px; font-weight:600; color:#7c3aed;
  background:#ede9fe; padding:1px 6px; border-radius:20px;
  white-space:nowrap; flex-shrink:0;
}
.wr-proj-dot {
  width:8px; height:8px; border-radius:50%; flex-shrink:0;
}
.wr-proj-hour-ro {
  font-size:12px; font-weight:700; color:#1e3a8a;
  flex-shrink:0; min-width:28px; text-align:right;
}

/* ─── Hours distribution bar ──────────────────────────────────── */
.wr-hours-bar { width:100%; padding:10px 0 4px; }
.wr-hours-bar.hidden { display:none; }
.wr-bar-track {
  width:100%; height:34px; border-radius:8px; overflow:hidden;
  display:flex; user-select:none; box-shadow:0 1px 3px rgba(0,0,0,.12);
}
.wr-bar-seg {
  height:100%; display:flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:700; color:#fff;
  text-shadow:0 1px 2px rgba(0,0,0,.35);
  transition:width .06s; min-width:2px; overflow:hidden;
  white-space:nowrap;
}
.wr-bar-handle {
  width:6px; height:100%; background:#fff; cursor:col-resize;
  flex-shrink:0; position:relative; z-index:1;
  box-shadow:0 0 0 1px rgba(0,0,0,.15);
  transition:background .1s;
}
.wr-bar-handle:hover { background:#e0e7ff; }
.wr-bar-legend {
  display:flex; flex-wrap:wrap; gap:6px 12px;
  margin-top:6px; padding:0 2px;
}
.wr-legend-item { display:flex; align-items:center; gap:4px; font-size:12px; }
.wr-legend-dot  { width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.wr-legend-name { color:#475569; max-width:130px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wr-legend-hrs  { font-weight:700; color:#1e3a8a; }

.wr-note-wrap { width:100%; }
.wr-note {
  width:100%; box-sizing:border-box;
  font-size:12px; color:#475569; resize:vertical;
  border:1px solid #e2e8f0; border-radius:8px;
  padding:8px 10px; background:#f8fafc;
  font-family:inherit; line-height:1.5;
  transition:border-color .15s;
}
.wr-note:focus { outline:none; border-color:#4f8ef7; background:#fff; }
.wr-note::placeholder { color:#b0bcc8; }

.wr-absent-btn { margin-top:2px; }

.wr-bottom-nav { display:flex; gap:8px; width:100%; margin-top:4px; }
.wr-btn-nav {
  flex:1; padding:9px 0; background:#f1f5f9; border:1px solid #e2e8f0;
  border-radius:8px; font-size:13px; font-weight:600; color:#374151;
  cursor:pointer; transition:background .15s;
}
.wr-btn-nav:hover    { background:#e2e8f0; }
.wr-btn-nav:disabled { opacity:.35; cursor:not-allowed; }
.wr-btn-next-smart   { background:#2d3a8c; color:#fff; border-color:#2d3a8c; }
.wr-btn-next-smart:hover { background:#1e2a6e; }

.wr-locked-msg {
  font-size:12px; color:#94a3b8; background:#f8fafc;
  border:1px solid #e2e8f0; border-radius:6px;
  padding:6px 14px; text-align:center; width:100%;
}
@keyframes fadeInUp {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ─── Scheduler toolbar ──────────────────────────────────────── */
.sched-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.sched-toolbar-left  { flex: 1; min-width: 180px; }
.sched-toolbar-nav   { display: flex; align-items: center; gap: 8px; }
.sched-toolbar-right { margin-left: auto; }
.sched-week-label    { font-weight: 700; font-size: 14px; color: #1e293b; min-width: 120px; text-align: center; }

/* Nav buttons — bigger and clearer */
.sched-nav-btn {
  padding: 8px 16px;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.sched-nav-btn:hover:not(:disabled) { background: #e2e8f0; border-color: #94a3b8; }
.sched-nav-btn:disabled { opacity: .35; cursor: not-allowed; }
.sched-nav-today { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.sched-nav-today:hover { background: #dbeafe !important; border-color: #93c5fd !important; }

/* Danger bar for copy-week */
.sched-copy-week-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 10px;
  margin-bottom: 12px;
}
.sched-copy-week-label {
  flex: 1;
  font-size: 12px;
  color: #92400e;
  font-weight: 500;
}
.sched-copy-week-btn {
  padding: 7px 16px;
  background: #fff;
  border: 1.5px solid #f97316;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #ea580c;
  cursor: pointer;
  transition: background .12s;
  white-space: nowrap;
}
.sched-copy-week-btn:hover { background: #fff7ed; }

.sched-bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
}

/* ─── Scheduler: day strip ────────────────────────────────────── */
.sched-grid-wrap {
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.sched-dstrip {
  display: flex;
  overflow-x: auto;
  gap: 4px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  scrollbar-width: none;
}
.sched-dstrip::-webkit-scrollbar { display: none; }

.sched-dstab {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 12px; min-width: 54px;
  border-radius: 10px; border: 1.5px solid transparent;
  background: #fff; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.sched-dstab:hover { background: #f1f5f9; }
.sched-dstab.active { background: #1d4ed8; border-color: #1d4ed8; }
.sched-dstab.is-today { border-color: #22c55e; }
.sched-dstab.is-tom   { border-color: #f97316; }

.sds-dow  { font-size: 10px; font-weight: 800; color: #94a3b8; text-transform: uppercase; }
.sds-date { font-size: 14px; font-weight: 700; color: #1e293b; }
.sched-dstab.active .sds-dow  { color: #bfdbfe; }
.sched-dstab.active .sds-date { color: #fff; }

/* ─── View toggle bar ────────────────────────────────────────── */
.sched-vbar {
  display: flex; gap: 6px; align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafafa;
}
.sched-vbtn {
  padding: 5px 14px;
  border-radius: 7px; border: 1.5px solid #e2e8f0;
  background: #fff; color: #64748b;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .1s;
}
.sched-vbtn.active   { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.sched-vbtn-copy     { margin-left: auto; border-color: #94a3b8; color: #475569; }
.sched-vbtn-copy:hover { background: #f1f5f9; }

/* ─── Day view (mobile-first list) ──────────────────────────── */
.sched-dayview { display: flex; flex-direction: column; }

.sched-dvrow {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid #f1f5f9;
  transition: background .1s;
}
.sched-dvrow:last-child { border-bottom: none; }
.sched-dvrow:hover { background: #f8fafc; }
.sched-dvrow.dv-selected { background: #eff6ff; }

.sched-dv-info  { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sched-dv-name  { font-size: 14px; font-weight: 600; color: #1e293b; }
.sched-dv-badges{ display: flex; flex-wrap: wrap; gap: 5px; }

.sched-dv-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 7px;
  font-size: 13px; font-weight: 600;
}
.dv-assign  { background: #eff6ff; color: #1d4ed8; }
.dv-absent  { background: #fef2f2; color: #dc2626; }
.dv-nowork  { background: #fffbeb; color: #d97706; }
.dv-pending { background: #f8fafc; color: #cbd5e1; font-weight: 400; font-style: italic; }
.dv-note    { font-size: 11px; font-weight: 400; color: #64748b; }

.sched-dv-edit {
  flex-shrink: 0; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; border: 1.5px solid #e2e8f0;
  border-radius: 8px; font-size: 14px; color: #64748b;
  cursor: pointer; transition: background .1s;
}
.sched-dv-edit:hover { background: #e2e8f0; }

/* ─── Week overview (compact dots) ──────────────────────────── */
.sched-wo { padding: 10px 14px 14px; overflow-x: auto; }

.sched-wo-hdr { display: flex; align-items: center; border-bottom: 1.5px solid #e2e8f0; padding-bottom: 6px; margin-bottom: 2px; }
.sched-wo-row { display: flex; align-items: center; border-bottom: 1px solid #f8fafc; }
.sched-wo-row:last-child { border-bottom: none; }

.sched-wo-name {
  width: 110px; flex-shrink: 0;
  font-size: 13px; font-weight: 600; color: #475569;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 4px 6px 4px 0;
}
.sched-wo-day {
  flex: 1; min-width: 38px; text-align: center;
  font-size: 10px; font-weight: 800; color: #94a3b8;
  text-transform: uppercase; line-height: 1.3; cursor: pointer;
  padding: 4px 2px;
}
.sched-wo-day.today { color: #16a34a; }
.sched-wo-day.tom   { color: #ea580c; }
.sched-wo-day:hover { color: #1d4ed8; }

.sched-wo-cell {
  flex: 1; min-width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 15px; margin: 2px;
  cursor: pointer; transition: transform .1s, box-shadow .1s;
}
.sched-wo-cell:hover { transform: scale(1.15); box-shadow: 0 2px 8px #0002; }
.wo-assigned { background: #d1fae5; color: #059669; font-size: 18px; }
.wo-absent   { background: #fee2e2; }
.wo-nowork   { background: #fef9c3; }
.wo-empty    { color: #e2e8f0; font-size: 22px; }
.sched-wo-cell.today { outline: 2px solid #22c55e; outline-offset: -2px; }
.sched-wo-cell.tom   { outline: 2px solid #f97316; outline-offset: -2px; }

.sched-cell {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 10px;
  min-height: 48px;
}
.sched-cell:last-child { border-right: none; }

.sched-header {
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
}
.sched-dow  { font-size: 12px; }
.sched-date { font-size: 11px; color: #94a3b8; }

.sched-today {
  background: #f0fdf4 !important;
}
.sched-header.sched-today { color: #16a34a; }
.sched-header.sched-today .sched-dow { color: #16a34a; }
.sched-header.sched-today .sched-date { color: #22c55e; }

.sched-tomorrow { background: #fff7ed !important; }
.sched-header.sched-tomorrow { color: #ea580c; }
.sched-header.sched-tomorrow .sched-dow { color: #ea580c; }
.sched-header.sched-tomorrow .sched-date { color: #f97316; }

.sched-copy-btn {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: #94a3b8;
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 1px 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .12s, border-color .12s;
}
.sched-copy-btn:hover { color: #3b82f6; border-color: #93c5fd; }

.sched-worker-col {
  background: #f8fafc;
  display: flex;
  align-items: center;
}
.sched-worker-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
}
.sched-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  object-fit: cover;
}
.sched-wname { font-size: 13px; font-weight: 500; color: #1e293b; }
.sched-chk   { accent-color: #3b82f6; width: 15px; height: 15px; flex-shrink: 0; }

.sched-selected { background: #f0f9ff !important; }

.sched-day-cell {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background .12s;
  align-items: flex-start;
}
.sched-day-cell:hover { background: #f0f9ff; }

.sched-chip {
  display: inline-block;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-chip-note { font-weight: 400; color: #3b82f6; }
.sched-chip-absent {
  display: inline-block;
  background: #fee2e2;
  color: #dc2626;
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
}
.sched-empty-cell { color: #cbd5e1; font-size: 12px; }
.sched-cell.sched-absent-cell  { background: #fff5f5; }
.sched-cell.sched-nowork-cell  { background: #fffbeb; }
.sched-chip-nowork {
  display: inline-block;
  background: #fef3c7;
  color: #d97706;
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
}

/* ─── Scheduler modal ────────────────────────────────────────── */
.sched-modal { max-width: 500px; }

.sched-loc-entry {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.sched-loc-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.sched-loc-sel, .sched-loc-custom, .sched-loc-notes {
  flex: 1;
  padding: 7px 10px;
  border: 1.5px solid #dde3f0;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: #1e293b;
}
.sched-loc-custom { display: none; }
.sched-loc-notes  { color: #64748b; }

.sched-add-loc {
  background: none;
  border: 1.5px dashed #cbd5e1;
  color: #64748b;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  width: 100%;
  margin-top: 4px;
  transition: border-color .12s, color .12s;
}
.sched-add-loc:hover { border-color: #3b82f6; color: #1d4ed8; }

/* Status radio group in modal */
.sched-status-radios {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sched-status-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  transition: border-color .12s, background .12s, color .12s;
  flex: 1;
  min-width: 120px;
}
.sched-status-opt input[type="radio"] { accent-color: #3b82f6; cursor: pointer; }
.sched-status-opt:has(input:checked) { border-color: #3b82f6; background: #eff6ff; color: #1d4ed8; }
#sched-opt-nowork:has(input:checked)  { border-color: #f97316; background: #fff7ed; color: #ea580c; }
#sched-opt-absent:has(input:checked)  { border-color: #dc2626; background: #fff5f5; color: #dc2626; }

/* No-work / absent state in hour entry panel */
.sup-wc-no-work {
  opacity: 0.55;
  pointer-events: none;
}
.sup-wc-no-work .sup-wc-controls { display: none; }
.sup-no-work-badge {
  font-size: 11px;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 600;
  margin-top: 4px;
}
.sup-absent-badge {
  font-size: 11px;
  color: #dc2626;
  background: #fee2e2;
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 600;
  margin-top: 4px;
}

/* ── Budget sections bar ────────────────────────────────── */
/* Labor rate bar */
.labor-rate-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: #f0f4ff;
  border: 1px solid #d0daf5;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
}
.labor-rate-label { font-weight: 600; color: #3a4a6b; }
.labor-rate-prefix { color: #3a4a6b; font-weight: 600; }
.labor-rate-suffix { color: #5a6a85; }
.labor-rate-field {
  width: 90px;
  padding: 5px 8px;
  border: 1px solid #bbb;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}
.labor-rate-auto-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #5a6a85;
  cursor: pointer;
  margin-left: 8px;
  font-size: 12px;
}

.bsec-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: #f8faff;
  border: 1px solid #e0e7ff;
  border-radius: 8px;
  font-size: 13px;
}
.bsec-label { font-weight: 600; color: #475569; margin-right: 2px; }
.bsec-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e8eaf6;
  color: #1a3560;
  border-radius: 20px;
  padding: 3px 10px 3px 12px;
  font-size: 12px;
  font-weight: 600;
}
.bsec-chip-name { cursor: default; }
.bsec-chip-name[title] { cursor: text; }
.bsec-del {
  background: none;
  border: none;
  cursor: pointer;
  color: #9fa8da;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.bsec-del:hover { color: #c62828; }
.bphase-insert-row td { padding: 0 !important; border: none !important; }
.bphase-insert-btn {
  display: none;
  width: 100%;
  background: none;
  border: none;
  border-top: 1px dashed #c7d0e0;
  color: #8a96a8;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 8px;
  text-align: left;
}
.bphase-insert-row:hover .bphase-insert-btn { display: block; }
.bphase-insert-btn:hover { color: #3a7bd5; border-color: #3a7bd5; }
.bsec-add {
  background: none;
  border: 1px dashed #9fa8da;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  color: #5c6bc0;
  cursor: pointer;
}
.bsec-add:hover { background: #e8eaf6; }
.bsec-name-input {
  padding: 3px 8px;
  border: 1px solid #9fa8da;
  border-radius: 20px;
  font-size: 12px;
  outline: none;
  width: 150px;
}
.bsec-name-input:focus { border-color: #1a3560; }
.bsec-confirm, .bsec-cancel-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}
.bsec-confirm { color: #16a34a; }
.bsec-confirm:hover { color: #14532d; }
.bsec-cancel-btn { color: #94a3b8; }
.bsec-cancel-btn:hover { color: #c62828; }

/* ── Edit material modal ─────────────────────────────────── */
.bmat-name-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f8faff;
  border: 1px solid #e0e7ff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}
.bmat-inv-badge {
  font-size: 10px;
  font-weight: 700;
  background: #e8eaf6;
  color: #1a3560;
  border-radius: 10px;
  padding: 2px 7px;
  flex-shrink: 0;
}
.bmat-qty-notice {
  font-size: 12px;
  color: #f57c00;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 10px;
}
.bmat-sec-qty-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 8px;
}
.bmat-sec-label { font-size: 13px; color: #334155; }
.bmat-sec-qty-grid input {
  width: 80px;
  padding: 4px 6px;
  border: 1px solid #bbb;
  border-radius: 5px;
  font-size: 13px;
}
.bmat-sec-unit { font-size: 12px; color: #94a3b8; }
.bmat-sec-total {
  font-size: 12px;
  color: #475569;
  border-top: 1px solid #e8eaf6;
  padding-top: 6px;
  margin-top: 2px;
}
.bsec-expand {
  background: none;
  border: none;
  cursor: pointer;
  color: #9fa8da;
  font-size: 11px;
  padding: 0 4px 0 0;
}
.bsec-expand:hover { color: #1a3560; }

/* ── Project card health row ────────────────────────────── */
.dp-health-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 10px;
  border-top: 1px solid #f1f5f9;
  margin-top: 6px;
}
.dp-health-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dp-health-label {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.dp-health-tip {
  font-size: 12px;
  color: #64748b;
  flex: 1;
}

/* ── Header company info ── */
.co-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-left: 4px;
  transition: background .15s;
}
.co-header-info:hover { background: rgba(255,255,255,.12); }
.co-header-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 5px; background: rgba(255,255,255,.9); }
.co-header-name { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.85); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Botón Publicar (scheduler) ── */
.btn-publish {
  padding: 6px 14px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-publish:hover { background: #e2e8f0; }
.btn-publish.sched-publish-pending {
  background: #0d1f3c;
  color: #fff;
  border-color: #0d1f3c;
  animation: pulse-pub 2s ease-in-out infinite;
}
.btn-publish.sched-publish-pending:hover { background: #283593; }
@keyframes pulse-pub {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26,35,126,.4); }
  50%       { box-shadow: 0 0 0 6px rgba(26,35,126,0); }
}

/* ── Modal reporte fullscreen ── */
#modal-report { display: flex; }

/* ══════════════════════════════════════════════════════
   ASISTENTE IA DE PROYECTO — Panel lateral
   ══════════════════════════════════════════════════════ */
.proj-chat-panel {
  width: min(700px, 100vw);
  height: 100vh;
  max-height: 100vh;
  background: #f5f7fb;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.18);
  animation: slideInRight 0.22s ease;
}
@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.proj-chat-header {
  background: #0d1f3c;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.proj-chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.proj-chat-icon { font-size: 22px; flex-shrink: 0; }
.proj-chat-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proj-chat-phases { display: flex; gap: 6px; margin-top: 5px; }
.pch-phase-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.75);
  border-radius: 16px;
  padding: 2px 11px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.pch-phase-btn.active {
  background: #fff;
  color: #0d1f3c;
  font-weight: 600;
  border-color: #fff;
}
.proj-chat-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pch-btn-icon {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.15s;
  line-height: 1;
}
.pch-btn-icon:hover { background: rgba(255,255,255,0.18); }
.proj-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pch-photo-preview {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #eef2ff;
  border-top: 1px solid #c5cae9;
  flex-shrink: 0;
}
.pch-photo-preview.hidden { display: none; }
.proj-chat-input-area {
  padding: 10px 14px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
}
.pch-btn-attach {
  color: #666;
  font-size: 20px;
  padding: 4px;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.pch-btn-attach:hover { background: #f0f2ff; }
.pch-textarea {
  flex: 1;
  border: 1px solid #d0d5e0;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  resize: none;
  outline: none;
  font-family: inherit;
  line-height: 1.4;
  max-height: 120px;
  overflow-y: auto;
  background: #f8f9fc;
  transition: border-color 0.15s;
}
.pch-textarea:focus { border-color: #1a3560; background: #fff; }
.pch-btn-send {
  background: #1a3560;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.pch-btn-send:hover    { background: #0d1f3c; }
.pch-btn-send:disabled { opacity: 0.55; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════
   GALERÍA DE FOTOS DEL PROYECTO
   ══════════════════════════════════════════════════════ */
.proj-photos-section {
  margin-top: 20px;
  border-top: 1px solid #e8ecf4;
  padding-top: 18px;
}
.proj-photos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.proj-photos-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a2332;
}
.proj-photos-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.proj-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.proj-photo-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f2f8;
  aspect-ratio: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}
.proj-photo-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.14); }
.proj-photo-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.proj-photo-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  color: #fff;
  font-size: 11px;
  padding: 16px 8px 6px;
  line-height: 1.3;
}
.proj-photo-uploading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: #8a96a8;
  font-size: 12px;
  border: 2px dashed #c5cae9;
  border-radius: 8px;
  aspect-ratio: 1;
}
.proj-photos-empty {
  text-align: center;
  color: #aaa;
  font-size: 13px;
  padding: 28px 0;
}

/* Lightbox */
.proj-photo-lightbox {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.88);
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
}
.proj-photo-lightbox.hidden { display: none; }
.proj-lb-content {
  max-width: min(860px, 90vw);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.proj-lb-content img {
  max-width: 100%; max-height: 80vh;
  border-radius: 8px;
  object-fit: contain;
}
.proj-lb-caption { color: #fff; font-size: 14px; text-align: center; }
.proj-lb-meta    { color: rgba(255,255,255,0.5); font-size: 12px; text-align: center; }
.proj-lb-close {
  position: absolute; top: 16px; right: 20px;
  background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 32px; cursor: pointer; line-height: 1;
}
.proj-lb-close:hover { color: #fff; }
.proj-lb-nav {
  background: rgba(255,255,255,0.1); border: none; color: #fff;
  font-size: 40px; cursor: pointer; padding: 8px 14px;
  border-radius: 6px; line-height: 1; flex-shrink: 0;
  transition: background 0.15s;
}
.proj-lb-nav:hover { background: rgba(255,255,255,0.2); }

/* Proyectos sin presupuesto aprobado — menos prominentes */
tr.proj-row-draft { opacity: 0.58; }
tr.proj-row-draft .proj-name-link { color: #6b7a99; }
tr.proj-row-draft:hover { opacity: 0.8; }

/* Acciones sobre cada foto (editar nota, eliminar) */
.proj-photo-actions {
  position: absolute;
  top: 6px; right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.proj-photo-card:hover .proj-photo-actions { opacity: 1; }
.proj-photo-btn {
  background: rgba(0,0,0,0.55);
  border: none;
  color: #fff;
  font-size: 14px;
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}
.proj-photo-btn:hover           { background: rgba(0,0,0,0.8); }
.proj-photo-btn-del:hover       { background: #c62828; }
.proj-photo-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: #fff;
  font-size: 11px;
  padding: 16px 8px 6px;
  line-height: 1.3;
  pointer-events: none;
}

/* ══ Subcontratos ejecutados ══ */
.sc-section {
  margin-top: 24px;
  border-top: 2px solid #e8ecf4;
  padding-top: 16px;
}
.sc-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.sc-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a2332;
}
.sc-section-sub {
  font-size: 12px;
  color: #8a96a8;
  margin-top: 2px;
}

/* ─── Credenciales e Integraciones (sección Empresa) ─────── */
.cred-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #1a2332;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1.5px solid #e8ecf4;
}
.cred-section-hint {
  font-size: 12px;
  color: #8a96a8;
  margin-top: 6px;
  line-height: 1.5;
}
.cred-field-hint {
  display: block;
  font-size: 11px;
  color: #a0aab8;
  margin-top: 4px;
}
.cred-input-wrap {
  display: flex;
  gap: 0;
}
.cred-input-wrap input {
  flex: 1;
  border-radius: 8px 0 0 8px !important;
}
.cred-toggle-btn {
  background: #f0f3fa;
  border: 1px solid #d0d8e8;
  border-left: none;
  border-radius: 0 8px 8px 0;
  padding: 0 10px;
  cursor: pointer;
  font-size: 14px;
  color: #6a7a8c;
  transition: background .15s;
}
.cred-toggle-btn:hover       { background: #e4e9f5; }
.cred-toggle-btn.cred-toggle-active { background: #dce7ff; color: #2563eb; }
.cred-status {
  display: inline-block;
  font-size: 11px;
  margin-top: 4px;
  color: #a0aab8;
}
.cred-status.cred-status-ok {
  color: #16a34a;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   SUPERVISOR DAY PANEL — Tabs (Horas / Materiales / Incidencias)
   ═══════════════════════════════════════════════════════ */

.sup-day-tab-bar {
  display: flex; gap: 0; border-bottom: 2px solid #e2e8f0;
  margin: 0 -12px 10px; padding: 0 12px;
}
.sup-day-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 8px 14px; font-size: 13px; font-weight: 600; color: #64748b;
  cursor: pointer; margin-bottom: -2px; transition: color .15s, border-color .15s;
}
.sup-day-tab:hover  { color: #2d3a8c; }
.sup-day-tab.active { color: #2d3a8c; border-bottom-color: #2d3a8c; }

/* ─── Incident status badges ─────────────────────────── */
.inc-status {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.inc-status.draft    { background: #f0f0f0;  color: #555; }
.inc-status.sent     { background: #e8f4fd;  color: #2563eb; }
.inc-status.approved { background: #e8f5e9;  color: #16a34a; }
.inc-status.closed   { background: #fff3cd;  color: #92400e; }
.inc-status.billed   { background: #ede9fe;  color: #7c3aed; }

/* ─── Incident card ──────────────────────────────────── */
.inc-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
}
.inc-card-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inc-card-title  { font-weight: 600; font-size: 13px; flex: 1; }
.inc-card-meta   { font-size: 12px; color: #64748b; }
.inc-card-actions{ display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.inc-btn {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 6px;
  border: 1px solid currentColor; background: transparent; cursor: pointer;
  transition: background .15s;
}
.inc-btn.sent     { color: #2563eb; }  .inc-btn.sent:hover     { background: #e8f4fd; }
.inc-btn.approved { color: #16a34a; }  .inc-btn.approved:hover { background: #e8f5e9; }
.inc-btn.closed   { color: #92400e; }  .inc-btn.closed:hover   { background: #fff3cd; }
.inc-btn.billed   { color: #7c3aed; }  .inc-btn.billed:hover   { background: #ede9fe; }
.inc-btn.danger   { color: #dc2626; border-color: #fca5a5; } .inc-btn.danger:hover { background: #fee2e2; }

/* ─── Incident create form ───────────────────────────── */
.inc-create-form {
  background: #f8fafc; border: 1px dashed #c7d2fe; border-radius: 8px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px;
}
.inc-create-form input, .inc-create-form textarea {
  width: 100%; box-sizing: border-box; padding: 7px 10px; border: 1px solid #d1d5db;
  border-radius: 6px; font-size: 13px; font-family: inherit;
}
.inc-create-form textarea { resize: vertical; min-height: 60px; }

/* ─── Daily summary area ─────────────────────────────── */
.day-summary-section {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid #e2e8f0;
}
.day-summary-label { font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.day-summary-wrap  { display: flex; gap: 6px; align-items: flex-start; }
.day-summary-textarea {
  flex: 1; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 13px; font-family: inherit; resize: vertical; min-height: 60px;
  line-height: 1.5;
}
.day-summary-textarea:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 2px rgba(129,140,248,.15); }
.day-summary-btns  { display: flex; flex-direction: column; gap: 4px; }
.day-summary-btn {
  padding: 6px 10px; border-radius: 6px; border: 1px solid #d1d5db;
  background: #fff; font-size: 12px; cursor: pointer; white-space: nowrap;
  transition: background .15s;
}
.day-summary-btn:hover   { background: #f3f4f6; }
.day-summary-btn.mic     { border-color: #fca5a5; color: #dc2626; }
.day-summary-btn.mic:hover{ background: #fee2e2; }
.day-summary-btn.mic.recording { background: #dc2626; color: #fff; border-color: #dc2626; }
.day-summary-btn.ai      { border-color: #a5b4fc; color: #4f46e5; }
.day-summary-btn.ai:hover{ background: #ede9fe; }
.day-summary-save-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.day-summary-msg { font-size: 12px; color: #64748b; }
.day-summary-msg.ok  { color: #16a34a; }
.day-summary-msg.err { color: #dc2626; }

/* ─── Materials tab ──────────────────────────────────── */
.day-mat-form {
  display: flex; flex-direction: column; gap: 10px; padding: 4px 0;
}
.day-mat-form select, .day-mat-form input {
  width: 100%; box-sizing: border-box; padding: 7px 10px;
  border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px;
}
.day-mat-form label { font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 3px; display: block; }
.day-mat-form .form-field { display: flex; flex-direction: column; }

/* ─── Materials tab — lista + tabla de productos ─────────────── */
.dmt-wrap { display: flex; flex-direction: column; gap: 0; }
.dmt-section-hdr { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #94a3b8; margin: 10px 0 6px; }

/* Destino — lista scrollable compacta */
.dmt-dest-scroll { max-height: 148px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
  border: 1px solid #e2e8f0; border-radius: 8px; padding: 4px; background: #fff; margin-bottom: 10px; }
.dmt-dest-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px;
  cursor: pointer; transition: background .1s; }
.dmt-dest-item:hover { background: #f8fafc; }
.dmt-dest-item:has(input:checked) { background: #eff6ff; }
.dmt-dest-item input[type=radio] { accent-color: #3b82f6; width: 14px; height: 14px; flex-shrink: 0; }
.dmt-dest-txt { flex: 1; font-size: 13px; font-weight: 500; color: #0f172a; }
.dmt-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; text-transform: uppercase; flex-shrink: 0; }
.dmt-badge-inc  { background: #fef3c7; color: #92400e; }
.dmt-badge-proj { background: #dbeafe; color: #1e40af; }

/* Filtros de productos */
.dmt-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.dmt-filter-inp { flex: 1; min-width: 90px; padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 12px; }

/* Tabla de productos */
.dmt-table-wrap { max-height: 340px; overflow-y: auto; border: 1px solid #e2e8f0; border-radius: 8px; }
.dmt-table { width: 100%; border-collapse: collapse; }
.dmt-thead th { background: #f8fafc; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: #94a3b8; font-weight: 700; padding: 7px 6px; position: sticky; top: 0; z-index: 1;
  border-bottom: 1px solid #e2e8f0; }
.dmt-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .1s; }
.dmt-table tbody tr:last-child { border-bottom: none; }
.dmt-row-sel { background: #eff6ff !important; }
.dmt-chk { width: 16px; height: 16px; accent-color: #3b82f6; cursor: pointer; }

/* Stepper en tabla */
.dmt-qty-wrap { display: flex; align-items: center; }
.dmt-qty-wrap.hidden { display: none; }
.dmt-step-btn {
  width: 26px; height: 26px; border: 1px solid #d1d5db; background: #fff;
  border-radius: 5px; font-size: 15px; font-weight: 700; cursor: pointer;
  color: #374151; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dmt-step-btn:hover { background: #f1f5f9; }
.dmt-step-inp {
  width: 44px; text-align: center; border-top: 1px solid #d1d5db; border-bottom: 1px solid #d1d5db;
  border-left: none; border-right: none; height: 26px;
  font-size: 13px; font-weight: 600; -moz-appearance: textfield;
}
.dmt-step-inp::-webkit-inner-spin-button, .dmt-step-inp::-webkit-outer-spin-button { -webkit-appearance: none; }
.dmt-loading { display: flex; align-items: center; gap: 8px; color: #94a3b8; font-size: 13px; }

/* Carrito — pills */
.dmt-cart-bar { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.dmt-cart-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.dmt-pill { display: inline-flex; align-items: center; gap: 4px; background: #dbeafe;
  color: #1e40af; border-radius: 20px; padding: 3px 10px; font-size: 12px; }
.dmt-grand-total { font-size: 13px; color: #1e40af; margin-top: 8px; font-weight: 500; }
.dmt-dest-error { border-color: #dc2626 !important; animation: dmt-shake .25s ease; }
@keyframes dmt-shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }

/* ─── Admin Incidencias section ──────────────────────────────── */
.inc-admin-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 14px; padding: 14px 16px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
}
.inc-admin-filters input, .inc-admin-filters select {
  padding: 7px 11px; border: 1px solid #d1d5db; border-radius: 7px;
  font-size: 13px; background: #fff; color: #1e293b;
}
.inc-admin-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
}
.num-cell { text-align: right; }
.btn-ghost {
  background: transparent; border: 1px solid #d1d5db; color: #64748b;
  padding: 7px 14px; border-radius: 7px; font-size: 13px; cursor: pointer; font-weight: 500;
}
.btn-ghost:hover { background: #f1f5f9; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.data-table thead tr { background: #f8fafc; }
.data-table th { padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.data-table td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; color: #1e293b; vertical-align: middle; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table input[type=checkbox] { width: 15px; height: 15px; accent-color: #3b82f6; cursor: pointer; }
.inc-row-reported td { color: #94a3b8 !important; font-weight: 400 !important; }
.inc-row-reported:hover { background: #fafafa !important; }

/* Photo upload section in incident cards */
.inc-photo-section { margin-top: 8px; padding: 8px 0 2px; border-top: 1px solid #f1f5f9; }
.inc-photo-label { font-size: 12px; font-weight: 600; color: #64748b; margin-bottom: 6px; }
.inc-thumbs-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.inc-thumb { position: relative; width: 72px; height: 72px; border-radius: 6px; overflow: hidden; border: 1px solid #e2e8f0; flex-shrink: 0; }
.inc-thumb-img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; display: block; }
.inc-thumb-cap { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 10px; padding: 2px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inc-thumb-del { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(220,38,38,.85); color: #fff; border: none; font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; padding: 0; }
.inc-thumb-del:hover { background: rgba(185,28,28,.95); }
.inc-file-label { display: inline-block; font-size: 12px; padding: 5px 12px; background: #f1f5f9; border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.inc-file-label:hover { background: #e2e8f0; }

/* ── Project Materials Accordion: Summary & Extra ────────────────── */
.pml-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid #f1f5f9; }
.pml-sum-chip { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: #f1f5f9; color: #374151; border: 1px solid #e2e8f0; white-space: nowrap; }
.pml-sum-chip.pml-sum-agotado { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.pml-sum-chip.pml-sum-libre   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.pml-sum-chip.pml-sum-over    { background: #fff0f0; color: #e53935; border-color: #fca5a5; }
.pml-sum-chip.pml-sum-extra   { background: #fefce8; color: #b45309; border-color: #fde68a; }
.pml-section-label { font-size: 11px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .5px; padding: 14px 0 10px; border-top: 1px solid #f1f5f9; margin-top: 4px; }
.pml-extra-tag { font-size: 10px; font-weight: 700; background: #fef9c3; color: #92400e; border: 1px solid #fde68a; border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; }

/* ── Project General Tab: Accordions ─────────────────────────────── */
.proj-accordion { border: 1px solid #e2e8f0; border-radius: 10px; margin-top: 16px; overflow: hidden; }
.proj-accordion-header { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; background: #f8f9fc; cursor: pointer; font-size: 14px; font-weight: 600; color: #1a1a2e; user-select: none; gap: 8px; }
.proj-accordion-header:hover { background: #f0f3fa; }
.proj-acc-chevron { font-size: 12px; color: #9ca3af; transition: transform .2s; }
.proj-accordion-body { padding: 16px 18px; background: #fff; }

/* Hours summary bar */
.proj-hours-summary { display: flex; align-items: center; gap: 16px; background: #f8f9fc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; flex-wrap: wrap; }
.phs-left { display: flex; flex-direction: column; align-items: center; min-width: 80px; }
.phs-total-lbl { font-size: 10px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .5px; }
.phs-total-val { font-size: 22px; font-weight: 800; color: #6366f1; line-height: 1.2; }
.phs-divider { width: 1px; height: 36px; background: #e2e8f0; flex-shrink: 0; }
.phs-right { flex: 1; min-width: 0; }
.phs-meta { font-size: 12px; color: #6b7280; }
.phs-workers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.phs-worker { font-size: 12px; color: #374151; }
.phs-more { font-size: 11px; color: #9ca3af; }
.phn-label { font-size: 11px; color: #9ca3af; margin-left: 4px; }
.pht-grand { font-weight: 700; color: #374151; background: #f8f9fc !important; border-left: 2px solid #e2e8f0 !important; }
.pht-grand-hdr { background: #f0f3ff !important; color: #4338ca !important; border-left: 2px solid #c7d2fe !important; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }

/* Hours table */
.proj-hours-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.proj-hours-range { flex: 1; text-align: center; font-size: 13px; font-weight: 600; color: #374151; }
.proj-hours-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.proj-hours-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.proj-hours-table th { padding: 8px 6px; background: #f8f9fc; border-bottom: 2px solid #e2e8f0; text-align: center; font-weight: 600; color: #374151; font-size: 11px; white-space: nowrap; }
.proj-hours-table td { padding: 9px 6px; border-bottom: 1px solid #f1f5f9; text-align: center; vertical-align: middle; }
.proj-hours-table tfoot td { border-top: 2px solid #e2e8f0; border-bottom: none; background: #f8f9fc; font-weight: 700; }
.pht-worker { text-align: left !important; min-width: 160px; }
.pht-worker-cell { display: flex; align-items: center; gap: 8px; }
.pht-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.pht-avatar-placeholder { width: 32px; height: 32px; border-radius: 50%; background: #6366f1; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.pht-worker-name { font-size: 13px; font-weight: 600; color: #1a1a2e; white-space: nowrap; }
.pht-worker-pos { font-size: 11px; color: #9ca3af; }
.pht-hours { font-weight: 600; color: #1a1a2e; }
.pht-zero { color: #d1d5db !important; font-weight: 400 !important; }
.pht-total { font-weight: 700; color: #6366f1; }

/* Materials list */
.proj-mat-list { display: flex; flex-direction: column; gap: 10px; }
.pml-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; position: relative; }
.pml-item:last-child { border-bottom: none; padding-bottom: 0; }
.pml-photo { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; border: 1px solid #e2e8f0; }
.pml-photo-placeholder { width: 48px; height: 48px; border-radius: 8px; background: #e8eaf6; color: #5c6bc0; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex-shrink: 0; }
.pml-info { flex: 1; min-width: 0; }
.pml-name { font-size: 13px; font-weight: 600; color: #1a1a2e; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pml-qty { font-size: 12px; color: #6b7280; }
.pml-libre { font-size: 12px; font-weight: 600; margin-top: 2px; }
.pml-libre-pos { color: #16a34a; }
.pml-libre-zero { color: #9ca3af; }
.pml-libre-neg { color: #e53935; }
.pml-progress { width: 80px; flex-shrink: 0; }
.pml-bar-wrap { width: 80px; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.pml-bar { height: 100%; background: #6366f1; border-radius: 3px; transition: width .3s; }
.pml-bar.pml-bar-over { background: #e53935; }

/* ── Otros costos / Servicios accordion ── */
.pec-form { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; display: flex; flex-direction: column; gap: 8px; }
.pec-input { padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; font-family: inherit; color: #1e293b; background: #fff; width: 100%; box-sizing: border-box; }
.pec-input:focus { outline: none; border-color: #4f8ef7; }
.pec-row { display: flex; gap: 8px; align-items: center; }
.pec-amount { flex: 0 0 110px; width: 110px; }
.pec-date   { flex: 0 0 140px; width: 140px; }
.pec-add-btn { flex-shrink: 0; padding: 7px 14px; font-size: 13px; white-space: nowrap; }
.pec-list { padding: 6px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.pec-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #f8fafc; border-radius: 8px; border: 1px solid #f1f5f9; }
.pec-item-info { flex: 1; min-width: 0; }
.pec-item-desc { font-size: 13px; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pec-item-meta { font-size: 11px; color: #94a3b8; margin-top: 1px; }
.pec-item-amount { font-size: 14px; font-weight: 700; color: #1e3a8a; flex-shrink: 0; }
.pec-del-btn { flex-shrink: 0; background: none; border: none; color: #94a3b8; font-size: 14px; cursor: pointer; padding: 2px 6px; border-radius: 4px; line-height: 1; }
.pec-del-btn:hover { background: #fee2e2; color: #dc2626; }
.pec-total { font-size: 13px; color: #475569; padding: 8px 10px; border-top: 1px solid #e2e8f0; text-align: right; margin-top: 4px; }
