/* Paleta tomada de la app real de PDA Profile (Angular, valores computados
   leidos en vivo de front.pdaprofile.com: --primaryColor, --secondaryColor,
   grayscale, fuente Poppins). Layout/componentes/transiciones (badges pill,
   cards, tablas, fade-in) tomados como referencia de Frappe Helpdesk. */
:root {
  --accent: #0075ff;      /* --primaryColor de Profile */
  --accent-light: #80bffe; /* --primaryLight de Profile */
  --accent-soft: #e5f1ff;
  --ink: #0075ff;
  --ink-hover: #0060d1;
  --text: #000000;         /* --theme-text de Profile */
  --text-muted: #6a6a6a;   /* --theme-text-secondary de Profile */
  --border: #d5d7d9;       /* --theme-border de Profile */
  --bg: #f2f3f3;           /* --theme-surface de Profile */
  --surface: #ffffff;      /* --theme-background de Profile */

  /* Semanticos reales de Profile ($success/$warning/$danger en _variables.scss) */
  --red: #ed4c6c;
  --red-bg: #fdedf0;
  --blue: #0075ff;
  --blue-bg: #e5f1ff;
  --green: #3ac785;
  --green-bg: #e9f9f1;
  --amber: #f5a001;
  --amber-bg: #fef4e5;
  --gray: #6a6a6a;
  --gray-bg: #f2f3f3;

  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --ease: 150ms ease;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* Fade-in general para contenido cargado por fetch, en vez de aparecer de golpe */
.fade-in {
  animation: fadeIn 220ms ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}
.topbar .brand .brand-rest {
  font-weight: 400;
  color: var(--text-muted);
}

.topbar nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--ease);
}
.topbar nav a:hover { color: var(--text); }

.topbar nav select#language-select {
  width: auto;
  margin-left: 20px;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--text-muted);
  border-color: var(--border);
  background: var(--surface);
}

.container {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 20px;
  transition: box-shadow var(--ease);
}

h1 { font-size: 22px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; color: var(--text); }

label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 600; color: var(--text); }

input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--ease), box-shadow var(--ease);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea { min-height: 100px; resize: vertical; }

button, .btn {
  background: var(--ink);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 16px;
  display: inline-block;
  text-decoration: none;
  transition: background var(--ease), transform var(--ease);
}

button:hover, .btn:hover { background: var(--ink-hover); }
button:active, .btn:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--gray-bg); }

.error { color: var(--red); margin-top: 10px; font-size: 14px; }
.success-banner {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 14px;
  font-weight: 600;
}
.hint { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 12px 10px; font-size: 14px; }
thead th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--ease); }
tbody tr:hover { background: var(--bg); }
tbody tr:last-child { border-bottom: none; }
td a { color: var(--text); font-weight: 600; text-decoration: none; }
td a:hover { color: var(--accent); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--gray-bg);
  color: var(--gray);
  white-space: nowrap;
}
.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
/* Mapeo por estado real de Jira (nombres en espanol e ingles, por si cambia) */
.status-abierto, .status-open, .status-nuevo, .status-new { background: var(--red-bg); color: var(--red); }
.status-en-curso, .status-in-progress, .status-en-revision, .status-waiting-for-support, .status-waiting-for-customer { background: var(--blue-bg); color: var(--blue); }
.status-resuelto, .status-resolved, .status-cerrado, .status-closed, .status-done { background: var(--green-bg); color: var(--green); }
.status-pendiente, .status-pending, .status-paused { background: var(--amber-bg); color: var(--amber); }

.comment {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 10px 0;
  background: var(--bg);
  transition: box-shadow var(--ease);
}
.comment:hover { box-shadow: var(--shadow-sm); }
.comment .meta { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }

.login-choice { display: flex; gap: 16px; margin-top: 20px; }
.login-choice .card { flex: 1; text-align: center; transition: box-shadow var(--ease), transform var(--ease); }
.login-choice .card:hover { box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08); transform: translateY(-2px); }

.skeleton {
  background: linear-gradient(90deg, var(--gray-bg) 25%, #e6e7e8 37%, var(--gray-bg) 63%);
  background-size: 400% 100%;
  animation: skeletonPulse 1.4s ease infinite;
  border-radius: 6px;
  height: 14px;
  display: block;
}
@keyframes skeletonPulse {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
