@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Montserrat:wght@400;500;600;700;800;900&family=Syne:wght@600;700;800&display=swap');

:root {
  --bg-base: #08080b;
  --bg-elevated: #101015;
  --bg-card: #14141c;
  --bg-card-hover: #181822;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #ececf1;
  --text-muted: rgba(236, 236, 241, 0.55);
  --text-faint: rgba(236, 236, 241, 0.35);
  --accent-cyan: #22d3ee;
  --accent-pink: #ec4899;
  --accent-green: #4ade80;
  --accent-amber: #fbbf24;
  --accent-red: #f87171;
  --gradient-brand: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  --sidebar-w: 260px;
  --header-h: 72px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 40px rgba(0, 0, 0, 0.35);
  --font-ui: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Syne', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text);
  line-height: 1.55;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: #67e8f9;
}

/* ─── Login ─── */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(34, 211, 238, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(236, 72, 153, 0.1), transparent 50%),
    var(--bg-base);
}

.login-shell {
  width: 100%;
  max-width: 420px;
}

.login-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-brand-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  background: var(--gradient-brand);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: #050505;
  box-shadow: 0 8px 32px rgba(34, 211, 238, 0.25);
}

.login-brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.login-brand p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

/* ─── App shell ─── */

.admin-app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  padding: 1.35rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gradient-brand);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: #050505;
  flex-shrink: 0;
}

.sidebar-brand-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-brand-text span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-item.active {
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-cyan);
  box-shadow: inset 3px 0 0 var(--accent-cyan);
}

.nav-item.active svg {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  min-width: 1.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(236, 72, 153, 0.2);
  color: #f9a8d4;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.nav-item-logout {
  color: rgba(248, 113, 113, 0.85);
}

.nav-item-logout:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

.admin-shell {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  padding: 1rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(8, 8, 11, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.page-header-main {
  flex: 1;
  min-width: 0;
}

.page-eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.page-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.page-header-desc {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.page-content {
  flex: 1;
  padding: 1.5rem 1.75rem 2.5rem;
}

/* ─── Alerts ─── */

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #fecaca;
}

.alert-ok {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: #bbf7d0;
}

/* ─── Buttons ─── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  color: #050505;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(34, 211, 238, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(236, 72, 153, 0.25);
  color: #050505;
}

.btn-primary svg,
.btn-inline svg,
.btn-save svg,
.btn-small svg,
.dashboard-action svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-save svg {
  width: 15px;
  height: 15px;
}

.btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-muted {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn-muted:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.btn-small {
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.15s;
}

.btn-small:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-link {
  display: inline-flex;
  text-decoration: none;
  text-align: center;
}

.btn-accent {
  border-color: rgba(34, 211, 238, 0.35);
  color: #a5f3fc;
  background: rgba(34, 211, 238, 0.08);
}

.btn-danger {
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
}

.btn-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  border-radius: 8px;
  border: 1px solid rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.22);
  color: #dcfce7;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-save:hover {
  background: rgba(34, 197, 94, 0.35);
  border-color: rgba(74, 222, 128, 0.65);
  color: #fff;
}

/* ─── Cards & KPI ─── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

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

.card-header h2,
.card-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.card-body {
  padding: 1.25rem;
}

.card-link {
  font-size: 0.82rem;
  font-weight: 600;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-card);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-grid-hero {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem;
}

.kpi-grid-sales {
  grid-template-columns: minmax(240px, 360px);
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.stat-card-link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.stat-card-link:hover {
  border-color: rgba(34, 211, 238, 0.25);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  color: inherit;
}

.stat-card-hero {
  padding: 1.35rem 1.25rem;
}

.stat-card-accent {
  border-color: rgba(34, 211, 238, 0.2);
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.08), rgba(236, 72, 153, 0.05));
}

.stat-card-highlight {
  border-color: rgba(34, 211, 238, 0.25);
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.1), transparent);
}

.stat-card-green {
  border-color: rgba(74, 222, 128, 0.2);
}

.stat-card-amber {
  border-color: rgba(251, 191, 36, 0.2);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-cyan);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-value-money {
  font-size: 1.85rem;
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--text-faint);
}

.stat-trend {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 0.1rem;
}

.stat-trend-up {
  color: var(--accent-green);
}

.stat-trend-down {
  color: var(--accent-red);
}

.stat-trend-neutral {
  color: var(--text-faint);
}

/* ─── Dashboard v2 ─── */

html.admin-dashboard {
  --font-ui: 'Montserrat', system-ui, sans-serif;
  --font-display: 'Montserrat', system-ui, sans-serif;
}

html.admin-dashboard,
html.admin-dashboard body.admin-app--dashboard,
html.admin-dashboard .sidebar,
html.admin-dashboard .admin-shell,
html.admin-dashboard .page-header,
html.admin-dashboard .page-content--dashboard,
html.admin-dashboard .stat-card,
html.admin-dashboard .stat-value,
html.admin-dashboard .stat-label,
html.admin-dashboard .stat-sub,
html.admin-dashboard .stat-trend,
html.admin-dashboard .card,
html.admin-dashboard .card-header h2,
html.admin-dashboard .nav-item,
html.admin-dashboard .page-header h1,
html.admin-dashboard .page-eyebrow,
html.admin-dashboard .page-header-desc,
html.admin-dashboard .sidebar-brand-text strong,
html.admin-dashboard .sidebar-brand-text span,
html.admin-dashboard .sidebar-logo,
html.admin-dashboard .alert-banner,
html.admin-dashboard .pipeline-funnel-step,
html.admin-dashboard .pipeline-funnel-dot,
html.admin-dashboard .pipeline-funnel-label,
html.admin-dashboard .kpi-secondary-item,
html.admin-dashboard .kpi-secondary-value,
html.admin-dashboard .kpi-secondary-label,
html.admin-dashboard .sales-bar-label,
html.admin-dashboard .activity-item,
html.admin-dashboard .activity-title,
html.admin-dashboard .activity-meta,
html.admin-dashboard .activity-amount,
html.admin-dashboard .dashboard-action,
html.admin-dashboard .btn-primary,
html.admin-dashboard .empty-state h3,
html.admin-dashboard .empty-state p,
html.admin-dashboard .card-link,
html.admin-dashboard .dashboard-muted,
html.admin-dashboard .badge,
html.admin-dashboard .badge-estado {
  font-family: 'Montserrat', system-ui, sans-serif !important;
}

.page-content--dashboard {
  background:
    radial-gradient(ellipse 70% 45% at 10% 0%, rgba(34, 211, 238, 0.06), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 20%, rgba(236, 72, 153, 0.05), transparent 50%);
}

.dashboard-alerts {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.alert-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  transition: border-color 0.15s, background 0.15s;
}

.alert-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.alert-banner:hover {
  color: var(--text);
}

.alert-banner-amber {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.alert-banner-amber:hover {
  background: rgba(251, 191, 36, 0.12);
}

.alert-banner-amber svg {
  color: var(--accent-amber);
}

.alert-banner-info {
  border-color: rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.06);
}

.alert-banner-info:hover {
  background: rgba(34, 211, 238, 0.1);
}

.alert-banner-info svg {
  color: var(--accent-cyan);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.dashboard-muted {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.card-compact .card-header {
  padding: 1rem 1.15rem 0.5rem;
}

.card-compact .card-body {
  padding-top: 0.5rem;
}

.card-body-pipeline {
  padding-top: 0.75rem;
  padding-bottom: 1.35rem;
}

.pipeline-funnel {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
}

.pipeline-funnel-step {
  flex: 1;
  min-width: 88px;
  position: relative;
  text-align: center;
  padding: 0.5rem 0.35rem 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s;
}

.pipeline-funnel-step::after {
  content: '';
  position: absolute;
  top: 22px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.pipeline-funnel-step:last-child::after {
  display: none;
}

.pipeline-funnel-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--bg-card);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.pipeline-funnel-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.pipeline-funnel-step.has-count .pipeline-funnel-dot {
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-cyan);
}

.pipeline-funnel-step.is-hot .pipeline-funnel-dot {
  border-color: var(--accent-pink);
  background: var(--gradient-brand);
  color: #050505;
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.15);
}

.pipeline-funnel-step.is-hot .pipeline-funnel-label {
  color: var(--text);
  font-weight: 600;
}

.pipeline-funnel-step:hover .pipeline-funnel-dot {
  transform: scale(1.05);
}

.pipeline-funnel-step.is-filter-active .pipeline-funnel-dot {
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.22);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

.pipeline-funnel-step.is-filter-active .pipeline-funnel-label {
  color: var(--text);
  font-weight: 700;
}

.pipeline-funnel-tasks .pipeline-funnel-step {
  min-width: 72px;
}

.pipeline-funnel-tasks .pipeline-funnel-dot {
  width: 38px;
  height: 38px;
  font-size: 0.9rem;
}

.kpi-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.kpi-secondary-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.kpi-secondary-item:hover {
  border-color: rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.05);
  color: inherit;
}

.kpi-secondary-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.kpi-secondary-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sales-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 140px;
  padding-top: 0.5rem;
}

.sales-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  height: 120px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s;
}

.sales-bar:hover {
  opacity: 0.85;
  color: inherit;
}

.sales-bar-fill {
  display: block;
  width: 100%;
  max-width: 36px;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--accent-cyan), rgba(34, 211, 238, 0.35));
  transition: height 0.35s ease;
}

.sales-bar:hover .sales-bar-fill {
  background: linear-gradient(180deg, #67e8f9, rgba(34, 211, 238, 0.5));
}

.sales-bar-label {
  margin-top: 0.5rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.15rem;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
}

.activity-list li:first-child .activity-item {
  border-top: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--accent-cyan);
}

.activity-icon svg {
  width: 18px;
  height: 18px;
}

.activity-icon-mail {
  color: var(--accent-pink);
}

.activity-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.activity-title {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.activity-amount {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.dashboard-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.dashboard-action:hover {
  border-color: rgba(34, 211, 238, 0.3);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  color: var(--text);
}

.dashboard-action svg {
  width: 18px;
  height: 18px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.empty-state-compact {
  padding: 1.5rem 1rem;
}

.empty-state-compact h3 {
  font-size: 1rem;
}

.empty-state-compact p {
  font-size: 0.85rem;
}

.page-content--dashboard.is-ready .kpi-grid-hero .stat-card,
.page-content--dashboard.is-ready .dashboard-alerts .alert-banner,
.page-content--dashboard.is-ready .dashboard-layout .card,
.page-content--dashboard.is-ready .dashboard-actions {
  animation: dashboard-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.page-content--dashboard.is-ready .kpi-grid-hero .stat-card:nth-child(1) { animation-delay: 0.04s; }
.page-content--dashboard.is-ready .kpi-grid-hero .stat-card:nth-child(2) { animation-delay: 0.08s; }
.page-content--dashboard.is-ready .kpi-grid-hero .stat-card:nth-child(3) { animation-delay: 0.12s; }
.page-content--dashboard.is-ready .kpi-grid-hero .stat-card:nth-child(4) { animation-delay: 0.16s; }
.page-content--dashboard.is-ready .dashboard-layout .dashboard-col-main .card:nth-child(1) { animation-delay: 0.2s; }
.page-content--dashboard.is-ready .dashboard-layout .dashboard-col-main .card:nth-child(2) { animation-delay: 0.26s; }
.page-content--dashboard.is-ready .dashboard-layout .dashboard-col-main .card:nth-child(3) { animation-delay: 0.32s; }
.page-content--dashboard.is-ready .dashboard-actions { animation-delay: 0.18s; }
.page-content--dashboard.is-ready .dashboard-col-side .card:nth-child(2) { animation-delay: 0.24s; }
.page-content--dashboard.is-ready .dashboard-col-side .card:nth-child(3) { animation-delay: 0.3s; }
.page-content--dashboard.is-ready .dashboard-col-side .card:nth-child(4) { animation-delay: 0.36s; }

@keyframes dashboard-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-content--dashboard.is-ready .kpi-grid-hero .stat-card,
  .page-content--dashboard.is-ready .dashboard-alerts .alert-banner,
  .page-content--dashboard.is-ready .dashboard-layout .card,
  .page-content--dashboard.is-ready .dashboard-actions {
    animation: none;
  }
}

/* ─── Dashboard layout (legacy) ─── */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.pipeline-card {
  margin-bottom: 1.25rem;
}

.pipeline {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.pipeline-step {
  flex: 1;
  min-width: 100px;
  padding: 0.75rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.pipeline-step strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.pipeline-step span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.pipeline-step.is-active {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
}

.pipeline-step.is-active strong {
  color: var(--accent-cyan);
}

.order-pipeline {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.order-pipeline-step {
  flex: 1;
  min-width: 90px;
  position: relative;
  text-align: center;
  padding: 0.65rem 0.5rem 0.75rem;
}

.order-pipeline-step::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.order-pipeline-step:last-child::after {
  display: none;
}

.order-pipeline-dot {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--bg-card);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.order-pipeline-step.done .order-pipeline-dot {
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent-cyan);
}

.order-pipeline-step.current .order-pipeline-dot {
  border-color: var(--accent-pink);
  background: var(--gradient-brand);
  color: #050505;
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.15);
}

.order-pipeline-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.order-pipeline-step.current .order-pipeline-label {
  color: var(--text);
  font-weight: 600;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.quick-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}

.quick-action:hover {
  border-color: rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.06);
  color: var(--text);
}

.quick-action svg {
  width: 18px;
  height: 18px;
  color: var(--accent-cyan);
}

/* ─── Toolbar & filters ─── */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.subtabs a {
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.subtabs a:hover {
  color: var(--text);
}

.subtabs a.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.search-form input[type="search"],
.search-form select,
.form-stack input,
.form-stack textarea,
.form-stack select,
.form-grid input,
.form-grid select,
.form-grid textarea,
.tasks-create-form input,
.tasks-create-form select,
.tasks-create-form textarea {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-base);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-grid textarea,
.tasks-create-form textarea {
  line-height: 1.45;
  resize: vertical;
  min-height: 2.75rem;
  max-height: 8rem;
}

.form-grid textarea::placeholder,
.tasks-create-form textarea::placeholder,
.form-stack textarea::placeholder {
  color: var(--text-faint);
}

.search-form input:focus,
.form-stack input:focus,
.form-stack textarea:focus,
.form-stack select:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.tasks-create-form input:focus,
.tasks-create-form select:focus,
.tasks-create-form textarea:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.search-form input[type="search"] {
  min-width: 200px;
}

.search-wrap {
  position: relative;
}

.search-wrap svg {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  pointer-events: none;
}

.search-wrap input {
  padding-left: 2.2rem !important;
}

/* ─── Tables ─── */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th,
.data-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: rgba(255, 255, 255, 0.025);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background 0.12s;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr.archived td {
  opacity: 0.55;
}

.cell-detail {
  max-width: 280px;
}

.msg-preview {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-word;
  line-height: 1.45;
}

.col-actions {
  white-space: nowrap;
}

.col-delete {
  white-space: nowrap;
  text-align: right;
  width: 1%;
  padding-left: 0.35rem !important;
  padding-right: 0.5rem !important;
}

.btn-delete-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.22rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 6px;
}

.btn-delete-order svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.page-action-delete {
  display: inline-flex;
  margin: 0;
}

.page-actions .page-action-delete {
  margin-left: auto;
}

.action-forms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.row-link {
  font-weight: 600;
  color: var(--text);
}

.row-link:hover {
  color: var(--accent-cyan);
}

/* ─── Badges ─── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-type-cv {
  background: rgba(236, 72, 153, 0.15);
  color: #f9a8d4;
}

.badge-type-contact {
  background: rgba(34, 211, 238, 0.12);
  color: #a5f3fc;
}

.badge-estado {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-estado-lg {
  font-size: 0.82rem;
  padding: 0.4rem 0.85rem;
}

.badge-estado-pendiente { background: rgba(161, 161, 170, 0.18); color: #d4d4d8; }
.badge-estado-preparacion { background: rgba(34, 211, 238, 0.12); color: #a5f3fc; }
.badge-estado-listo { background: rgba(251, 191, 36, 0.12); color: #fde047; }
.badge-estado-entregado { background: rgba(74, 222, 128, 0.12); color: #86efac; }
.badge-estado-cobrado { background: rgba(34, 197, 94, 0.2); color: #bbf7d0; }
.badge-estado-cancelado { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }

.badge-web {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  background: rgba(34, 211, 238, 0.15);
  color: #a5f3fc;
}

.badge-web-lg {
  display: inline-block;
  margin: 0.35rem 0 0.5rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
}

.detail-list-compact {
  gap: 0.65rem;
}

.detail-block-web {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.stat-card-cyan {
  border-color: rgba(34, 211, 238, 0.2);
}

.select-small {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-base);
  color: var(--text);
  font-size: 0.75rem;
  max-width: 150px;
}

.inline-status-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

/* ─── Empty state ─── */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.015);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  color: var(--text-faint);
}

.empty-state h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1rem;
}

.empty-state p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.muted {
  color: var(--text-muted);
}

/* ─── Forms ─── */

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stack label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

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

.form-stack label,
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-stack textarea {
  resize: vertical;
  min-height: 90px;
}

.form-hint {
  margin: 0;
  font-size: 0.85rem;
}

.form-actions {
  display: flex;
  gap: 0.65rem;
  padding-top: 0.5rem;
}

.panel-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.section-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.section-title-inline {
  margin: 0;
}

/* ─── Order detail ─── */

.order-detail-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.order-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.order-num {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-cyan);
  letter-spacing: 0.04em;
}

.order-client {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin: 0 0 1.25rem;
}

.detail-list > div {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
}

.detail-list dt {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.detail-list dd {
  margin: 0;
  font-size: 0.92rem;
}

.detail-list dd a {
  word-break: break-all;
}

.detail-monto {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem !important;
  color: var(--accent-green);
}

.detail-block {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.detail-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.detail-block p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

.stack-gap {
  margin-bottom: 1rem;
}

.status-form {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.timeline-title {
  margin-top: 0;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-item {
  position: relative;
  padding: 0 0 1.1rem 1.35rem;
  border-left: 2px solid var(--border);
  margin-left: 0.35rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 0.15rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.timeline-meta {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  color: var(--text-faint);
}

.timeline-body {
  margin: 0;
  font-size: 0.88rem;
}

.timeline-note {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Responsive ─── */

@media (max-width: 1100px) {
  .kpi-grid-hero {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid,
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
  }

  .admin-shell {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: grid;
    place-items: center;
  }

  .page-content {
    padding: 1.25rem 1rem 2rem;
  }

  .order-detail-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .data-table {
    font-size: 0.8rem;
  }
}

@media (max-width: 520px) {
  .kpi-grid,
  .kpi-grid-hero {
    grid-template-columns: 1fr;
  }

  .page-header {
    padding: 0.85rem 1rem;
  }

  .page-header h1 {
    font-size: 1.15rem;
  }
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 90;
}

.sidebar-backdrop.is-visible {
  display: block;
}

/* ─── Kanban Tareas ─── */

.tasks-settings {
  margin-bottom: 1.25rem;
  padding: 0;
  overflow: hidden;
  max-width: 36rem;
}

.tasks-settings-summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  list-style: none;
  user-select: none;
}

.tasks-settings-summary::-webkit-details-marker {
  display: none;
}

.tasks-settings-form {
  padding: 0 1.25rem 1.25rem;
}

.tasks-settings-actions {
  grid-column: 1 / -1;
}

.tasks-create-card {
  margin-bottom: 1.5rem;
  max-width: 52rem;
}

.tasks-create-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tasks-create-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 0;
}

.tasks-create-row {
  display: grid;
  gap: 0.75rem 0.85rem;
  align-items: end;
}

.tasks-create-row-fields {
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
}

.tasks-create-row-bottom {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
}

.tasks-create-desc {
  margin: 0;
}

.tasks-create-actions {
  padding: 0;
  margin: 0;
  align-self: end;
  flex-shrink: 0;
}

.tasks-create-actions .btn-primary {
  white-space: nowrap;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 1rem;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.kanban-column {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: calc(100vh - 280px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  border-top: 3px solid var(--border-strong);
}

.kanban-col-ideas { border-top-color: rgba(167, 139, 250, 0.6); }
.kanban-col-por-hacer { border-top-color: rgba(161, 161, 170, 0.6); }
.kanban-col-en-curso { border-top-color: rgba(34, 211, 238, 0.6); }
.kanban-col-hecho { border-top-color: rgba(74, 222, 128, 0.6); }

.kanban-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.kanban-column-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
}

.kanban-count {
  min-width: 1.5rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-muted);
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.kanban-empty {
  margin: 0;
  font-size: 0.82rem;
  text-align: center;
  padding: 1.5rem 0.5rem;
}

.kanban-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  transition: border-color 0.15s;
}

.kanban-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.kanban-card-head h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.kanban-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.kanban-card-desc {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  word-break: break-word;
}

.kanban-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.kanban-edit-details {
  width: 100%;
}

.kanban-edit-details summary {
  list-style: none;
  cursor: pointer;
}

.kanban-edit-details summary::-webkit-details-marker {
  display: none;
}

.kanban-edit-form {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
}

.kanban-move-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.kanban-column-foot {
  padding: 0.65rem 0.75rem 0.75rem;
  border-top: 1px solid var(--border);
}

.kanban-quick-add {
  display: flex;
  gap: 0.35rem;
}

.kanban-quick-input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-base);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
}

.badge-prioridad-baja {
  background: rgba(161, 161, 170, 0.15);
  color: #d4d4d8;
}

.badge-prioridad-media {
  background: rgba(34, 211, 238, 0.12);
  color: #a5f3fc;
}

.badge-prioridad-alta {
  background: rgba(236, 72, 153, 0.15);
  color: #f9a8d4;
}

.badge-asignado {
  background: rgba(74, 222, 128, 0.12);
  color: #86efac;
}

@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(4, minmax(220px, 280px));
  }

  .tasks-create-row-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tasks-create-titulo {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .tasks-create-card,
  .tasks-settings {
    max-width: none;
  }

  .tasks-create-row-fields,
  .tasks-create-row-bottom {
    grid-template-columns: 1fr;
  }

  .tasks-create-actions {
    width: 100%;
  }

  .tasks-create-actions .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 900px) {
  .kanban-board {
    grid-template-columns: repeat(4, minmax(260px, 280px));
  }

  .kanban-column {
    max-height: none;
    min-height: 320px;
  }
}

/* ─── Catálogo admin v2 ─── */

.catalog-breadcrumb {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
}

.catalog-breadcrumb a {
  color: var(--accent-cyan);
  text-decoration: none;
}

.catalog-breadcrumb a:hover {
  text-decoration: underline;
}

.catalog-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.catalog-chip {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.catalog-chip-ok {
  border-color: rgba(74, 222, 128, 0.3);
  color: #86efac;
}

.catalog-chip-warn {
  border-color: rgba(251, 191, 36, 0.35);
  color: var(--accent-amber);
}

.catalog-field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.catalog-dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  padding: 1rem;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
}

.catalog-dropzone-tall {
  min-height: 180px;
}

.catalog-dropzone:hover,
.catalog-dropzone.is-dragover {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.05);
}

.catalog-dropzone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.catalog-dropzone-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  pointer-events: none;
  z-index: 1;
}

.catalog-dropzone-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-cyan);
}

.catalog-dropzone-icon svg {
  width: 100%;
  height: 100%;
}

.catalog-dropzone-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.catalog-dropzone-hint {
  font-size: 0.72rem;
  color: var(--text-faint);
}

.catalog-dropzone-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.catalog-dropzone.has-preview .catalog-dropzone-input {
  z-index: 3;
}

.catalog-dropzone-clear {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  z-index: 4;
  pointer-events: auto;
}

.catalog-section {
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.catalog-section-summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.catalog-section-summary::-webkit-details-marker {
  display: none;
}

.catalog-section-summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: transform 0.15s;
}

.catalog-section[open] .catalog-section-summary::after {
  transform: rotate(180deg);
}

.catalog-section-summary-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
}

.catalog-section-summary-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-section-summary-emoji {
  font-size: 1.35rem;
}

.catalog-section-summary-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.catalog-section-summary-text strong {
  font-size: 0.92rem;
}

.catalog-cover-block {
  border-top: 1px solid var(--border);
}

.catalog-cover-layout {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.catalog-cover-preview {
  width: 140px;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.catalog-cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-cover-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2.25rem;
}

.catalog-cover-form {
  min-width: 0;
}

.catalog-checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
}

.catalog-checkbox input {
  width: auto;
  margin: 0;
}

.catalog-delete-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.catalog-products-section {
  max-width: 100%;
}

.catalog-toolbar {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
}

.catalog-toolbar-desc {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
}

.catalog-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.catalog-add-panel {
  margin: 0 1.15rem 1rem;
  padding: 1.15rem;
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: var(--radius-md);
  background: rgba(34, 211, 238, 0.04);
}

.catalog-add-panel[hidden] {
  display: none !important;
}

.catalog-add-layout {
  display: grid;
  grid-template-columns: minmax(0, 220px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

.catalog-add-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.catalog-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  padding: 0 1.15rem 1.15rem;
}

.catalog-product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  transition: border-color 0.15s;
}

.catalog-product-card:hover {
  border-color: rgba(34, 211, 238, 0.2);
}

.catalog-product-card-media {
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.catalog-product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-product-card-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 2rem;
  opacity: 0.4;
}

.catalog-product-card-body {
  padding: 0.75rem 0.85rem 0.5rem;
}

.catalog-product-card-title {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}

.catalog-product-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.catalog-product-edit {
  margin: 0 0.65rem;
  border-top: 1px solid var(--border);
}

.catalog-product-edit summary {
  padding: 0.55rem 0.25rem;
  cursor: pointer;
  list-style: none;
}

.catalog-product-edit summary::-webkit-details-marker {
  display: none;
}

.catalog-product-edit-form {
  padding: 0 0 0.75rem;
}

.catalog-product-edit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
}

.catalog-product-card-delete {
  padding: 0 0.65rem 0.65rem;
  margin-top: auto;
}

.catalog-product-card-delete .btn-small {
  width: 100%;
  justify-content: center;
}

.catalog-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

.catalog-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.catalog-cat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
}

.catalog-cat-item:first-child {
  border-top: none;
}

.catalog-cat-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.15rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.catalog-cat-link:hover {
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
}

.catalog-cat-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
}

.catalog-cat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-cat-thumb-empty {
  font-size: 1.5rem;
}

.catalog-cat-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.catalog-cat-info strong {
  font-size: 0.92rem;
}

.catalog-cat-info .muted {
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .catalog-admin-grid {
    grid-template-columns: 1fr;
  }

  .catalog-cover-layout {
    grid-template-columns: 1fr;
  }

  .catalog-cover-preview {
    width: 100%;
    max-width: 200px;
  }

  .catalog-add-layout {
    grid-template-columns: 1fr;
  }

  .catalog-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .catalog-toolbar-actions {
    width: 100%;
  }

  .catalog-toolbar-actions .btn-primary {
    flex: 1;
  }
}

/* ─── Pedidos v2 ─── */

.orders-alert {
  margin-bottom: 1rem;
}

.orders-pipeline-card {
  margin-bottom: 1.25rem;
}

.orders-pipeline-card .card-body-pipeline {
  padding-bottom: 0.5rem;
}

.orders-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1.25rem 1.1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
  padding-top: 0.85rem;
}

.orders-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.orders-chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.orders-chip.is-active {
  color: var(--accent-cyan);
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.1);
}

.orders-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.orders-list-title {
  margin: 0;
  font-size: 1.1rem;
  font-family: var(--font-display);
}

.orders-list-count {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
}

.orders-search {
  flex: 1;
  min-width: min(100%, 320px);
  max-width: 420px;
  justify-content: flex-end;
}

.orders-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.orders-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.orders-card:hover {
  border-color: var(--border-strong);
}

.orders-card.is-cancelled {
  opacity: 0.72;
}

.orders-card-main {
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.orders-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.orders-card-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.orders-card-client {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.orders-card-desc {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.orders-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.orders-card-amount {
  font-weight: 700;
  color: var(--accent-cyan);
}

.orders-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  flex-shrink: 0;
}

.orders-card-advance {
  margin: 0;
}

.orders-card-more {
  position: relative;
}

.orders-card-more summary {
  list-style: none;
  cursor: pointer;
}

.orders-card-more summary::-webkit-details-marker {
  display: none;
}

.orders-card-more-body {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  min-width: 200px;
  padding: 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.orders-card-status-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

.order-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
}

.order-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.order-breadcrumb-sep {
  color: var(--text-faint);
}

.order-advance-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(236, 72, 153, 0.06));
}

.order-advance-banner p {
  margin: 0;
  font-size: 0.9rem;
}

.order-advance-banner strong {
  color: var(--text);
}

.order-advance-banner form {
  margin: 0;
}

@media (max-width: 720px) {
  .orders-card {
    grid-template-columns: 1fr;
  }

  .orders-card-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }

  .orders-card-more-body {
    left: 0;
    right: auto;
  }

  .orders-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .orders-search {
    max-width: none;
  }
}

/* ─── Home images admin ─── */

.home-images-admin {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.home-images-hint {
  margin: 0 0 1rem;
  font-size: 0.82rem;
}

.home-images-empty {
  margin: 0 0 1rem;
}

.home-images-grid {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

.home-images-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.home-images-card.is-hidden {
  opacity: 0.72;
}

.home-images-card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: rgba(0, 0, 0, 0.25);
}

.home-images-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-images-card-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.65);
  color: #fca5a5;
}

.home-images-card-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.home-images-meta-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
}

.home-images-alt-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.home-images-alt-label input {
  font-size: 0.82rem;
}

.home-images-active-check {
  margin: 0;
}

.home-images-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.home-images-replace-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
}

.catalog-dropzone-compact {
  min-height: 72px;
  padding: 0.65rem;
}

.catalog-dropzone-compact .catalog-dropzone-ui {
  gap: 0.15rem;
}

.catalog-dropzone-compact .catalog-dropzone-text {
  font-size: 0.78rem;
}

.home-images-order-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.home-images-order-btns form {
  margin: 0;
}

.home-images-add-form {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
