/* ============================================================
   components.css — Componentes reutilizables
   Responsabilidad: botones, inputs, badges, toasts y elementos
   atómicos que se usan en múltiples vistas.
   ============================================================ */

/* ------------------------------------------------------------
   FORM ELEMENTS
   ------------------------------------------------------------ */
.field { margin-bottom: 1.1rem; }

.field label,
.form-group label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.field input,
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-hi);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
}

.field input:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 255, 0.1);
}

.field input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group select {
  cursor: pointer;
}

.form-group select option {
  background: var(--surface2);
}

/* Form error */
.form-error {
  font-size: 12px;
  color: var(--red);
  background: var(--redbg);
  border: 1px solid rgba(255, 68, 85, 0.2);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------ */
.btn-primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 20px rgba(0, 180, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 180, 255, 0.35);
}

.btn-primary:active  { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost:hover {
  background: var(--surface2);
  color: var(--text-hi);
  border-color: var(--border-hi);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-submit {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 180, 255, 0.2);
}

.btn-submit:hover    { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0, 180, 255, 0.3); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ------------------------------------------------------------
   STATUS & PRIORITY BADGES
   ------------------------------------------------------------ */
.status,
.priority {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.status-open       { background: var(--bluebg);  color: var(--blue); }
.status-inprogress { background: var(--amberbg); color: var(--amber); }
.status-closed     { background: var(--greenbg); color: var(--green); }

.priority-low    { background: var(--greenbg); color: var(--green); }
.priority-medium { background: var(--amberbg); color: var(--amber); }
.priority-high   { background: var(--redbg);   color: var(--red); }

/* ------------------------------------------------------------
   ROLE BADGES
   ------------------------------------------------------------ */
.role-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-badge-client { background: var(--bluebg);   color: var(--blue); }
.role-badge-agent  { background: var(--accentbg); color: var(--accent); }
.role-badge-admin  { background: var(--redbg);    color: var(--red); }

/* ------------------------------------------------------------
   AVATAR
   ------------------------------------------------------------ */
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-avatar-client { background: var(--bluebg);   color: var(--blue); }
.user-avatar-agent  { background: var(--accentbg); color: var(--accent); }
.user-avatar-admin  { background: var(--redbg);    color: var(--red); }

/* ------------------------------------------------------------
   FILE CHIP
   ------------------------------------------------------------ */
.file-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}

.file-chip-remove {
  color: var(--hint);
  cursor: pointer;
  font-size: 13px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  transition: color 0.1s;
}

.file-chip-remove:hover { color: var(--red); }

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

/* ------------------------------------------------------------
   FILE DROP AREA
   ------------------------------------------------------------ */
.file-drop {
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.file-drop:hover,
.file-drop.drag {
  border-color: var(--accent);
  background: var(--accentbg);
}

.file-drop input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-drop-icon {
  font-size: 32px;
  color: var(--hint);
  display: block;
  margin-bottom: 8px;
}

.file-drop p     { font-size: 13px; color: var(--muted); }
.file-drop small { font-size: 11px; color: var(--hint); display: block; margin-top: 4px; }

/* ------------------------------------------------------------
   TOAST
   ------------------------------------------------------------ */
.toast-wrap {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.2s ease;
}

.toast.success .toast-icon { color: var(--green); }
.toast.error   .toast-icon { color: var(--red); }
.toast.info    .toast-icon { color: var(--accent); }

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   CARD
   ------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-body { padding: 1.5rem; }

/* ------------------------------------------------------------
   EMPTY STATE
   ------------------------------------------------------------ */
.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--hint);
}

.empty-state i {
  font-size: 52px;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state strong {
  color: var(--muted);
  display: block;
  font-size: 15px;
  margin-bottom: 0.3rem;
}

.empty-state p {
  font-size: 13px;
}
