/* alfombras.css - Rug production kanban styles */

#view-alfombras {
  padding: 0 24px;
}

/* ======================== */
/* Top bar                  */
/* ======================== */
.alf-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}
.alf-topbar-title {
  font-size: 22px;
  font-weight: 700;
}
.alf-topbar-actions {
  display: flex;
  gap: 10px;
}
.alf-topbar-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  color: var(--text);
}
.alf-topbar-btn:active {
  transform: scale(0.97);
}

/* ======================== */
/* Tabs                     */
/* ======================== */
.alf-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
  gap: 0;
}
.alf-tab {
  flex: 1;
  padding: 14px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.15s;
}
.alf-tab.active {
  color: var(--text);
  border-bottom-color: var(--green);
}
.alf-tab-count {
  display: inline-block;
  background: var(--border);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  margin-left: 6px;
}
.alf-tab.active .alf-tab-count {
  background: var(--green);
  color: #fff;
}

/* ======================== */
/* Rug cards                */
/* ======================== */
.rug-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.rug-card:active {
  transform: scale(0.98);
}
.rug-card-issue {
  border-left: 3px solid #DC2626;
}
.rug-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.rug-card-id {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.rug-card-size {
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-dark);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
}
.rug-card-customer {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.rug-card-sale {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Menlo', monospace;
  margin-bottom: 6px;
}
.rug-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.rug-card-date {
  color: var(--text-muted);
}
.rug-card-badges {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ======================== */
/* Priority & status badges */
/* ======================== */
.badge-overdue {
  background: #FEE2E2;
  color: #DC2626;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.badge-due-soon {
  background: #FEF3C7;
  color: #D97706;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.badge-issue {
  background: #FEE2E2;
  color: #DC2626;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}
.badge-no-phone {
  background: #FEF3C7;
  color: #D97706;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ======================== */
/* List                     */
/* ======================== */
.alf-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 24px;
}

/* ======================== */
/* Status badge (detail)    */
/* ======================== */
.alf-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.alf-status-badge.large {
  font-size: 14px;
  padding: 6px 16px;
}

/* ======================== */
/* Action buttons           */
/* ======================== */
.alf-action-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.alf-action-btn:active {
  transform: scale(0.98);
}
.alf-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.alf-action-primary {
  background: var(--green);
  color: #fff;
}
.alf-action-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.alf-action-whatsapp {
  background: #25D366;
  color: #fff;
}
.alf-action-danger {
  background: #FEE2E2;
  color: #DC2626;
}

/* ======================== */
/* Pickup / search overlay  */
/* ======================== */
.pickup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
}
.pickup-search-box {
  width: 90%;
  max-width: 500px;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  max-height: 80vh;
  overflow-y: auto;
}
.pickup-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  margin-bottom: 16px;
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  box-sizing: border-box;
}
.pickup-input:focus {
  border-color: var(--green);
}
.pickup-results {
  max-height: 400px;
  overflow-y: auto;
}

/* ======================== */
/* Detail view              */
/* ======================== */
.alf-detail {
  padding: 0 0 24px;
}

.alf-back {
  background: none;
  border: none;
  color: var(--text-muted-dark);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 12px 0;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.alf-back:hover { color: var(--text); }

.alf-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.alf-detail-id {
  font-size: 20px;
  font-weight: 800;
  font-family: 'SF Mono', 'Menlo', monospace;
}

/* Info rows */
.alf-detail-info {
  background: var(--bg-card);
  border-radius: var(--radius, 12px);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,0.1));
}

.alf-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0ece4;
}
.alf-info-row:last-child { border-bottom: none; }

.alf-info-label {
  font-size: 14px;
  color: var(--text-muted-dark);
  font-weight: 600;
}

.alf-info-value {
  font-size: 14px;
  font-weight: 700;
}

/* Sections */
.alf-detail-section {
  margin-bottom: 20px;
}

.alf-section-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted-dark);
  margin-bottom: 10px;
}

/* Photo */
.alf-photo-preview {
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
  max-height: 240px;
}

.alf-photo-preview img {
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
  display: block;
}

.alf-photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-muted-dark);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.alf-photo-btn:hover {
  border-color: var(--text-muted-dark);
}

/* Notes */
.alf-notes {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
  -webkit-user-select: text;
  user-select: text;
}
.alf-notes:focus {
  border-color: var(--text);
  outline: none;
}

/* ======================== */
/* Empty state              */
/* ======================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon {
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ======================== */
/* Responsive               */
/* ======================== */
@media (min-width: 1024px) {
  #view-alfombras {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (max-width: 480px) {
  #view-alfombras { padding: 0 16px; }
  .alf-topbar { padding: 12px 0; }
  .alf-topbar-btn { padding: 8px 12px; font-size: 13px; }
  .alf-tab { padding: 12px 4px; font-size: 12px; }
  .alf-tab-count { font-size: 10px; padding: 2px 6px; }
}
