/* ═══════════════════════════════════════════════════════════════════════
   Zenthrus Theme Utilities — zen-* classes que se adaptam a dark/light
   Importado em base.html; usa CSS variables definidas em :root / html.dark
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Cards ──────────────────────────────────────────────────────────── */
.zen-card {
  border-radius: 0.75rem;       /* rounded-xl */
  border-width: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  background-color: hsl(var(--card));
  border-color: hsl(var(--border));
  color: hsl(var(--card-foreground));
}
html.dark .zen-card {
  box-shadow: none;
}

/* ── Surfaces ───────────────────────────────────────────────────────── */
.zen-surface {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

/* ── Muted backgrounds ──────────────────────────────────────────────── */
.zen-muted {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

/* ── Primary button ─────────────────────────────────────────────────── */
.zen-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;    /* py-2.5 px-5 */
  border-radius: 0.5rem;        /* rounded-lg */
  font-size: 0.875rem;          /* text-sm */
  font-weight: 500;             /* font-medium */
  transition: background-color 0.25s ease, color 0.25s ease, filter 0.15s ease;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  cursor: pointer;
}
.zen-btn-primary:hover {
  filter: brightness(1.1);
}

/* ── Secondary / Ghost button ───────────────────────────────────────── */
.zen-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  background-color: transparent;
  transition: background-color 0.25s ease, color 0.25s ease;
  cursor: pointer;
}
.zen-btn-secondary:hover {
  background-color: hsl(var(--muted));
}

/* ── Form inputs ────────────────────────────────────────────────────── */
.zen-input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.25s ease;
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}
.zen-input:focus {
  border-color: hsl(var(--ring));
  outline: none;
  box-shadow: 0 0 0 2px hsla(var(--ring), 0.2);
}
.zen-input::placeholder {
  color: hsl(var(--muted-foreground));
}

/* ── Tables ─────────────────────────────────────────────────────────── */
.zen-table {
  width: 100%;
  border-collapse: collapse;
}
.zen-table thead {
  background-color: hsl(var(--muted));
}
.zen-table th {
  padding: 0.75rem 1.5rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
}
.zen-table td {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}
.zen-table tbody tr {
  border-bottom: 1px solid hsl(var(--border));
}
.zen-table tbody tr:hover {
  background-color: hsla(var(--muted), 0.5);
}

/* ── Badges ─────────────────────────────────────────────────────────── */
.zen-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.zen-badge-success {
  background-color: hsla(152, 69%, 31%, 0.1);
  color: hsl(152, 69%, 31%);
}
html.dark .zen-badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: rgb(16, 185, 129);
}
.zen-badge-warning {
  background-color: hsla(37, 92%, 50%, 0.1);
  color: hsl(37, 92%, 40%);
}
html.dark .zen-badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: rgb(245, 158, 11);
}
.zen-badge-error {
  background-color: hsla(0, 72%, 51%, 0.1);
  color: hsl(0, 72%, 42%);
}
html.dark .zen-badge-error {
  background-color: rgba(239, 68, 68, 0.1);
  color: rgb(239, 68, 68);
}
.zen-badge-info {
  background-color: hsla(var(--primary), 0.1);
  color: hsl(var(--primary));
}

/* ── Sidebar link ───────────────────────────────────────────────────── */
.zen-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: background-color 0.2s ease, color 0.2s ease;
  color: hsl(var(--chrome-muted-fg));
}
.zen-sidebar-link:hover {
  background-color: hsl(var(--chrome-accent));
  color: hsl(var(--chrome-foreground));
}
.zen-sidebar-link.active {
  background-color: hsla(var(--primary), 0.15);
  color: hsl(var(--primary));
  font-weight: 600;
}

/* ── Modal ──────────────────────────────────────────────────────────── */
.zen-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
.zen-modal-content {
  position: relative;
  width: 100%;
  max-width: 32rem;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
}

/* ── Stat card ──────────────────────────────────────────────────────── */
.zen-stat-card {
  border-radius: 0.75rem;
  border-width: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  background-color: hsl(var(--card));
  border-color: hsl(var(--border));
  color: hsl(var(--card-foreground));
  padding: 1.5rem;
}
html.dark .zen-stat-card {
  box-shadow: none;
}
.zen-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}
.zen-stat-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* ── Text helpers ───────────────────────────────────────────────────── */
.zen-text {
  color: hsl(var(--foreground));
}
.zen-text-muted {
  color: hsl(var(--muted-foreground));
}
.zen-text-primary {
  color: hsl(var(--primary));
}

/* ── Filter pill (tab / toggle buttons) ─────────────────────────────── */
.zen-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  transition: background-color 0.2s ease, color 0.2s ease;
  color: hsl(var(--muted-foreground));
  background-color: hsl(var(--muted));
}
.zen-pill:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--foreground));
}
.zen-pill.active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

/* ── Back link ──────────────────────────────────────────────────────── */
.zen-back-link {
  color: hsl(var(--primary));
  font-size: 0.875rem;
  text-decoration: none;
}
.zen-back-link:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════
   LIGHT MODE OVERRIDES — BPO standalone palette
   Uses html:not(.dark) so dark mode (correct) is never affected
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Cards (light) ──────────────────────────────────────────────── */
html:not(.dark) .zen-card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
html:not(.dark) .zen-card:hover {
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* ── Primary button (light) ─────────────────────────────────────── */
html:not(.dark) .zen-btn-primary {
  background-color: #2563eb;
  color: white;
}
html:not(.dark) .zen-btn-primary:hover {
  background-color: #1d4ed8;
  filter: none;
}

/* ── Secondary button (light) ───────────────────────────────────── */
html:not(.dark) .zen-btn-secondary {
  border: 1px solid #d1d5db;
  color: #374151;
  background-color: white;
}
html:not(.dark) .zen-btn-secondary:hover {
  background-color: #f3f4f6;
}

/* ── Inputs (light) ─────────────────────────────────────────────── */
html:not(.dark) .zen-input {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #1f2937;
}
html:not(.dark) .zen-input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
html:not(.dark) .zen-input::placeholder {
  color: #9ca3af;
}

/* ── Tables (light) ─────────────────────────────────────────────── */
html:not(.dark) .zen-table thead {
  background-color: #f9fafb;
}
html:not(.dark) .zen-table th {
  color: #6b7280;
}
html:not(.dark) .zen-table tbody tr {
  border-bottom: 1px solid #f3f4f6;
}
html:not(.dark) .zen-table tbody tr:hover {
  background-color: rgba(249, 250, 251, 0.5);
}

/* ── Badges (light) ─────────────────────────────────────────────── */
html:not(.dark) .zen-badge-success {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
html:not(.dark) .zen-badge-warning {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
html:not(.dark) .zen-badge-error {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
html:not(.dark) .zen-badge-info {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ── Stat cards (light) ─────────────────────────────────────────── */
html:not(.dark) .zen-stat-card {
  background-color: white;
  border: 1px solid #e5e7eb;
}
html:not(.dark) .zen-stat-value {
  color: #111827;
}
html:not(.dark) .zen-stat-label {
  color: #6b7280;
}

/* ── Priority badges (specific for tickets) ─────────────────────────── */
.zen-priority-critical { background-color: hsl(0, 72%, 51%); color: white; }
.zen-priority-high     { background-color: hsl(25, 95%, 53%); color: white; }
.zen-priority-medium   { background-color: hsl(43, 96%, 47%); color: white; }
.zen-priority-low      { background-color: hsl(215, 16%, 47%); color: white; }

/* ── Sidebar link (light) ──────────────────────────────────────────── */
html:not(.dark) .zen-sidebar-link {
  color: #374151;
}
html:not(.dark) .zen-sidebar-link:hover {
  background-color: #f3f4f6;
  color: #2563eb;
}
html:not(.dark) .zen-sidebar-link.active {
  background-color: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
