/* =============================================================
   VARIABLES
   ============================================================= */

:root {
    --bg:            #f4f6f8;
    --surface:       #ffffff;
    --surface-soft:  #f8fafc;
    --text:          #1d2733;
    --muted:         #667085;
    --line:          #d9e0e8;
    --primary:       #84cc16;   /* verde lima */
    --primary-hover: #78b814;   /* lima hover */
    --on-primary:    #0f1a03;   /* texto sobre lima */
    --danger:        #b42318;
    --success:       #067647;
    --warning:       #b45309;
    --shadow:        0 16px 40px rgba(15, 23, 42, 0.08);
    --shadow-sm:     0 4px 12px rgba(15, 23, 42, 0.06);

    /* Tipografía — 5 tamaños */
    --text-xs:   13px;
    --text-sm:   14px;
    --text-base: 15px;
    --text-lg:   22px;
    --text-xl:   28px;
}

/* =============================================================
   RESET
   ============================================================= */

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

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: var(--text-base);
    line-height: 1.5;
}

h1, h2, h3, p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font: inherit;
}

/* =============================================================
   LAYOUT — App shell (sidebar + workspace)
   ============================================================= */

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
}

.workspace {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    display: grid;
    gap: 24px;
    padding: 28px 32px;
    align-content: start;
}

/* =============================================================
   NAVBAR / TOPBAR
   ============================================================= */

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

.topbar-left h1 {
    font-size: var(--text-xl);
    line-height: 1.2;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.eyebrow {
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0;
}

/* Medidor de consumo IA — visible siempre en topbar */
.consumption-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    font-size: var(--text-xs);
}

.consumption-widget span {
    color: var(--muted);
    white-space: nowrap;
}

.consumption-bar {
    width: 80px;
    height: 6px;
    border-radius: 99px;
    background: var(--line);
    overflow: hidden;
}

.consumption-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.consumption-bar-fill.is-warning {
    background: #f59e0b;
}

.consumption-bar-fill.is-danger {
    background: var(--danger);
}

.consumption-pct {
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

/* User chip in topbar */
.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: var(--text-xs);
    flex-shrink: 0;
}

/* =============================================================
   SIDEBAR ADMIN
   ============================================================= */

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    background: #18212b;
    color: #ffffff;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-weight: 800;
    font-size: var(--text-base);
    letter-spacing: -0.01em;
}

.brand-mark {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 8px;
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 900;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-group {
    margin-top: 16px;
}

.nav-group:first-child {
    margin-top: 0;
}

.nav-group-label {
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 7px;
    color: rgba(255,255,255,0.65);
    font-weight: 600;
    font-size: var(--text-sm);
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.07);
    color: #ffffff;
}

.nav-link.is-active {
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 700;
}

.nav-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    font-style: normal;
}

.sidebar-footer {
    padding: 16px 12px 0;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin-top: auto;
}

/* =============================================================
   CARDS
   ============================================================= */

.panel {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.panel-header h2 {
    margin-top: 4px;
    font-size: var(--text-lg);
}

.alert {
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: var(--text-sm);
}

.alert-success {
    border-color: #abefc6;
    color: var(--success);
    background: #ecfdf3;
}

.alert-danger {
    border-color: #fca5a5;
    color: var(--danger);
    background: #fef2f2;
}

.alert-warning {
    border-color: #fcd34d;
    color: var(--warning);
    background: #fffbeb;
}

/* =============================================================
   DASHBOARD — métricas
   ============================================================= */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.metric-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    display: grid;
    gap: 10px;
}

.metric-card-label {
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.metric-card-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.metric-card-sub {
    color: var(--muted);
    font-size: var(--text-xs);
}

.metric-card.is-accent {
    background: var(--primary);
    border-color: var(--primary);
}

.metric-card.is-accent .metric-card-label,
.metric-card.is-accent .metric-card-value,
.metric-card.is-accent .metric-card-sub {
    color: var(--on-primary);
}

/* Status dot */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
}

.status-dot.is-active { background: var(--primary); }
.status-dot.is-warning { background: #f59e0b; }
.status-dot.is-danger { background: var(--danger); }

/* =============================================================
   TABLAS
   ============================================================= */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

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

.table th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.table tbody tr:hover td {
    background: #fafcff;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.actions-cell {
    text-align: right;
}

.pagination {
    margin-top: 18px;
}

.pagination nav {
    display: flex;
    gap: 8px;
}

/* =============================================================
   FORMULARIOS
   ============================================================= */

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #eaf0f2;
}

.auth-wrap {
    width: min(100%, 420px);
}

.login-panel {
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.login-intro {
    display: grid;
    gap: 6px;
    margin-bottom: 28px;
}

.login-intro h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.login-intro p {
    color: var(--muted);
    font-size: var(--text-sm);
}

.form {
    display: grid;
    gap: 18px;
}

.form-panel {
    max-width: 760px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    font-weight: 600;
    font-size: var(--text-sm);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.field textarea {
    padding: 10px 12px;
    min-height: 100px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 3px solid rgba(132, 204, 22, 0.2);
    border-color: var(--primary);
}

.field-error {
    color: var(--danger);
    font-size: var(--text-xs);
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-weight: 600;
    font-size: var(--text-sm);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =============================================================
   BADGES
   ============================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: var(--text-xs);
    font-weight: 700;
}

.badge-success {
    background: #ecfdf3;
    color: var(--success);
}

.badge-danger {
    background: #fef2f2;
    color: var(--danger);
}

.badge-warning {
    background: #fffbeb;
    color: var(--warning);
}

.badge-muted {
    background: var(--surface-soft);
    color: var(--muted);
}

.badge-lime {
    background: #f0fce6;
    color: #3a6404;
}

/* =============================================================
   BOTONES
   ============================================================= */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    font-size: var(--text-sm);
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.button:hover {
    border-color: #b7c4d2;
    background: var(--surface-soft);
}

.button-primary {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--on-primary);
}

.button-primary:hover {
    border-color: var(--primary-hover);
    background: var(--primary-hover);
    color: var(--on-primary);
}

.button-ghost {
    background: transparent;
    border-color: transparent;
}

.button-ghost:hover {
    background: var(--surface-soft);
    border-color: var(--line);
}

.button-danger {
    border-color: #fca5a5;
    color: var(--danger);
}

.button-danger:hover {
    background: #fef2f2;
}

.button-small {
    min-height: 32px;
    padding: 0 12px;
    font-size: var(--text-xs);
    border-radius: 6px;
}

.button-full {
    width: 100%;
}

/* =============================================================
   PERFIL DE CUENTA
   ============================================================= */

.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.profile-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--primary);
    color: var(--on-primary);
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 900;
    flex-shrink: 0;
}

.profile-header-left h2 {
    font-size: var(--text-xl);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

/* Info rows — label / value pairs dentro de panels */
.info-grid {
    display: grid;
    gap: 0;
}

.info-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: var(--text-sm);
}

.info-row:last-child {
    border-bottom: 0;
}

.info-label {
    width: 180px;
    flex-shrink: 0;
    color: var(--muted);
    font-weight: 600;
}

.info-value {
    flex: 1;
    font-weight: 500;
}

/* Red social cards — show view */
.network-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.network-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.network-card.is-active {
    background: var(--surface);
    border-color: #c3e88d;
}

.network-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* Red social cards — form */
.network-form-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.network-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.network-form-fields {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

/* =============================================================
   M12 · LÓGICA
   ============================================================= */

.logica-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    padding: 18px 20px;
}

.logica-card--inactiva {
    opacity: .55;
}

.logica-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.logica-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px rgba(132,204,22,.5);
    flex-shrink: 0;
    margin-top: 5px;
}

.logica-indicator--off {
    background: var(--line);
    box-shadow: none;
}

.logica-instruccion {
    padding: 12px 14px;
    background: var(--surface-soft);
    border-radius: 7px;
    border: 1px solid var(--line);
}

/* =============================================================
   M13 · CONEXIONES IA
   ============================================================= */

.conexiones-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.conexion-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.conexion-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.conexion-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #18212b;
    color: var(--primary);
    display: grid;
    place-items: center;
    font-size: 18px;
    flex-shrink: 0;
}

.conexion-form-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding: 8px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--muted);
    transition: background .15s;
}

.conexion-form-toggle:hover {
    background: var(--bg);
}

.conexion-form.hidden {
    display: none;
}

.conexion-form {
    padding-top: 4px;
}

/* =============================================================
   M14 · CONSUMO
   ============================================================= */

.consumo-plataforma-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.consumo-plataforma-row:last-child {
    border-bottom: 0;
}

/* =============================================================
   M9 · BITÁCORA — badges por módulo
   ============================================================= */

.badge-module-cuentas    { background:#eff6ff;color:#1d4ed8; }
.badge-module-campanas   { background:#f5f3ff;color:#7c3aed; }
.badge-module-ordenes    { background:#fffbeb;color:#b45309; }
.badge-module-produccion { background:#f0fce6;color:#3a6404; }
.badge-module-aprobacion { background:#ecfdf3;color:var(--success); }
.badge-module-publicacion{ background:#ecfeff;color:#0e7490; }
.badge-module-reportes   { background:#fff1f2;color:#be123c; }
.badge-module-sistema    { background:var(--surface-soft);color:var(--muted); }

/* =============================================================
   M10 · REPORTES — documento de reporte
   ============================================================= */

.report-doc {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #18212b;
    color: #ffffff;
}

.report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 32px;
    background: #0f1923;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.report-brand {
    font-size: var(--text-lg);
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -.02em;
    margin: 0;
}

.report-section {
    padding: 28px 32px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.report-section:last-of-type {
    border-bottom: none;
}

.report-section-title {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.4);
    margin: 0 0 16px;
}

/* Gráfica CSS */
.report-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 90px;
    padding-bottom: 24px;
    position: relative;
}

.report-chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    position: relative;
}

.report-chart-bar {
    width: 100%;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    min-height: 4px;
    opacity: .8;
    transition: opacity .2s;
}

.report-chart-bar:hover { opacity: 1; }

.report-chart-label {
    position: absolute;
    bottom: -20px;
    font-size: 10px;
    color: rgba(255,255,255,.35);
    white-space: nowrap;
}

.report-footer {
    padding: 20px 32px;
    background: #0f1923;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* =============================================================
   M11 · INSPIRACIÓN — grid de referencias
   ============================================================= */

.inspiracion-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.inspiracion-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}

.inspiracion-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.inspiracion-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 120px;
}

.inspiracion-preview--img {
    padding: 0;
}

.inspiracion-preview--img img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.inspiracion-preview--url {
    background: linear-gradient(135deg, #18212b, #1e3040);
    color: rgba(255,255,255,.8);
    text-align: center;
    min-height: 120px;
}

.inspiracion-card-body {
    padding: 14px;
    border-top: 1px solid var(--line);
}

/* =============================================================
   M5 · PRODUCCIÓN — pantalla dark / n8n style
   ============================================================= */

/* Override del content para la pantalla de producción */
.content-produccion {
    background: #0c1520;
    color: #c8d2df;
    padding: 0;
    gap: 0;
}

.prod-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 28px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    color: #fff;
    flex-wrap: wrap;
}

.workflow-canvas {
    padding: 32px 28px;
    overflow-x: auto;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.workflow-row {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
}

/* Nodo individual */
.workflow-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    min-width: 110px;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}

.workflow-node--done {
    border-color: rgba(132,204,22,0.4);
    background: rgba(132,204,22,0.06);
}

.workflow-node--active {
    border-color: var(--primary);
    background: rgba(132,204,22,0.1);
    box-shadow: 0 0 24px rgba(132,204,22,0.2);
    animation: node-glow 2s ease-in-out infinite;
}

.workflow-node--pending {
    opacity: 0.35;
}

@keyframes node-glow {
    0%, 100% { box-shadow: 0 0 12px rgba(132,204,22,0.15); }
    50%       { box-shadow: 0 0 28px rgba(132,204,22,0.35); }
}

.workflow-node-icon {
    font-size: 22px;
    color: rgba(255,255,255,0.8);
}

.workflow-node--done .workflow-node-icon { color: var(--primary); }
.workflow-node--active .workflow-node-icon { color: var(--primary); }

.workflow-node-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    line-height: 1.3;
}

.workflow-node-api {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
}

.workflow-node-check {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    font-size: 10px;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.workflow-node-spinner {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(132,204,22,0.3);
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

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

/* Conector entre nodos */
.workflow-connector {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding: 0 4px;
    min-width: 50px;
}

.workflow-counter {
    position: absolute;
    top: -20px;
    background: rgba(132,204,22,0.15);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 99px;
    white-space: nowrap;
}

.workflow-connector-arrow {
    color: rgba(255,255,255,0.2);
    font-size: 18px;
}

/* Tarea actual */
.prod-tarea-activa {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: rgba(132,204,22,0.08);
    border: 1px solid rgba(132,204,22,0.2);
    border-radius: 8px;
    font-size: var(--text-sm);
    color: rgba(255,255,255,0.85);
    max-width: 600px;
}

/* Log de producción */
.workflow-log {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.3);
}

.workflow-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 28px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: var(--text-xs);
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.workflow-log-body {
    padding: 14px 28px;
    display: grid;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
}

.log-line {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 12px;
    font-family: monospace;
}

.log-time {
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.log-msg { color: rgba(255,255,255,0.7); }
.log-line--success .log-msg { color: #86efac; }
.log-line--active  .log-msg { color: var(--primary); }
.log-line--error   .log-msg { color: #fca5a5; }

/* =============================================================
   M6 · APROBACIÓN
   ============================================================= */

.aprobacion-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.resultado-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    overflow: hidden;
    transition: box-shadow .2s;
}

.resultado-card:hover {
    box-shadow: var(--shadow);
}

.resultado-card--aprobado {
    border-color: #c3e88d;
}

.resultado-card--rechazado {
    border-color: #fca5a5;
    opacity: .7;
}

/* Preview de resultado — aspect ratio por ratio */
.resultado-preview {
    background: linear-gradient(135deg, #18212b 0%, #1e3040 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.resultado-preview.ratio-1-1  { aspect-ratio: 1; }
.resultado-preview.ratio-4-5  { aspect-ratio: 4/5; }
.resultado-preview.ratio-9-16 { aspect-ratio: 9/16; max-height: 280px; }
.resultado-preview.ratio-16-9 { aspect-ratio: 16/9; }

.resultado-preview-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255,255,255,0.6);
    text-align: center;
}

.resultado-body {
    padding: 16px;
}

.resultado-status-badge {
    font-size: var(--text-xs);
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
}

.resultado-status--generado  { background: var(--surface-soft); color: var(--muted); }
.resultado-status--aprobado  { background: #ecfdf3; color: var(--success); }
.resultado-status--rechazado { background: #fef2f2; color: var(--danger); }

/* =============================================================
   M7 · PUBLICACIÓN
   ============================================================= */

.publicacion-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.publicacion-preview {
    width: 100px;
    flex-shrink: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #18212b 0%, #1e3040 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.6);
    min-height: 100px;
}

.publicacion-red-check {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.publicacion-red-check:has(input:checked) {
    border-color: var(--primary);
    background: #f6fce8;
    color: #3a6404;
}

/* =============================================================
   M8 · TERMINADO
   ============================================================= */

.terminado-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px;
    border-radius: 12px;
    background: linear-gradient(135deg, #18212b 0%, #1a2e0d 100%);
    color: #ffffff;
}

.terminado-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    display: grid;
    place-items: center;
    font-size: 24px;
    font-weight: 900;
    flex-shrink: 0;
}

/* =============================================================
   ÓRDENES — cola, tareas, ratios
   ============================================================= */

/* Banner de orden en producción */
.orden-produccion-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 10px;
    background: #18212b;
    color: #ffffff;
    flex-wrap: wrap;
}

.orden-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 0 rgba(132,204,22,0.6);
    animation: pulse 1.8s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(132,204,22,0.6); }
    70%  { box-shadow: 0 0 0 10px rgba(132,204,22,0); }
    100% { box-shadow: 0 0 0 0 rgba(132,204,22,0); }
}

/* Items en cola */
.queue-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.queue-pos {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--line);
    display: grid;
    place-items: center;
    font-size: var(--text-xs);
    font-weight: 800;
    color: var(--muted);
    flex-shrink: 0;
}

/* Task cards — show view */
.task-show-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    overflow: hidden;
}

.task-show-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
}

.task-show-body {
    padding: 14px 18px;
}

.task-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    display: grid;
    place-items: center;
    font-size: var(--text-xs);
    font-weight: 800;
    flex-shrink: 0;
}

/* Tipo count card */
.tipo-count-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

/* Ratio selector */
.ratio-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.ratio-opt {
    position: relative;
    cursor: pointer;
}

.ratio-opt input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ratio-opt span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font-size: var(--text-xs);
    font-weight: 700;
    background: var(--surface);
    transition: border-color .15s, background .15s;
    cursor: pointer;
}

.ratio-opt input:checked + span {
    border-color: var(--primary);
    background: #f6fce8;
    color: #3a6404;
}

/* Archivo / foto picker placeholder */
.files-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    cursor: pointer;
    transition: border-color .15s;
}

.files-picker:hover {
    border-color: var(--primary);
}

.files-picker-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.files-picker-upload {
    flex-direction: column;
    text-align: center;
    justify-content: center;
}

/* =============================================================
   CAMPAÑAS — targets y checklist
   ============================================================= */

/* Frase destacada en show */
.campana-frase {
    font-size: var(--text-lg);
    font-weight: 700;
    font-style: italic;
    color: var(--text);
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    background: #f6fce8;
    border-radius: 0 8px 8px 0;
}

/* Target cards — show view */
.target-card {
    display: flex;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.target-card-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    display: grid;
    place-items: center;
    font-size: var(--text-xs);
    font-weight: 800;
    flex-shrink: 0;
}

.target-label {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin: 0 0 3px;
}

.target-value {
    font-size: var(--text-sm);
    line-height: 1.6;
    margin: 0;
}

/* Target form cards */
.target-form-card {
    display: flex;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    align-items: flex-start;
}

.target-form-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    display: grid;
    place-items: center;
    font-size: var(--text-xs);
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 6px;
}

/* Checklist grid — tipos de publicación */
.checklist-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.checklist-item:has(input:checked) {
    border-color: var(--primary);
    background: #f6fce8;
}

.checklist-label {
    font-size: var(--text-sm);
    font-weight: 600;
}

/* =============================================================
   EMPTY STATES
   ============================================================= */

.empty-state {
    display: grid;
    place-items: center;
    gap: 12px;
    padding: 48px 24px;
    text-align: center;
}

.empty-state-icon {
    font-size: 40px;
    line-height: 1;
}

.empty-state h3 {
    font-size: var(--text-base);
    font-weight: 700;
}

.empty-state p {
    color: var(--muted);
    font-size: var(--text-sm);
}

/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 960px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .topbar,
    .panel-header,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .content,
    .topbar {
        padding: 20px;
    }

    .metrics-grid,
    .form-grid,
    .profile-grid,
    .network-grid,
    .checklist-grid,
    .aprobacion-grid,
    .inspiracion-grid,
    .conexiones-grid {
        grid-template-columns: 1fr;
    }

    .consumo-plataforma-row {
        flex-wrap: wrap;
    }

    .publicacion-card {
        flex-direction: column;
    }

    .topbar-right {
        flex-wrap: wrap;
    }
}
