/* ============================================
   SMART SYSTEMS — CONTENIDO INFINITO
   Premium Dark Theme Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────────── */
:root {
  --bg-primary: #0f0f0d;
  --bg-secondary: #1a1a18;
  --bg-card: #1e1e1b;
  --bg-card-hover: #252521;
  --bg-input: #191917;
  --border: #2e2c26;
  --border-hover: #3c3930;
  --text-primary: #F0EDD8;
  --text-secondary: #b8b29a;
  --text-muted: #7a7568;
  --accent-violet: #C2B280;
  --accent-cyan: #B2422E;
  --accent-amber: #f59e0b;
  --accent-blue: #3b82f6;
  --accent-pink: #ec4899;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --gradient: linear-gradient(135deg, #C2B280, #8B6840);
  --gradient-subtle: linear-gradient(135deg, rgba(194, 178, 128, 0.12), rgba(178, 66, 46, 0.08));
  --gradient-border: linear-gradient(135deg, rgba(194, 178, 128, 0.5), rgba(178, 66, 46, 0.35));
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 30px rgba(194, 178, 128, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset & Base ──────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-violet);
  text-decoration: none;
  transition: var(--transition-fast);
}

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

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
  color: var(--text-secondary);
}

/* ── Custom Scrollbar ──────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ── Glassmorphism Cards ───────────────────── */
.glass-card {
  background: rgba(26, 26, 22, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.glass-card:hover {
  background: rgba(34, 34, 28, 0.75);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

/* ── Buttons ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 2px 12px rgba(194, 178, 128, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 20px rgba(194, 178, 128, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent-violet);
  color: var(--accent-violet);
  background: rgba(194, 178, 128, 0.08);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--accent-red);
  box-shadow: 0 2px 12px rgba(239, 68, 68, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.5rem 0.75rem;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--accent-green);
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Button ripple effect */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0);
  transition: transform 0.5s, opacity 0.3s;
}

.btn:active::after {
  opacity: 1;
  transform: scale(2.5);
  transition: 0s;
}

/* ── Form Inputs ───────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  outline: none;
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
  border-color: var(--border-hover);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(194, 178, 128, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-error {
  color: var(--accent-red);
  font-size: 0.8rem;
  margin-top: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ── Navigation Bar ────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  text-decoration: none;
}

.navbar-brand .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.navbar-user .avatar {
  width: 32px;
  height: 32px;
}

/* ── Avatar ────────────────────────────────── */
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient);
  flex-shrink: 0;
  text-transform: uppercase;
}

.avatar-sm { width: 24px; height: 24px; font-size: 0.6rem; }
.avatar-md { width: 36px; height: 36px; font-size: 0.8rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }

/* ── Login Page ────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(194, 178, 128, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(178, 66, 46, 0.06) 0%, transparent 50%),
    var(--bg-primary);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  background: rgba(26, 26, 40, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: fadeIn 0.6s ease-out;
  position: relative;
}

.login-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: var(--gradient-border);
  z-index: -1;
  opacity: 0.5;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .logo-icon {
  width: 56px;
  height: 56px;
  background: var(--gradient);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(194, 178, 128, 0.3);
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--accent-red);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
  align-items: center;
  gap: 0.5rem;
  animation: shake 0.5s ease-in-out;
}

.login-error.show {
  display: flex;
}

/* ── Dashboard ─────────────────────────────── */
.page-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

.page-header .subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Project Cards Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: slideUp 0.4s ease-out backwards;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: var(--transition);
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.project-card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.content-type-badge {
  padding: 0.25rem 0.625rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 100px;
  background: rgba(194, 178, 128, 0.15);
  color: var(--accent-violet);
  border: 1px solid rgba(194, 178, 128, 0.25);
}

.project-client {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-progress {
  margin-bottom: 1rem;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-input);
  border-radius: 100px;
  overflow: hidden;
  display: flex;
}

.progress-segment {
  height: 100%;
  transition: width 0.5s ease;
}

.stage-dots {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.stage-dot {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stage-dot .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.project-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-violet);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: var(--transition-fast);
}

.project-link:hover {
  color: var(--accent-cyan);
  gap: 0.625rem;
}

/* ── Kanban Board ──────────────────────────── */
.board-wrapper {
  height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
}

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.board-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.board-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.board-header .board-client {
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}

.board-container {
  flex: 1;
  display: flex;
  gap: 1rem;
  padding: 0 2rem 2rem;
  overflow-x: auto;
  overflow-y: hidden;
}

.board-column {
  flex: 0 0 280px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  background: rgba(18, 18, 16, 0.6);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-height: 100%;
}

.column-header {
  padding: 1rem 1rem 0.75rem;
  position: relative;
}

.column-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.column-header[data-stage="guion"]::before { background: var(--accent-violet); }
.column-header[data-stage="autorizacion"]::before { background: var(--accent-amber); }
.column-header[data-stage="grabacion"]::before { background: var(--accent-blue); }
.column-header[data-stage="edicion"]::before { background: var(--accent-pink); }
.column-header[data-stage="listo"]::before { background: var(--accent-green); }
.column-header[data-stage="publicado"]::before { background: var(--accent-cyan); }

.column-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.column-title .emoji,
.column-title svg {
  flex-shrink: 0;
  color: inherit;
}

.column-count {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 0.125rem 0.5rem;
  border-radius: 100px;
  margin-left: auto;
}

.column-tasks {
  flex: 1;
  padding: 0.5rem;
  overflow-y: auto;
  min-height: 60px;
}

/* ── Task Cards ────────────────────────────── */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.875rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
  animation: fadeIn 0.3s ease-out;
  position: relative;
}

.task-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.task-card-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.625rem;
  line-height: 1.4;
}

.task-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-card-assigned {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.task-card-warning {
  font-size: 0.7rem;
  color: var(--accent-red);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.task-card-badge {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  font-weight: 500;
}

.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-approved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Drag & Drop */
.task-card.sortable-ghost {
  opacity: 0.4;
  background: rgba(194, 178, 128, 0.1);
  border: 1px dashed var(--accent-violet);
}

.task-card.sortable-chosen {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 2px var(--accent-violet);
  transform: rotate(2deg) scale(1.02);
  z-index: 1000;
}

.task-card.sortable-drag {
  opacity: 0.9;
}

.column-tasks.drop-active {
  background: rgba(194, 178, 128, 0.05);
  border: 1px dashed rgba(194, 178, 128, 0.3);
  border-radius: var(--radius-sm);
}

/* ── Modal / Dialog ────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  font-size: 1.2rem;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ── Toast Notifications ───────────────────── */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  color: var(--text-primary);
  pointer-events: auto;
  animation: slideInRight 0.4s ease-out;
  max-width: 380px;
}

.toast-success {
  border-left: 3px solid var(--accent-green);
}

.toast-error {
  border-left: 3px solid var(--accent-red);
}

.toast-info {
  border-left: 3px solid var(--accent-blue);
}

.toast-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.toast.removing {
  animation: slideOutRight 0.3s ease-in forwards;
}

/* ── Task Detail / Script Editor ───────────── */
.task-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
}

.task-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0;
  flex-wrap: wrap;
}

.task-header h1 {
  font-size: 1.5rem;
  flex: 1;
  min-width: 200px;
}

.stage-badge {
  padding: 0.3rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 100px;
}

.stage-badge[data-stage="guion"] {
  background: rgba(194, 178, 128, 0.15);
  color: var(--accent-violet);
  border: 1px solid rgba(194, 178, 128, 0.3);
}
.stage-badge[data-stage="autorizacion"] {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.stage-badge[data-stage="grabacion"] {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.stage-badge[data-stage="edicion"] {
  background: rgba(236, 72, 153, 0.15);
  color: var(--accent-pink);
  border: 1px solid rgba(236, 72, 153, 0.3);
}
.stage-badge[data-stage="listo"] {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.stage-badge[data-stage="publicado"] {
  background: rgba(178, 66, 46, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(178, 66, 46, 0.3);
}

.editor-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

.editor-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.script-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.script-section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-violet);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.script-section .form-textarea {
  min-height: 80px;
}

.script-section .form-textarea.large {
  min-height: 180px;
}

.editor-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* Guidelines Sidebar */
.guidelines-sidebar {
  position: sticky;
  top: 80px;
}

.guidelines-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.guidelines-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition-fast);
}

.guidelines-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.guidelines-header h4 {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.guidelines-toggle {
  color: var(--text-muted);
  transition: transform 0.3s;
  font-size: 0.8rem;
}

.guidelines-content {
  padding: 1.25rem;
  max-height: 60vh;
  overflow-y: auto;
}

.guideline-section {
  margin-bottom: 1.25rem;
}

.guideline-section:last-child {
  margin-bottom: 0;
}

.guideline-section h5 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.guideline-section p,
.guideline-section li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.guideline-section ul {
  padding-left: 1rem;
  list-style: disc;
}

.guideline-section ul li {
  margin-bottom: 0.25rem;
}

/* Metrics Form */
.metrics-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

/* Activity Timeline */
.activity-timeline {
  margin-top: 1.5rem;
}

.activity-timeline h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.timeline-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  position: relative;
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 13px;
  top: 2.5rem;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  z-index: 1;
}

.timeline-content {
  flex: 1;
}

.timeline-content p {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.timeline-content time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Approval Page ─────────────────────────── */
.approve-page {
  min-height: 100vh;
  padding: 2rem;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(194, 178, 128, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(178, 66, 46, 0.05) 0%, transparent 50%),
    var(--bg-primary);
}

.approve-container {
  max-width: 720px;
  margin: 0 auto;
}

.approve-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.approve-logo .logo-icon {
  width: 48px;
  height: 48px;
  background: var(--gradient);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 20px rgba(194, 178, 128, 0.3);
}

.approve-logo h2 {
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.approve-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: slideUp 0.5s ease-out;
}

.approve-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.approve-header h1 {
  font-size: 1.35rem;
}

.approve-header p {
  margin-top: 0.5rem;
}

.approve-script {
  padding: 2rem;
}

.approve-script-section {
  margin-bottom: 1.5rem;
}

.approve-script-section:last-child {
  margin-bottom: 0;
}

.approve-script-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-violet);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.approve-script-content {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.approve-actions {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  justify-content: center;
  flex-wrap: wrap;
}

.approve-feedback {
  padding: 0 2rem 1.5rem;
  display: none;
}

.approve-feedback.show {
  display: block;
  animation: slideUp 0.3s ease-out;
}

.approve-result {
  text-align: center;
  padding: 3rem 2rem;
  display: none;
}

.approve-result.show {
  display: block;
  animation: fadeIn 0.5s ease-out;
}

.approve-result .result-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.result-svg.approved { color: var(--accent-green); }
.result-svg.revision { color: var(--accent-amber); }

.approve-result h2 {
  margin-bottom: 0.5rem;
}

/* ── Loading Spinner ───────────────────────── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-violet);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.page-loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 9999;
}

/* ── Empty States ──────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}

.empty-state .empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  opacity: 0.4;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 320px;
}

/* Column empty state */
.column-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── Badge ─────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.625rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Confirm Dialog ────────────────────────── */
.confirm-dialog {
  text-align: center;
}

.confirm-dialog p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ── Separator ─────────────────────────────── */
.separator {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ── Save Indicator ────────────────────────── */
.save-indicator {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.save-indicator.saving {
  color: var(--accent-amber);
}

.save-indicator.saved {
  color: var(--accent-green);
}

/* ── Animations ────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes cardHover {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Utility Classes ───────────────────────── */
/* Spacing */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }

/* Grid */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Text */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-violet { color: var(--accent-violet); }
.text-cyan { color: var(--accent-cyan); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.w-full { width: 100%; }
.relative { position: relative; }

/* Truncate */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .guidelines-sidebar {
    position: static;
  }

  .board-container {
    padding: 0 1rem 1rem;
  }

  .page-container {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .board-header {
    padding: 1rem;
  }

  .board-column {
    flex: 0 0 260px;
    min-width: 260px;
  }

  .task-page {
    padding: 0 1rem 1.5rem;
  }

  .task-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .approve-actions {
    flex-direction: column;
  }

  .approve-actions .btn {
    width: 100%;
  }

  .approve-script {
    padding: 1.5rem;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .modal {
    margin: 1rem;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .login-card {
    padding: 1.75rem;
  }

  .board-column {
    flex: 0 0 240px;
    min-width: 240px;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    flex: 1;
  }
}

/* ── SVG Icon System ───────────────────────── */
.logo-icon svg {
  display: block;
  color: #fff;
  flex-shrink: 0;
}

.toast-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.project-link svg {
  vertical-align: middle;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.project-link:hover svg {
  transform: translateX(3px);
}

.project-client svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.script-section-label svg,
.approve-script-label svg {
  flex-shrink: 0;
}

.btn svg {
  flex-shrink: 0;
}

.task-card-warning svg {
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .project-link:hover svg {
    transform: none;
  }
}

/* Logo Icon Override to remove background box */
.logo-icon {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.logo-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
