/* SaleClientChanger Module Stylesheet — PureMed */

/* Change Client Button in Edit Sale page */
.scc-btn-change-client {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(79, 70, 229, 0.25);
  transition: all 0.2s ease-in-out;
  vertical-align: middle;
}

.scc-btn-change-client:hover {
  background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
  color: #ffffff;
  text-decoration: none;
}

.scc-btn-change-client i {
  font-size: 0.85rem;
}

/* Quick change button in sales list table */
.scc-btn-change-client-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
  border: none;
  cursor: pointer;
  margin-left: 6px;
  font-size: 11px;
  transition: all 0.15s ease;
  vertical-align: middle;
}

.scc-btn-change-client-row:hover {
  background: #4f46e5;
  color: #ffffff;
  transform: scale(1.15);
}

/* Quick change button in sale detail page */
.scc-btn-change-detail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: #ffffff !important;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
  transition: all 0.2s ease;
  text-decoration: none;
}

.scc-btn-change-detail:hover {
  background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%);
  transform: translateY(-1px);
}

.scc-billto-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.15s ease;
}

.scc-billto-badge-btn:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

/* Dropdown item button */
button.scc-dropdown-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 16px;
  font-size: 13px;
  color: #334155;
  display: flex;
  align-items: center;
  cursor: pointer;
}

button.scc-dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Modal Overlay */
.scc-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: sccFadeIn 0.2s ease-out;
}

@keyframes sccFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sccSlideUp {
  from { opacity: 0; transform: translateY(15px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal Box */
.scc-modal-box {
  background: #ffffff;
  width: 100%;
  max-width: 560px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  animation: sccSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header */
.scc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.scc-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scc-modal-title i {
  color: #4f46e5;
}

.scc-modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.scc-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

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

/* Action Bar inside Body (Search + Add Client Button) */
.scc-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.scc-btn-add-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.scc-btn-add-new:hover {
  background: #bbf7d0;
  color: #14532d;
}

/* Current Client Banner */
.scc-current-client-info {
  background: #f1f5f9;
  border-left: 4px solid #4f46e5;
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: #334155;
}

.scc-current-client-info strong {
  color: #0f172a;
}

/* Search Box */
.scc-search-wrapper {
  position: relative;
  flex: 1;
}

.scc-search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  font-size: 0.88rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.scc-search-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.scc-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Client List */
.scc-client-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.scc-client-item {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s ease;
}

.scc-client-item:last-child {
  border-bottom: none;
}

.scc-client-item:hover {
  background: #f8fafc;
}

.scc-client-item.selected {
  background: #eef2ff;
  border-left: 3px solid #4f46e5;
}

.scc-client-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.9rem;
}

.scc-client-meta {
  font-size: 0.78rem;
  color: #64748b;
}

.scc-client-badge {
  background: #e0e7ff;
  color: #3730a3;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Form New Client */
.scc-form-new-client {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: sccFadeIn 0.2s ease-out;
}

.scc-form-row {
  display: flex;
  gap: 12px;
}

.scc-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.scc-form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin: 0;
}

.scc-form-label span.req {
  color: #ef4444;
}

.scc-form-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.88rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease;
}

.scc-form-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.scc-btn-back {
  background: transparent;
  border: none;
  color: #4f46e5;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.scc-btn-back:hover {
  text-decoration: underline;
}

/* Footer */
.scc-modal-footer {
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.scc-btn-cancel {
  padding: 8px 16px;
  background: #e2e8f0;
  color: #334155;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.scc-btn-cancel:hover {
  background: #cbd5e1;
}

.scc-btn-save {
  padding: 8px 18px;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.scc-btn-save:hover {
  background: #4338ca;
}

.scc-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.scc-btn-create-client {
  padding: 8px 18px;
  background: #16a34a;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.scc-btn-create-client:hover {
  background: #15803d;
}

.scc-btn-create-client:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Toast Message */
.scc-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  z-index: 10600;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  animation: sccSlideUp 0.2s ease-out;
}

.scc-toast-success {
  border-left: 4px solid #10b981;
}

.scc-toast-error {
  border-left: 4px solid #ef4444;
}
